;    _____                    __                     .___
;   /  _  \   _____   _______/  |_____________     __| _/
;  /  /_\  \ /     \ /  ___/\   __\_  __ \__  \   / __ | 
; /    |    \  Y Y  \\___ \  |  |  |  | \// __ \_/ /_/ | 
; \____|__  /__|_|  /____  > |__|  |__|  (____  /\____ | 
;         \/      \/     \/                   \/      \/ 
; Firmware & AmsDOS symbols.
; Grim/Arkos^Semilanceata

; LOW KERNEL JUMBLOCK
_RESET_ENTRY				equ &0000	; RST &00
_LOW_JUMP				equ &0008	; RST &08
_KL_LOW_PCHL				equ &000B
_PCBC					equ &000E
_SIDE_CALL				equ &0010	; RST &10
_KL_SIDE_PCHL				equ &0013
_PCDE					equ &0016
_FAR_CALL				equ &0018	; RST &18
_KL_FAR_PCHL				equ &001B
_PCHL					equ &001E
_RAM_LAM				equ &0020	; RST &20
_KL_FAR_CALL				equ &0023
_FIRM_JUMP				equ &0028	; RST &28
_USER_RESTART				equ &0030	; RST &30
_INTERRUPT_ENTRY			equ &0038	; RST &38
_EXT_INTERRUPT				equ &003B

; HIGH KERNEL JUMPBLOCK
_KL_U_ROM_ENABLE			equ &B900
_KL_U_ROM_DISABLE			equ &B903
_KL_L_ROM_ENABLE			equ &B906
_KL_L_ROM_DISABLE			equ &B909
_KL_ROM_RESTORE				equ &B90C
_KL_ROM_SELECT				equ &B90F
_KL_CURR_SELECTION			equ &B912
_KL_PROBE_ROM				equ &B915
_KL_ROM_DESELECT			equ &B918
_KL_LDIR				equ &B91B
_KL_LDDR				equ &B91E
_KL_POLL_SYNCHRONOUS			equ &B921
_KL_SCAN_NEEDED				equ &B92A

; The Key Manager
_KM_INITIALISE				equ &BB00
_KM_RESET				equ &BB03
_KM_WAIT_CHAR				equ &BB06
_KM_READ_CHAR				equ &BB09
_KM_CHAR_RETURN				equ &BB0C
_KM_SET_EXPAND				equ &BB0F
_KM_GET_EXPAND				equ &BB12
_KM_EXP_BUFFER				equ &BB15
_KM_WAIT_KEY				equ &BB18
_KM_READ_KEY				equ &BB1B
_KM_TEST_KEY				equ &BB1E
_KM_GET_STATE				equ &BB21
_KM_GET_JOYSTICK			equ &BB24
_KM_SET_TRANSLATE			equ &BB27
_KM_GET_TRANSLATE			equ &BB2A
_KM_SET_SHIFT				equ &BB2D
_KM_GET_SHIFT				equ &BB30
_KM_SET_CONTROL				equ &BB33
_KM_GET_CONTROL				equ &BB36
_KM_SET_REPEAT				equ &BB39
_KM_GET_REPEAT				equ &BB3C
_KM_SET_DELAY				equ &BB3F
_KM_GET_DELAY				equ &BB42
_KM_ARM_BREAKS				equ &BB45
_KM_DISARM_BREAK			equ &BB48
_KM_BREAK_EVENT				equ &BB4B

; The Text VDU
_TXT_INITIALISE				equ &BB4E
_TXT_RESET				equ &BB51
_TXT_VDU_ENABLE				equ &BB54
_TXT_VDU_DISABLE			equ &BB57
_TXT_OUTPUT				equ &BB5A
_TXT_WR_CHAR				equ &BB5D
_TXT_RD_CHAR				equ &BB60
_TXT_SET_GRAPHIC			equ &BB63
_TXT_WIN_ENABLE				equ &BB66
_TXT_GET_WINDOW				equ &BB69
_TXT_CLEAR_WINDOW			equ &BB6C
_TXT_SET_COLUMN				equ &BB6F
_TXT_SET_ROW				equ &BB72
_TXT_SET_CURSOR				equ &BB75
_TXT_GET_CURSOR				equ &BB78
_TXT_CUR_ENABLE				equ &BB7B
_TXT_CUR_DISABLE			equ &BB7E
_TXT_CUR_ON				equ &BB81
_TXT_CUR_OFF				equ &BB84
_TXT_VALIDATE				equ &BB87
_TXT_PLACE_CURSOR			equ &BB8A
_TXT_REMOVE_CURSOR			equ &BB8D
_TXT_SET_PEN				equ &BB90
_TXT_GET_PEN				equ &BB93
_TXT_SET_PAPER				equ &BB96
_TXT_GET_PAPER				equ &BB99
_TXT_INVERSE				equ &BB9C
_TXT_SET_BACK				equ &BB9F
_TXT_GET_BACK				equ &BBA2
_TXT_GET_MATRIX				equ &BBA5
_TXT_SET_MATRIX				equ &BBA8
_TXT_SET_M_TABLE			equ &BBAB
_TXT_GET_M_TABLE			equ &BBAE
_TXT_GET_CONTROLS			equ &BBB1
_TXT_STR_SELECT				equ &BBB4
_TXT_SWAP_STREAMS			equ &BBB7

; The Graphics VDU
_GRA_INITIALISE				equ &BBBA
_GRA_RESET				equ &BBBD
_GRA_MOVE_ABSOLUTE			equ &BBC0
_GRA_MOVE_RELATIVE			equ &BBC3
_GRA_ASK_CURSOR				equ &BBC6
_GRA_SET_ORIGIN				equ &BBC9
_GRA_GET_ORIGIN				equ &BBCC
_GRA_WIN_WIDTH				equ &BBCF
_GRA_WIN_HEIGHT				equ &BBD2
_GRA_GET_W_WIDTH			equ &BBD5
_GRA_GET_W_HEIGHT			equ &BBD8
_GRA_CLEAR_WINDOW			equ &BBDB
_GRA_SET_PEN				equ &BBDE
_GRA_GET_PEN				equ &BBE1
_GRA_SET_PAPER				equ &BBE4
_GRA_GET_PAPER				equ &BBE7
_GRA_PLOT_ABSOLUTE			equ &BBEA
_GRA_PLOT_RELATIVE			equ &BBED
_GRA_TEST_ABSOLUTE			equ &BBF0
_GRA_TEST_RELATIVE			equ &BBF3
_GRA_LINE_ABSOLUTE			equ &BBF6
_GRA_LINE_RELATIVE			equ &BBF9
_GRA_WR_CHAR				equ &BBFC

; the Screen Pack
_SCR_INITIALISE				equ &BBFF
_SCR_RESET				equ &BC02
_SCR_SET_OFFSET				equ &BC05
_SCR_SET_BASE				equ &BC08
_SCR_GET_LOCATION			equ &BC0B
_SCR_SET_MODE				equ &BC0E
_SCR_GET_MODE				equ &BC11
_SCR_CLEAR				equ &BC14
_SCR_CHAR_LIMITS			equ &BC17
_SCR_CHAR_POSITION			equ &BC1A
_SCR_DOT_POSITION			equ &BC1D
_SCR_NEXT_BYTE				equ &BC20
_SCR_PREV_BYTE				equ &BC23
_SCR_NEXT_LINE				equ &BC26
_SCR_PREV_LINE				equ &BC29
_SCR_INK_ENCODE				equ &BC2C
_SCR_INK_DECODE				equ &BC2F
_SCR_SET_INK				equ &BC32
_SCR_GET_INK				equ &BC35
_SCR_SET_BORDER				equ &BC38
_SCR_GET_BORDER				equ &BC3B
_SCR_SET_FLASHING			equ &BC3E
_SCR_GET_FLASHING			equ &BC41
_SCR_FILL_BOX				equ &BC44
_SCR_FLOOD_BOX				equ &BC47
_SCR_CHAR_INVERT			equ &BC4A
_SCR_HW_ROLL				equ &BC4D
_SCR_SW_ROLL				equ &BC50
_SCR_UNPACK				equ &BC53
_SCR_REPACK				equ &BC56
_SCR_ACCESS				equ &BC59
_SCR_PIXELS				equ &BC5C
_SCR_HORIZONTAL				equ &BC5F
_SCR_VERTICAL				equ &BC62

; The Cassette/AmsDOS Manager
_CAS_INITIALISE				equ &BC65
_CAS_SET_SPEED				equ &BC68
_CAS_NOISY				equ &BC6B
_CAS_START_MOTOR			equ &BC6E
_CAS_STOP_MOTOR				equ &BC71
_CAS_RESTORE_MOTOR			equ &BC74
_CAS_IN_OPEN				equ &BC77
_CAS_IN_CLOSE				equ &BC7A
_CAS_IN_ABANDON				equ &BC7D
_CAS_IN_CHAR				equ &BC80
_CAS_IN_DIRECT				equ &BC83
_CAS_RETURN				equ &BC86
_CAS_TEST_EOF				equ &BC89
_CAS_OUT_OPEN				equ &BC8C
_CAS_OUT_CLOSE				equ &BC8F
_CAS_OUT_ABANDON			equ &BC92
_CAS_OUT_CHAR				equ &BC95
_CAS_OUT_DIRECT				equ &BC98
_CAS_CATALOG				equ &BC9B
_CAS_WRITE				equ &BC9E
_CAS_READ				equ &BCA1
_CAS_CHECK				equ &BCA4

; The Sound Manager
_SOUND_RESET				equ &BCA7
_SOUND_QUEUE				equ &BCAA
_SOUND_CHECK				equ &BCAD
_SOUND_ARM_EVENT			equ &BCB0
_SOUND_RELEASE				equ &BCB3
_SOUND_HOLD				equ &BCB6
_SOUND_CONTINUE				equ &BCB9
_SOUND_AMPL_ENVELOPE			equ &BCBC
_SOUND_TONE_ENVELOPE			equ &BCBF
_SOUND_A_ADDRESS			equ &BCC2
_SOUND_T_ADDRESS			equ &BCC5

; The Kernel
_KL_CHOKE_OFF				equ &BCC8
_KL_ROM_WALK				equ &BCCB
_KL_INIT_BACK				equ &BCCE
_KL_LOG_EXT				equ &BCD1
_KL_FIND_COMMAND			equ &BCD4
_KL_NEW_FRAME_FLY			equ &BCD7
_KL_ADD_FRAME_FLY			equ &BCDA
_KL_DEL_FRAME_FLY			equ &BCDD
_KL_NEW_FAST_TICKER			equ &BCE0
_KL_ADD_FAST_TICKER			equ &BCE3
_KL_DEL_FAST_TICKER			equ &BCE6
_KL_ADD_TICKER				equ &BCE9
_KL_DEL_TICKER				equ &BCEC
_KL_INIT_EVENT				equ &BCEF
_KL_EVENT				equ &BCF2
_KL_SYNC_RESET				equ &BCF5
_KL_DEL_SYNCHRONOUS			equ &BCF8
_KL_NEXT_SYNCH				equ &BCFB
_KL_DO_SYNCH				equ &BCFE
_KL_DONE_SYNCH				equ &BD01
_KL_EVENT_DISABLE			equ &BD04
_KL_EVENT_ENABLE			equ &BD07
_KL_DISARM_EVENT			equ &BD0A
_KL_TIME_PLEASE				equ &BD0D
_KL_TIME_SET				equ &BD10

; The Machine Pack
_MC_BOOT_PROGRAM			equ &BD13
_MC_START_PROGRAM			equ &BD16
_MC_WAIT_FLYBACK			equ &BD19
_MC_SET_MODE				equ &BD1C
_MC_SCREEN_OFFSET			equ &BD1F
_MC_CLEAR_INKS				equ &BD22
_MC_SET_INKS				equ &BD25
_MC_RESET_PRINTER			equ &BD28
_MC_PRINT_CHAR				equ &BD2B
_MC_PRINTER_BUSY			equ &BD2E
_MC_SEND_PRINTER			equ &BD31
_MC_SOUND_REGISTER			equ &BD34
_JUMP_RESTORE				equ &BD37
_KM_SET_LOCKS				equ &BD3A
_TXT_ASK_STATE				equ &BD40
_GRA_DEFAULT				equ &BD43
_GRA_SET_BACK				equ &BD46
_GRA_SET_FIRST				equ &BD49
_GRA_SET_LINE_MASK			equ &BD4C
_GRA_FROM_USER				equ &BD4F
_GRA_FILL				equ &BD52
_SCR_SET_POSITION			equ &BD55
_MC_PRINT_TRANSLATION			equ &BD58
_KL_BANK_SWITCH				equ &BD5B

; The Firmware Indirections
_IND_TXT_DRAW_CURSOR			equ &BDCD
_IND_TXT_UNDRAW_CURSOR			equ &BDD0
_IND_TXT_WRITE_CHAR			equ &BDD3
_IND_TXT_UNWRITE			equ &BDD6
_IND_TXT_OUT_ACTION			equ &BDD9
_IND_GRA_PLOT				equ &BDDC
_IND_GRA_TEST				equ &BDDF
_IND_GRA_LINE				equ &BDE2
_IND_SCR_READ				equ &BDE5
_IND_SCR_WRITE				equ &BDE8
_IND_SCR_MODE_CLEAR			equ &BDEB
_IND_KM_TEST_BREAK			equ &BDEE
_IND_MC_WAIT_PRINTER			equ &BDF1
_IND_KM_SCAN_KEYS			equ &BDF4

; The Maths Firmware
_MOVE_REAL				equ &BD61
_INTEGER_TO_REAL			equ &BD64
_BINARY_TO_REAL				equ &BD67
_REAL_TO_INTEGER			equ &BD6A
_REAL_TO_BINARY				equ &BD6D
_REAL_FIX				equ &BD70
_REAL_INT				equ &BD73
_INTERNAL_SUBROUTINE			equ &BD76
_REAL_x10POWA				equ &BD79
_REAL_ADDITION				equ &BD7C
_REAL_REVERSE_SUBTRACTION		equ &BD82
_REAL_MULTIPLICATION			equ &BD85
_REAL_DIVISION				equ &BD88
_REAL_COMPARISON			equ &BD8E
_REAL_UNARY_MINUS			equ &BD91
_REAL_SIGNUM_SGN			equ &BD94
_SET_ANGLE_MODE				equ &BD97
_REAL_PI				equ &BD9A
_REAL_SQR				equ &BD9D
_REAL_POWER				equ &BDA0
_REAL_LOG				equ &BDA3
_REAL_LOG_10				equ &BDA6
_REAL_EXP				equ &BDA9
_REAL_SINE				equ &BDAC
_REAL_COSINE				equ &BDAF
_REAL_TANGENT				equ &BDB2
_REAL_ARCTANGENT			equ &BDB5

; Maths Routines for the 464 only
_V1_REAL_SUBTRACTION			equ &BD5B
_V1_REAL_EXPONENT_ADDITION		equ &BD67
_V1_INTEGER_ADDITION			equ &BDAC
_V1_INTEGER_SUBTRACTION			equ &BDAF
_V1_INTEGER_REVERSE_SUBTRACTION		equ &BDB2
_V1_INTEGER_MULTIPLICATION		equ &BDB5
_V1_INTEGER_DIVISION			equ &BDB8
_V1_INTEGER_DIVISION_2			equ &BDBB
_V1_INTEGER_COMPARISON			equ &BDC4
_V1_INTEGER_UNARY_MINUS			equ &BDC7
_V1_INTEGER_SIGNUM_SGN			equ &BDCA

; Subroutines for the 664 and 6128 only
_V2_TEXT_INPUT				equ &BD5E
_V2_REAL_RND				equ &BD7F
_V2_REAL_RND0				equ &BD8B

; AMSDOS and BIOS Firmware
_BIOS_SET_MESSAGE			equ &C033
_BIOS_SETUP_DISC			equ &C036
_BIOS_SELECT_FORMAT			equ &C039
_BIOS_READ_SECTOR			equ &C03C
_BIOS_WRITE_SECTOR			equ &C03F
_BIOS_FORMAT_TRACK			equ &C042
_BIOS_MOVE_TRACK			equ &C045
_BIOS_GET_STATUS			equ &C048
_BIOS_SET_RETRY_COUNT			equ &C04B
_GET_SECTOR_DATA			equ &C56C