mirror of
https://github.com/romychs/OK240.2-Firmware.git
synced 2026-04-21 10:53:18 +03:00
143 lines
6.2 KiB
PHP
143 lines
6.2 KiB
PHP
; ======================================================
|
|
; Ocean-240.2
|
|
; Equates for all assembly sources
|
|
;
|
|
; By Romych 2025-09-09
|
|
; ======================================================
|
|
|
|
IFNDEF _EQUATES
|
|
DEFINE _EQUATES
|
|
|
|
ADDLIST EQU 0x08
|
|
|
|
ASCII_BS EQU 0x08
|
|
ASCII_TAB EQU 0x09
|
|
ASCII_LF EQU 0x0A
|
|
ASCII_FF EQU 0x0C
|
|
ASCII_CR EQU 0x0D
|
|
ASCII_CAN EQU 0x18
|
|
ASCII_EM EQU 0x19
|
|
ASCII_SUB EQU 0x1A ; CTRL-Z - end of text file marker
|
|
ASCII_ESC EQU 0x1B
|
|
ASCII_US EQU 0x1F
|
|
ASCII_SP EQU 0x20
|
|
; ------------------------------------------------------
|
|
BDOS_CTLC EQU 0x03
|
|
BDOS_NFUNCS EQU 0x29
|
|
BELL_CHAR EQU 0x07
|
|
BELL_PIN EQU 0x08
|
|
; ------------------------------------------------------
|
|
CCP_COMMAND_SIZE EQU 0x05
|
|
CCP_COMMANDS_COUNT EQU 0x04
|
|
CCP_COMMAND_CNT EQU 6
|
|
CCP_COMMAND_LEN EQU 4
|
|
|
|
CCP_SRC_ADDR EQU 0xc000
|
|
CCP_DST_ADDR EQU 0xb200
|
|
CCP_SIZE EQU 0x809
|
|
|
|
CPM_VERSION EQU 0x22 ; Version of CP/M as byte nibbles '2.2'
|
|
|
|
CTRL EQU 0x5E ; ^
|
|
CTRL_C EQU 0x03 ; Warm boot
|
|
CTRL_H EQU 0x08 ; Backspace
|
|
CTRL_E EQU 0x05 ; Move to beginning of new line (Physical EOL)
|
|
CTRL_J EQU 0x0A ; LF - Line Feed
|
|
CTRL_M EQU 0x0D ; CR - Carriage Return
|
|
CTRL_P EQU 0x10 ; turn on/off printer
|
|
CTRL_R EQU 0x12 ; Repeat current cmd line
|
|
CTRL_S EQU 0x13 ; Temporary stop display data to console (aka DC3)
|
|
CTRL_U EQU 0x15 ; Cancel (erase) current cmd line
|
|
CTRL_X EQU 0x18 ; Cancel (erase) current cmd line
|
|
|
|
; ------------------------------------------------------
|
|
DBPLIST EQU 0x0F
|
|
DEF_DISK_A_SIZE EQU 0x3F
|
|
DEF_DISK_B_SIZE EQU 0x0168
|
|
DSK_MAP EQU 0x10
|
|
DSK_MSK EQU 0x03
|
|
DSK_SHF EQU 0x02
|
|
DMA_BUFF_SIZE EQU 0x80
|
|
; ------------------------------------------------------
|
|
ENDDIR EQU 0xFFFF
|
|
ESC_CMD_END EQU 0x1A
|
|
;EXT_NUM EQU 12 ; Extent byte offset
|
|
; ------------------------------------------------------
|
|
FALSE EQU 0x00
|
|
FDC_DD80RB EQU 0x21
|
|
FDC_NOT_READY EQU 0x80
|
|
FDC_RESTORE_L EQU 0x08
|
|
FDC_SEEK_LV EQU 0x1C
|
|
FILE_DELETED EQU 0xE5
|
|
FWF_MASK EQU 0x80 ; File Write Flag mask
|
|
|
|
; ---------------------------------------------------
|
|
; FCB Offsets
|
|
; ---------------------------------------------------
|
|
FCB_LEN EQU 32 ; length of FCB
|
|
FCB_SHF EQU 5
|
|
FN_LEN EQU 12 ; Length of filename in FCB
|
|
|
|
FCB_DR EQU 0 ; Drive. 0 for default, 1-16 for A-P
|
|
FCB_FN EQU 1 ; Fn - Filename, 7-bit ASCII. The top bits - attributes
|
|
FCB_FT EQU 9 ; Filetype, 7-bit ASCII.
|
|
; T1' to T3' have the following
|
|
; T1' - Read-Only
|
|
; T2' - System (hidden)
|
|
; T3' - Archive
|
|
FCB_EXT EQU 12 ; EX - Set this to 0 when opening a file and then leave it to
|
|
; CP/M. You can rewind a file by setting EX, RC, S2 and CR to 0.
|
|
FCB_S1 EQU 13 ; S1 - Reserved.
|
|
FCB_S2 EQU 14 ; S2 - Reserved. Bit 7 - wile write flag, [6:0] module number (Extent hi bits)
|
|
FCB_RC EQU 15 ; RC - Set this to 0 when opening a file and then leave it to CP/M.
|
|
FCB_AL EQU 16 ; AL - Image of the second half of the directory entry,
|
|
; containing the file's allocation (which disc blocks it owns).
|
|
FCB_CR EQU 32 ; CR - Current record within extent. It is usually best to set
|
|
; this to 0 immediately after a file has been opened and
|
|
; then ignore it.
|
|
FCB_RN EQU 33 ; Rn - Random access record number. A 16-bit (with R2 used for overflow)
|
|
|
|
|
|
; ------------------------------------------------------
|
|
JP_OPCODE EQU 0xC3
|
|
; ------------------------------------------------------
|
|
KBD_ACK EQU 0x10
|
|
KBD_IRQ EQU 0x02
|
|
KEY_ALF EQU 0x0D
|
|
KEY_FIX EQU 0x15
|
|
; ------------------------------------------------------
|
|
LST_REC EQU 0x7F
|
|
; ------------------------------------------------------
|
|
MAX_EXT EQU 0x1F
|
|
MAX_MOD EQU 0x0F
|
|
;MOD_NUM EQU 0x0E
|
|
; ------------------------------------------------------
|
|
FCB_INFO_LEN EQU 15 ; length of FCB info bytes to match
|
|
;NXT_REC EQU 0x20
|
|
; ------------------------------------------------------
|
|
PIC_POLL_MODE EQU 0x0A
|
|
PORT_C4 EQU 0x10
|
|
PRINTER_ACK EQU 0x10
|
|
PRINTER_IRQ EQU 0x08
|
|
; ------------------------------------------------------
|
|
;RAN_REC EQU 0x21
|
|
;FCB_RC EQU 0x0F
|
|
DIR_BUFF_SIZE EQU 128
|
|
RO_FILE EQU 0x09
|
|
DEL_KEY EQU 0x7F
|
|
RX_READY EQU 0x02
|
|
; ------------------------------------------------------
|
|
TAPE_D EQU 0x08
|
|
TAPE_P EQU 0x04
|
|
TIMER_IRQ EQU 0x10
|
|
TL_HIGH EQU 0x05
|
|
TL_LOW EQU 0x03
|
|
TL_MID EQU 0x04
|
|
TMR0_SQWAVE EQU 0x36
|
|
TRUE EQU 0xFF
|
|
TX_READY EQU 0x01
|
|
; ------------------------------------------------------
|
|
;U_BYTES EQU 0x0D
|
|
|
|
ENDIF
|