Updated
This commit is contained in:
51
OperatingSystem/monitor_v2/include/addresses.s
Normal file
51
OperatingSystem/monitor_v2/include/addresses.s
Normal file
@@ -0,0 +1,51 @@
|
||||
CS_BANK equ 0000000b
|
||||
CS_DIP equ 0000001b
|
||||
CS_CTC_0 equ 0000100b
|
||||
CS_CTC_1 equ 0000101b
|
||||
CS_CTC_2 equ 0000110b
|
||||
CS_CTC_3 equ 0000111b
|
||||
CS_SIO_A_D equ 0001000b
|
||||
CS_SIO_A_C equ 0001001b
|
||||
CS_SIO_B_D equ 0001010b
|
||||
CS_SIO_B_C equ 0001011b
|
||||
|
||||
IO_RTC_SEC0 equ 00100000b
|
||||
IO_RTC_SEC1 equ 00100001b
|
||||
IO_RTC_MIN0 equ 00100010b
|
||||
IO_RTC_MIN1 equ 00100011b
|
||||
IO_RTC_HOUR equ 00100100b
|
||||
IO_RTC_AMPM equ 00100101b
|
||||
IO_RTC_DAY0 equ 00100110b
|
||||
IO_RTC_DAY1 equ 00100111b
|
||||
IO_RTC_MON0 equ 00101000b
|
||||
IO_RTC_MON1 equ 00101001b
|
||||
IO_RTC_YERR0 equ 00101010b
|
||||
IO_RTC_YEAR1 equ 00101011b
|
||||
IO_RTC_WEEK equ 00101100b
|
||||
IO_RTC_CTR_D equ 00101101b
|
||||
IO_RTC_CTR_E equ 00101110b
|
||||
IO_RTC_CTR_F equ 00101111b
|
||||
|
||||
IO_AY0_ADDR equ 01000000b ;64
|
||||
IO_AY0_DATA equ 01000001b ;65
|
||||
IO_AY1_ADDR equ 01000010b ;66
|
||||
IO_AY1_DATA equ 01000011b ;67
|
||||
|
||||
START_ROM equ 0x0000
|
||||
IO_REG0 equ 0x20
|
||||
|
||||
VDP_REG equ 0x81
|
||||
VDP_MEM equ 0x80
|
||||
|
||||
PROG_ROM_START equ 0x0100
|
||||
PROG_MEM_START equ 04000h
|
||||
|
||||
IO_PIO_0_A_D equ 0x60
|
||||
IO_PIO_0_A_C equ 0x61
|
||||
IO_PIO_0_B_D equ 0x62
|
||||
IO_PIO_0_B_C equ 0x63
|
||||
|
||||
IO_PIO_1_A_D equ 0x64 ;PS2
|
||||
IO_PIO_1_A_C equ 0x65
|
||||
IO_PIO_1_B_D equ 0x66
|
||||
IO_PIO_1_B_C equ 0x67
|
||||
4564
OperatingSystem/monitor_v2/include/basic.s
Normal file
4564
OperatingSystem/monitor_v2/include/basic.s
Normal file
File diff suppressed because it is too large
Load Diff
115
OperatingSystem/monitor_v2/include/bootldr.s
Normal file
115
OperatingSystem/monitor_v2/include/bootldr.s
Normal file
@@ -0,0 +1,115 @@
|
||||
; Z8C Bootloader
|
||||
; 2022 by Dennis Gunia
|
||||
|
||||
BTLDR_ENTRY:
|
||||
;ld SP, 0ffffh ; set stack pointer
|
||||
|
||||
;Setup Serial Interface
|
||||
LD A,01001111b ; External Trigger, Time Constant Follows
|
||||
OUT (CS_CTC_0),A
|
||||
IN A,(CS_DIP) ; Read BAUD from DIP-Switches
|
||||
OUT (CS_CTC_0),A
|
||||
LD A,00110000b ;write into WR0: error reset, select WR0
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,018h ;write into WR0: channel reset
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,004h ;write into WR0: select WR4
|
||||
OUT (CS_SIO_A_C),A
|
||||
;LD a,04h ;write into WR4: clkx1,1 stop bit, no parity
|
||||
LD a,01000100b ;write into WR4: clkx16,1 stop bit, no parity
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,005h ;write into WR0: select WR5
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,11101000b ;DTR inactive, TX 8bit, BREAK off, TX on, RTS inactive
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,01h ;write into WR0: select WR1
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,00000100b ;no interrupt in CH B, special RX condition affects vect
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,02h ;write into WR0: select WR2
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,0h ;write into WR2: cmd line int vect (see int vec table)
|
||||
;bits D3,D2,D1 are changed according to RX condition
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,003h ;write into WR0: select WR3
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,0C1h ;RX 8bit, auto enable off, RX on
|
||||
OUT (CS_SIO_A_C),A
|
||||
|
||||
BTLDR_STARTUP_MSG:
|
||||
LD HL,[S_BTLDR_STARTUP_MSG]
|
||||
BTLDR_STARTUP_MSG_LOOP:
|
||||
LD A,(HL)
|
||||
OR A
|
||||
JR Z, BTLDR_INPUT
|
||||
CALL BTLDR_SUB_WRITEA
|
||||
INC HL
|
||||
JR BTLDR_STARTUP_MSG_LOOP
|
||||
BTLDR_INPUT:
|
||||
; Byte 1 & 2 = Length
|
||||
CALL BTLDR_SUB_INPUT_READ
|
||||
LD B, A
|
||||
CALL BTLDR_SUB_INPUT_READ
|
||||
LD C, A
|
||||
|
||||
; Byte 3 & 4 = Offset / Start address
|
||||
CALL BTLDR_SUB_INPUT_READ
|
||||
LD H, A
|
||||
CALL BTLDR_SUB_INPUT_READ
|
||||
LD L, A
|
||||
|
||||
; Byte 5+ = Payload
|
||||
BTLDR_INPUT_1:
|
||||
CALL BTLDR_SUB_INPUT_READ
|
||||
LD (HL),A ;Store byte
|
||||
DEC BC
|
||||
LD A,H
|
||||
OR A.L
|
||||
JR Z, BTLDR_DONE
|
||||
INC HL
|
||||
JR BTLDR_INPUT_1
|
||||
|
||||
BTLDR_DONE:
|
||||
RET
|
||||
|
||||
|
||||
; Strings
|
||||
S_BTLDR_STARTUP_MSG:
|
||||
db "Z8C BTLDR.S V0.1 by Dennis Gunia [RDY] ",0
|
||||
|
||||
|
||||
; Subroutines
|
||||
BTLDR_SUB_WRITEA:
|
||||
OUT (CS_SIO_A_D),A
|
||||
BTLDR_SUB_WRITEA_WAIT:
|
||||
XOR A
|
||||
INC A
|
||||
OUT (CS_SIO_A_C),A
|
||||
IN A,(CS_SIO_A_C)
|
||||
BIT 0,A
|
||||
JR Z, BTLDR_SUB_WRITEA_WAIT
|
||||
RET
|
||||
|
||||
BTLDR_SUB_RTS_OFF:
|
||||
ld a,005h ;write into WR0: select WR5
|
||||
out (CS_SIO_A_C),A
|
||||
ld a,0E8h ;DTR active, TX 8bit, BREAK off, TX on, RTS inactive
|
||||
out (CS_SIO_A_C),A
|
||||
ret
|
||||
BTLDR_SUB_RTS_ON:
|
||||
ld a,005h ;write into WR0: select WR5
|
||||
out (CS_SIO_A_C),A
|
||||
ld a,0EAh ;DTR active, TX 8bit, BREAK off, TX on, RTS active
|
||||
out (CS_SIO_A_C),A
|
||||
ret
|
||||
|
||||
BTLDR_SUB_INPUT_READ:
|
||||
CALL BTLDR_SUB_RTS_ON
|
||||
XOR A
|
||||
OUT (CS_SIO_A_C), a
|
||||
IN A, (CS_SIO_A_C)
|
||||
AND 1
|
||||
JR Z, BTLDR_SUB_INPUT_READ ;LOOP IF BUFFER EMPTY
|
||||
CALL BTLDR_SUB_RTS_OFF
|
||||
IN A, (CS_SIO_A_D)
|
||||
RET
|
||||
136
OperatingSystem/monitor_v2/include/console.s
Normal file
136
OperatingSystem/monitor_v2/include/console.s
Normal file
@@ -0,0 +1,136 @@
|
||||
;DIP SWICTHES
|
||||
;1843200 CLK / x16 SIO CLOCK MODE = 115200
|
||||
;MAX BAUD RATE = 115200
|
||||
;DIP VALUE = 115200/<BAUD>
|
||||
;
|
||||
;9600 -> 12 / 00110000
|
||||
;
|
||||
|
||||
CONSOLE_INIT:
|
||||
CONSOLE_INIT_CTC:
|
||||
;LD A,00001111b ; Set /16 Divider, CPU Trigger, Time COnstant Follows
|
||||
LD A,01001111b ; External Trigger, Time COnstant Follows
|
||||
OUT (CS_CTC_0),A
|
||||
IN A,(CS_DIP) ; Read BAUD from DIP-Switches
|
||||
;LD A,39
|
||||
OUT (CS_CTC_0),A
|
||||
CONSOLE_INIT_SIO:
|
||||
LD A,00110000b ;write into WR0: error reset, select WR0
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,018h ;write into WR0: channel reset
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,004h ;write into WR0: select WR4
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,01000100b ;write into WR4: clkx16,1 stop bit, no parity
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,005h ;write into WR0: select WR5
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,11101000b ;DTR inactive, TX 8bit, BREAK off, TX on, RTS inactive
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,01h ;write into WR0: select WR1
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,00000100b ;no interrupt in CH B, special RX condition affects vect
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,02h ;write into WR0: select WR2
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,0h ;write into WR2: cmd line int vect (see int vec table)
|
||||
;bits D3,D2,D1 are changed according to RX condition
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,003h ;write into WR0: select WR3
|
||||
OUT (CS_SIO_A_C),A
|
||||
LD a,0C1h ;RX 8bit, auto enable off, RX on
|
||||
OUT (CS_SIO_A_C),A
|
||||
;Channel A RX active
|
||||
RET
|
||||
|
||||
; A contains char
|
||||
; Destroys A
|
||||
print_char:
|
||||
push af
|
||||
out (CS_SIO_A_D),a
|
||||
call print_wait_out
|
||||
pop af
|
||||
;call print_char
|
||||
ret
|
||||
; HL contains pointer to string
|
||||
; Destroy A, HL
|
||||
|
||||
print_str:
|
||||
ld a, (hl)
|
||||
or a
|
||||
jr z,print_str_end
|
||||
call print_char
|
||||
inc hl
|
||||
jr print_str
|
||||
print_str_end:
|
||||
ret
|
||||
|
||||
print_clear:
|
||||
ld hl, [MSG_CLEAR]
|
||||
call print_str
|
||||
ret
|
||||
|
||||
print_newLine:
|
||||
ld a,10
|
||||
call print_char
|
||||
ld a,13
|
||||
call print_char
|
||||
ret
|
||||
; destroys a
|
||||
print_wait_out:
|
||||
; check for TX buffer empty
|
||||
sub a ;clear a, write into WR0: select RR0
|
||||
inc a ;select RR1
|
||||
out (CS_SIO_A_C),A
|
||||
in A,(CS_SIO_A_C) ;read RRx
|
||||
bit 0,A
|
||||
jr z,print_wait_out
|
||||
ret
|
||||
|
||||
print_a_hex:
|
||||
push af
|
||||
push bc
|
||||
push de
|
||||
call STRCONV_BYTES_TO_HEX
|
||||
ld a,b
|
||||
call print_char
|
||||
ld a,c
|
||||
call print_char
|
||||
pop de
|
||||
pop bc
|
||||
pop af
|
||||
|
||||
read_char:
|
||||
call A_RTS_ON
|
||||
nop
|
||||
xor a ; a = 0
|
||||
out (CS_SIO_A_C), a ; select reg 0
|
||||
in a, (CS_SIO_A_C) ; read reg 0
|
||||
and 1 ; mask D0 (recieve char available)
|
||||
call A_RTS_OFF
|
||||
ret Z ; return 0 if no char
|
||||
in a, (CS_SIO_A_D) ; read char if avail
|
||||
ret ; return
|
||||
|
||||
;MSG_CRSR_0:
|
||||
; db 0x1B, "[?25h",0
|
||||
;MSG_CRSR_1:
|
||||
; db 0x1B, "[?25l",0
|
||||
MSG_CLEAR:
|
||||
db 27, '[2J', 27, '[H',0
|
||||
|
||||
|
||||
|
||||
; Serial Util Functions
|
||||
A_RTS_OFF:
|
||||
ld a,005h ;write into WR0: select WR5
|
||||
out (CS_SIO_A_C),A
|
||||
ld a,068h ;DTR inactiveh, TX 8bit, BREAK off, TX on, RTS inactive
|
||||
out (CS_SIO_A_C),A
|
||||
ret
|
||||
A_RTS_ON:
|
||||
ld a,005h ;write into WR0: select WR5
|
||||
out (CS_SIO_A_C),A
|
||||
ld a,0EAh ;DTR active, TX 8bit, BREAK off, TX on, RTS active
|
||||
out (CS_SIO_A_C),A
|
||||
ret
|
||||
89
OperatingSystem/monitor_v2/include/conversions.s
Normal file
89
OperatingSystem/monitor_v2/include/conversions.s
Normal file
@@ -0,0 +1,89 @@
|
||||
; HL Contains Address to string
|
||||
; E is 0xFF if error
|
||||
; E is 0x00 if okay
|
||||
; A returns byte
|
||||
; A,DE are destroyed
|
||||
DHEX_TO_BYTE:
|
||||
PUSH HL ;Backup pointer
|
||||
; Load First Byte
|
||||
LD A,(HL) ;Load first char (high)
|
||||
CALL HEX_TO_BIN ;Conv chart to 4bit
|
||||
jr C, DHEX_TO_BYTE_FAILED ;If error jmp to DHEX_TO_BYTE_FAILED
|
||||
SLA A ;shift result to upper 4 bits
|
||||
SLA A
|
||||
SLA A
|
||||
SLA A
|
||||
LD D,A ;store result in D
|
||||
|
||||
INC HL ;next byte
|
||||
LD A,(HL) ;load 2nd char (lower)
|
||||
CALL HEX_TO_BIN ;Conv chart to 4bit
|
||||
jr C, DHEX_TO_BYTE_FAILED ;If error jmp to DHEX_TO_BYTE_FAILED
|
||||
OR D ;merge D with accumulator
|
||||
|
||||
POP HL ;restor original pointer
|
||||
LD E,0x00 ;set error to 0x00 = no error
|
||||
RET
|
||||
DHEX_TO_BYTE_FAILED:
|
||||
LD E,0xFF ;set error to oxFF
|
||||
;LD A,0x00
|
||||
POP HL
|
||||
RET
|
||||
|
||||
; REG A Contains CHAR-Low
|
||||
; If failed, Carry is set
|
||||
HEX_TO_BIN:
|
||||
SUB 48 ; 0 is 0
|
||||
jp PE, HEX_TO_INVALID_2; to low (SUB overflow)
|
||||
CP 10 ; Value is between 0 and 9
|
||||
JR C, HEX_TO_BIN_2
|
||||
SUB 7
|
||||
jp PE, HEX_TO_INVALID_2; to low (SUB overflow)
|
||||
HEX_TO_BIN_2:
|
||||
CP 16
|
||||
JR NC, HEX_TO_INVALID_2; if bigger than 15-> fail
|
||||
AND 0x0F
|
||||
RET
|
||||
HEX_TO_INVALID_2:
|
||||
SCF ;set carry flag
|
||||
RET
|
||||
|
||||
|
||||
;*****************
|
||||
; Convert Byte to Hex Char (ASCII)
|
||||
;*****************
|
||||
;Description: the StrLength function inline
|
||||
;
|
||||
;Inputs: A contains input byte
|
||||
;
|
||||
;Outputs: BC contains 2 Bytes of ASCII (HEX)
|
||||
;
|
||||
;Destroys: A, BC,
|
||||
STRCONV_BYTES_TO_HEX:
|
||||
PUSH AF;Backup A Register
|
||||
RRA
|
||||
RRA
|
||||
RRA
|
||||
RRA
|
||||
CALL STRCONV_BYTES_TO_HEX_1
|
||||
;LD A,D
|
||||
LD B,A
|
||||
POP AF ; Reload first Byte
|
||||
CALL STRCONV_BYTES_TO_HEX_1
|
||||
;LD A,D
|
||||
LD C,A
|
||||
RET
|
||||
|
||||
STRCONV_BYTES_TO_HEX_1:
|
||||
AND 0x0F
|
||||
ADD 48
|
||||
CP 58 ; Check if less than 58 (less than ASCII 9)
|
||||
;JR C, STRCONV_BYTES_TO_HEX_2
|
||||
RET C
|
||||
ADD 7 ; A-F
|
||||
RET
|
||||
STRCONV_BYTES_TO_HEX_2:
|
||||
;LD D,A
|
||||
RET
|
||||
|
||||
|
||||
78
OperatingSystem/monitor_v2/include/debug.s
Normal file
78
OperatingSystem/monitor_v2/include/debug.s
Normal file
@@ -0,0 +1,78 @@
|
||||
|
||||
|
||||
debug_init:
|
||||
ld A,VAR_CONSOLE_CONF ; Setup CTC
|
||||
out (IO_CTC0_C0),A ; Controll word, software reset, time constant follows, CLK/TRG starts timer
|
||||
ld A,VAR_CONSOLE_BAUD ; Setup timer const
|
||||
out (IO_CTC0_C0),A ; Load timer const into CTC (Setup Baud generator)
|
||||
;set up TX and RX:W
|
||||
ld a,00110000b ;write into WR0: error reset, select WR0
|
||||
out (IO_SIO0A_C),A
|
||||
ld a,018h ;write into WR0: channel reset
|
||||
out (IO_SIO0A_C),A
|
||||
ld a,004h ;write into WR0: select WR4
|
||||
out (IO_SIO0A_C),A
|
||||
ld a,04h ;44h write into WR4: clkx1,1 stop bit, no parity
|
||||
out (IO_SIO0A_C),A
|
||||
ld a,005h ;write into WR0: select WR5
|
||||
out (IO_SIO0A_C),A
|
||||
ld a,068h ;DTR active, TX 8bit, BREAK off, TX on, RTS inactive
|
||||
out (IO_SIO0A_C),A
|
||||
ld a,01h ;write into WR0: select WR1
|
||||
out (IO_SIO0A_C),A
|
||||
ld a,00000100b ;no interrupt in CH B, special RX condition affects vect
|
||||
out (IO_SIO0A_C),A
|
||||
;enable SIO channel A RX
|
||||
ld a,003h ;write into WR0: select WR3
|
||||
out (IO_SIO0A_C),A
|
||||
ld a,0C1h ;RX 8bit, auto enable off, RX on
|
||||
out (IO_SIO0A_C),A
|
||||
;Channel A RX active
|
||||
ld hl,[MSG_START_DBG]
|
||||
call debug_print_str
|
||||
ret
|
||||
|
||||
debug_print_char:
|
||||
out (IO_SIO0A_D),a
|
||||
call debug_wait_out
|
||||
ret
|
||||
|
||||
debug_print_str:
|
||||
ld a, (hl)
|
||||
or a
|
||||
ret z
|
||||
call debug_print_char
|
||||
inc hl
|
||||
jr debug_print_str
|
||||
|
||||
debug_print_newLine:
|
||||
ld a,10
|
||||
call debug_print_char
|
||||
ld a,13
|
||||
call debug_print_char
|
||||
ret
|
||||
|
||||
debug_wait_out:
|
||||
; check for TX buffer empty
|
||||
sub a ;clear a, write into WR0: select RR0
|
||||
inc a ;select RR1
|
||||
out (IO_SIO0A_C),A
|
||||
in A,(IO_SIO0A_C) ;read RRx
|
||||
bit 0,A
|
||||
jr z,debug_wait_out
|
||||
ret
|
||||
|
||||
MSG_START_DBG:
|
||||
db "Debug interface active!",13,10,0
|
||||
|
||||
debug_a_hex:
|
||||
push BC
|
||||
push AF
|
||||
call STRCONV_BYTES_TO_HEX
|
||||
ld a, b
|
||||
call debug_print_char
|
||||
ld a, c
|
||||
call debug_print_char
|
||||
pop AF
|
||||
pop BC
|
||||
ret
|
||||
322
OperatingSystem/monitor_v2/include/disassembler copy.s
Normal file
322
OperatingSystem/monitor_v2/include/disassembler copy.s
Normal file
@@ -0,0 +1,322 @@
|
||||
; HL contains start address
|
||||
; B contains length
|
||||
disassemble:
|
||||
call dasm_print16hex_addr ;print address (HL)
|
||||
call disassemble_table_seek
|
||||
xor a
|
||||
or b
|
||||
or c
|
||||
jr z, disassemble_err ;if bc==0000h
|
||||
|
||||
ld a,(hl) ;load first byte
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
call dasm_print8hex ;print value
|
||||
ld a,(hl)
|
||||
cp 0xC3 ;C3 JPnn
|
||||
jp z, dasm_C3
|
||||
|
||||
;start getting value
|
||||
|
||||
disassemble_err:
|
||||
ld a,(hl)
|
||||
call dasm_print8hex ;print value
|
||||
push hl
|
||||
ld hl, [dasm_UU]
|
||||
call print_str
|
||||
pop hl
|
||||
disassemble_continue:
|
||||
call print_newLine
|
||||
inc hl
|
||||
dec b
|
||||
jp nz, disassemble
|
||||
ret
|
||||
|
||||
|
||||
|
||||
;A contains char
|
||||
;BC contains returned position
|
||||
disassemble_table_seek:
|
||||
push hl
|
||||
ld c,a
|
||||
disassemble_table_seek_loop:
|
||||
ld a,(hl)
|
||||
cp c ; if match
|
||||
jr z, disassemble_table_found
|
||||
or a ; if null
|
||||
jp z, disassemble_table_notfound
|
||||
ld b,0
|
||||
ld c,4
|
||||
add hl,bc
|
||||
ld a,(hl)
|
||||
ld c,a
|
||||
add hl,bc
|
||||
inc hl
|
||||
jr disassemble_table_seek_loop
|
||||
|
||||
|
||||
disassemble_table_found
|
||||
ld b,H
|
||||
ld c,l
|
||||
pop hl
|
||||
ret
|
||||
|
||||
disassemble_table_notfound
|
||||
ld b,0
|
||||
ld c,0
|
||||
pop hl
|
||||
ret
|
||||
|
||||
|
||||
|
||||
dasm_C3: ;JP nn (276)
|
||||
inc hl
|
||||
ld e, (HL)
|
||||
inc hl
|
||||
ld d, (HL)
|
||||
inc hl
|
||||
;de now has jmp value
|
||||
push hl
|
||||
ld hl, [dasm_C3_str]
|
||||
call print_str
|
||||
ld h,d
|
||||
ld l,e
|
||||
call dasm_print16hex_addr
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_C3_str:
|
||||
db "JP ",0x00
|
||||
|
||||
dasm_JPccnn: ;JP nn (276)
|
||||
rra
|
||||
rra
|
||||
rra
|
||||
and 0x07
|
||||
call dasm_printFlags
|
||||
ld a, ","
|
||||
call print_char
|
||||
inc hl
|
||||
ld e, (HL)
|
||||
inc hl
|
||||
ld d, (HL)
|
||||
inc hl
|
||||
;de now has jmp value
|
||||
push hl
|
||||
ld hl, [dasm_C3_str]
|
||||
call print_str
|
||||
ld h,d
|
||||
ld l,e
|
||||
call dasm_print16hex_addr
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
|
||||
dasm_18: ;JR e
|
||||
inc hl
|
||||
ld e, (HL)
|
||||
inc hl
|
||||
;de now has jmp value
|
||||
push hl
|
||||
ld hl, [dasm_18_str]
|
||||
call print_str
|
||||
ld a,e
|
||||
call dasm_print8relhex
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_18_str:
|
||||
db "JR ",0x00
|
||||
|
||||
dasm_38: ;JR C,e
|
||||
inc hl
|
||||
ld e, (HL)
|
||||
inc hl
|
||||
;de now has jmp value
|
||||
push hl
|
||||
ld hl, [dasm_38_str]
|
||||
call print_str
|
||||
ld a,e
|
||||
call dasm_print8relhex
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_38_str:
|
||||
db "JR C, ",0x00
|
||||
|
||||
dasm_30: ;JR NC,e
|
||||
inc hl
|
||||
ld e, (HL)
|
||||
inc hl
|
||||
;de now has jmp value
|
||||
push hl
|
||||
ld hl, [dasm_30_str]
|
||||
call print_str
|
||||
ld a,e
|
||||
call dasm_print8relhex
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_30_str:
|
||||
db "JR NC, ",0x00
|
||||
|
||||
dasm_28: ;JR Z,e
|
||||
inc hl
|
||||
ld e, (HL)
|
||||
inc hl
|
||||
;de now has jmp value
|
||||
push hl
|
||||
ld hl, [dasm_28_str]
|
||||
call print_str
|
||||
ld a,e
|
||||
call dasm_print8relhex
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_28_str:
|
||||
db "JR Z, ",0x00
|
||||
|
||||
dasm_20: ;JR NZ,e
|
||||
inc hl
|
||||
ld e, (HL)
|
||||
inc hl
|
||||
;de now has jmp value
|
||||
push hl
|
||||
ld hl, [dasm_20_str]
|
||||
call print_str
|
||||
ld a,e
|
||||
call dasm_print8relhex
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_20_str:
|
||||
db "JR NZ, ",0x00
|
||||
|
||||
dasm_E9: ;JR NZ,e
|
||||
inc hl
|
||||
push hl
|
||||
ld hl, [dasm_20_str]
|
||||
call print_str
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_E9_str:
|
||||
db "JP (HL), ",0x00
|
||||
|
||||
dasm_E9: ;JP (HL)
|
||||
inc hl
|
||||
push hl
|
||||
ld hl, [dasm_E9_str]
|
||||
call print_str
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_E9_str:
|
||||
db "JP (HL)",0x00
|
||||
|
||||
dasm_E9: ;JP (IX)
|
||||
inc hl
|
||||
push hl
|
||||
ld hl, [dasm_E9_str]
|
||||
call print_str
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_E9_str:
|
||||
db "JP (IX)",0x00
|
||||
|
||||
dasm_E9: ;JP (IY)
|
||||
inc hl
|
||||
push hl
|
||||
ld hl, [dasm_E9_str]
|
||||
call print_str
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_E9_str:
|
||||
db "JP (IY)",0x00
|
||||
|
||||
|
||||
dasm_00: ;JP nn (276)
|
||||
inc hl
|
||||
push hl
|
||||
ld hl, [dasm_00_str]
|
||||
call print_str
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_00_str:
|
||||
db "NOP",0x00
|
||||
|
||||
dasm_FF: ;JP nn (276)
|
||||
inc hl
|
||||
push hl
|
||||
ld hl, [dasm_FF_str]
|
||||
call print_str
|
||||
pop hl
|
||||
jp disassemble_continue
|
||||
dasm_FF_str:
|
||||
db "---",0x00
|
||||
|
||||
|
||||
dasm_print16hex_addr:
|
||||
ld a,"$"
|
||||
call print_char
|
||||
ld a,h
|
||||
call print_a_hex
|
||||
ld a,l
|
||||
call print_a_hex
|
||||
ld a,"h"
|
||||
call print_char
|
||||
ld a," "
|
||||
call print_char
|
||||
ret
|
||||
|
||||
dasm_print8hex:
|
||||
call print_a_hex
|
||||
ld a,"h"
|
||||
call print_char
|
||||
ld a," "
|
||||
call print_char
|
||||
ret
|
||||
|
||||
dasm_print8relhex:
|
||||
push af
|
||||
and 0x80
|
||||
jp nz, dasm_print8relhex_neg
|
||||
ld a,"$"
|
||||
call print_char
|
||||
ld a,"+"
|
||||
call print_char
|
||||
pop af
|
||||
call print_a_hex
|
||||
ld a,"h"
|
||||
call print_char
|
||||
ret
|
||||
|
||||
dasm_print8relhex_neg:
|
||||
ld a,"$"
|
||||
call print_char
|
||||
ld a,"-"
|
||||
call print_char
|
||||
pop af
|
||||
neg
|
||||
call print_a_hex
|
||||
ld a,"h"
|
||||
call print_char
|
||||
ret
|
||||
|
||||
|
||||
dasm_printFlags:
|
||||
push hl
|
||||
ld hl, [dasm_printFlags_table]
|
||||
rlca
|
||||
ld b,0
|
||||
ld c,a
|
||||
add hl,bc
|
||||
call print_str
|
||||
ld a, " "
|
||||
call print_char
|
||||
pop hl
|
||||
ret
|
||||
|
||||
dasm_printFlags_table:
|
||||
db "NZ",0
|
||||
db "Z",0,0
|
||||
db "NC"
|
||||
db "C",0,0
|
||||
db "PO",0
|
||||
db "PE",0
|
||||
db "P",0,0
|
||||
db "M",0,0
|
||||
569
OperatingSystem/monitor_v2/include/disassembler.s
Normal file
569
OperatingSystem/monitor_v2/include/disassembler.s
Normal file
@@ -0,0 +1,569 @@
|
||||
var_opcode_start equ PRG_RAM_START ;16 bit pointer to opcode in mem
|
||||
var_opcode_table equ PRG_RAM_START+2 ;16 bit pointer to opcode in table
|
||||
var_opcode equ PRG_RAM_START+4 ;8 bit opcode value
|
||||
var_opcode_x equ PRG_RAM_START+5 ;8 bit opcode extension value
|
||||
var_opcode_length equ PRG_RAM_START+6 ;8 bit opcode length (in bytes)
|
||||
var_opcode_string equ PRG_RAM_START+7 ;16 bit pointer to opcode string
|
||||
var_opcode_pcount equ PRG_RAM_START+9 ;8 bit opcode param count
|
||||
var_bytes_count equ PRG_RAM_START+10 ;bytes to examine
|
||||
; HL contains start address
|
||||
; B contains length
|
||||
disassemble:
|
||||
ld a,b
|
||||
ld (var_bytes_count),a
|
||||
disassemble_next:
|
||||
|
||||
|
||||
ld (var_opcode_start), hl ;16 bit pointer to opcode in mem
|
||||
ld a,(hl) ;load opcode to find in A
|
||||
ld (var_opcode), a ;8 bit opcode value
|
||||
inc hl
|
||||
ld a,(hl) ;load opcode to find in A
|
||||
ld (var_opcode_x), a ;8 bit opcode extended value
|
||||
dec hl
|
||||
call disassemble_table_seek
|
||||
ld a,b
|
||||
or c
|
||||
jp z, disassemble_err ;if bc==0000h
|
||||
|
||||
ld (var_opcode_table), bc ;16 bit pointer to opcode in table
|
||||
|
||||
;load params
|
||||
inc bc
|
||||
inc bc
|
||||
inc bc
|
||||
inc bc
|
||||
ld a,(bc)
|
||||
ld (var_opcode_length),A ;8 bit opcode length (in bytes)
|
||||
inc bc
|
||||
ld a, (bc)
|
||||
ld e,a
|
||||
inc bc
|
||||
ld a, (bc)
|
||||
ld d,a
|
||||
ld (var_opcode_string),de ;16 bit pointer to opcode string
|
||||
inc bc
|
||||
ld a,(bc)
|
||||
ld (var_opcode_pcount),A ;8 bit opcode param count
|
||||
|
||||
;values are prepared. Continue with print
|
||||
|
||||
ld hl,(var_opcode_start) ;print address
|
||||
call dasm_print16hex_addr
|
||||
|
||||
ld a,(var_opcode_length)
|
||||
ld b, a
|
||||
|
||||
;print up to 4 opcode bytes
|
||||
ld hl,(var_opcode_start)
|
||||
|
||||
disassemble_print_opcode_raw
|
||||
ld a,(hl) ;load first byte
|
||||
call print_a_hex
|
||||
inc hl
|
||||
djnz disassemble_print_opcode_raw
|
||||
|
||||
ld a,"h"
|
||||
call print_char
|
||||
;fill empty spots
|
||||
ld a,(var_opcode_length)
|
||||
ld b,a
|
||||
ld a,6
|
||||
sub b
|
||||
ld b,a
|
||||
|
||||
disassemble_print_opcode_raw_fill:
|
||||
ld a," "
|
||||
call print_char
|
||||
ld a," "
|
||||
call print_char
|
||||
djnz disassemble_print_opcode_raw_fill
|
||||
ld a," "
|
||||
call print_char
|
||||
|
||||
push hl
|
||||
;print opcode
|
||||
ld hl,(var_opcode_string)
|
||||
call print_str
|
||||
|
||||
|
||||
;print params
|
||||
ld a,(var_opcode_pcount)
|
||||
or a
|
||||
jp z, disassemble_print_opcode_params_end ;skip if no params
|
||||
|
||||
ld hl,(var_opcode_table)
|
||||
ld bc, 8
|
||||
add hl,bc ;hl now has address of first param
|
||||
ld a,(var_opcode_pcount)
|
||||
ld b,a
|
||||
disassemble_print_opcode_params_loop:
|
||||
;ld a,(hl) ;load param
|
||||
;call print_a_hex
|
||||
ld a,(hl) ;load param
|
||||
|
||||
cp 0x01
|
||||
call z, param_01
|
||||
cp 0x02
|
||||
call z, param_02
|
||||
cp 0x03
|
||||
call z, param_03
|
||||
cp 0x04
|
||||
call z, param_04
|
||||
cp 0x05
|
||||
call z, param_05
|
||||
cp 0x06
|
||||
call z, param_06
|
||||
cp 0x07
|
||||
call z, param_07
|
||||
cp 0x08
|
||||
call z, param_08
|
||||
cp 0x09
|
||||
call z, param_09
|
||||
cp 0x10
|
||||
call z, param_10
|
||||
cp 0x11
|
||||
call z, param_11
|
||||
cp 0x12
|
||||
call z, param_12
|
||||
cp 0x13
|
||||
call z, param_13
|
||||
cp 0x0A
|
||||
call z, param_0A
|
||||
;strings
|
||||
cp 0x80
|
||||
call z, param_80
|
||||
cp 0x81
|
||||
call z, param_81
|
||||
inc hl
|
||||
djnz disassemble_print_opcode_params_loop
|
||||
disassemble_print_opcode_params_end:
|
||||
pop hl
|
||||
jr disassemble_continue
|
||||
|
||||
|
||||
disassemble_err:
|
||||
call dasm_print16hex_addr
|
||||
ld a,(hl)
|
||||
call dasm_print8hex ;print value
|
||||
inc hl
|
||||
push hl
|
||||
ld hl, [dasm_UU]
|
||||
call print_str
|
||||
pop hl
|
||||
|
||||
disassemble_continue:
|
||||
|
||||
call print_newLine
|
||||
;inc hl
|
||||
ld a,(var_bytes_count)
|
||||
dec a
|
||||
ld (var_bytes_count),a
|
||||
jp nz, disassemble_next
|
||||
ret
|
||||
|
||||
|
||||
|
||||
;A contains opcode
|
||||
;BC contains returned position
|
||||
disassemble_table_seek:
|
||||
push hl
|
||||
ld hl, [dasm_opcode_table]
|
||||
disassemble_table_seek_loop:
|
||||
ld a,(var_opcode)
|
||||
ld c,a
|
||||
ld a,(hl)
|
||||
cp 0xFF ; if null
|
||||
jp z, disassemble_table_notfound
|
||||
|
||||
;apply mask
|
||||
push af
|
||||
inc hl
|
||||
ld b,(hl) ;load mask
|
||||
dec hl
|
||||
ld a,c
|
||||
and b ;apply mask
|
||||
ld c,a
|
||||
pop af
|
||||
|
||||
cp c ; if match
|
||||
jr z, disassemble_table_first_match
|
||||
ld b,0
|
||||
ld c,7
|
||||
add hl,bc
|
||||
ld a,(hl)
|
||||
ld c,a
|
||||
add hl,bc
|
||||
inc hl
|
||||
jr disassemble_table_seek_loop
|
||||
|
||||
disassemble_table_first_match
|
||||
inc hl
|
||||
inc hl
|
||||
ld c,(hl) ;load opcode x from table
|
||||
inc hl
|
||||
ld a,(var_opcode_x) ;load current opcode x
|
||||
ld b,(hl) ;load mask
|
||||
and b ;apply mask
|
||||
cp c ;compare to table
|
||||
dec hl
|
||||
dec hl
|
||||
dec hl
|
||||
jr z, disassemble_table_found ;IF FOUND
|
||||
ld b,0 ;else continue with next
|
||||
|
||||
ld c,7
|
||||
add hl,bc
|
||||
ld a,(hl)
|
||||
ld c,a
|
||||
add hl,bc
|
||||
inc hl
|
||||
jr disassemble_table_seek_loop
|
||||
|
||||
disassemble_table_found
|
||||
ld b,H
|
||||
ld c,l
|
||||
pop hl
|
||||
ret
|
||||
|
||||
disassemble_table_notfound
|
||||
ld b,0
|
||||
ld c,0
|
||||
pop hl
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
dasm_print16hex_addr:
|
||||
ld a,"$"
|
||||
call print_char
|
||||
ld a,h
|
||||
call print_a_hex
|
||||
ld a,l
|
||||
call print_a_hex
|
||||
ld a,"h"
|
||||
call print_char
|
||||
ld a," "
|
||||
call print_char
|
||||
ret
|
||||
|
||||
dasm_print8hex:
|
||||
call print_a_hex
|
||||
ld a,"h"
|
||||
call print_char
|
||||
ld a," "
|
||||
call print_char
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
param_01: ; 0x01 16bit address pointer
|
||||
push hl
|
||||
ld de,(var_opcode_start)
|
||||
inc de
|
||||
ld a,(de)
|
||||
ld l,a
|
||||
inc de
|
||||
ld a,(de)
|
||||
ld h,a
|
||||
|
||||
ld a,"$"
|
||||
call print_char
|
||||
ld a,h
|
||||
call print_a_hex
|
||||
ld a,l
|
||||
call print_a_hex
|
||||
ld a,"h"
|
||||
call print_char
|
||||
ld a," "
|
||||
call print_char
|
||||
call param_comma
|
||||
pop hl
|
||||
ret
|
||||
|
||||
param_02:
|
||||
push bc
|
||||
ld de,(var_opcode_start)
|
||||
ld a,(de)
|
||||
rra
|
||||
rra
|
||||
and 0x0E
|
||||
|
||||
push hl
|
||||
ld hl, [dasm_printFlags_table]
|
||||
ld b,0
|
||||
ld c,a
|
||||
add hl,bc
|
||||
call print_str
|
||||
ld a, " "
|
||||
call print_char
|
||||
pop hl
|
||||
pop bc
|
||||
ret
|
||||
|
||||
|
||||
param_03:
|
||||
ld de,(var_opcode_start)
|
||||
inc de
|
||||
ld a,(de)
|
||||
|
||||
push af
|
||||
and 0x80
|
||||
jp nz, param_03_neg
|
||||
ld a,"$"
|
||||
call print_char
|
||||
ld a,"+"
|
||||
call print_char
|
||||
pop af
|
||||
call print_a_hex
|
||||
ld a,"h"
|
||||
call print_char
|
||||
jr param_03_done
|
||||
|
||||
param_03_neg:
|
||||
ld a,"$"
|
||||
call print_char
|
||||
ld a,"-"
|
||||
call print_char
|
||||
pop af
|
||||
neg
|
||||
call print_a_hex
|
||||
ld a,"h"
|
||||
call print_char
|
||||
jr param_03_done
|
||||
|
||||
param_03_done:
|
||||
call param_comma
|
||||
ret
|
||||
|
||||
|
||||
param_04:
|
||||
ld de,(var_opcode_start)
|
||||
inc de
|
||||
ld a,(de)
|
||||
cp 0x4D
|
||||
jr z,param_04_i
|
||||
ld a,"N"
|
||||
call print_char
|
||||
ret
|
||||
param_04_i:
|
||||
ld a,"I"
|
||||
call print_char
|
||||
ret
|
||||
|
||||
param_05:
|
||||
push bc
|
||||
ld de,(var_opcode_start)
|
||||
ld a,(de)
|
||||
and 0x38
|
||||
; print hex char
|
||||
call dasm_print8hex
|
||||
pop bc
|
||||
ret
|
||||
|
||||
|
||||
param_06:
|
||||
push bc
|
||||
ld de,(var_opcode_start)
|
||||
ld a,(de)
|
||||
rra
|
||||
rra
|
||||
rra
|
||||
and 0x07
|
||||
call param_printRegister
|
||||
ld a," "
|
||||
call print_char
|
||||
ld a,","
|
||||
call print_char
|
||||
pop bc
|
||||
ret
|
||||
|
||||
param_07:
|
||||
push bc
|
||||
ld de,(var_opcode_start)
|
||||
ld a,(de)
|
||||
and 0x07
|
||||
|
||||
call param_printRegister
|
||||
pop bc
|
||||
ret
|
||||
|
||||
param_08:
|
||||
push bc
|
||||
ld de,(var_opcode_start)
|
||||
inc de
|
||||
ld a,(de)
|
||||
call dasm_print8hex
|
||||
pop bc
|
||||
ret
|
||||
|
||||
|
||||
param_0A:
|
||||
push hl
|
||||
ld de,(var_opcode_start)
|
||||
inc de
|
||||
inc de
|
||||
jr param_09_0A
|
||||
param_09:
|
||||
push hl
|
||||
ld de,(var_opcode_start)
|
||||
inc de
|
||||
param_09_0A:
|
||||
ld a,(de)
|
||||
ld l,a
|
||||
inc de
|
||||
ld a,(de)
|
||||
ld h,a
|
||||
ld a,h
|
||||
call print_a_hex
|
||||
ld a,l
|
||||
call print_a_hex
|
||||
pop hl
|
||||
ret
|
||||
|
||||
param_10:
|
||||
push bc
|
||||
ld de,(var_opcode_start)
|
||||
ld a,(de)
|
||||
rra
|
||||
rra
|
||||
rra
|
||||
and 0x07
|
||||
call param_printRegister
|
||||
pop bc
|
||||
ret
|
||||
|
||||
|
||||
param_11:
|
||||
push hl
|
||||
push bc
|
||||
ld de,(var_opcode_start)
|
||||
jr param_11_12
|
||||
param_12:
|
||||
push hl
|
||||
push bc
|
||||
ld de,(var_opcode_start)
|
||||
inc de
|
||||
|
||||
param_11_12:
|
||||
ld a,(de)
|
||||
rra
|
||||
rra
|
||||
rra
|
||||
and 0x06
|
||||
push af
|
||||
;check which table to use
|
||||
ld hl, (var_opcode_start)
|
||||
ld a,(hl)
|
||||
cp 0xDD
|
||||
jr z,param_11_12_ix
|
||||
cp 0xFD
|
||||
jr z,param_11_12_iy
|
||||
param_11_12_def:
|
||||
ld hl, [dasm_printRegister8_table]
|
||||
jr param_11_12_all
|
||||
param_11_12_ix:
|
||||
ld hl, [dasm_printRegisterIX_table]
|
||||
jr param_11_12_all
|
||||
param_11_12_iy:
|
||||
ld hl, [dasm_printRegisterIY_table]
|
||||
param_11_12_all:
|
||||
pop af
|
||||
ld b,0
|
||||
ld c,a
|
||||
add hl, bc
|
||||
ld a,(hl)
|
||||
call print_char
|
||||
inc hl
|
||||
ld a,(hl)
|
||||
call print_char
|
||||
pop bc
|
||||
pop hl
|
||||
ret
|
||||
|
||||
param_13:
|
||||
push hl
|
||||
push bc
|
||||
ld de,(var_opcode_start)
|
||||
ld a,(de)
|
||||
rra
|
||||
rra
|
||||
rra
|
||||
and 0x06
|
||||
push af
|
||||
;check which table to use
|
||||
ld hl, (var_opcode_start)
|
||||
ld a,(hl)
|
||||
ld hl, [dasm_printRegisterSP_table]
|
||||
jr param_11_12_all ;reuse code from 11_12
|
||||
|
||||
|
||||
param_81:
|
||||
push hl
|
||||
push bc
|
||||
ld hl, (var_opcode_string)
|
||||
ld b,2
|
||||
jr param_80_seek
|
||||
param_80:
|
||||
push hl
|
||||
push bc
|
||||
ld hl, (var_opcode_string)
|
||||
ld b,1
|
||||
param_80_seek:
|
||||
ld a,(hl)
|
||||
inc hl
|
||||
and a
|
||||
jr nz, param_80_seek
|
||||
;found
|
||||
dec b ;found but counter too high
|
||||
jp nz, param_80_seek
|
||||
|
||||
call print_str
|
||||
pop bc
|
||||
pop hl
|
||||
ret
|
||||
|
||||
|
||||
|
||||
param_printRegister:
|
||||
push hl
|
||||
cp 0x06
|
||||
jr z, param_printRegisterHL
|
||||
cp 0x07
|
||||
jr z, param_printRegisterA
|
||||
ld hl, [dasm_printRegister8_table]
|
||||
ld b,0
|
||||
ld c,a
|
||||
add hl,bc
|
||||
ld a, (hl)
|
||||
call print_char
|
||||
pop hl
|
||||
ret
|
||||
|
||||
param_printRegisterHL:
|
||||
ld hl, [dasm_printRegister8_table_HL]
|
||||
call print_str
|
||||
pop hl
|
||||
ret
|
||||
|
||||
param_printRegisterA:
|
||||
ld a,"A"
|
||||
call print_char
|
||||
pop hl
|
||||
ret
|
||||
|
||||
|
||||
param_comma:
|
||||
ld a,b
|
||||
cp 1
|
||||
ret z
|
||||
ld a," "
|
||||
call print_char
|
||||
ld a,","
|
||||
call print_char
|
||||
ret
|
||||
333
OperatingSystem/monitor_v2/include/disassembler_table.s
Normal file
333
OperatingSystem/monitor_v2/include/disassembler_table.s
Normal file
@@ -0,0 +1,333 @@
|
||||
;disassembler tables
|
||||
|
||||
dasm_opcode_table:
|
||||
;byte 0 = opcode
|
||||
;byte 1 = opcode mask
|
||||
;byte 2 = opcode extended
|
||||
;byte 3 = opcode extended mask
|
||||
;byte 4 = length
|
||||
;byte 5+6 = pointer to string
|
||||
;byte 7 = params = count of paramters
|
||||
;byte 8+ = paramters
|
||||
; 0x01 16bit address pointer
|
||||
; 0x02 flag bit 3-5
|
||||
; 0x03 relative jmp address
|
||||
; 0x04 RETI/RETN
|
||||
; 0x05 RST Vector
|
||||
; 0x06 register (r)
|
||||
; 0x07 register (r')
|
||||
; 0x08 8-Bit value
|
||||
; 0x09 16-Bit value
|
||||
; 0x0A 16-bit value with offset +1
|
||||
; 0x10 same as 0x06 without ","
|
||||
; 0x11 print 16 bit register from 1st byte
|
||||
; 0x12 print 16 bit register from 2nd byte
|
||||
; 0x13 push/pop register lookup
|
||||
; 0x80 print string suffix
|
||||
; 0x81 print string suffix 2
|
||||
defb 0x00, 0xFF, 0x00, 0x00, 1, [dasm_00], [dasm_00]>>8,0 ;NOP
|
||||
;General-Purpose Arithmetic and CPU Control Groups
|
||||
defb 0x27, 0xFF, 0x00, 0x00, 1, [dasm_27], [dasm_27]>>8, 0 ;DAA
|
||||
defb 0x2F, 0xFF, 0x00, 0x00, 1, [dasm_2F], [dasm_2F]>>8, 0 ;CPL
|
||||
defb 0xED, 0xFF, 0x44, 0xFF, 2, [dasm_ED_44], [dasm_ED_44]>>8, 0 ;NEG
|
||||
defb 0x3f, 0xFF, 0x00, 0x00, 1, [dasm_3F], [dasm_3F]>>8, 0 ;CCF
|
||||
defb 0x37, 0xFF, 0x00, 0x00, 1, [dasm_37], [dasm_37]>>8, 0 ;SCF
|
||||
;defb 0x00, 0xFF, 0x00, 0x00, 1, [dasm_00], [dasm_00]>>8,0 ;NOP -> already at top for performance reasons
|
||||
defb 0x76, 0xFF, 0x00, 0x00, 1, [dasm_76], [dasm_76]>>8, 0 ;HALT
|
||||
defb 0xF3, 0xFF, 0x00, 0x00, 1, [dasm_F3], [dasm_F3]>>8, 0 ;DI
|
||||
defb 0xFB, 0xFF, 0x00, 0x00, 1, [dasm_FB], [dasm_FB]>>8, 0 ;EI
|
||||
defb 0xED, 0xFF, 0x46, 0xFF, 2, [dasm_ED_46], [dasm_ED_46]>>8, 0 ;IM 0
|
||||
defb 0xED, 0xFF, 0x56, 0xFF, 2, [dasm_ED_56], [dasm_ED_56]>>8, 0 ;IM 1
|
||||
defb 0xED, 0xFF, 0x5E, 0xFF, 2, [dasm_ED_5E], [dasm_ED_5E]>>8, 0 ;IM 2
|
||||
|
||||
;Exchange, Block Transfer, and Search Group
|
||||
defb 0xEB, 0xFF, 0x00, 0x00, 1, [dasm_BE], [dasm_BE]>>8, 0 ;EX DE, HL
|
||||
defb 0x08, 0xFF, 0x00, 0x00, 1, [dasm_08], [dasm_08]>>8, 0 ;EX AF, AF′
|
||||
defb 0xD9, 0xFF, 0x00, 0x00, 1, [dasm_D9], [dasm_D9]>>8, 0 ;EXX
|
||||
defb 0xE3, 0xFF, 0x00, 0x00, 1, [dasm_E3], [dasm_E3]>>8, 0 ;EX (SP), HL
|
||||
defb 0xDD, 0xFF, 0xE3, 0xFF, 2, [dasm_DD_E3], [dasm_DD_E3]>>8, 0 ;EX (SP), IX
|
||||
defb 0xFD, 0xFF, 0xE3, 0xFF, 2, [dasm_FD_E3], [dasm_FD_E3]>>8, 0 ;EX (SP), IY
|
||||
defb 0xED, 0xFF, 0xA0, 0xFF, 2, [dasm_ED_A0], [dasm_ED_A0]>>8, 0 ;LDI
|
||||
defb 0xED, 0xFF, 0xB0, 0xFF, 2, [dasm_ED_B0], [dasm_ED_B0]>>8, 0 ;LDIR
|
||||
defb 0xED, 0xFF, 0xA8, 0xFF, 2, [dasm_ED_A8], [dasm_ED_A8]>>8, 0 ;LDD
|
||||
defb 0xED, 0xFF, 0xB8, 0xFF, 2, [dasm_ED_B8], [dasm_ED_B8]>>8, 0 ;LDDR
|
||||
defb 0xED, 0xFF, 0xA1, 0xFF, 2, [dasm_ED_A1], [dasm_ED_A1]>>8, 0 ;CPI
|
||||
defb 0xED, 0xFF, 0xB1, 0xFF, 2, [dasm_ED_B1], [dasm_ED_B1]>>8, 0 ;CPIR
|
||||
defb 0xED, 0xFF, 0xA9, 0xFF, 2, [dasm_ED_A9], [dasm_ED_A9]>>8, 0 ;CPD
|
||||
defb 0xED, 0xFF, 0xB9, 0xFF, 2, [dasm_ED_B9], [dasm_ED_B9]>>8, 0 ;CPDR
|
||||
|
||||
;JUMP Group
|
||||
defb 0xC3, 0xFF, 0x00, 0x00, 3, [dasm_C3], [dasm_C3]>>8,1, 0x01 ;JP nn
|
||||
defb 0xC2, 0xC7, 0x00, 0x00, 3, [dasm_C3], [dasm_C3]>>8,3, 0x02, 0x80, 0x01 ;JP cc,nn
|
||||
defb 0x18, 0xFF, 0x00, 0x00, 2, [dasm_18], [dasm_18]>>8,1, 0x03 ;JR e
|
||||
defb 0x38, 0xFF, 0x00, 0x00, 2, [dasm_38], [dasm_38]>>8,1, 0x03 ;JR C,e
|
||||
defb 0x30, 0xFF, 0x00, 0x00, 2, [dasm_30], [dasm_30]>>8,1, 0x03 ;JR NC,e
|
||||
defb 0x28, 0xFF, 0x00, 0x00, 2, [dasm_28], [dasm_28]>>8,1, 0x03 ;JR Z,e
|
||||
defb 0x20, 0xFF, 0x00, 0x00, 2, [dasm_20], [dasm_20]>>8,1, 0x03 ;JR NZ,e
|
||||
defb 0xE9, 0xFF, 0x00, 0x00, 2, [dasm_E9], [dasm_E9]>>8,0 ;JP (HL)
|
||||
defb 0xDD, 0xFF, 0xE9, 0xFF, 2, [dasm_DD], [dasm_DD]>>8,0 ;JP (IX)
|
||||
defb 0xFD, 0xFF, 0xE9, 0xFF, 2, [dasm_FD], [dasm_FD]>>8,0 ;JP (IY)
|
||||
defb 0x10, 0xFF, 0x00, 0x00, 2, [dasm_10], [dasm_10]>>8,1, 0x03 ;DJNZ, e
|
||||
;Call and Return Group
|
||||
defb 0xCD, 0xFF, 0x00, 0x00, 3, [dasm_CD], [dasm_CD]>>8,1, 0x01 ;CALL nn
|
||||
defb 0xC4, 0xC7, 0x00, 0x00, 3, [dasm_CD], [dasm_CD]>>8,2, 0x02, 0x01 ;CALL cc,nn
|
||||
defb 0xC9, 0xFF, 0x00, 0x00, 1, [dasm_C9], [dasm_C9]>>8,0 ;RET
|
||||
defb 0xC0, 0xC7, 0x00, 0x00, 1, [dasm_C9], [dasm_C9]>>8,1, 0x02 ;RET cc
|
||||
defb 0xED, 0xFF, 0x4D, 0xFF, 2, [dasm_ED_4D], [dasm_ED_4D]>>8,0 ;RETI
|
||||
defb 0xED, 0xFF, 0x45, 0xFF, 2, [dasm_ED_45], [dasm_ED_45]>>8,0 ;RETN
|
||||
|
||||
defb 0xC7, 0xC7, 0x00, 0x00, 1, [dasm_FF], [dasm_FF]>>8,1, 0x05 ;RST
|
||||
;8-Bit load group
|
||||
defb 0x0A, 0xFF, 0x00, 0x00, 1, [dasm_0A], [dasm_0A]>>8, 0 ;LD A, (BC)
|
||||
defb 0x1A, 0xFF, 0x00, 0x00, 1, [dasm_1A], [dasm_1A]>>8, 0 ;LD A, (DE)
|
||||
defb 0x3A, 0xFF, 0x00, 0x00, 3, [dasm_3A], [dasm_3A]>>8, 2, 0x09, 0x80 ;LD A, (nn)
|
||||
defb 0x02, 0xFF, 0x00, 0x00, 1, [dasm_02], [dasm_02]>>8, 0 ;LD (BC), A
|
||||
defb 0x12, 0xFF, 0x00, 0x00, 1, [dasm_12], [dasm_12]>>8, 0 ;LD (DE), A
|
||||
defb 0x32, 0xFF, 0x00, 0x00, 3, [dasm_32], [dasm_32]>>8, 2, 0x09, 0x80 ;LD (nn), A
|
||||
defb 0xED, 0xFF, 0x57, 0xFF, 2, [dasm__ED_57], [dasm__ED_57]>>8, 0 ;LD A, I
|
||||
defb 0xED, 0xFF, 0x5F, 0xFF, 2, [dasm__ED_5F], [dasm__ED_5F]>>8, 0 ;LD A, R
|
||||
defb 0xED, 0xFF, 0x47, 0xFF, 2, [dasm__ED_47], [dasm__ED_47]>>8, 0 ;LD I, A
|
||||
defb 0xED, 0xFF, 0x4F, 0xFF, 2, [dasm__ED_4F], [dasm__ED_4F]>>8, 0 ;LD R, A
|
||||
|
||||
defb 0x06, 0xC7, 0x00, 0x00, 2, [dasm__LD], [dasm__LD]>>8, 2, 0x06, 0x08 ;LD r, n
|
||||
defb 0x40, 0xC0, 0x00, 0x00, 1, [dasm__LD], [dasm__LD]>>8, 2, 0x06, 0x07 ;LD r, r' / LD r, (HL) / LD (HL), r
|
||||
|
||||
;8-Bit Arithmetic Group
|
||||
defb 0x80, 0xF8, 0x00, 0x00, 1, [dasm_80C6], [dasm_80C6]>>8, 1, 0x07 ;ADD A, r / ADD A, (HL)
|
||||
defb 0xC6, 0xFF, 0x00, 0x00, 2, [dasm_80C6], [dasm_80C6]>>8, 1, 0x08 ;ADD A, n
|
||||
defb 0xDD, 0xFF, 0x86, 0xFF, 3, [dasm_DD_86], [dasm_DD_86]>>8, 2, 0x08, 0x80 ;ADD A, (IX + d)
|
||||
defb 0xFD, 0xFF, 0x86, 0xFF, 3, [dasm_FD_86], [dasm_FD_86]>>8, 2, 0x08, 0x80 ;ADD A, (IY + d)
|
||||
defb 0xC8, 0xF8, 0x00, 0x00, 1, [dasm_C88E], [dasm_C88E]>>8, 1, 0x07 ;ADC A, r / ADC A, (HL)
|
||||
defb 0x8E, 0xF8, 0x00, 0x00, 2, [dasm_C88E], [dasm_C88E]>>8, 1, 0x08 ;ADC A, n
|
||||
defb 0xDD, 0xFF, 0x8E, 0xFF, 3, [dasm_DD_8E], [dasm_DD_8E]>>8, 2, 0x08, 0x80 ;ADC A, (IX + d)
|
||||
defb 0xFD, 0xFF, 0x8E, 0xFF, 3, [dasm_FD_8E], [dasm_FD_8E]>>8, 2, 0x08, 0x80 ;ADC A, (IY + d)
|
||||
defb 0x90, 0xF8, 0x00, 0x00, 1, [dasm__SUB], [dasm__SUB]>>8, 1, 0x07 ;SUB r / SUB A, (HL)
|
||||
defb 0xD6, 0xFF, 0x00, 0x00, 2, [dasm__SUB], [dasm__SUB]>>8, 1, 0x08 ;SUB n
|
||||
defb 0xDD, 0xFF, 0x96, 0xFF, 3, [dasm_DD_96], [dasm_DD_96]>>8, 2, 0x08, 0x80 ;SUB (IX + d)
|
||||
defb 0xFD, 0xFF, 0x96, 0xFF, 3, [dasm_FD_96], [dasm_FD_96]>>8, 2, 0x08, 0x80 ;SUB (IY + d)
|
||||
defb 0x94, 0xF8, 0x00, 0x00, 1, [dasm__SBC], [dasm__SBC]>>8, 1, 0x07 ;SBC A,r / SBC A, (HL)
|
||||
defb 0xDE, 0xFF, 0x00, 0x00, 2, [dasm__SBC], [dasm__SBC]>>8, 1, 0x08 ;SBC A,n
|
||||
defb 0xDD, 0xFF, 0x9E, 0xFF, 3, [dasm_DD_9E], [dasm_DD_9E]>>8, 2, 0x08, 0x80 ;SBC A,(IX + d)
|
||||
defb 0xFD, 0xFF, 0x9E, 0xFF, 3, [dasm_FD_9E], [dasm_FD_9E]>>8, 2, 0x08, 0x80 ;SBC A,(IY + d)
|
||||
defb 0xA0, 0xF8, 0x00, 0x00, 1, [dasm__AND], [dasm__AND]>>8, 1, 0x07 ;AND A,r / AND A, (HL)
|
||||
defb 0xE6, 0xFF, 0x00, 0x00, 2, [dasm__AND], [dasm__AND]>>8, 1, 0x08 ;AND A,n
|
||||
defb 0xDD, 0xFF, 0xA6, 0xFF, 3, [dasm_DD_A6], [dasm_DD_A6]>>8, 2, 0x08, 0x80 ;AND A,(IX + d)
|
||||
defb 0xFD, 0xFF, 0xA6, 0xFF, 3, [dasm_FD_A6], [dasm_FD_A6]>>8, 2, 0x08, 0x80 ;AND A,(IY + d)
|
||||
defb 0xB0, 0xF8, 0x00, 0x00, 1, [dasm__OR], [dasm__OR]>>8, 1, 0x07 ;OR A,r / OR A, (HL)
|
||||
defb 0xF6, 0xFF, 0x00, 0x00, 2, [dasm__OR], [dasm__OR]>>8, 1, 0x08 ;OR A,n
|
||||
defb 0xDD, 0xFF, 0xB6, 0xFF, 3, [dasm_DD_B6], [dasm_DD_B6]>>8, 2, 0x08, 0x80 ;OR A,(IX + d)
|
||||
defb 0xFD, 0xFF, 0xB6, 0xFF, 3, [dasm_FD_B6], [dasm_FD_B6]>>8, 2, 0x08, 0x80 ;OR A,(IY + d)
|
||||
defb 0xA8, 0xF8, 0x00, 0x00, 1, [dasm__XOR], [dasm__XOR]>>8, 1, 0x07 ;XOR A,r / XOR A, (HL)
|
||||
defb 0xEE, 0xFF, 0x00, 0x00, 2, [dasm__XOR], [dasm__XOR]>>8, 1, 0x08 ;XOR A,n
|
||||
defb 0xDD, 0xFF, 0xAE, 0xFF, 3, [dasm_DD_AE], [dasm_DD_AE]>>8, 2, 0x08, 0x80 ;XOR A,(IX + d)
|
||||
defb 0xFD, 0xFF, 0xAE, 0xFF, 3, [dasm_FD_AE], [dasm_FD_AE]>>8, 2, 0x08, 0x80 ;XOR A,(IY + d)
|
||||
defb 0xB8, 0xF8, 0x00, 0x00, 1, [dasm__CP], [dasm__CP]>>8, 1, 0x07 ;CP A,r / CP A, (HL)
|
||||
defb 0xFE, 0xFF, 0x00, 0x00, 2, [dasm__CP], [dasm__CP]>>8, 1, 0x08 ;CP A,n
|
||||
defb 0xDD, 0xFF, 0xBE, 0xFF, 3, [dasm_DD_BE], [dasm_DD_BE]>>8, 2, 0x08, 0x80 ;CP A,(IX + d)
|
||||
defb 0xFD, 0xFF, 0xBE, 0xFF, 3, [dasm_FD_BE], [dasm_FD_BE]>>8, 2, 0x08, 0x80 ;CP A,(IY + d)
|
||||
defb 0x04, 0xC7, 0x00, 0x00, 1, [dasm__INC], [dasm__INC]>>8, 1, 0x10 ;INC r / INC (HL)
|
||||
defb 0xDD, 0xFF, 0x34, 0xFF, 3, [dasm_DD_34], [dasm_DD_34]>>8, 2, 0x08, 0x80 ;INC (IX + d)
|
||||
defb 0xFD, 0xFF, 0x34, 0xFF, 3, [dasm_FD_34], [dasm_FD_34]>>8, 2, 0x08, 0x80 ;INC (IY + d)
|
||||
defb 0x05, 0xC7, 0x00, 0x00, 1, [dasm__DEC], [dasm__DEC]>>8, 1, 0x10 ;DEC r / DEC (HL)
|
||||
defb 0xDD, 0xFF, 0x35, 0xFF, 3, [dasm_DD_35], [dasm_DD_35]>>8, 2, 0x08, 0x80 ;DEC (IX + d)
|
||||
defb 0xFD, 0xFF, 0x35, 0xFF, 3, [dasm_FD_35], [dasm_FD_35]>>8, 2, 0x08, 0x80 ;DEC (IY + d)
|
||||
;16-Bit Arithmetic Group
|
||||
defb 0x09, 0xCF, 0x00, 0x00, 1, [dasm_09], [dasm_09]>>8, 1, 0x11 ;ADD HL, ss
|
||||
defb 0xED, 0xFF, 0x4A, 0xCF, 2, [dasm_ED_4A], [dasm_ED_4A]>>8, 1, 0x12 ;ADC HL, ss
|
||||
defb 0xED, 0xFF, 0x42, 0xCF, 2, [dasm_ED_42], [dasm_ED_42]>>8, 1, 0x12 ;SBC HL, ss
|
||||
defb 0xDD, 0xFF, 0x09, 0xCF, 2, [dasm_DD_09], [dasm_DD_09]>>8, 1, 0x12 ;ADD IX, ss
|
||||
defb 0xFD, 0xFF, 0x09, 0xCF, 2, [dasm_FD_09], [dasm_FD_09]>>8, 1, 0x12 ;ADD IY, ss
|
||||
defb 0x03, 0xCF, 0x00, 0x00, 1, [dasm_03], [dasm_03]>>8, 1, 0x11 ;INC ss
|
||||
defb 0xDD, 0xFF, 0x23, 0xFF, 2, [dasm_DD_23], [dasm_DD_23]>>8, 0 ;INC IX
|
||||
defb 0xFD, 0xFF, 0x23, 0xFF, 2, [dasm_FD_23], [dasm_FD_23]>>8, 0 ;INC IY
|
||||
defb 0x0B, 0xCF, 0x00, 0x00, 1, [dasm_0B], [dasm_0B]>>8, 1, 0x11 ;DEC ss
|
||||
defb 0xDD, 0xFF, 0x2B, 0xFF, 2, [dasm_DD_2B], [dasm_DD_2B]>>8, 0 ;DEC IX
|
||||
defb 0xFD, 0xFF, 0x2B, 0xFF, 2, [dasm_FD_2B], [dasm_FD_2B]>>8, 0 ;DEC IY
|
||||
;16-Bit Load Group
|
||||
defb 0x01, 0xCF, 0x00, 0x00, 3, [dasm_01], [dasm_01]>>8, 3, 0x11, 0x80, 0x09 ;LD dd, nn
|
||||
defb 0xDD, 0xFF, 0x21, 0xFF, 4, [dasm_DD_01], [dasm_DD_01]>>8, 1, 0x0A ;LD IX, nn
|
||||
defb 0xFD, 0xFF, 0x21, 0xFF, 4, [dasm_FD_01], [dasm_FD_01]>>8, 1, 0x0A ;LD IY, nn
|
||||
defb 0x2A, 0xFF, 0x00, 0x00, 3, [dasm_2A], [dasm_2A]>>8, 2, 0x09, 0x80 ;LD HL, (nn)
|
||||
defb 0xED, 0xFF, 0x4B, 0xCF, 4, [dasm_ED_4B], [dasm_ED_4B]>>8, 4, 0x12, 0x80, 0x0A, 0x81 ;LD dd, (nn)
|
||||
defb 0xDD, 0xFF, 0x2A, 0xFF, 4, [dasm_DD_2A], [dasm_DD_2A]>>8, 1, 0x0A ;LD IX, (nn)
|
||||
defb 0xFD, 0xFF, 0x2A, 0xFF, 4, [dasm_FD_2A], [dasm_FD_2A]>>8, 1, 0x0A ;LD IY, (nn)
|
||||
defb 0x22, 0xFF, 0x00, 0x00, 3, [dasm_22], [dasm_22]>>8, 2, 0x0A, 0x80 ;LD (nn), HL
|
||||
defb 0xED, 0xFF, 0x43, 0xCF, 4, [dasm_ED_43], [dasm_ED_43]>>8, 3, 0x0A, 0x80, 0x12 ;LD (nn), dd
|
||||
defb 0xDD, 0xFF, 0x22, 0xCF, 4, [dasm_DD_22], [dasm_DD_22]>>8, 2, 0x0A, 0x80 ;LD (nn), IX
|
||||
defb 0xFD, 0xFF, 0x22, 0xCF, 4, [dasm_FD_22], [dasm_FD_22]>>8, 2, 0x0A, 0x80 ;LD (nn), IY
|
||||
defb 0xF9, 0xFF, 0x00, 0x00, 1, [dasm_F9], [dasm_F9]>>8, 0 ;LD SP, HL
|
||||
defb 0xDD, 0xFF, 0xF9, 0xFF, 2, [dasm_DD_F9], [dasm_DD_F9]>>8, 0 ;LD SP, IX
|
||||
defb 0xFD, 0xFF, 0xF9, 0xFF, 2, [dasm_FD_F9], [dasm_FD_F9]>>8, 0 ;LD SP, IY
|
||||
defb 0xC5, 0xCF, 0x00, 0x00, 1, [dasm_E5], [dasm_E5]>>8, 1, 0x13 ;PUSH qq
|
||||
defb 0xDD, 0xFF, 0xE5, 0xFF, 2, [dasm_DD_E5], [dasm_DD_E5]>>8, 0 ;PUSH IX
|
||||
defb 0xFD, 0xFF, 0xE5, 0xFF, 2, [dasm_FD_E5], [dasm_FD_E5]>>8, 0 ;PUSH IY
|
||||
defb 0xC1, 0xCF, 0x00, 0x00, 1, [dasm_E1], [dasm_E1]>>8, 1, 0x13 ;POP qq
|
||||
defb 0xDD, 0xFF, 0xE1, 0xFF, 2, [dasm_DD_E1], [dasm_DD_E1]>>8, 0 ;POP IX
|
||||
defb 0xFD, 0xFF, 0xE1, 0xFF, 2, [dasm_FD_E1], [dasm_FD_E1]>>8, 0 ;POP IY
|
||||
|
||||
|
||||
dasm_00: db "NOP",0x00
|
||||
;JUMP Group
|
||||
dasm_C3: db "JP ",0x00,", ",0x00
|
||||
dasm_18: db "JR ",0x00
|
||||
dasm_38: db "JR C, ",0x00
|
||||
dasm_30: db "JR NC, ",0x00
|
||||
dasm_28: db "JR Z, ",0x00
|
||||
dasm_20: db "JR NZ, ",0x00
|
||||
dasm_E9: db "JP (HL) ",0x00
|
||||
dasm_DD: db "JP (IX) ",0x00
|
||||
dasm_FD: db "JP (IY) ",0x00
|
||||
dasm_10: db "DJNZ ",0x00
|
||||
;Call and Return Group
|
||||
dasm_CD: db "CALL ",0x00
|
||||
dasm_C9: db "RET ",0x00
|
||||
dasm_ED_4D: db "RETI",0x00
|
||||
dasm_ED_45: db "RETN",0x00
|
||||
dasm_FF: db "RST ",0x00
|
||||
;8-Bit load group
|
||||
dasm_0A: db "LD A,(BC)",0x00
|
||||
dasm_1A: db "LD A,(DE)",0x00
|
||||
dasm_3A: db "LD A,(",0x00, "h)",0x00
|
||||
dasm_02: db "LD (BC), A",0x00
|
||||
dasm_12: db "LD (DE), A",0x00
|
||||
dasm_32: db "LD (",0x00, "h), A",0x00
|
||||
dasm__LD: db "LD ",0x00
|
||||
dasm__ED_57: db "LD A, I",0x00
|
||||
dasm__ED_5F: db "LD A, R",0x00
|
||||
dasm__ED_47: db "LD I, A",0x00
|
||||
dasm__ED_4F: db "LD R, A",0x00
|
||||
;General-Purpose Arithmetic and CPU Control Groups
|
||||
dasm_27: db "DAA",0x00
|
||||
dasm_2F: db "CPL",0x00
|
||||
dasm_ED_44: db "NEG",0x00
|
||||
dasm_3F: db "CCF",0x00
|
||||
dasm_37: db "SCF",0x00
|
||||
dasm_76: db "HALT",0x00
|
||||
dasm_F3: db "DI",0x00
|
||||
dasm_FB: db "EI",0x00
|
||||
dasm_ED_46: db "IM 0",0x00
|
||||
dasm_ED_56: db "IM 1",0x00
|
||||
dasm_ED_5E: db "IM 2",0x00
|
||||
;Exchange, Block Transfer, and Search Group
|
||||
dasm_BE: db "EX DE, HL",0x00
|
||||
dasm_08: db "EX AF, AF′",0x00
|
||||
dasm_D9: db "EXX",0x00
|
||||
dasm_E3: db "EX (SP), HL",0x00
|
||||
dasm_DD_E3: db "EX (SP), IX",0x00
|
||||
dasm_FD_E3: db "EX (SP), IY",0x00
|
||||
dasm_ED_A0: db "LDI",0x00
|
||||
dasm_ED_B0: db "LDIR",0x00
|
||||
dasm_ED_A8: db "LDD",0x00
|
||||
dasm_ED_B8: db "LDDR",0x00
|
||||
dasm_ED_A1: db "CPI",0x00
|
||||
dasm_ED_B1: db "CPIR",0x00
|
||||
dasm_ED_A9: db "CPD",0x00
|
||||
dasm_ED_B9: db "CPDR",0x00
|
||||
;8-Bit Arithmetic Group
|
||||
dasm_80C6: db "ADD A, ", 0x00
|
||||
dasm_DD_86: db "ADD A, (IX+", 0x00, "h)",0x00
|
||||
dasm_FD_86: db "ADD A, (IY+", 0x00, "h)",0x00
|
||||
dasm_C88E: db "ADC A, ", 0x00
|
||||
dasm_DD_8E: db "ADC A, (IX+", 0x00, "h)",0x00
|
||||
dasm_FD_8E: db "ADC A, (IY+", 0x00, "h)",0x00
|
||||
dasm__SUB: db "SUB ", 0x00
|
||||
dasm_DD_96: db "SUB (IX+", 0x00, "h)",0x00
|
||||
dasm_FD_96: db "SUB (IY+", 0x00, "h)",0x00
|
||||
dasm__SBC: db "SBC A, ", 0x00
|
||||
dasm_DD_9E: db "SBC A,(IX+", 0x00, "h)",0x00
|
||||
dasm_FD_9E: db "SBC A,(IY+", 0x00, "h)",0x00
|
||||
dasm__AND: db "AND ", 0x00
|
||||
dasm_DD_A6: db "AND (IX+", 0x00, "h)",0x00
|
||||
dasm_FD_A6: db "AND (IY+", 0x00, "h)",0x00
|
||||
dasm__OR: db "OR ", 0x00
|
||||
dasm_DD_B6: db "OR (IX+", 0x00, "h)",0x00
|
||||
dasm_FD_B6: db "OR (IY+", 0x00, "h)",0x00
|
||||
dasm__XOR: db "XOR ", 0x00
|
||||
dasm_DD_AE: db "XOR (IX+", 0x00, "h)",0x00
|
||||
dasm_FD_AE: db "XOR (IY+", 0x00, "h)",0x00
|
||||
dasm__CP: db "CP ", 0x00
|
||||
dasm_DD_BE: db "CP (IX+", 0x00, "h)",0x00
|
||||
dasm_FD_BE: db "CP (IY+", 0x00, "h)",0x00
|
||||
dasm__INC: db "INC ", 0x00
|
||||
dasm_DD_34: db "INC (IX+", 0x00, "h)",0x00
|
||||
dasm_FD_34: db "INC (IY+", 0x00, "h)",0x00
|
||||
dasm__DEC: db "DEC ", 0x00
|
||||
dasm_DD_35: db "DEC (IX+", 0x00, "h)",0x00
|
||||
dasm_FD_35: db "DEC (IY+", 0x00, "h)",0x00
|
||||
;16-Bit Arithmetic Group
|
||||
dasm_09: db "ADD HL, ",0x00
|
||||
dasm_ED_4A: db "ADC HL, ",0x00
|
||||
dasm_ED_42: db "SBC HL, ",0x00
|
||||
dasm_DD_09: db "ADD IX, ",0x00
|
||||
dasm_FD_09: db "ADD IY, ",0x00
|
||||
dasm_03: db "INC ",0x00
|
||||
dasm_DD_23: db "INC IX, ",0x00
|
||||
dasm_FD_23: db "INC IY, ",0x00
|
||||
dasm_0B: db "DEC ",0x00
|
||||
dasm_DD_2B: db "DEC IX, ",0x00
|
||||
dasm_FD_2B: db "DEC IY, ",0x00
|
||||
;16-Bit Load Group
|
||||
dasm_01: db "LD ",0x00, ", ",0x00
|
||||
dasm_DD_01: db "LD IX, ",0x00
|
||||
dasm_FD_01: db "LD IY, ",0x00
|
||||
dasm_2A: db "LD HL, (",0x00,"h)",0x00
|
||||
dasm_ED_4B: db "LD ",0x00,", (",0x00,"h)",0x00
|
||||
dasm_DD_2A: db "LD IX, (",0x00,"h)",0x00
|
||||
dasm_FD_2A: db "LD IY, (",0x00,"h)",0x00
|
||||
dasm_22: db "LD (",0x00,"h), HL",0x00
|
||||
dasm_ED_43: db "LD (",0x00,"h), ",0x00
|
||||
dasm_DD_22: db "LD (",0x00,"h), IX",0x00
|
||||
dasm_FD_22: db "LD (",0x00,"h), IY",0x00
|
||||
dasm_F9: db "LD SP, HL",0x00
|
||||
dasm_DD_F9: db "LD SP, IX",0x00
|
||||
dasm_FD_F9: db "LD SP, IY",0x00
|
||||
dasm_E5: db "PUSH ",0x00
|
||||
dasm_DD_E5: db "PUSH IX",0x00
|
||||
dasm_FD_E5: db "PUSH IY",0x00
|
||||
dasm_E1: db "PUSH ",0x00
|
||||
dasm_DD_E1: db "PUSH IX",0x00
|
||||
dasm_FD_E1: db "PUSH IY",0x00
|
||||
|
||||
;Misc
|
||||
dasm_UU: db ".?.",0x00
|
||||
dasm_UW: db " ",0x00
|
||||
|
||||
dasm_printFlags_table:
|
||||
db "NZ"
|
||||
db "Z",0
|
||||
db "NC"
|
||||
db "C",0
|
||||
db "PO"
|
||||
db "PE"
|
||||
db "P",0
|
||||
db "M",0
|
||||
|
||||
dasm_printRegister8_table:
|
||||
db "B"
|
||||
db "C"
|
||||
db "D"
|
||||
db "E"
|
||||
db "H"
|
||||
db "L"
|
||||
db "S" ;only 18 bit (SP)
|
||||
db "P" ;only 18 bit (SP)
|
||||
|
||||
dasm_printRegisterIX_table:
|
||||
db "BC"
|
||||
db "DE"
|
||||
db "IX"
|
||||
db "SP"
|
||||
dasm_printRegisterIY_table:
|
||||
db "BC"
|
||||
db "DE"
|
||||
db "IY"
|
||||
db "SP"
|
||||
|
||||
dasm_printRegisterSP_table:
|
||||
db "BC"
|
||||
db "DE"
|
||||
db "HL"
|
||||
db "AF"
|
||||
|
||||
dasm_printRegister8_table_HL:
|
||||
db "(HL)", 0
|
||||
158
OperatingSystem/monitor_v2/include/keyboard.s
Normal file
158
OperatingSystem/monitor_v2/include/keyboard.s
Normal file
@@ -0,0 +1,158 @@
|
||||
;----------------------------------------------------------------
|
||||
;Keyboard input library for Z8C
|
||||
;by Dennis Gunia (04/2022)
|
||||
;----------------------------------------------------------------
|
||||
|
||||
var_ps2_extension equ var_ps2mem+4 ;extension code
|
||||
var_ps2_shift equ var_ps2mem+5 ;shift down = 0xFF, up = 0x00
|
||||
var_ps2_raw equ var_ps2mem+6 ;raw scan code
|
||||
|
||||
keybd_read:
|
||||
xor a
|
||||
ld (var_ps2_extension), a
|
||||
call keybd_read_wait
|
||||
cp 0xE0
|
||||
jr z, keybd_read_extended ;handle extended scancodes
|
||||
cp 0xE1
|
||||
jr z, keybd_read_extended_E1 ;handle extended scancodes for stupid pause button ....
|
||||
;else fall through to keybd_read_simple
|
||||
|
||||
keybd_read_simple:
|
||||
cp 0xF0 ;check if break
|
||||
jr z, keybd_read_break ;handle break code logic
|
||||
cp 0x12
|
||||
jr z, keybd_shift_down
|
||||
cp 0x59
|
||||
jr z, keybd_shift_down
|
||||
;else process key
|
||||
jr keybd_read_return
|
||||
|
||||
keybd_read_extended:
|
||||
ld (var_ps2_extension), a ;store first byte to ram
|
||||
call keybd_read_wait ;read key
|
||||
cp 0xF0 ;check if break
|
||||
jr z, keybd_read_break_extended ;handle break code logic
|
||||
;else process key
|
||||
jr keybd_read_return
|
||||
|
||||
keybd_read_extended_E1: ;pause key
|
||||
call keybd_read_wait ;read realeased key
|
||||
call keybd_read_wait ;read realeased key
|
||||
call keybd_read_wait ;read realeased key
|
||||
call keybd_read_wait ;read realeased key
|
||||
call keybd_read_wait ;read realeased key
|
||||
call keybd_read_wait ;read realeased key
|
||||
;fall-thorugh for last byte
|
||||
keybd_read_break_extended:
|
||||
call keybd_read_wait ;read realeased key
|
||||
jr keybd_read
|
||||
|
||||
keybd_read_break:
|
||||
call keybd_read_wait ;read realeased key
|
||||
cp 0x12
|
||||
jr z, keybd_shift_up
|
||||
cp 0x59
|
||||
jr z, keybd_shift_up
|
||||
jp keybd_read
|
||||
|
||||
keybd_read_return:
|
||||
;a contains scan code
|
||||
ret
|
||||
|
||||
|
||||
keybd_shift_down:
|
||||
ld a,0x01
|
||||
ld (var_ps2_shift),a
|
||||
jr keybd_read
|
||||
keybd_shift_up:
|
||||
xor a
|
||||
ld (var_ps2_shift),a
|
||||
jr keybd_read
|
||||
|
||||
|
||||
;wait for keyboard input
|
||||
keybd_read_wait:
|
||||
call keyboard_read
|
||||
jr z, keybd_read_wait ;read again if error
|
||||
ret
|
||||
|
||||
|
||||
keybd_read_ascii:
|
||||
call keybd_read
|
||||
;push af
|
||||
;call print_a_hex
|
||||
;pop af
|
||||
|
||||
ld ix, [keybd_lut] ;LUT base address
|
||||
ld bc, 4 ;increments
|
||||
ld d, a ;Load scancode into d
|
||||
keybd_read_ascii_seekloop:
|
||||
ld a, (ix) ;load scancode from table
|
||||
or a ;test if scancode is 0x00 -> indicates end of list
|
||||
jr z, keybd_read_ascii_notfound ;reached end of list wizhout match
|
||||
cp d ;compare scancode
|
||||
jr z, keybd_read_ascii_match ;found entry
|
||||
add ix,bc
|
||||
jr keybd_read_ascii_seekloop
|
||||
|
||||
keybd_read_ascii_match:
|
||||
ld b,0
|
||||
ld a, (var_ps2_shift) ;if shift offset+1
|
||||
inc a ;add ofset for column1
|
||||
ld c,a
|
||||
add ix,bc ;add column address to row address
|
||||
ld a,(ix)
|
||||
ret
|
||||
|
||||
keybd_read_ascii_notfound:
|
||||
jr keybd_read_ascii
|
||||
|
||||
keybd_lut:
|
||||
defb 0x1C, "a", "A", "@"
|
||||
defb 0x32, "b", "B", 0x00
|
||||
defb 0x21, "c", "C", 0x00
|
||||
defb 0x23, "d", "D", 0x00
|
||||
defb 0x24, "e", "E", 0x00
|
||||
defb 0x2B, "f", "F", 0x00
|
||||
defb 0x34, "g", "G", 0x00
|
||||
defb 0x33, "h", "H", 0x00
|
||||
defb 0x43, "i", "I", 0x00
|
||||
defb 0x3B, "j", "J", 0x00
|
||||
defb 0x42, "k", "K", 0x00
|
||||
defb 0x4B, "l", "L", 0x00
|
||||
defb 0x3A, "m", "M", 0x00
|
||||
defb 0x31, "n", "N", 0x00
|
||||
defb 0x44, "o", "O", 0x00
|
||||
defb 0x4D, "p", "P", 0x00
|
||||
defb 0x15, "q", "Q", 0x00
|
||||
defb 0x2D, "r", "R", 0x00
|
||||
defb 0x1B, "s", "S", 0x00
|
||||
defb 0x2C, "t", "T", 0x00
|
||||
defb 0x3C, "u", "U", 0x00
|
||||
defb 0x2A, "v", "V", 0x00
|
||||
defb 0x1D, "w", "W", 0x00
|
||||
defb 0x22, "x", "X", 0x00
|
||||
defb 0x1A, "y", "Y", 0x00
|
||||
defb 0x35, "z", "Z", 0x00
|
||||
defb 0x45, "0", "=", "}"
|
||||
defb 0x16, "1", "!", 0x00
|
||||
defb 0x1E, "2", 0x22, 0x00
|
||||
defb 0x26, "3", "3", 0x00
|
||||
defb 0x25, "4", "$", 0x00
|
||||
defb 0x2E, "5", "%", 0x00
|
||||
defb 0x36, "6", "&", 0x00
|
||||
defb 0x3D, "7", "/", "{"
|
||||
defb 0x3E, "8", "(", "["
|
||||
defb 0x46, "9", ")", "]"
|
||||
defb 0x41, ",", ";", 0x00
|
||||
defb 0x49, ".", ":", 0x00
|
||||
defb 0x4A, "-", "_", 0x00
|
||||
defb 0x5D, "#", "'", 0x00
|
||||
defb 0x5B, "+", "*", "~"
|
||||
defb 0x4E, "s", "?", 0x5C
|
||||
defb 0x61, "<", ">", "|"
|
||||
defb 0x5A, 13, 13, 13 ;enter
|
||||
defb 0x66, 0x08, 0x08, 0x08 ;backspace
|
||||
defb 0x29, " ", " ", 0x00 ;space
|
||||
defb 0x00 ;end of LUT
|
||||
|
||||
16
OperatingSystem/monitor_v2/include/parity.s
Normal file
16
OperatingSystem/monitor_v2/include/parity.s
Normal file
@@ -0,0 +1,16 @@
|
||||
; a contains data
|
||||
; bc destroied
|
||||
; carry is set if odd, reset if even
|
||||
calc_parity:
|
||||
ld c,0 ;parity data
|
||||
ld b,8 ;bit counter
|
||||
calc_parity_loop:
|
||||
rrca
|
||||
jr nc,calc_parity_loop_2 ;if not zero then skip increment
|
||||
inc c
|
||||
calc_parity_loop_2:
|
||||
djnz calc_parity_loop
|
||||
ld a,c
|
||||
rra ;carry is set to bit 0 of high-counter.
|
||||
;if bit1 is set -> odd # of 1s else even # of 1s
|
||||
ret
|
||||
22
OperatingSystem/monitor_v2/include/rst.s
Normal file
22
OperatingSystem/monitor_v2/include/rst.s
Normal file
@@ -0,0 +1,22 @@
|
||||
EXEC_RST_08:
|
||||
call print_char
|
||||
ret
|
||||
|
||||
|
||||
EXEC_RST_10:
|
||||
push bc
|
||||
push de
|
||||
push hl
|
||||
;call vdp_cursor_on
|
||||
call read_char
|
||||
push af
|
||||
;call vdp_cursor_off
|
||||
pop af
|
||||
pop hl
|
||||
pop de
|
||||
pop bc
|
||||
ret
|
||||
|
||||
EXEC_RST_18:
|
||||
ld a,0
|
||||
ret
|
||||
96
OperatingSystem/monitor_v2/include/vt82c42.s
Normal file
96
OperatingSystem/monitor_v2/include/vt82c42.s
Normal file
@@ -0,0 +1,96 @@
|
||||
;----------------------------------------------------------------
|
||||
;Keyboard interface driver for Z8C
|
||||
;Controller used: vt82c42
|
||||
;Datasheet: http://www.s100computers.com/My%20System%20Pages/MSDOS%20Board/vt82c42%20PC%20Keyboard%20conrtroller.pdf
|
||||
;by Dennis Gunia (04/2022)
|
||||
;----------------------------------------------------------------
|
||||
|
||||
;IO Ports
|
||||
CS_VT82C42_DATA .EQU F0h
|
||||
CS_VT82C42_CTRL .EQU F1h
|
||||
|
||||
keyboard_init_io: ;Subroutine for initializing keyboard controller
|
||||
LD A, A7h ;Disable Mouse
|
||||
OUT (CS_VT82C42_CTRL), A
|
||||
LD A, ADh ;Disable Keyboard
|
||||
OUT (CS_VT82C42_CTRL), A
|
||||
_keyboard_init_flush_buffer:
|
||||
IN A,(CS_VT82C42_DATA) ;Read buffer
|
||||
IN A,(CS_VT82C42_CTRL) ;Read status byte
|
||||
BIT 0,A ;Test if buffer is empty
|
||||
JR Z, _keyboard_init_flush_buffer
|
||||
;buffer is now flushed. Now set the Controller Configuration Byte
|
||||
IN A,(CS_VT82C42_CTRL) ;Disable bits 0,1,6 (disablee IRQ and Translation)
|
||||
AND 10111100
|
||||
OUT (CS_VT82C42_CTRL),A
|
||||
;Perform Controller Self Test
|
||||
LD A, AAh
|
||||
OUT (CS_VT82C42_CTRL), A
|
||||
NOP
|
||||
IN A,(CS_VT82C42_CTRL) ;Check results
|
||||
CP 55h
|
||||
JR NZ, keyboard_init_failed
|
||||
;Perform Interface Tests
|
||||
LD A, ABh
|
||||
OUT (CS_VT82C42_CTRL), A
|
||||
NOP
|
||||
IN A,(CS_VT82C42_CTRL) ;Check results
|
||||
CP 00h
|
||||
JR NZ, _keyboard_init_failed
|
||||
;Enable Devices
|
||||
LD A,AEh
|
||||
OUT (CS_VT82C42_CTRL), A
|
||||
;Reset Devices
|
||||
LD A,FFh
|
||||
OUT (CS_VT82C42_DATA), A ;Send reset to keboard (0xFF command)
|
||||
NOP
|
||||
IN A,(CS_VT82C42_CTRL) ;Read status byte
|
||||
BIT 0,A ;Test if buffer is empty -> no keyboard found
|
||||
JP NZ, _keyboard_init_dev_missing
|
||||
CP A, 0xFC
|
||||
JR Z, _keyboard_init_okay ; 0xFC -> Success. Init done!
|
||||
;Else device error
|
||||
LD HL, [STR_keyboard_init_failed]
|
||||
CALL print_str
|
||||
HALT
|
||||
_keyboard_init_failed:
|
||||
LD HL, [STR_keyboard_init_err]
|
||||
CALL print_str
|
||||
HALT
|
||||
_keyboard_init_dev_missing:
|
||||
LD HL, [STR_keyboard_init_missing]
|
||||
CALL print_str
|
||||
HALT
|
||||
_keyboard_init_okay:
|
||||
LD HL, [STR_keyboard_init_okay]
|
||||
CALL print_str
|
||||
RET
|
||||
|
||||
;Keyboard IO functions
|
||||
keyboard_read:
|
||||
IN A,(CS_VT82C42_CTRL) ;Read status byte
|
||||
BIT 0,A ;Test if buffer is empty
|
||||
RET NZ ;Return if empty
|
||||
IN A,(CS_VT82C42_DATA)
|
||||
RET ;Return with data in A
|
||||
|
||||
keyboard_write:
|
||||
PUSH AF
|
||||
_keyboard_write_wait:
|
||||
IN A,(CS_VT82C42_CTRL) ;Read status byte
|
||||
BIT 1,A ;Test if buffer is full
|
||||
JR Z, _keyboard_write_wait ;Wait if input buffer is full
|
||||
POP AF
|
||||
OUT (CS_VT82C42_DATA), A
|
||||
RET
|
||||
|
||||
|
||||
;Status message strings
|
||||
STR_keyboard_init_okay:
|
||||
.BYTE "PS/2 Keyboard initialized.",0
|
||||
STR_keyboard_init_err:
|
||||
.BYTE "PS/2 Controller error! System HALT!",0
|
||||
STR_keyboard_init_failed:
|
||||
.BYTE "PS/2 Keyboard error! System HALT!",0
|
||||
STR_keyboard_init_missing:
|
||||
.BYTE "PS/2 no keyboard found!",0
|
||||
286
OperatingSystem/monitor_v2/include/xmodem.s
Normal file
286
OperatingSystem/monitor_v2/include/xmodem.s
Normal file
@@ -0,0 +1,286 @@
|
||||
;-------------------------------------------------------------------------
|
||||
; Z80 XMODEM implementation by Dennis Gunia
|
||||
; 2022 - www,dennisgunia.de
|
||||
;
|
||||
; important doc: https://web.mit.edu/6.115/www/amulet/xmodem.htm
|
||||
; http://www.blunk-electronic.de/train-z/pdf/xymodem.pdf
|
||||
;-------------------------------------------------------------------------
|
||||
|
||||
;Symbols
|
||||
SYM_SOH equ 0x01
|
||||
SYM_EOT equ 0x04
|
||||
SYM_ACK equ 0x06
|
||||
SYM_NAK equ 0x15
|
||||
SYM_ETB equ 0x17
|
||||
SYM_CAN equ 0x18
|
||||
SYM_C equ 0x43
|
||||
|
||||
;Memory locations
|
||||
MEM_VAR_BLOCK equ 0x40FB ;last block
|
||||
MEM_VAR_TIMEA equ 0x40FC ;timer var (mills)
|
||||
MEM_VAR_TIMER equ 0x40FE ;timer var (seconds)
|
||||
MEM_INT_VEC_T equ 0x40FE ;interrupt vector table
|
||||
|
||||
MEM_LOC_LOAD equ 0x4400 ;load location for program
|
||||
|
||||
;XMODEM routine
|
||||
xmodem_init:
|
||||
call A_RTS_OFF
|
||||
|
||||
LD A,10100111b ; Init CTC Channel 3
|
||||
OUT (CS_CTC_2),A
|
||||
LD A,14 ; 1028.57Hz ISR
|
||||
OUT (CS_CTC_2),A
|
||||
LD A,00h ; Set CTC Ch3 Interrupt Vector
|
||||
OUT (CS_CTC_0),A
|
||||
;load int vector to ram
|
||||
ld hl,xmodem_int ;CTC Ch3 INT routine
|
||||
ld (0x4200 + 0x04),hl
|
||||
;reset timer vars
|
||||
ld hl,0x0000
|
||||
ld (MEM_VAR_TIMEA),hl
|
||||
ld (MEM_VAR_TIMER),hl
|
||||
|
||||
ld a,0x42 ; Set interrupt vector register
|
||||
ld i,a
|
||||
im 2 ; Z80 Interrupt mode
|
||||
|
||||
ld hl,MSG_START ; Print start banner
|
||||
call print_str
|
||||
ei ; Enable interrupts
|
||||
; init done. Continue with xmodem_await_conn
|
||||
call xmodem_wait
|
||||
|
||||
xmodem_await_conn: ;Wait for initial connection
|
||||
ld a, SYM_C ;Send C to notify sender, that we want CRC
|
||||
call xmodem_out
|
||||
call xmodem_read_wait ;Read with timeout
|
||||
jp c, xmodem_await_conn ;Carry flag set = timeout -> repeat
|
||||
;else continue
|
||||
|
||||
xmodem_packet: ;XmodemCRC packet start
|
||||
;use 1st byte to decide further processing
|
||||
cp SYM_EOT ;End of Transmission
|
||||
jp z, xmodem_packet_EOT
|
||||
cp SYM_CAN ;Cancel (Force receiver to start sending C's)
|
||||
jp z, xmodem_await_conn
|
||||
cp SYM_SOH ;Start of
|
||||
jp z, xmodem_packet_get
|
||||
|
||||
jp xmodem_err ;anything else is an error -> abort transmission
|
||||
|
||||
xmodem_packet_get: ;if first byte == SYM_SOH -> receive block
|
||||
call xmodem_read_wait ;get byte 2 => block ID
|
||||
jp c, xmodem_nak
|
||||
ld b,a
|
||||
ld (MEM_VAR_BLOCK), a ;store block id to memory
|
||||
call xmodem_read_wait ;get byte 3 => block ID complement
|
||||
jp c, xmodem_nak
|
||||
add b
|
||||
cp 255 ;both size infos should always sum to 255
|
||||
jp nz,xmodem_err ;if not 255 then its an error
|
||||
|
||||
;calculate block start address in RAM
|
||||
;multiply by 128
|
||||
;use more efficient bit-wise operations
|
||||
dec a ;a-1 to remove 1 sector offset
|
||||
ld a,b
|
||||
rra ;shift 1 bit to the right
|
||||
and 0x7F
|
||||
ld h,a
|
||||
ld a,b
|
||||
dec a ;a-1 to remove 1 sector offset
|
||||
rrca ;shift bit0 to bit 7
|
||||
and 0x80 ;mask out all other bits
|
||||
ld l,a
|
||||
;result:
|
||||
;hl = 0aaaaaaa a000000
|
||||
|
||||
ld de,MEM_LOC_LOAD
|
||||
add hl,de ;add calculated offset to base address
|
||||
;hl now contains the true start address of this sector
|
||||
|
||||
ld b,128 ;preload counter for data baytes
|
||||
ld c,0 ;packet length counter ( used for overflow error )
|
||||
|
||||
xmodem_packet_get_data: ;get 128 data bytes (loop)
|
||||
push hl ;push hl onto stack because xmodem_read_wait destroys hl
|
||||
call xmodem_read_wait ;read byte or timeout
|
||||
jp c, xmodem_nak ;if timeout -> nak and retry
|
||||
pop hl ;restore hl
|
||||
ld (hl), a ;store received byte in memory
|
||||
inc hl ;increment pointer
|
||||
inc c ;increment packet length counter
|
||||
dec b ;decerment data bytes remmaining
|
||||
jp nz, xmodem_packet_get_data ;if bytes remaining, loop
|
||||
;else continue with crc bytes
|
||||
|
||||
xmodem_packet_get_crc: ;get 16-Bit CRC
|
||||
call xmodem_read_wait
|
||||
jp c, xmodem_nak
|
||||
ld d,a
|
||||
inc c
|
||||
call xmodem_read_wait
|
||||
jp c, xmodem_nak
|
||||
ld e,a
|
||||
inc c
|
||||
;de now contains CRC value
|
||||
;check if c is not bigger than 130 byte (128 data + 2crc)
|
||||
;TODO if so NACK
|
||||
|
||||
;de contains 16-bit CRC
|
||||
;TODO if crc error NACK
|
||||
jp xmodem_ack ;ack block -> then jump to start again
|
||||
|
||||
xmodem_packet_EOT: ;End of transmission SUB.
|
||||
ld a, SYM_ACK ;Acknowledge EOT
|
||||
call xmodem_out
|
||||
jp xmodem_end ;and end xmodem
|
||||
|
||||
|
||||
|
||||
xmodem_err: ;non recoverable error -> abort
|
||||
ld a, SYM_CAN
|
||||
call xmodem_out
|
||||
ld a, SYM_CAN
|
||||
call xmodem_out
|
||||
ld a, SYM_CAN
|
||||
call xmodem_out
|
||||
ld a, SYM_CAN
|
||||
call xmodem_out
|
||||
ld a, SYM_CAN
|
||||
call xmodem_out
|
||||
ld a, SYM_CAN
|
||||
call xmodem_out
|
||||
ld a, SYM_CAN
|
||||
call xmodem_out
|
||||
ld a, SYM_CAN
|
||||
call xmodem_out
|
||||
ld a, SYM_CAN
|
||||
call xmodem_out
|
||||
ld a, SYM_CAN
|
||||
call xmodem_out
|
||||
ld a, SYM_CAN
|
||||
|
||||
ld hl, MSG_ERROR
|
||||
call print_str
|
||||
|
||||
;overflow to end
|
||||
xmodem_end:
|
||||
di ;disable interrupts
|
||||
call print_newLine ;print new line
|
||||
jp PROMPT_BEGIN ;return ti prompt
|
||||
|
||||
;isr is used as counter for timeouts
|
||||
xmodem_int:
|
||||
di ;setup ISR (disable further interrupts, exchange registers)
|
||||
ex AF,AF'
|
||||
exx
|
||||
|
||||
ld hl,(MEM_VAR_TIMEA) ;millis counter
|
||||
inc hl
|
||||
ld (MEM_VAR_TIMEA),hl
|
||||
|
||||
ld de,1028 ;every 1028 millis counter
|
||||
sbc hl,de
|
||||
jp nz, xmodem_int_cont ;if less than 1028 millis, loop
|
||||
|
||||
ld hl,0 ;reset millis
|
||||
ld (MEM_VAR_TIMEA),hl
|
||||
ld hl,(MEM_VAR_TIMER) ;incement seconds
|
||||
inc hl
|
||||
ld (MEM_VAR_TIMER),hl
|
||||
xmodem_int_cont: ;end isr
|
||||
ex AF,AF' ;restore registers
|
||||
exx
|
||||
EI ;enable interrupts
|
||||
reti ;exit ISR
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; A returns char
|
||||
; Carry is set if timeout
|
||||
xmodem_read_timeount equ 3 ;3 seconds timeout
|
||||
xmodem_read_wait:
|
||||
di
|
||||
ld hl,0
|
||||
ld (MEM_VAR_TIMEA),hl
|
||||
ld (MEM_VAR_TIMER),hl
|
||||
ei
|
||||
call A_RTS_ON
|
||||
xmodem_read_wait_loop:
|
||||
;check timeout
|
||||
ld hl,(MEM_VAR_TIMER)
|
||||
ld a, l
|
||||
cp xmodem_read_timeount
|
||||
jp z, xmodem_read_wait_timeout ;if timeout retry
|
||||
|
||||
; if no timeout
|
||||
xor a ; a = 0
|
||||
out (CS_SIO_A_C), a ; select reg 0
|
||||
in a, (CS_SIO_A_C) ; read reg 0
|
||||
and 1 ; mask D0 (recieve char available)
|
||||
jp Z,xmodem_read_wait_loop ; wait if no char
|
||||
|
||||
; if char avail
|
||||
in a, (CS_SIO_A_D) ; read char
|
||||
;call debug_a_hex
|
||||
push af
|
||||
call A_RTS_OFF
|
||||
pop af
|
||||
scf
|
||||
ccf
|
||||
ret ; return
|
||||
xmodem_read_wait_timeout:
|
||||
scf
|
||||
ret
|
||||
|
||||
|
||||
xmodem_out:
|
||||
out (CS_SIO_A_D), a
|
||||
call xmodem_wait_out
|
||||
ret
|
||||
|
||||
xmodem_wait_out:
|
||||
sub a ;clear a, write into WR0: select RR0
|
||||
inc a ;select RR1
|
||||
out (CS_SIO_A_C),A
|
||||
in A,(CS_SIO_A_C) ;read RRx
|
||||
bit 0,A
|
||||
jr z,xmodem_wait_out
|
||||
ret
|
||||
|
||||
MSG_ERROR:
|
||||
db "Error: unexpected byte",13,10,0
|
||||
|
||||
MSG_START:
|
||||
db "Await xmodem connection",13,10,0
|
||||
|
||||
|
||||
xmodem_ack: ;ack routine. Only use when expecting transmission afterwards.
|
||||
ld a, SYM_ACK ;send ACK
|
||||
call xmodem_out
|
||||
call xmodem_read_wait ;wait for response
|
||||
jp c, xmodem_ack ;if timeout repeat
|
||||
jp xmodem_packet ;if received, continue with new packet
|
||||
|
||||
xmodem_nak: ;nak routine. Only use when expecting transmission afterwards.
|
||||
ld a, SYM_NAK ;send NAK
|
||||
call xmodem_out
|
||||
call xmodem_read_wait ;wait for response
|
||||
jp c, xmodem_nak ;if timeout repeat
|
||||
jp xmodem_packet ;if received, continue with new packet
|
||||
|
||||
xmodem_wait:
|
||||
ld hl, 0xFF
|
||||
ld bc, 0x01
|
||||
xmodem_wait_1:
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
sbc hl,bc
|
||||
ret Z
|
||||
jr xmodem_wait_1
|
||||
489
OperatingSystem/monitor_v2/main.asm
Normal file
489
OperatingSystem/monitor_v2/main.asm
Normal file
@@ -0,0 +1,489 @@
|
||||
SYS_RAM_START equ 0x4000
|
||||
SYS_BUF_START equ 0x4010
|
||||
PRG_RAM_START equ 0x4110
|
||||
PRG_RAM_TOP equ 0xFF00
|
||||
STACK_RAM_TOP equ 0xFFFF
|
||||
|
||||
;VAR_CONSOLE_CONF equ 0x07 ;CLK/TRG Clock @ 1843220.5/s
|
||||
VAR_CONSOLE_CONF equ 0x0F ;CPU/16 Clock @ 230402.5625/s
|
||||
|
||||
VAR_CONSOLE_BAUD equ 24 ;BAUD timer constant
|
||||
;CLK/TRG Clock @ 1843220.5/s
|
||||
; -> 0x16 : 14400
|
||||
;CPU/16 Clock @ 230402.5625/s
|
||||
; -> 12 : 19200
|
||||
; -> 24 : 9600
|
||||
|
||||
; include IO device addresses
|
||||
.include "addresses.s"
|
||||
|
||||
org 0x0000
|
||||
RST_00: ;Hardware Restart
|
||||
jp mon_start_init_sound
|
||||
|
||||
org 0x0008
|
||||
RST_08 ;Print Char
|
||||
jp EXEC_RST_08
|
||||
|
||||
org 0x0010
|
||||
RST_10 ;receive char
|
||||
jp EXEC_RST_10
|
||||
|
||||
org 0x0018
|
||||
RST_18 ;Buffer length
|
||||
jp EXEC_RST_18
|
||||
|
||||
|
||||
INT_VEC:
|
||||
org 0x0044
|
||||
;DEFW EXEC_INT_VDP
|
||||
|
||||
;memory var template
|
||||
mon_var_template:
|
||||
phase SYS_RAM_START
|
||||
|
||||
var_buffer_len:
|
||||
defb 0
|
||||
var_last_char:
|
||||
defb 0
|
||||
var_curserx:
|
||||
defb 0
|
||||
var_cursery:
|
||||
defb 0
|
||||
var_curserstate:
|
||||
defb 0
|
||||
var_curseron:
|
||||
defb 0
|
||||
var_curserchar:
|
||||
defb 0
|
||||
var_curserlastaddr:
|
||||
defw 0
|
||||
var_scratch:
|
||||
defs 16 ;16 bytes space for scratch vars
|
||||
var_ps2mem:
|
||||
defs 16 ;16 bytes space for scratch vars
|
||||
var_buffer:
|
||||
defb 0 ;var lentgh
|
||||
|
||||
mon_var_template_end:
|
||||
dephase
|
||||
;end memory var template
|
||||
org 0x0050
|
||||
mon_start_init_sound:
|
||||
;CALL BTLDR_ENTRY ;call bootloader first
|
||||
;ld D,0x08 ; Select register #8
|
||||
;ld A,0x00 ; Volume channel A 0
|
||||
;call AY0_WRITE_REG
|
||||
;ld D,0x09 ; Select register #9
|
||||
;ld A,0x00 ; Volume channel B 0
|
||||
;call AY0_WRITE_REG
|
||||
;ld D,0x0A ; Select register #10
|
||||
;ld A,0x00 ; Volume channel C 0
|
||||
;call AY0_WRITE_REG
|
||||
|
||||
mon_start_init_ctc:
|
||||
ld sp, 0xffff
|
||||
; Set CTC Ch2 Interrupt Vector
|
||||
;LD A,40h ; it vector defined in bit 73,bit 21 don't care, bit 0 = 0
|
||||
;OUT (IO_CTC0_C0),A
|
||||
; Init CTC Channel 2
|
||||
;LD A,10100111b
|
||||
;OUT (IO_CTC0_C2),A
|
||||
;LD A,0x34 ; 55Hz ISR
|
||||
;LD A,0xFF ; 55Hz ISR
|
||||
;OUT (IO_CTC0_C2),A
|
||||
|
||||
xor a
|
||||
;ld i, a
|
||||
;im 2 ;set int mode 2
|
||||
|
||||
ld (var_curserstate),a
|
||||
ld (var_curseron),a
|
||||
ld a, " "
|
||||
ld (var_curserchar),a
|
||||
|
||||
|
||||
;ei ; Enable Interrupts
|
||||
|
||||
;jr mon_start_ram ;skip serial, cause not used atm
|
||||
mon_start_init_serial:
|
||||
call CONSOLE_INIT
|
||||
mon_start_ram:
|
||||
ld hl,mon_var_template
|
||||
ld de,mon_var_template_end
|
||||
ld bc,SYS_RAM_START
|
||||
mon_start_ram_loop:
|
||||
ld a,(hl) ;copy values
|
||||
ld (bc),a
|
||||
inc hl
|
||||
inc bc
|
||||
push hl ;check if end is reached
|
||||
sbc hl,de
|
||||
pop hl
|
||||
jp nz, mon_start_ram_loop
|
||||
;template copy done
|
||||
|
||||
mon_start_complete:
|
||||
|
||||
;call keyboard_init_io
|
||||
;call vdpconsole_init
|
||||
|
||||
;call print_str
|
||||
|
||||
|
||||
;jp splash_run
|
||||
|
||||
;jp ps2demo_run
|
||||
;call debug_init
|
||||
;call vdp_cursor_on
|
||||
;jp COLD
|
||||
|
||||
call print_clear
|
||||
ld hl, [STR_Banner_Start]
|
||||
call print_str
|
||||
|
||||
;halt
|
||||
|
||||
;call vdp_cursor_on
|
||||
call PROMPT_BEGIN
|
||||
|
||||
;halt CPU if prompt exits
|
||||
halt
|
||||
|
||||
; Misc Functions
|
||||
AY0_WRITE_REG:
|
||||
LD B,A
|
||||
LD A,D
|
||||
OUT (IO_AY0_ADDR),A
|
||||
LD A,B
|
||||
OUT (IO_AY0_DATA),A
|
||||
RET
|
||||
|
||||
PROMPT_BEGIN:
|
||||
call print_newLine
|
||||
;call A_RTS_ON
|
||||
ld a,'>'
|
||||
call print_char
|
||||
xor a ;reset buffer len
|
||||
ld (var_buffer_len),a
|
||||
|
||||
PROMPT_BEGIN_READ_LOOP:
|
||||
call read_char
|
||||
;call keybd_read_ascii
|
||||
jp z, PROMPT_BEGIN_READ_LOOP ; wait until char avail
|
||||
push af
|
||||
pop af
|
||||
; process special ops
|
||||
cp 13 ; enter
|
||||
jp z,PROMPT_BEGIN_READ_PROCESS
|
||||
cp 10
|
||||
jp z, PROMPT_BEGIN_READ_LOOP; skip LF for file load
|
||||
cp 0x08 ; backspace 0x08 VT102 0x7f Putty
|
||||
jp z,PROMPT_BEGIN_READ_BACKSPACE
|
||||
|
||||
push af
|
||||
; a contains latest char
|
||||
ld hl,[var_buffer]
|
||||
ld d,0
|
||||
ld a,(var_buffer_len)
|
||||
ld e,a
|
||||
add hl,de ;hl now contains pointer to last position in buffer
|
||||
inc a
|
||||
ld (var_buffer_len),a ;store incremented buffer length
|
||||
|
||||
pop af
|
||||
ld (hl),a
|
||||
call print_char
|
||||
inc hl
|
||||
xor a ;a = 0
|
||||
ld (hl),a ;always add null termination after last char
|
||||
jp PROMPT_BEGIN_READ_LOOP
|
||||
|
||||
PROMPT_BEGIN_READ_BACKSPACE:
|
||||
ld a,(var_buffer_len)
|
||||
and a
|
||||
jp z, PROMPT_BEGIN_READ_LOOP ; do not continue if already at char 0
|
||||
dec a ;decrement length
|
||||
ld (var_buffer_len),a ;and store it
|
||||
ld e,a ;load de with decremented value
|
||||
ld d,0
|
||||
ld hl,[var_buffer]
|
||||
add hl,de ;hl now contains pointer to last position in buffer
|
||||
xor a ; store null byte to current location
|
||||
ld (hl),a
|
||||
;call print_delete
|
||||
ld a, 0x08
|
||||
call print_char
|
||||
ld a, 0x20
|
||||
call print_char
|
||||
ld a, 0x08
|
||||
call print_char
|
||||
jp PROMPT_BEGIN_READ_LOOP
|
||||
|
||||
PROMPT_BEGIN_READ_PROCESS:
|
||||
;call print_newLine
|
||||
;ld hl,var_buffer
|
||||
;call print_str
|
||||
|
||||
ld a,([var_buffer])
|
||||
cp '$' ;jump to addr
|
||||
jp z, CMD_EXEC
|
||||
cp '?' ;print hexdump
|
||||
jp z, CMD_VIEW
|
||||
cp '!' ;set memory
|
||||
jp z, CMD_SET
|
||||
cp 'i' ;in IO
|
||||
jp z, CMD_IO_READ
|
||||
cp 'o' ;out IO
|
||||
jp z, CMD_IO_WRITE
|
||||
cp 'd' ;disassemble
|
||||
jp z, CMD_DASM
|
||||
cp 'x' ;start xmodem
|
||||
jp z, xmodem_init
|
||||
|
||||
|
||||
call print_newLine
|
||||
ld hl, [STR_Unknown]
|
||||
call print_str
|
||||
jp PROMPT_BEGIN
|
||||
|
||||
ret
|
||||
|
||||
CMD_EXEC:
|
||||
xor a ;write null byte to buffer pos 0 to prevent reexecute the last command
|
||||
ld (var_buffer),a
|
||||
|
||||
ld hl,var_buffer+1 ;load 1st byte
|
||||
call DHEX_TO_BYTE
|
||||
ld b,a ;store result in b
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
ld hl,var_buffer+3 ;load 2nd byte
|
||||
call DHEX_TO_BYTE
|
||||
ld c,a
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
ld h,b
|
||||
ld l,c
|
||||
jp (hl)
|
||||
|
||||
CMD_VIEW:
|
||||
call print_newLine
|
||||
ld hl,var_buffer+1 ;load 1st byte
|
||||
call DHEX_TO_BYTE
|
||||
ld b,a ;store result in b
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
ld hl,var_buffer+3 ;load 2nd byte
|
||||
call DHEX_TO_BYTE
|
||||
ld c,a
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
|
||||
ld a,(var_buffer+5)
|
||||
cp ' '
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
ld hl,var_buffer+6 ;load length
|
||||
call DHEX_TO_BYTE
|
||||
push af
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
;draw header
|
||||
ld hl,[STR_HEXDUMP_HEADER]
|
||||
call print_str
|
||||
|
||||
pop af
|
||||
;loading vars done. display results
|
||||
ld h, b ;pointer to current byte
|
||||
ld l, c ;pointer to current byte
|
||||
ld b, a ;bytes counter
|
||||
|
||||
;draw row
|
||||
CMD_VIEW_ROW:
|
||||
call print_newLine
|
||||
ld a,h ;print start
|
||||
call print_a_hex
|
||||
ld a,l
|
||||
call print_a_hex
|
||||
ld a, ' '
|
||||
call print_char
|
||||
ld c, 8 ;column counter
|
||||
CMD_VIEW_ROW_LOOP:
|
||||
ld a,(hl)
|
||||
call print_a_hex
|
||||
|
||||
inc hl ;increment pointer
|
||||
dec b ;decrement byte counter
|
||||
dec c ;decrement column counter
|
||||
|
||||
ld a,b
|
||||
and a
|
||||
jp z,CMD_VIEW_END ;if byte counter = 0 -> end reached
|
||||
|
||||
ld a,c
|
||||
and a
|
||||
jp z,CMD_VIEW_ROW ;else if column counter = 0 -> 16 chars printed. next row
|
||||
|
||||
ld a, ' '
|
||||
call print_char
|
||||
jp CMD_VIEW_ROW_LOOP ;else
|
||||
CMD_VIEW_END:
|
||||
call print_newLine
|
||||
jp PROMPT_BEGIN
|
||||
|
||||
CMD_SET:
|
||||
ld hl,var_buffer+1 ;load 1st byte
|
||||
call DHEX_TO_BYTE
|
||||
ld b,a ;store result in b
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
ld hl,var_buffer+3 ;load 2nd byte
|
||||
call DHEX_TO_BYTE
|
||||
ld c,a
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
;bc now contains the start address
|
||||
|
||||
ld hl,var_buffer+5
|
||||
CMD_SET_LOOP:
|
||||
ld a,(hl)
|
||||
cp 0 ;if 0 then end
|
||||
jp z, CMD_SET_END
|
||||
cp ' '
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
inc hl ;next byte
|
||||
call DHEX_TO_BYTE
|
||||
ld (bc),a ;load byte to
|
||||
ld a,e
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
inc bc
|
||||
inc hl
|
||||
inc hl
|
||||
jp CMD_SET_LOOP
|
||||
CMD_SET_END:
|
||||
call print_newLine
|
||||
jp PROMPT_BEGIN
|
||||
|
||||
|
||||
CMD_IO_WRITE:
|
||||
ld hl,var_buffer+1 ;load 1st byte
|
||||
call DHEX_TO_BYTE
|
||||
ld c,a ;store result in b
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
ld a,(var_buffer+3)
|
||||
cp ' '
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
ld hl,var_buffer+4 ;load 1st byte
|
||||
call DHEX_TO_BYTE
|
||||
push af
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
pop af
|
||||
out (c),a
|
||||
call print_newLine
|
||||
jp PROMPT_BEGIN
|
||||
|
||||
CMD_IO_READ:
|
||||
ld hl,var_buffer+1 ;load 1st byte
|
||||
call DHEX_TO_BYTE
|
||||
ld c,a ;store result in b
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
in a,(c)
|
||||
push af
|
||||
call print_newLine
|
||||
pop af
|
||||
call print_a_hex
|
||||
call print_newLine
|
||||
jp PROMPT_BEGIN
|
||||
|
||||
CMD_DASM:
|
||||
call print_newLine
|
||||
ld hl,var_buffer+1 ;load 1st byte
|
||||
call DHEX_TO_BYTE
|
||||
ld b,a ;store result in b
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
ld hl,var_buffer+3 ;load 2nd byte
|
||||
call DHEX_TO_BYTE
|
||||
ld c,a
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
|
||||
ld a,(var_buffer+5)
|
||||
cp ' '
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
ld hl,var_buffer+6 ;load length
|
||||
call DHEX_TO_BYTE
|
||||
push af
|
||||
ld a,e ;check for error
|
||||
and a
|
||||
jp nz, CMD_SYNTAX_ERROR
|
||||
|
||||
ld h,b
|
||||
ld l,c
|
||||
|
||||
pop af ;restore af
|
||||
ld b,a
|
||||
|
||||
call disassemble
|
||||
|
||||
|
||||
jp PROMPT_BEGIN
|
||||
|
||||
CMD_SYNTAX_ERROR:
|
||||
call print_newLine
|
||||
ld hl, [STR_SyntaxError]
|
||||
call print_str
|
||||
jp PROMPT_BEGIN
|
||||
|
||||
|
||||
|
||||
Includes:
|
||||
;.include "bootldr.s"
|
||||
.include "console.s"
|
||||
.include "conversions.s"
|
||||
;.include "basic.s"
|
||||
.include "disassembler.s"
|
||||
.include "disassembler_table.s"
|
||||
.include "rst.s"
|
||||
; Strings
|
||||
STR_Banner_Start:
|
||||
db "Z8C Monitor V2 by Dennis Gunia (2022)",0
|
||||
STR_SyntaxError:
|
||||
db "syn?",0
|
||||
STR_Unknown:
|
||||
db "cmd?",0
|
||||
STR_HEXDUMP_HEADER:
|
||||
db 'BASE 0 1 2 3 4 5 6 7',0
|
||||
|
||||
.include "xmodem.s"
|
||||
;.include "debug.s"
|
||||
55
OperatingSystem/monitor_v2/monitor.md
Normal file
55
OperatingSystem/monitor_v2/monitor.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# Z8C Monitor V2
|
||||
Monitor V2 is a less bloated monitor for my Z80 homebrew computer
|
||||
|
||||
## System
|
||||
* Z80 CPU @ 3.686411MHz
|
||||
* 48k Ram
|
||||
* TMS9918 VDP (not used for normal operations)
|
||||
* 2x AY3-8901
|
||||
* Serial RS232 Ports
|
||||
|
||||
not implemented yet but already present in hardware:
|
||||
* PS/2 Keyboard Interface
|
||||
* RTC72421B real time clock
|
||||
|
||||
planned
|
||||
* IDE interface
|
||||
* 28J60 10Mbit ethernet interface
|
||||
* dual joystick gameports
|
||||
|
||||
|
||||
## Terminal
|
||||
* `baud`: 19200
|
||||
* `mode`: 8N1
|
||||
* `parity`: none
|
||||
* `temrinal`: vt102
|
||||
* `flow`: none / RTS(not implemented yet)
|
||||
|
||||
## Commands
|
||||
### View memory content
|
||||
`?<addr> <len>`
|
||||
* `addr`: word in hex -> start address of hexdump
|
||||
* `len`: byte in hex -> length of hexdump
|
||||
|
||||
### Write memory content
|
||||
`!<addr> <byte>,<byte>,...`
|
||||
* `addr`: word in hex -> start address
|
||||
* `byte`: byte in hex followed by space -> bytes to write to memory
|
||||
|
||||
### Run program
|
||||
`$<addr>`
|
||||
* `addr`: word in hex -> start address of program
|
||||
|
||||
### X-Modem
|
||||
`x<addr>`
|
||||
* `addr`: word in hex -> start address of recieved binary (at least 0x0420)
|
||||
|
||||
### Write IO port
|
||||
`w<addr> <data>`
|
||||
* `addr`: byte in hex -> IO port address
|
||||
* `len`: byte in hex -> data
|
||||
|
||||
### Read IO port
|
||||
`r<addr>`
|
||||
* `addr`: byte in hex -> IO port address
|
||||
|
||||
5
OperatingSystem/monitor_v2/properties.env
Normal file
5
OperatingSystem/monitor_v2/properties.env
Normal file
@@ -0,0 +1,5 @@
|
||||
export OPT_GEN_SYMBOLTABLE=1
|
||||
export OPT_GEN_MONFILE=0
|
||||
export OPT_GEN_OBJFILE=1
|
||||
export OPT_WRITEROM=1
|
||||
export FILENAME=main
|
||||
BIN
OperatingSystem/monitor_v2/zout/main.bin
Normal file
BIN
OperatingSystem/monitor_v2/zout/main.bin
Normal file
Binary file not shown.
271
OperatingSystem/monitor_v2/zout/main.hex
Normal file
271
OperatingSystem/monitor_v2/zout/main.hex
Normal file
@@ -0,0 +1,271 @@
|
||||
:03000000C35000EA
|
||||
:03000800C3B60E6E
|
||||
:03001000C3BA0E62
|
||||
:03001800C3C60E4E
|
||||
:1000440000000000000000000000000000000000AC
|
||||
:10005400000000000000000000000000000000009C
|
||||
:0A0064000000000000000000000092
|
||||
:1000500031FFFFAF3204403205403E20320640CD32
|
||||
:100060007002214400112A400100407E022303E572
|
||||
:10007000ED52E1C26B00CDBC0221C90ECDB102CD63
|
||||
:100080008B0076477AD34078D341C9CDC3023E3E38
|
||||
:10009000CDA902AF320040CDEA02CA9700F5F1FEC9
|
||||
:1000A0000DCAEE00FE0ACA9700FE08CAC800F52174
|
||||
:1000B000294016003A00405F193C320040F177CDEC
|
||||
:1000C000A90223AF77C397003A0040A7CA97003D23
|
||||
:1000D0003200405F160021294019AF773E08CDA9B4
|
||||
:1000E000023E20CDA9023E08CDA902C397003A29BD
|
||||
:1000F00040FE24CA2101FE3FCA4001FE21CAAA01D6
|
||||
:10010000FE69CA0F02FE6FCAE601FE64CA2B02FE38
|
||||
:1001100078CA150FCDC30221F40ECDB102C38B00F6
|
||||
:10012000C9AF322940212A40CD1603477BA7C264BC
|
||||
:1001300002212C40CD16034F7BA7C264026069E9FF
|
||||
:10014000CDC302212A40CD1603477BA7C2640221FA
|
||||
:100150002C40CD16034F7BA7C264023A2E40FE20EE
|
||||
:10016000C26402212F40CD1603F57BA7C264022191
|
||||
:10017000F90ECDB102F1606947CDC3027CCDD90241
|
||||
:100180007DCDD9023E20CDA9020E087ECDD9022315
|
||||
:10019000050D78A7CAA40179A7CA79013E20CDA987
|
||||
:1001A00002C38B01CDC302C38B00212A40CD1603AD
|
||||
:1001B000477BA7C26402212C40CD16034F7BA7C208
|
||||
:1001C0006402212E407EFE00CAE001FE20C26402CD
|
||||
:1001D00023CD1603027BA7C26402032323C3C501F8
|
||||
:1001E000CDC302C38B00212A40CD16034F7BA7C28B
|
||||
:1001F00064023A2C40FE20C26402212D40CD160339
|
||||
:10020000F57BA7C26402F1ED79CDC302C38B002157
|
||||
:100210002A40CD16034F7BA7C26402ED78F5CDC30B
|
||||
:1002200002F1CDD902CDC302C38B00CDC302212A76
|
||||
:1002300040CD1603477BA7C26402212C40CD160394
|
||||
:100240004F7BA7C264023A2E40FE20C26402212FD7
|
||||
:1002500040CD1603F57BA7C264026069F147CD6704
|
||||
:1002600003C38B00CDC30221EF0ECDB102C38B00BF
|
||||
:100270003E4FD304DB01D3043E30D3093E18D309EB
|
||||
:100280003E04D3093E44D3093E05D3093EE8D309D1
|
||||
:100290003E01D3093E04D3093E02D3093E00D309EF
|
||||
:1002A0003E03D3093EC1D309C9F5D308CDCE02F12F
|
||||
:1002B000C97EB72806CDA9022318F6C921FC02CDB4
|
||||
:1002C000B102C93E0ACDA9023E0DCDA902C9973C93
|
||||
:1002D000D309DB09CB4728F6C9F5C5D5CD4D037841
|
||||
:1002E000CDA90279CDA902D1C1F1CD0D0300AFD3C3
|
||||
:1002F00009DB09E601CD0403C8DB08C91B5B324AF0
|
||||
:100300001B5B48003E05D3093E68D309C93E05D3AF
|
||||
:10031000093EEAD309C9E57ECD36033815CB27CB94
|
||||
:1003200027CB27CB2757237ECD36033805B2E11ED6
|
||||
:1003300000C91EFFE1C9D630EA4B03FE0A3805D6D4
|
||||
:1003400007EA4B03FE103003E60FC937C9F51F1F3C
|
||||
:100350001F1FCD5C0347F1CD5C034FC9E60FC630CC
|
||||
:10036000FE3AD8C607C9C978321A412210417E32F6
|
||||
:100370001441237E3215412BCD5B0478B1CA3D0474
|
||||
:10038000ED431241030303030A321641030A5F03DC
|
||||
:100390000A57ED531741030A3219412A1041CDA3E0
|
||||
:1003A000043A1641472A10417ECDD9022310F93E66
|
||||
:1003B00068CDA9023A1641473E0690473E20CDA996
|
||||
:1003C000023E20CDA90210F43E20CDA902E52A1755
|
||||
:1003D00041CDB1023A1941B7CA3A042A1241010883
|
||||
:1003E00000093A1941477EFE01CCC904FE02CCF057
|
||||
:1003F00004FE03CC0D05FE04CC4905FE05CC5F05CB
|
||||
:10040000FE06CC6C05FE07CC8605FE08CC9305FEE7
|
||||
:1004100009CCA805FE10CCBD05FE11CCCD05FE1201
|
||||
:10042000CCD505FE13CC0D06FE0ACC9F05FE80CC74
|
||||
:100430002C06FE81CC23062310ACE11810CDA304BA
|
||||
:100440007ECDBB0423E521780ECDB102E1CDC30200
|
||||
:100450003A1A413D321A41C26B03C9E52176063A88
|
||||
:1004600014414F7EFEFFCA9D04F523462B79A04F11
|
||||
:10047000F1B9280B06000E07097E4F092318E02367
|
||||
:10048000234E233A154146A0B92B2B2B280B0600EF
|
||||
:100490000E07097E4F092318C6444DE1C906000E18
|
||||
:1004A00000E1C93E24CDA9027CCDD9027DCDD9027F
|
||||
:1004B0003E68CDA9023E20CDA902C9CDD9023E6831
|
||||
:1004C000CDA9023E20CDA902C9E5ED5B1041131A6A
|
||||
:1004D0006F131A673E24CDA9027CCDD9027DCDD9F8
|
||||
:1004E000023E68CDA9023E20CDA902CD6706E1C932
|
||||
:1004F000C5ED5B10411A1F1FE60EE521810E0600B7
|
||||
:100500004F09CDB1023E20CDA902E1C1C9ED5B107A
|
||||
:1005100041131AF5E680C22E053E24CDA9023E2BDA
|
||||
:10052000CDA902F1CDD9023E68CDA90218173E240B
|
||||
:10053000CDA9023E2DCDA902F1ED44CDD9023E68F0
|
||||
:10054000CDA9021800CD6706C9ED5B1041131AFE54
|
||||
:100550004D28063E4ECDA902C93E49CDA902C9C5C6
|
||||
:10056000ED5B10411AE638CDBB04C1C9C5ED5B1087
|
||||
:10057000411A1F1F1FE607CD42063E20CDA9023EAD
|
||||
:100580002CCDA902C1C9C5ED5B10411AE607CD42C9
|
||||
:1005900006C1C9C5ED5B1041131ACDBB04C1C9E545
|
||||
:1005A000ED5B104113131806E5ED5B1041131A6F54
|
||||
:1005B000131A677CCDD9027DCDD902E1C9C5ED5BA7
|
||||
:1005C00010411A1F1F1FE607CD4206C1C9E5C5ED40
|
||||
:1005D0005B10411807E5C5ED5B1041131A1F1F1F83
|
||||
:1005E000E606F52A10417EFEDD2809FEFD280A21D7
|
||||
:1005F000910E180821990E180321A10EF106004F43
|
||||
:10060000097ECDA902237ECDA902C1E1C9E5C5EDD0
|
||||
:100610005B10411A1F1F1FE606F52A10417E21A913
|
||||
:100620000E18D9E5C52A174106021807E5C52A178D
|
||||
:100630004106017E23A720FB05C23306CDB102C1CE
|
||||
:10064000E1C9E5FE062811FE07281521910E0600D6
|
||||
:100650004F097ECDA902E1C921B10ECDB102E1C998
|
||||
:100660003E41CDA902E1C978FE01C83E20CDA902D4
|
||||
:100670003E2CCDA902C900FF000001CE0A0027FFD1
|
||||
:10068000000001990B002FFF0000019D0B00EDFF02
|
||||
:1006900044FF02A10B003FFF000001A50B0037FF44
|
||||
:1006A000000001A90B0076FF000001AD0B00F3FF75
|
||||
:1006B000000001B20B00FBFF000001B50B00EDFFD5
|
||||
:1006C00046FF02B80B00EDFF56FF02BD0B00EDFF29
|
||||
:1006D0005EFF02C20B00EBFF000001C70B0008FF2A
|
||||
:1006E000000001D10B00D9FF000001DE0B00E3FF89
|
||||
:1006F000000001E20B00DDFFE3FF02EE0B00FDFF57
|
||||
:10070000E3FF02FA0B00EDFFA0FF02060C00EDFF75
|
||||
:10071000B0FF020A0C00EDFFA8FF020F0C00EDFF76
|
||||
:10072000B8FF02130C00EDFFA1FF02180C00EDFF53
|
||||
:10073000B1FF021C0C00EDFFA9FF02210C00EDFF30
|
||||
:10074000B9FF02250C00C3FF000003D20A0101C259
|
||||
:10075000C7000003D20A0302800118FF000002D97B
|
||||
:100760000A010338FF000002DD0A010330FF000028
|
||||
:1007700002E40A010328FF000002EC0A010320FF43
|
||||
:10078000000002F30A0103E9FF000002FB0A00DD9A
|
||||
:10079000FFE9FF02040B00FDFFE9FF020D0B001053
|
||||
:1007A000FF000002160B0103CDFF0000031C0B012C
|
||||
:1007B00001C4C70000031C0B020201C9FF000001B5
|
||||
:1007C000220B00C0C7000001220B0102EDFF4DFF0C
|
||||
:1007D00002270B00EDFF45FF022C0B00C7C70000EE
|
||||
:1007E00001310B01050AFF000001360B001AFF0062
|
||||
:1007F0000001400B003AFF0000034A0B020980028F
|
||||
:10080000FF000001540B0012FF0000015F0B0032DB
|
||||
:10081000FF0000036A0B020980EDFF57FF02790B0E
|
||||
:1008200000EDFF5FFF02810B00EDFF47FF02890B28
|
||||
:1008300000EDFF4FFF02910B0006C7000002750B91
|
||||
:1008400002060840C0000001750B02060780F80090
|
||||
:1008500000012A0C0107C6FF0000022A0C0108DD76
|
||||
:10086000FF86FF03320C020880FDFF86FF03410C68
|
||||
:10087000020880C8F8000001500C01078EF8000043
|
||||
:1008800002500C0108DDFF8EFF03580C020880FDAA
|
||||
:10089000FF8EFF03670C02088090F8000001760CC1
|
||||
:1008A0000107D6FF000002760C0108DDFF96FF036A
|
||||
:1008B0007B0C020880FDFF96FF03870C02088094E2
|
||||
:1008C000F8000001930C0107DEFF000002930C0109
|
||||
:1008D00008DDFF9EFF039B0C020880FDFF9EFF03C7
|
||||
:1008E000A90C020880A0F8000001B70C0107E6FF80
|
||||
:1008F000000002B70C0108DDFFA6FF03BC0C0208D4
|
||||
:1009000080FDFFA6FF03C80C020880B0F8000001BC
|
||||
:10091000D40C0107F6FF000002D40C0108DDFFB67D
|
||||
:10092000FF03D80C020880FDFFB6FF03E30C0208AA
|
||||
:1009300080A8F8000001EE0C0107EEFF000002EEB7
|
||||
:100940000C0108DDFFAEFF03F30C020880FDFFAED3
|
||||
:10095000FF03FF0C020880B8F80000010B0D01072F
|
||||
:10096000FEFF0000020B0D0108DDFFBEFF030F0DAF
|
||||
:10097000020880FDFFBEFF031A0D02088004C700B5
|
||||
:100980000001250D0110DDFF34FF032A0D02088050
|
||||
:10099000FDFF34FF03360D02088005C70000014249
|
||||
:1009A0000D0110DDFF35FF03470D020880FDFF3507
|
||||
:1009B000FF03530D02088009CF0000015F0D0111F4
|
||||
:1009C000EDFF4ACF02680D0112EDFF42CF02710D1B
|
||||
:1009D0000112DDFF09CF027A0D0112FDFF09CF02DE
|
||||
:1009E000830D011203CF0000018C0D0111DDFF23E7
|
||||
:1009F000FF02910D00FDFF23FF029A0D000BCF00B7
|
||||
:100A00000001A30D0111DDFF2BFF02A80D00FDFF6A
|
||||
:100A10002BFF02B10D0001CF000003BA0D031180BE
|
||||
:100A200009DDFF21FF04C10D010AFDFF21FF04C9FB
|
||||
:100A30000D010A2AFF000003D10D020980EDFF4BD2
|
||||
:100A4000CF04DD0D0412800A81DDFF2AFF04E80DCA
|
||||
:100A5000010AFDFF2AFF04F40D010A22FF00000332
|
||||
:100A6000000E020A80EDFF43CF040C0E030A801231
|
||||
:100A7000DDFF22CF04160E020A80FDFF22CF0422E2
|
||||
:100A80000E020A80F9FF0000012E0E00DDFFF9FFC3
|
||||
:100A900002380E00FDFFF9FF02420E00C5CF000034
|
||||
:100AA000014C0E0113DDFFE5FF02520E00FDFFE5D4
|
||||
:100AB000FF025A0E00C1CF000001620E0113DDFFDC
|
||||
:100AC000E1FF02680E00FDFFE1FF02700E004E4FD5
|
||||
:100AD00050004A5020002C20004A5220004A522048
|
||||
:100AE000432C20004A52204E432C20004A52205AC8
|
||||
:100AF0002C20004A52204E5A2C20004A50202848D0
|
||||
:100B00004C2920004A50202849582920004A5020CA
|
||||
:100B1000284959292000444A4E5A200043414C4C50
|
||||
:100B20002000524554200052455449005245544E2D
|
||||
:100B30000052535420004C4420412C2842432900A9
|
||||
:100B40004C4420412C28444529004C4420412C2869
|
||||
:100B5000006829004C4420284243292C2041004CA5
|
||||
:100B60004420284445292C2041004C44202800687A
|
||||
:100B7000292C2041004C4420004C4420412C204989
|
||||
:100B8000004C4420412C2052004C4420492C204150
|
||||
:100B9000004C4420522C2041004441410043504C21
|
||||
:100BA000004E454700434346005343460048414CEE
|
||||
:100BB0005400444900454900494D203000494D202A
|
||||
:100BC0003100494D20320045582044452C20484CE6
|
||||
:100BD0000045582041462C204146E280B20045584D
|
||||
:100BE0005800455820285350292C20484C0045587F
|
||||
:100BF00020285350292C204958004558202853506C
|
||||
:100C0000292C204959004C4449004C444952004C7D
|
||||
:100C10004444004C4444520043504900435049521C
|
||||
:100C20000043504400435044520041444420412C6E
|
||||
:100C3000200041444420412C202849582B00682999
|
||||
:100C40000041444420412C202849592B00682900A8
|
||||
:100C500041444320412C200041444320412C202882
|
||||
:100C600049582B0068290041444320412C20284941
|
||||
:100C7000592B006829005355422000535542202823
|
||||
:100C800049582B00682900535542202849592B0008
|
||||
:100C900068290053424320412C2000534243204105
|
||||
:100CA0002C2849582B0068290053424320412C2806
|
||||
:100CB00049592B00682900414E442000414E4420F0
|
||||
:100CC0002849582B00682900414E44202849592BB7
|
||||
:100CD000006829004F5220004F52202849582B000D
|
||||
:100CE0006829004F52202849592B00682900584F85
|
||||
:100CF000522000584F52202849582B00682900588C
|
||||
:100D00004F52202849592B006829004350200043A6
|
||||
:100D100050202849582B0068290043502028495961
|
||||
:100D20002B00682900494E432000494E43202849A2
|
||||
:100D3000582B00682900494E43202849592B006848
|
||||
:100D400029004445432000444543202849582B00AE
|
||||
:100D5000682900444543202849592B00682900414F
|
||||
:100D6000444420484C2C200041444320484C2C2033
|
||||
:100D70000053424320484C2C200041444420495811
|
||||
:100D80002C20004144442049592C2000494E432046
|
||||
:100D900000494E432049582C2000494E43204959D0
|
||||
:100DA0002C200044454320004445432049582C2032
|
||||
:100DB000004445432049592C20004C4420002C205D
|
||||
:100DC000004C442049582C20004C442049592C20E8
|
||||
:100DD000004C4420484C2C2028006829004C44201A
|
||||
:100DE000002C2028006829004C442049582C202839
|
||||
:100DF000006829004C442049592C2028006829000B
|
||||
:100E00004C4420280068292C20484C004C442028C1
|
||||
:100E10000068292C20004C4420280068292C2049F7
|
||||
:100E200058004C4420280068292C204959004C4483
|
||||
:100E30002053502C20484C004C442053502C204927
|
||||
:100E400058004C442053502C2049590050555348C9
|
||||
:100E500020005055534820495800505553482049C8
|
||||
:100E600059005055534820005055534820495800C8
|
||||
:100E700050555348204959002E3F2E002020202055
|
||||
:100E8000004E5A5A004E434300504F504550004DBB
|
||||
:100E90000042434445484C5350424344454958530B
|
||||
:100EA00050424344454959535042434445484C41BC
|
||||
:100EB0004628484C2900CDA902C9C5D5E5CDEA028E
|
||||
:100EC000F5F1E1D1C1C93E00C95A3843204D6F6EDA
|
||||
:100ED00069746F722056322062792044656E6E69A3
|
||||
:100EE000732047756E6961202832303232290073D1
|
||||
:100EF000796E3F00636D643F0042415345203020CE
|
||||
:100F00002031202032202033202034202035202082
|
||||
:100F10003620203700CD04033EA7D3063E0ED3066D
|
||||
:100F20003E00D30421F50F22044221000022FC40A0
|
||||
:100F300022FE403E42ED47ED5E217010CDB102FB36
|
||||
:100F4000CDA6103E43CD4610CD1910DA430FFE0456
|
||||
:100F5000CAAC0FFE18CA430FFE01CA600FC3B40F1C
|
||||
:100F6000CD1910DA98104732FB40CD1910DA9810DD
|
||||
:100F700080FEFFC2B40F3D781FE67F67783D0FE625
|
||||
:100F8000806F1100441906800E00E5CD1910DA9823
|
||||
:100F900010E177230C05C28A0FCD1910DA9810578B
|
||||
:100FA0000CCD1910DA98105F0CC38A103E06CD469E
|
||||
:100FB00010C3EE0F3E18CD46103E18CD46103E1819
|
||||
:100FC000CD46103E18CD46103E18CD46103E18CDE9
|
||||
:100FD00046103E18CD46103E18CD46103E18CD4660
|
||||
:100FE000103E18CD46103E18215710CDB102F3CD5A
|
||||
:100FF000C302C38B00F308D92AFC402322FC401112
|
||||
:101000000404ED52C2141021000022FC402AFE40CC
|
||||
:101010002322FE4008D9FBED4DF321000022FC40C5
|
||||
:1010200022FE40FBCD0D032AFE407DFE03CA441084
|
||||
:10103000AFD309DB09E601CA2710DB08F5CD0403AD
|
||||
:10104000F1373FC937C9D308CD4C10C9973CD309F4
|
||||
:10105000DB09CB4728F6C94572726F723A20756E6C
|
||||
:10106000657870656374656420627974650D0A0043
|
||||
:10107000417761697420786D6F64656D20636F6E70
|
||||
:101080006E656374696F6E0D0A003E06CD4610CD25
|
||||
:101090001910DA8A10C34E0F3E15CD4610CD191027
|
||||
:1010A000DA9810C34E0F21FF00010100000000007C
|
||||
:0510B000ED42C818F735
|
||||
:00000001FF
|
||||
2724
OperatingSystem/monitor_v2/zout/main.lst
Normal file
2724
OperatingSystem/monitor_v2/zout/main.lst
Normal file
File diff suppressed because it is too large
Load Diff
270
OperatingSystem/monitor_v2/zout/main.mon
Normal file
270
OperatingSystem/monitor_v2/zout/main.mon
Normal file
@@ -0,0 +1,270 @@
|
||||
!0000 C3 50 00
|
||||
!0008 C3 B6 0E
|
||||
!0010 C3 BA 0E
|
||||
!0018 C3 C6 0E
|
||||
!0044 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
!0054 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
!0064 00 00 00 00 00 00 00 00 00 00
|
||||
!0050 31 FF FF AF 32 04 40 32 05 40 3E 20 32 06 40 CD
|
||||
!0060 70 02 21 44 00 11 2A 40 01 00 40 7E 02 23 03 E5
|
||||
!0070 ED 52 E1 C2 6B 00 CD BC 02 21 C9 0E CD B1 02 CD
|
||||
!0080 8B 00 76 47 7A D3 40 78 D3 41 C9 CD C3 02 3E 3E
|
||||
!0090 CD A9 02 AF 32 00 40 CD EA 02 CA 97 00 F5 F1 FE
|
||||
!00A0 0D CA EE 00 FE 0A CA 97 00 FE 08 CA C8 00 F5 21
|
||||
!00B0 29 40 16 00 3A 00 40 5F 19 3C 32 00 40 F1 77 CD
|
||||
!00C0 A9 02 23 AF 77 C3 97 00 3A 00 40 A7 CA 97 00 3D
|
||||
!00D0 32 00 40 5F 16 00 21 29 40 19 AF 77 3E 08 CD A9
|
||||
!00E0 02 3E 20 CD A9 02 3E 08 CD A9 02 C3 97 00 3A 29
|
||||
!00F0 40 FE 24 CA 21 01 FE 3F CA 40 01 FE 21 CA AA 01
|
||||
!0100 FE 69 CA 0F 02 FE 6F CA E6 01 FE 64 CA 2B 02 FE
|
||||
!0110 78 CA 15 0F CD C3 02 21 F4 0E CD B1 02 C3 8B 00
|
||||
!0120 C9 AF 32 29 40 21 2A 40 CD 16 03 47 7B A7 C2 64
|
||||
!0130 02 21 2C 40 CD 16 03 4F 7B A7 C2 64 02 60 69 E9
|
||||
!0140 CD C3 02 21 2A 40 CD 16 03 47 7B A7 C2 64 02 21
|
||||
!0150 2C 40 CD 16 03 4F 7B A7 C2 64 02 3A 2E 40 FE 20
|
||||
!0160 C2 64 02 21 2F 40 CD 16 03 F5 7B A7 C2 64 02 21
|
||||
!0170 F9 0E CD B1 02 F1 60 69 47 CD C3 02 7C CD D9 02
|
||||
!0180 7D CD D9 02 3E 20 CD A9 02 0E 08 7E CD D9 02 23
|
||||
!0190 05 0D 78 A7 CA A4 01 79 A7 CA 79 01 3E 20 CD A9
|
||||
!01A0 02 C3 8B 01 CD C3 02 C3 8B 00 21 2A 40 CD 16 03
|
||||
!01B0 47 7B A7 C2 64 02 21 2C 40 CD 16 03 4F 7B A7 C2
|
||||
!01C0 64 02 21 2E 40 7E FE 00 CA E0 01 FE 20 C2 64 02
|
||||
!01D0 23 CD 16 03 02 7B A7 C2 64 02 03 23 23 C3 C5 01
|
||||
!01E0 CD C3 02 C3 8B 00 21 2A 40 CD 16 03 4F 7B A7 C2
|
||||
!01F0 64 02 3A 2C 40 FE 20 C2 64 02 21 2D 40 CD 16 03
|
||||
!0200 F5 7B A7 C2 64 02 F1 ED 79 CD C3 02 C3 8B 00 21
|
||||
!0210 2A 40 CD 16 03 4F 7B A7 C2 64 02 ED 78 F5 CD C3
|
||||
!0220 02 F1 CD D9 02 CD C3 02 C3 8B 00 CD C3 02 21 2A
|
||||
!0230 40 CD 16 03 47 7B A7 C2 64 02 21 2C 40 CD 16 03
|
||||
!0240 4F 7B A7 C2 64 02 3A 2E 40 FE 20 C2 64 02 21 2F
|
||||
!0250 40 CD 16 03 F5 7B A7 C2 64 02 60 69 F1 47 CD 67
|
||||
!0260 03 C3 8B 00 CD C3 02 21 EF 0E CD B1 02 C3 8B 00
|
||||
!0270 3E 4F D3 04 DB 01 D3 04 3E 30 D3 09 3E 18 D3 09
|
||||
!0280 3E 04 D3 09 3E 44 D3 09 3E 05 D3 09 3E E8 D3 09
|
||||
!0290 3E 01 D3 09 3E 04 D3 09 3E 02 D3 09 3E 00 D3 09
|
||||
!02A0 3E 03 D3 09 3E C1 D3 09 C9 F5 D3 08 CD CE 02 F1
|
||||
!02B0 C9 7E B7 28 06 CD A9 02 23 18 F6 C9 21 FC 02 CD
|
||||
!02C0 B1 02 C9 3E 0A CD A9 02 3E 0D CD A9 02 C9 97 3C
|
||||
!02D0 D3 09 DB 09 CB 47 28 F6 C9 F5 C5 D5 CD 4D 03 78
|
||||
!02E0 CD A9 02 79 CD A9 02 D1 C1 F1 CD 0D 03 00 AF D3
|
||||
!02F0 09 DB 09 E6 01 CD 04 03 C8 DB 08 C9 1B 5B 32 4A
|
||||
!0300 1B 5B 48 00 3E 05 D3 09 3E 68 D3 09 C9 3E 05 D3
|
||||
!0310 09 3E EA D3 09 C9 E5 7E CD 36 03 38 15 CB 27 CB
|
||||
!0320 27 CB 27 CB 27 57 23 7E CD 36 03 38 05 B2 E1 1E
|
||||
!0330 00 C9 1E FF E1 C9 D6 30 EA 4B 03 FE 0A 38 05 D6
|
||||
!0340 07 EA 4B 03 FE 10 30 03 E6 0F C9 37 C9 F5 1F 1F
|
||||
!0350 1F 1F CD 5C 03 47 F1 CD 5C 03 4F C9 E6 0F C6 30
|
||||
!0360 FE 3A D8 C6 07 C9 C9 78 32 1A 41 22 10 41 7E 32
|
||||
!0370 14 41 23 7E 32 15 41 2B CD 5B 04 78 B1 CA 3D 04
|
||||
!0380 ED 43 12 41 03 03 03 03 0A 32 16 41 03 0A 5F 03
|
||||
!0390 0A 57 ED 53 17 41 03 0A 32 19 41 2A 10 41 CD A3
|
||||
!03A0 04 3A 16 41 47 2A 10 41 7E CD D9 02 23 10 F9 3E
|
||||
!03B0 68 CD A9 02 3A 16 41 47 3E 06 90 47 3E 20 CD A9
|
||||
!03C0 02 3E 20 CD A9 02 10 F4 3E 20 CD A9 02 E5 2A 17
|
||||
!03D0 41 CD B1 02 3A 19 41 B7 CA 3A 04 2A 12 41 01 08
|
||||
!03E0 00 09 3A 19 41 47 7E FE 01 CC C9 04 FE 02 CC F0
|
||||
!03F0 04 FE 03 CC 0D 05 FE 04 CC 49 05 FE 05 CC 5F 05
|
||||
!0400 FE 06 CC 6C 05 FE 07 CC 86 05 FE 08 CC 93 05 FE
|
||||
!0410 09 CC A8 05 FE 10 CC BD 05 FE 11 CC CD 05 FE 12
|
||||
!0420 CC D5 05 FE 13 CC 0D 06 FE 0A CC 9F 05 FE 80 CC
|
||||
!0430 2C 06 FE 81 CC 23 06 23 10 AC E1 18 10 CD A3 04
|
||||
!0440 7E CD BB 04 23 E5 21 78 0E CD B1 02 E1 CD C3 02
|
||||
!0450 3A 1A 41 3D 32 1A 41 C2 6B 03 C9 E5 21 76 06 3A
|
||||
!0460 14 41 4F 7E FE FF CA 9D 04 F5 23 46 2B 79 A0 4F
|
||||
!0470 F1 B9 28 0B 06 00 0E 07 09 7E 4F 09 23 18 E0 23
|
||||
!0480 23 4E 23 3A 15 41 46 A0 B9 2B 2B 2B 28 0B 06 00
|
||||
!0490 0E 07 09 7E 4F 09 23 18 C6 44 4D E1 C9 06 00 0E
|
||||
!04A0 00 E1 C9 3E 24 CD A9 02 7C CD D9 02 7D CD D9 02
|
||||
!04B0 3E 68 CD A9 02 3E 20 CD A9 02 C9 CD D9 02 3E 68
|
||||
!04C0 CD A9 02 3E 20 CD A9 02 C9 E5 ED 5B 10 41 13 1A
|
||||
!04D0 6F 13 1A 67 3E 24 CD A9 02 7C CD D9 02 7D CD D9
|
||||
!04E0 02 3E 68 CD A9 02 3E 20 CD A9 02 CD 67 06 E1 C9
|
||||
!04F0 C5 ED 5B 10 41 1A 1F 1F E6 0E E5 21 81 0E 06 00
|
||||
!0500 4F 09 CD B1 02 3E 20 CD A9 02 E1 C1 C9 ED 5B 10
|
||||
!0510 41 13 1A F5 E6 80 C2 2E 05 3E 24 CD A9 02 3E 2B
|
||||
!0520 CD A9 02 F1 CD D9 02 3E 68 CD A9 02 18 17 3E 24
|
||||
!0530 CD A9 02 3E 2D CD A9 02 F1 ED 44 CD D9 02 3E 68
|
||||
!0540 CD A9 02 18 00 CD 67 06 C9 ED 5B 10 41 13 1A FE
|
||||
!0550 4D 28 06 3E 4E CD A9 02 C9 3E 49 CD A9 02 C9 C5
|
||||
!0560 ED 5B 10 41 1A E6 38 CD BB 04 C1 C9 C5 ED 5B 10
|
||||
!0570 41 1A 1F 1F 1F E6 07 CD 42 06 3E 20 CD A9 02 3E
|
||||
!0580 2C CD A9 02 C1 C9 C5 ED 5B 10 41 1A E6 07 CD 42
|
||||
!0590 06 C1 C9 C5 ED 5B 10 41 13 1A CD BB 04 C1 C9 E5
|
||||
!05A0 ED 5B 10 41 13 13 18 06 E5 ED 5B 10 41 13 1A 6F
|
||||
!05B0 13 1A 67 7C CD D9 02 7D CD D9 02 E1 C9 C5 ED 5B
|
||||
!05C0 10 41 1A 1F 1F 1F E6 07 CD 42 06 C1 C9 E5 C5 ED
|
||||
!05D0 5B 10 41 18 07 E5 C5 ED 5B 10 41 13 1A 1F 1F 1F
|
||||
!05E0 E6 06 F5 2A 10 41 7E FE DD 28 09 FE FD 28 0A 21
|
||||
!05F0 91 0E 18 08 21 99 0E 18 03 21 A1 0E F1 06 00 4F
|
||||
!0600 09 7E CD A9 02 23 7E CD A9 02 C1 E1 C9 E5 C5 ED
|
||||
!0610 5B 10 41 1A 1F 1F 1F E6 06 F5 2A 10 41 7E 21 A9
|
||||
!0620 0E 18 D9 E5 C5 2A 17 41 06 02 18 07 E5 C5 2A 17
|
||||
!0630 41 06 01 7E 23 A7 20 FB 05 C2 33 06 CD B1 02 C1
|
||||
!0640 E1 C9 E5 FE 06 28 11 FE 07 28 15 21 91 0E 06 00
|
||||
!0650 4F 09 7E CD A9 02 E1 C9 21 B1 0E CD B1 02 E1 C9
|
||||
!0660 3E 41 CD A9 02 E1 C9 78 FE 01 C8 3E 20 CD A9 02
|
||||
!0670 3E 2C CD A9 02 C9 00 FF 00 00 01 CE 0A 00 27 FF
|
||||
!0680 00 00 01 99 0B 00 2F FF 00 00 01 9D 0B 00 ED FF
|
||||
!0690 44 FF 02 A1 0B 00 3F FF 00 00 01 A5 0B 00 37 FF
|
||||
!06A0 00 00 01 A9 0B 00 76 FF 00 00 01 AD 0B 00 F3 FF
|
||||
!06B0 00 00 01 B2 0B 00 FB FF 00 00 01 B5 0B 00 ED FF
|
||||
!06C0 46 FF 02 B8 0B 00 ED FF 56 FF 02 BD 0B 00 ED FF
|
||||
!06D0 5E FF 02 C2 0B 00 EB FF 00 00 01 C7 0B 00 08 FF
|
||||
!06E0 00 00 01 D1 0B 00 D9 FF 00 00 01 DE 0B 00 E3 FF
|
||||
!06F0 00 00 01 E2 0B 00 DD FF E3 FF 02 EE 0B 00 FD FF
|
||||
!0700 E3 FF 02 FA 0B 00 ED FF A0 FF 02 06 0C 00 ED FF
|
||||
!0710 B0 FF 02 0A 0C 00 ED FF A8 FF 02 0F 0C 00 ED FF
|
||||
!0720 B8 FF 02 13 0C 00 ED FF A1 FF 02 18 0C 00 ED FF
|
||||
!0730 B1 FF 02 1C 0C 00 ED FF A9 FF 02 21 0C 00 ED FF
|
||||
!0740 B9 FF 02 25 0C 00 C3 FF 00 00 03 D2 0A 01 01 C2
|
||||
!0750 C7 00 00 03 D2 0A 03 02 80 01 18 FF 00 00 02 D9
|
||||
!0760 0A 01 03 38 FF 00 00 02 DD 0A 01 03 30 FF 00 00
|
||||
!0770 02 E4 0A 01 03 28 FF 00 00 02 EC 0A 01 03 20 FF
|
||||
!0780 00 00 02 F3 0A 01 03 E9 FF 00 00 02 FB 0A 00 DD
|
||||
!0790 FF E9 FF 02 04 0B 00 FD FF E9 FF 02 0D 0B 00 10
|
||||
!07A0 FF 00 00 02 16 0B 01 03 CD FF 00 00 03 1C 0B 01
|
||||
!07B0 01 C4 C7 00 00 03 1C 0B 02 02 01 C9 FF 00 00 01
|
||||
!07C0 22 0B 00 C0 C7 00 00 01 22 0B 01 02 ED FF 4D FF
|
||||
!07D0 02 27 0B 00 ED FF 45 FF 02 2C 0B 00 C7 C7 00 00
|
||||
!07E0 01 31 0B 01 05 0A FF 00 00 01 36 0B 00 1A FF 00
|
||||
!07F0 00 01 40 0B 00 3A FF 00 00 03 4A 0B 02 09 80 02
|
||||
!0800 FF 00 00 01 54 0B 00 12 FF 00 00 01 5F 0B 00 32
|
||||
!0810 FF 00 00 03 6A 0B 02 09 80 ED FF 57 FF 02 79 0B
|
||||
!0820 00 ED FF 5F FF 02 81 0B 00 ED FF 47 FF 02 89 0B
|
||||
!0830 00 ED FF 4F FF 02 91 0B 00 06 C7 00 00 02 75 0B
|
||||
!0840 02 06 08 40 C0 00 00 01 75 0B 02 06 07 80 F8 00
|
||||
!0850 00 01 2A 0C 01 07 C6 FF 00 00 02 2A 0C 01 08 DD
|
||||
!0860 FF 86 FF 03 32 0C 02 08 80 FD FF 86 FF 03 41 0C
|
||||
!0870 02 08 80 C8 F8 00 00 01 50 0C 01 07 8E F8 00 00
|
||||
!0880 02 50 0C 01 08 DD FF 8E FF 03 58 0C 02 08 80 FD
|
||||
!0890 FF 8E FF 03 67 0C 02 08 80 90 F8 00 00 01 76 0C
|
||||
!08A0 01 07 D6 FF 00 00 02 76 0C 01 08 DD FF 96 FF 03
|
||||
!08B0 7B 0C 02 08 80 FD FF 96 FF 03 87 0C 02 08 80 94
|
||||
!08C0 F8 00 00 01 93 0C 01 07 DE FF 00 00 02 93 0C 01
|
||||
!08D0 08 DD FF 9E FF 03 9B 0C 02 08 80 FD FF 9E FF 03
|
||||
!08E0 A9 0C 02 08 80 A0 F8 00 00 01 B7 0C 01 07 E6 FF
|
||||
!08F0 00 00 02 B7 0C 01 08 DD FF A6 FF 03 BC 0C 02 08
|
||||
!0900 80 FD FF A6 FF 03 C8 0C 02 08 80 B0 F8 00 00 01
|
||||
!0910 D4 0C 01 07 F6 FF 00 00 02 D4 0C 01 08 DD FF B6
|
||||
!0920 FF 03 D8 0C 02 08 80 FD FF B6 FF 03 E3 0C 02 08
|
||||
!0930 80 A8 F8 00 00 01 EE 0C 01 07 EE FF 00 00 02 EE
|
||||
!0940 0C 01 08 DD FF AE FF 03 F3 0C 02 08 80 FD FF AE
|
||||
!0950 FF 03 FF 0C 02 08 80 B8 F8 00 00 01 0B 0D 01 07
|
||||
!0960 FE FF 00 00 02 0B 0D 01 08 DD FF BE FF 03 0F 0D
|
||||
!0970 02 08 80 FD FF BE FF 03 1A 0D 02 08 80 04 C7 00
|
||||
!0980 00 01 25 0D 01 10 DD FF 34 FF 03 2A 0D 02 08 80
|
||||
!0990 FD FF 34 FF 03 36 0D 02 08 80 05 C7 00 00 01 42
|
||||
!09A0 0D 01 10 DD FF 35 FF 03 47 0D 02 08 80 FD FF 35
|
||||
!09B0 FF 03 53 0D 02 08 80 09 CF 00 00 01 5F 0D 01 11
|
||||
!09C0 ED FF 4A CF 02 68 0D 01 12 ED FF 42 CF 02 71 0D
|
||||
!09D0 01 12 DD FF 09 CF 02 7A 0D 01 12 FD FF 09 CF 02
|
||||
!09E0 83 0D 01 12 03 CF 00 00 01 8C 0D 01 11 DD FF 23
|
||||
!09F0 FF 02 91 0D 00 FD FF 23 FF 02 9A 0D 00 0B CF 00
|
||||
!0A00 00 01 A3 0D 01 11 DD FF 2B FF 02 A8 0D 00 FD FF
|
||||
!0A10 2B FF 02 B1 0D 00 01 CF 00 00 03 BA 0D 03 11 80
|
||||
!0A20 09 DD FF 21 FF 04 C1 0D 01 0A FD FF 21 FF 04 C9
|
||||
!0A30 0D 01 0A 2A FF 00 00 03 D1 0D 02 09 80 ED FF 4B
|
||||
!0A40 CF 04 DD 0D 04 12 80 0A 81 DD FF 2A FF 04 E8 0D
|
||||
!0A50 01 0A FD FF 2A FF 04 F4 0D 01 0A 22 FF 00 00 03
|
||||
!0A60 00 0E 02 0A 80 ED FF 43 CF 04 0C 0E 03 0A 80 12
|
||||
!0A70 DD FF 22 CF 04 16 0E 02 0A 80 FD FF 22 CF 04 22
|
||||
!0A80 0E 02 0A 80 F9 FF 00 00 01 2E 0E 00 DD FF F9 FF
|
||||
!0A90 02 38 0E 00 FD FF F9 FF 02 42 0E 00 C5 CF 00 00
|
||||
!0AA0 01 4C 0E 01 13 DD FF E5 FF 02 52 0E 00 FD FF E5
|
||||
!0AB0 FF 02 5A 0E 00 C1 CF 00 00 01 62 0E 01 13 DD FF
|
||||
!0AC0 E1 FF 02 68 0E 00 FD FF E1 FF 02 70 0E 00 4E 4F
|
||||
!0AD0 50 00 4A 50 20 00 2C 20 00 4A 52 20 00 4A 52 20
|
||||
!0AE0 43 2C 20 00 4A 52 20 4E 43 2C 20 00 4A 52 20 5A
|
||||
!0AF0 2C 20 00 4A 52 20 4E 5A 2C 20 00 4A 50 20 28 48
|
||||
!0B00 4C 29 20 00 4A 50 20 28 49 58 29 20 00 4A 50 20
|
||||
!0B10 28 49 59 29 20 00 44 4A 4E 5A 20 00 43 41 4C 4C
|
||||
!0B20 20 00 52 45 54 20 00 52 45 54 49 00 52 45 54 4E
|
||||
!0B30 00 52 53 54 20 00 4C 44 20 41 2C 28 42 43 29 00
|
||||
!0B40 4C 44 20 41 2C 28 44 45 29 00 4C 44 20 41 2C 28
|
||||
!0B50 00 68 29 00 4C 44 20 28 42 43 29 2C 20 41 00 4C
|
||||
!0B60 44 20 28 44 45 29 2C 20 41 00 4C 44 20 28 00 68
|
||||
!0B70 29 2C 20 41 00 4C 44 20 00 4C 44 20 41 2C 20 49
|
||||
!0B80 00 4C 44 20 41 2C 20 52 00 4C 44 20 49 2C 20 41
|
||||
!0B90 00 4C 44 20 52 2C 20 41 00 44 41 41 00 43 50 4C
|
||||
!0BA0 00 4E 45 47 00 43 43 46 00 53 43 46 00 48 41 4C
|
||||
!0BB0 54 00 44 49 00 45 49 00 49 4D 20 30 00 49 4D 20
|
||||
!0BC0 31 00 49 4D 20 32 00 45 58 20 44 45 2C 20 48 4C
|
||||
!0BD0 00 45 58 20 41 46 2C 20 41 46 E2 80 B2 00 45 58
|
||||
!0BE0 58 00 45 58 20 28 53 50 29 2C 20 48 4C 00 45 58
|
||||
!0BF0 20 28 53 50 29 2C 20 49 58 00 45 58 20 28 53 50
|
||||
!0C00 29 2C 20 49 59 00 4C 44 49 00 4C 44 49 52 00 4C
|
||||
!0C10 44 44 00 4C 44 44 52 00 43 50 49 00 43 50 49 52
|
||||
!0C20 00 43 50 44 00 43 50 44 52 00 41 44 44 20 41 2C
|
||||
!0C30 20 00 41 44 44 20 41 2C 20 28 49 58 2B 00 68 29
|
||||
!0C40 00 41 44 44 20 41 2C 20 28 49 59 2B 00 68 29 00
|
||||
!0C50 41 44 43 20 41 2C 20 00 41 44 43 20 41 2C 20 28
|
||||
!0C60 49 58 2B 00 68 29 00 41 44 43 20 41 2C 20 28 49
|
||||
!0C70 59 2B 00 68 29 00 53 55 42 20 00 53 55 42 20 28
|
||||
!0C80 49 58 2B 00 68 29 00 53 55 42 20 28 49 59 2B 00
|
||||
!0C90 68 29 00 53 42 43 20 41 2C 20 00 53 42 43 20 41
|
||||
!0CA0 2C 28 49 58 2B 00 68 29 00 53 42 43 20 41 2C 28
|
||||
!0CB0 49 59 2B 00 68 29 00 41 4E 44 20 00 41 4E 44 20
|
||||
!0CC0 28 49 58 2B 00 68 29 00 41 4E 44 20 28 49 59 2B
|
||||
!0CD0 00 68 29 00 4F 52 20 00 4F 52 20 28 49 58 2B 00
|
||||
!0CE0 68 29 00 4F 52 20 28 49 59 2B 00 68 29 00 58 4F
|
||||
!0CF0 52 20 00 58 4F 52 20 28 49 58 2B 00 68 29 00 58
|
||||
!0D00 4F 52 20 28 49 59 2B 00 68 29 00 43 50 20 00 43
|
||||
!0D10 50 20 28 49 58 2B 00 68 29 00 43 50 20 28 49 59
|
||||
!0D20 2B 00 68 29 00 49 4E 43 20 00 49 4E 43 20 28 49
|
||||
!0D30 58 2B 00 68 29 00 49 4E 43 20 28 49 59 2B 00 68
|
||||
!0D40 29 00 44 45 43 20 00 44 45 43 20 28 49 58 2B 00
|
||||
!0D50 68 29 00 44 45 43 20 28 49 59 2B 00 68 29 00 41
|
||||
!0D60 44 44 20 48 4C 2C 20 00 41 44 43 20 48 4C 2C 20
|
||||
!0D70 00 53 42 43 20 48 4C 2C 20 00 41 44 44 20 49 58
|
||||
!0D80 2C 20 00 41 44 44 20 49 59 2C 20 00 49 4E 43 20
|
||||
!0D90 00 49 4E 43 20 49 58 2C 20 00 49 4E 43 20 49 59
|
||||
!0DA0 2C 20 00 44 45 43 20 00 44 45 43 20 49 58 2C 20
|
||||
!0DB0 00 44 45 43 20 49 59 2C 20 00 4C 44 20 00 2C 20
|
||||
!0DC0 00 4C 44 20 49 58 2C 20 00 4C 44 20 49 59 2C 20
|
||||
!0DD0 00 4C 44 20 48 4C 2C 20 28 00 68 29 00 4C 44 20
|
||||
!0DE0 00 2C 20 28 00 68 29 00 4C 44 20 49 58 2C 20 28
|
||||
!0DF0 00 68 29 00 4C 44 20 49 59 2C 20 28 00 68 29 00
|
||||
!0E00 4C 44 20 28 00 68 29 2C 20 48 4C 00 4C 44 20 28
|
||||
!0E10 00 68 29 2C 20 00 4C 44 20 28 00 68 29 2C 20 49
|
||||
!0E20 58 00 4C 44 20 28 00 68 29 2C 20 49 59 00 4C 44
|
||||
!0E30 20 53 50 2C 20 48 4C 00 4C 44 20 53 50 2C 20 49
|
||||
!0E40 58 00 4C 44 20 53 50 2C 20 49 59 00 50 55 53 48
|
||||
!0E50 20 00 50 55 53 48 20 49 58 00 50 55 53 48 20 49
|
||||
!0E60 59 00 50 55 53 48 20 00 50 55 53 48 20 49 58 00
|
||||
!0E70 50 55 53 48 20 49 59 00 2E 3F 2E 00 20 20 20 20
|
||||
!0E80 00 4E 5A 5A 00 4E 43 43 00 50 4F 50 45 50 00 4D
|
||||
!0E90 00 42 43 44 45 48 4C 53 50 42 43 44 45 49 58 53
|
||||
!0EA0 50 42 43 44 45 49 59 53 50 42 43 44 45 48 4C 41
|
||||
!0EB0 46 28 48 4C 29 00 CD A9 02 C9 C5 D5 E5 CD EA 02
|
||||
!0EC0 F5 F1 E1 D1 C1 C9 3E 00 C9 5A 38 43 20 4D 6F 6E
|
||||
!0ED0 69 74 6F 72 20 56 32 20 62 79 20 44 65 6E 6E 69
|
||||
!0EE0 73 20 47 75 6E 69 61 20 28 32 30 32 32 29 00 73
|
||||
!0EF0 79 6E 3F 00 63 6D 64 3F 00 42 41 53 45 20 30 20
|
||||
!0F00 20 31 20 20 32 20 20 33 20 20 34 20 20 35 20 20
|
||||
!0F10 36 20 20 37 00 CD 04 03 3E A7 D3 06 3E 0E D3 06
|
||||
!0F20 3E 00 D3 04 21 F5 0F 22 04 42 21 00 00 22 FC 40
|
||||
!0F30 22 FE 40 3E 42 ED 47 ED 5E 21 70 10 CD B1 02 FB
|
||||
!0F40 CD A6 10 3E 43 CD 46 10 CD 19 10 DA 43 0F FE 04
|
||||
!0F50 CA AC 0F FE 18 CA 43 0F FE 01 CA 60 0F C3 B4 0F
|
||||
!0F60 CD 19 10 DA 98 10 47 32 FB 40 CD 19 10 DA 98 10
|
||||
!0F70 80 FE FF C2 B4 0F 3D 78 1F E6 7F 67 78 3D 0F E6
|
||||
!0F80 80 6F 11 00 44 19 06 80 0E 00 E5 CD 19 10 DA 98
|
||||
!0F90 10 E1 77 23 0C 05 C2 8A 0F CD 19 10 DA 98 10 57
|
||||
!0FA0 0C CD 19 10 DA 98 10 5F 0C C3 8A 10 3E 06 CD 46
|
||||
!0FB0 10 C3 EE 0F 3E 18 CD 46 10 3E 18 CD 46 10 3E 18
|
||||
!0FC0 CD 46 10 3E 18 CD 46 10 3E 18 CD 46 10 3E 18 CD
|
||||
!0FD0 46 10 3E 18 CD 46 10 3E 18 CD 46 10 3E 18 CD 46
|
||||
!0FE0 10 3E 18 CD 46 10 3E 18 21 57 10 CD B1 02 F3 CD
|
||||
!0FF0 C3 02 C3 8B 00 F3 08 D9 2A FC 40 23 22 FC 40 11
|
||||
!1000 04 04 ED 52 C2 14 10 21 00 00 22 FC 40 2A FE 40
|
||||
!1010 23 22 FE 40 08 D9 FB ED 4D F3 21 00 00 22 FC 40
|
||||
!1020 22 FE 40 FB CD 0D 03 2A FE 40 7D FE 03 CA 44 10
|
||||
!1030 AF D3 09 DB 09 E6 01 CA 27 10 DB 08 F5 CD 04 03
|
||||
!1040 F1 37 3F C9 37 C9 D3 08 CD 4C 10 C9 97 3C D3 09
|
||||
!1050 DB 09 CB 47 28 F6 C9 45 72 72 6F 72 3A 20 75 6E
|
||||
!1060 65 78 70 65 63 74 65 64 20 62 79 74 65 0D 0A 00
|
||||
!1070 41 77 61 69 74 20 78 6D 6F 64 65 6D 20 63 6F 6E
|
||||
!1080 6E 65 63 74 69 6F 6E 0D 0A 00 3E 06 CD 46 10 CD
|
||||
!1090 19 10 DA 8A 10 C3 4E 0F 3E 15 CD 46 10 CD 19 10
|
||||
!10A0 DA 98 10 C3 4E 0F 21 FF 00 01 01 00 00 00 00 00
|
||||
!10B0 ED 42 C8 18 F7
|
||||
263
OperatingSystem/monitor_v2/zout/symbols.s
Normal file
263
OperatingSystem/monitor_v2/zout/symbols.s
Normal file
@@ -0,0 +1,263 @@
|
||||
;This file is generated by the build script.
|
||||
;Do not make any changes here!
|
||||
|
||||
AY0_WRITE_REG equ 0x83
|
||||
A_RTS_OFF equ 0x304
|
||||
A_RTS_ON equ 0x30D
|
||||
CMD_DASM equ 0x22B
|
||||
CMD_EXEC equ 0x121
|
||||
CMD_IO_READ equ 0x20F
|
||||
CMD_IO_WRITE equ 0x1E6
|
||||
CMD_SET equ 0x1AA
|
||||
CMD_SET_END equ 0x1E0
|
||||
CMD_SET_LOOP equ 0x1C5
|
||||
CMD_SYNTAX_ERROR equ 0x264
|
||||
CMD_VIEW equ 0x140
|
||||
CMD_VIEW_END equ 0x1A4
|
||||
CMD_VIEW_ROW equ 0x179
|
||||
CMD_VIEW_ROW_LOOP equ 0x18B
|
||||
CONSOLE_INIT equ 0x270
|
||||
CONSOLE_INIT_CTC equ 0x270
|
||||
CONSOLE_INIT_SIO equ 0x278
|
||||
DHEX_TO_BYTE equ 0x316
|
||||
DHEX_TO_BYTE_FAILED equ 0x332
|
||||
EXEC_RST_08 equ 0xEB6
|
||||
EXEC_RST_10 equ 0xEBA
|
||||
EXEC_RST_18 equ 0xEC6
|
||||
HEX_TO_BIN equ 0x336
|
||||
HEX_TO_BIN_2 equ 0x344
|
||||
HEX_TO_INVALID_2 equ 0x34B
|
||||
INT_VEC equ 0x1B
|
||||
Includes equ 0x270
|
||||
MSG_CLEAR equ 0x2FC
|
||||
MSG_ERROR equ 0x1057
|
||||
MSG_START equ 0x1070
|
||||
PROMPT_BEGIN equ 0x8B
|
||||
PROMPT_BEGIN_READ_BACKSPACE equ 0xC8
|
||||
PROMPT_BEGIN_READ_LOOP equ 0x97
|
||||
PROMPT_BEGIN_READ_PROCESS equ 0xEE
|
||||
RST_00 equ 0x00
|
||||
RST_08 equ 0x08
|
||||
RST_10 equ 0x10
|
||||
RST_18 equ 0x18
|
||||
STRCONV_BYTES_TO_HEX equ 0x34D
|
||||
STRCONV_BYTES_TO_HEX_1 equ 0x35C
|
||||
STRCONV_BYTES_TO_HEX_2 equ 0x366
|
||||
STR_Banner_Start equ 0xEC9
|
||||
STR_HEXDUMP_HEADER equ 0xEF9
|
||||
STR_SyntaxError equ 0xEEF
|
||||
STR_Unknown equ 0xEF4
|
||||
dasm_00 equ 0xACE
|
||||
dasm_01 equ 0xDBA
|
||||
dasm_02 equ 0xB54
|
||||
dasm_03 equ 0xD8C
|
||||
dasm_08 equ 0xBD1
|
||||
dasm_09 equ 0xD5F
|
||||
dasm_0A equ 0xB36
|
||||
dasm_0B equ 0xDA3
|
||||
dasm_10 equ 0xB16
|
||||
dasm_12 equ 0xB5F
|
||||
dasm_18 equ 0xAD9
|
||||
dasm_1A equ 0xB40
|
||||
dasm_20 equ 0xAF3
|
||||
dasm_22 equ 0xE00
|
||||
dasm_27 equ 0xB99
|
||||
dasm_28 equ 0xAEC
|
||||
dasm_2A equ 0xDD1
|
||||
dasm_2F equ 0xB9D
|
||||
dasm_30 equ 0xAE4
|
||||
dasm_32 equ 0xB6A
|
||||
dasm_37 equ 0xBA9
|
||||
dasm_38 equ 0xADD
|
||||
dasm_3A equ 0xB4A
|
||||
dasm_3F equ 0xBA5
|
||||
dasm_76 equ 0xBAD
|
||||
dasm_80C6 equ 0xC2A
|
||||
dasm_BE equ 0xBC7
|
||||
dasm_C3 equ 0xAD2
|
||||
dasm_C88E equ 0xC50
|
||||
dasm_C9 equ 0xB22
|
||||
dasm_CD equ 0xB1C
|
||||
dasm_D9 equ 0xBDE
|
||||
dasm_DD equ 0xB04
|
||||
dasm_DD_01 equ 0xDC1
|
||||
dasm_DD_09 equ 0xD7A
|
||||
dasm_DD_22 equ 0xE16
|
||||
dasm_DD_23 equ 0xD91
|
||||
dasm_DD_2A equ 0xDE8
|
||||
dasm_DD_2B equ 0xDA8
|
||||
dasm_DD_34 equ 0xD2A
|
||||
dasm_DD_35 equ 0xD47
|
||||
dasm_DD_86 equ 0xC32
|
||||
dasm_DD_8E equ 0xC58
|
||||
dasm_DD_96 equ 0xC7B
|
||||
dasm_DD_9E equ 0xC9B
|
||||
dasm_DD_A6 equ 0xCBC
|
||||
dasm_DD_AE equ 0xCF3
|
||||
dasm_DD_B6 equ 0xCD8
|
||||
dasm_DD_BE equ 0xD0F
|
||||
dasm_DD_E1 equ 0xE68
|
||||
dasm_DD_E3 equ 0xBEE
|
||||
dasm_DD_E5 equ 0xE52
|
||||
dasm_DD_F9 equ 0xE38
|
||||
dasm_E1 equ 0xE62
|
||||
dasm_E3 equ 0xBE2
|
||||
dasm_E5 equ 0xE4C
|
||||
dasm_E9 equ 0xAFB
|
||||
dasm_ED_42 equ 0xD71
|
||||
dasm_ED_43 equ 0xE0C
|
||||
dasm_ED_44 equ 0xBA1
|
||||
dasm_ED_45 equ 0xB2C
|
||||
dasm_ED_46 equ 0xBB8
|
||||
dasm_ED_4A equ 0xD68
|
||||
dasm_ED_4B equ 0xDDD
|
||||
dasm_ED_4D equ 0xB27
|
||||
dasm_ED_56 equ 0xBBD
|
||||
dasm_ED_5E equ 0xBC2
|
||||
dasm_ED_A0 equ 0xC06
|
||||
dasm_ED_A1 equ 0xC18
|
||||
dasm_ED_A8 equ 0xC0F
|
||||
dasm_ED_A9 equ 0xC21
|
||||
dasm_ED_B0 equ 0xC0A
|
||||
dasm_ED_B1 equ 0xC1C
|
||||
dasm_ED_B8 equ 0xC13
|
||||
dasm_ED_B9 equ 0xC25
|
||||
dasm_F3 equ 0xBB2
|
||||
dasm_F9 equ 0xE2E
|
||||
dasm_FB equ 0xBB5
|
||||
dasm_FD equ 0xB0D
|
||||
dasm_FD_01 equ 0xDC9
|
||||
dasm_FD_09 equ 0xD83
|
||||
dasm_FD_22 equ 0xE22
|
||||
dasm_FD_23 equ 0xD9A
|
||||
dasm_FD_2A equ 0xDF4
|
||||
dasm_FD_2B equ 0xDB1
|
||||
dasm_FD_34 equ 0xD36
|
||||
dasm_FD_35 equ 0xD53
|
||||
dasm_FD_86 equ 0xC41
|
||||
dasm_FD_8E equ 0xC67
|
||||
dasm_FD_96 equ 0xC87
|
||||
dasm_FD_9E equ 0xCA9
|
||||
dasm_FD_A6 equ 0xCC8
|
||||
dasm_FD_AE equ 0xCFF
|
||||
dasm_FD_B6 equ 0xCE3
|
||||
dasm_FD_BE equ 0xD1A
|
||||
dasm_FD_E1 equ 0xE70
|
||||
dasm_FD_E3 equ 0xBFA
|
||||
dasm_FD_E5 equ 0xE5A
|
||||
dasm_FD_F9 equ 0xE42
|
||||
dasm_FF equ 0xB31
|
||||
dasm_UU equ 0xE78
|
||||
dasm_UW equ 0xE7C
|
||||
dasm__AND equ 0xCB7
|
||||
dasm__CP equ 0xD0B
|
||||
dasm__DEC equ 0xD42
|
||||
dasm__ED_47 equ 0xB89
|
||||
dasm__ED_4F equ 0xB91
|
||||
dasm__ED_57 equ 0xB79
|
||||
dasm__ED_5F equ 0xB81
|
||||
dasm__INC equ 0xD25
|
||||
dasm__LD equ 0xB75
|
||||
dasm__OR equ 0xCD4
|
||||
dasm__SBC equ 0xC93
|
||||
dasm__SUB equ 0xC76
|
||||
dasm__XOR equ 0xCEE
|
||||
dasm_opcode_table equ 0x676
|
||||
dasm_print16hex_addr equ 0x4A3
|
||||
dasm_print8hex equ 0x4BB
|
||||
dasm_printFlags_table equ 0xE81
|
||||
dasm_printRegister8_table equ 0xE91
|
||||
dasm_printRegister8_table_HL equ 0xEB1
|
||||
dasm_printRegisterIX_table equ 0xE99
|
||||
dasm_printRegisterIY_table equ 0xEA1
|
||||
dasm_printRegisterSP_table equ 0xEA9
|
||||
disassemble equ 0x367
|
||||
disassemble_continue equ 0x44D
|
||||
disassemble_err equ 0x43D
|
||||
disassemble_next equ 0x36B
|
||||
disassemble_print_opcode_params_end equ 0x43A
|
||||
disassemble_print_opcode_params_loop equ 0x3E6
|
||||
disassemble_print_opcode_raw equ 0x3A8
|
||||
disassemble_print_opcode_raw_fill equ 0x3BC
|
||||
disassemble_table_first_match equ 0x47F
|
||||
disassemble_table_found equ 0x499
|
||||
disassemble_table_notfound equ 0x49D
|
||||
disassemble_table_seek equ 0x45B
|
||||
disassemble_table_seek_loop equ 0x45F
|
||||
mon_start_complete equ 0x76
|
||||
mon_start_init_ctc equ 0x50
|
||||
mon_start_init_serial equ 0x5F
|
||||
mon_start_init_sound equ 0x50
|
||||
mon_start_ram equ 0x62
|
||||
mon_start_ram_loop equ 0x6B
|
||||
mon_var_template equ 0x44
|
||||
mon_var_template_end equ 0x402A
|
||||
param_01 equ 0x4C9
|
||||
param_02 equ 0x4F0
|
||||
param_03 equ 0x50D
|
||||
param_03_done equ 0x545
|
||||
param_03_neg equ 0x52E
|
||||
param_04 equ 0x549
|
||||
param_04_i equ 0x559
|
||||
param_05 equ 0x55F
|
||||
param_06 equ 0x56C
|
||||
param_07 equ 0x586
|
||||
param_08 equ 0x593
|
||||
param_09 equ 0x5A8
|
||||
param_09_0A equ 0x5AE
|
||||
param_0A equ 0x59F
|
||||
param_10 equ 0x5BD
|
||||
param_11 equ 0x5CD
|
||||
param_11_12 equ 0x5DC
|
||||
param_11_12_all equ 0x5FC
|
||||
param_11_12_def equ 0x5EF
|
||||
param_11_12_ix equ 0x5F4
|
||||
param_11_12_iy equ 0x5F9
|
||||
param_12 equ 0x5D5
|
||||
param_13 equ 0x60D
|
||||
param_80 equ 0x62C
|
||||
param_80_seek equ 0x633
|
||||
param_81 equ 0x623
|
||||
param_comma equ 0x667
|
||||
param_printRegister equ 0x642
|
||||
param_printRegisterA equ 0x660
|
||||
param_printRegisterHL equ 0x658
|
||||
print_a_hex equ 0x2D9
|
||||
print_char equ 0x2A9
|
||||
print_clear equ 0x2BC
|
||||
print_newLine equ 0x2C3
|
||||
print_str equ 0x2B1
|
||||
print_str_end equ 0x2BB
|
||||
print_wait_out equ 0x2CE
|
||||
read_char equ 0x2EA
|
||||
var_buffer equ 0x4029
|
||||
var_buffer_len equ 0x4000
|
||||
var_curserchar equ 0x4006
|
||||
var_curserlastaddr equ 0x4007
|
||||
var_curseron equ 0x4005
|
||||
var_curserstate equ 0x4004
|
||||
var_curserx equ 0x4002
|
||||
var_cursery equ 0x4003
|
||||
var_last_char equ 0x4001
|
||||
var_ps2mem equ 0x4019
|
||||
var_scratch equ 0x4009
|
||||
xmodem_ack equ 0x108A
|
||||
xmodem_await_conn equ 0xF43
|
||||
xmodem_end equ 0xFEE
|
||||
xmodem_err equ 0xFB4
|
||||
xmodem_init equ 0xF15
|
||||
xmodem_int equ 0xFF5
|
||||
xmodem_int_cont equ 0x1014
|
||||
xmodem_nak equ 0x1098
|
||||
xmodem_out equ 0x1046
|
||||
xmodem_packet equ 0xF4E
|
||||
xmodem_packet_EOT equ 0xFAC
|
||||
xmodem_packet_get equ 0xF60
|
||||
xmodem_packet_get_crc equ 0xF99
|
||||
xmodem_packet_get_data equ 0xF8A
|
||||
xmodem_read_wait equ 0x1019
|
||||
xmodem_read_wait_loop equ 0x1027
|
||||
xmodem_read_wait_timeout equ 0x1044
|
||||
xmodem_wait equ 0x10A6
|
||||
xmodem_wait_1 equ 0x10AC
|
||||
xmodem_wait_out equ 0x104C
|
||||
Reference in New Issue
Block a user