2778 lines
116 KiB
Plaintext
2778 lines
116 KiB
Plaintext
1: - 4000 SYS_RAM_START equ 0x4000
|
||
2: - 4010 SYS_BUF_START equ 0x4010
|
||
3: - 4110 PRG_RAM_START equ 0x4110
|
||
4: - FF00 PRG_RAM_TOP equ 0xFF00
|
||
5: - FFFF STACK_RAM_TOP equ 0xFFFF
|
||
6:
|
||
7: ;VAR_CONSOLE_CONF equ 0x07 ;CLK/TRG Clock @ 1843220.5/s
|
||
8: - 000F VAR_CONSOLE_CONF equ 0x0F ;CPU/16 Clock @ 230402.5625/s
|
||
9:
|
||
10: - 0018 VAR_CONSOLE_BAUD equ 24 ;BAUD timer constant
|
||
11: ;CLK/TRG Clock @ 1843220.5/s
|
||
12: ; -> 0x16 : 14400
|
||
13: ;CPU/16 Clock @ 230402.5625/s
|
||
14: ; -> 12 : 19200
|
||
15: ; -> 24 : 9600
|
||
16:
|
||
17: ; include IO device addresses
|
||
18: .include "addresses.s"
|
||
**** include/addresses.s ****
|
||
1: - 0000 CS_BANK equ 0000000b
|
||
2: - 0001 CS_DIP equ 0000001b
|
||
3: - 0004 CS_CTC_0 equ 0000100b
|
||
4: - 0005 CS_CTC_1 equ 0000101b
|
||
5: - 0006 CS_CTC_2 equ 0000110b
|
||
6: - 0007 CS_CTC_3 equ 0000111b
|
||
7: - 0008 CS_SIO_A_D equ 0001000b
|
||
8: - 0009 CS_SIO_A_C equ 0001001b
|
||
9: - 000A CS_SIO_B_D equ 0001010b
|
||
10: - 000B CS_SIO_B_C equ 0001011b
|
||
11:
|
||
12: - 0020 IO_RTC_SEC0 equ 00100000b
|
||
13: - 0021 IO_RTC_SEC1 equ 00100001b
|
||
14: - 0022 IO_RTC_MIN0 equ 00100010b
|
||
15: - 0023 IO_RTC_MIN1 equ 00100011b
|
||
16: - 0024 IO_RTC_HOUR equ 00100100b
|
||
17: - 0025 IO_RTC_AMPM equ 00100101b
|
||
18: - 0026 IO_RTC_DAY0 equ 00100110b
|
||
19: - 0027 IO_RTC_DAY1 equ 00100111b
|
||
20: - 0028 IO_RTC_MON0 equ 00101000b
|
||
21: - 0029 IO_RTC_MON1 equ 00101001b
|
||
22: - 002A IO_RTC_YERR0 equ 00101010b
|
||
23: - 002B IO_RTC_YEAR1 equ 00101011b
|
||
24: - 002C IO_RTC_WEEK equ 00101100b
|
||
25: - 002D IO_RTC_CTR_D equ 00101101b
|
||
26: - 002E IO_RTC_CTR_E equ 00101110b
|
||
27: - 002F IO_RTC_CTR_F equ 00101111b
|
||
28:
|
||
29: - 0040 IO_AY0_ADDR equ 01000000b ;64
|
||
30: - 0041 IO_AY0_DATA equ 01000001b ;65
|
||
31: - 0042 IO_AY1_ADDR equ 01000010b ;66
|
||
32: - 0043 IO_AY1_DATA equ 01000011b ;67
|
||
33:
|
||
34: - 0000 START_ROM equ 0x0000
|
||
35: - 0020 IO_REG0 equ 0x20
|
||
36:
|
||
37: - 0081 VDP_REG equ 0x81
|
||
38: - 0080 VDP_MEM equ 0x80
|
||
39:
|
||
40: - 0100 PROG_ROM_START equ 0x0100
|
||
41: - 4000 PROG_MEM_START equ 04000h
|
||
42:
|
||
43:
|
||
44: - 00F5 CS_PIO_BD .EQU 0xF5
|
||
45: - 00F7 CS_PIO_BC .EQU 0xF7
|
||
46: - 00F4 CS_PIO_AD .EQU 0xF4
|
||
47: - 00F6 CS_PIO_AC .EQU 0xF6
|
||
**** main.asm ****
|
||
19:
|
||
20: - 0000 org 0x0000
|
||
21: - 0000 RST_00: ;Hardware Restart
|
||
22: 0+10 0000 31FFFF ld sp, STACK_RAM_TOP
|
||
23: 10+4 0003 F3 di
|
||
24: 14+10 0004 C35000 jp mon_start_init_sound
|
||
25:
|
||
26: - 0008 org 0x0008
|
||
27: - 0008 RST_08 ;Print Char
|
||
28: 24+10 0008 C3C10E jp EXEC_RST_08
|
||
29:
|
||
30: - 0010 org 0x0010
|
||
31: - 0010 RST_10 ;receive char
|
||
32: 34+10 0010 C3C50E jp EXEC_RST_10
|
||
33:
|
||
34: - 0018 org 0x0018
|
||
35: - 0018 RST_18 ;Buffer length
|
||
36: 44+10 0018 C3D10E jp EXEC_RST_18
|
||
37:
|
||
38:
|
||
39: - 001B INT_VEC:
|
||
40: - 0044 org 0x0044
|
||
41: ;DEFW EXEC_INT_VDP
|
||
42:
|
||
43: ;memory var template
|
||
44: - 0044 mon_var_template:
|
||
45: - 4000 phase SYS_RAM_START
|
||
46:
|
||
47: - 4000 var_buffer_len:
|
||
48: - 4000 00 defb 0
|
||
49: - 4001 var_last_char:
|
||
50: - 4001 00 defb 0
|
||
51: - 4002 var_curserx:
|
||
52: - 4002 00 defb 0
|
||
53: - 4003 var_cursery:
|
||
54: - 4003 00 defb 0
|
||
55: - 4004 var_curserstate:
|
||
56: - 4004 00 defb 0
|
||
57: - 4005 var_curseron:
|
||
58: - 4005 00 defb 0
|
||
59: - 4006 var_curserchar:
|
||
60: - 4006 00 defb 0
|
||
61: - 4007 var_curserlastaddr:
|
||
62: - 4007 0000 defw 0
|
||
63: - 4009 var_scratch:
|
||
64: - 4009 ..4018 00 defs 16 ;16 bytes space for scratch vars
|
||
65: - 4019 var_ps2mem:
|
||
66: - 4019 ..4028 00 defs 16 ;16 bytes space for scratch vars
|
||
67: - 4029 var_buffer:
|
||
68: - 4029 00 defb 0 ;var lentgh
|
||
69:
|
||
70: - 006E dephase
|
||
71: - 006E mon_var_template_end:
|
||
72: 54+4 006E 00 nop
|
||
73: ;end memory var template
|
||
74: - 0050 org 0x0050
|
||
75: - 0050 mon_start_init_sound:
|
||
76: ;CALL BTLDR_ENTRY ;call bootloader first
|
||
77: ;ld D,0x08 ; Select register #8
|
||
78: ;ld A,0x00 ; Volume channel A 0
|
||
79: ;call AY0_WRITE_REG
|
||
80: ;ld D,0x09 ; Select register #9
|
||
81: ;ld A,0x00 ; Volume channel B 0
|
||
82: ;call AY0_WRITE_REG
|
||
83: ;ld D,0x0A ; Select register #10
|
||
84: ;ld A,0x00 ; Volume channel C 0
|
||
85: ;call AY0_WRITE_REG
|
||
86:
|
||
87: - 0050 mon_start_init_ctc:
|
||
88:
|
||
89: ; Set CTC Ch2 Interrupt Vector
|
||
90: ;LD A,40h ; it vector defined in bit 73,bit 21 don't care, bit 0 = 0
|
||
91: ;OUT (IO_CTC0_C0),A
|
||
92: ; Init CTC Channel 2
|
||
93: ;LD A,10100111b
|
||
94: ;OUT (IO_CTC0_C2),A
|
||
95: ;LD A,0x34 ; 55Hz ISR
|
||
96: ;LD A,0xFF ; 55Hz ISR
|
||
97: ;OUT (IO_CTC0_C2),A
|
||
98:
|
||
99: ;INIT PIO
|
||
100: 58+7 0050 3ECF LD A,0xCF
|
||
101: 65+11 0052 D3F6 OUT (CS_PIO_AC), A
|
||
102: 76+7 0054 3EF5 LD A,11110101b
|
||
103: 83+11 0056 D3F6 OUT (CS_PIO_AC), A
|
||
104:
|
||
105:
|
||
106: 94+4 0058 AF xor a
|
||
107: ;ld i, a
|
||
108: ;im 2 ;set int mode 2
|
||
109:
|
||
110: 98+13 0059 320440 ld (var_curserstate),a
|
||
111: 111+13 005C 320540 ld (var_curseron),a
|
||
112: 124+7 005F 3E20 ld a, " "
|
||
113: 131+13 0061 320640 ld (var_curserchar),a
|
||
114:
|
||
115:
|
||
116:
|
||
117:
|
||
118: ;ei ; Enable Interrupts
|
||
119:
|
||
120: ;jr mon_start_ram ;skip serial, cause not used atm
|
||
121: - 0064 mon_start_init_serial:
|
||
122: 144+17 0064 CD7B02 call CONSOLE_INIT
|
||
123: ;jp mon_start_complete
|
||
124:
|
||
125: - 0067 mon_start_ram:
|
||
126: 161+10 0067 214400 ld hl,mon_var_template
|
||
127: 171+10 006A 116E00 ld de,mon_var_template_end
|
||
128: 181+10 006D 010040 ld bc,SYS_RAM_START
|
||
129: - 0070 mon_start_ram_loop:
|
||
130: 191+7 0070 7E ld a,(hl) ;copy values
|
||
131: 198+7 0071 02 ld (bc),a
|
||
132: 205+6 0072 23 inc hl
|
||
133: 211+6 0073 03 inc bc
|
||
134: 217+11 0074 E5 push hl ;check if end is reached
|
||
135: 228+15 0075 ED52 sbc hl,de
|
||
136: 243+10 0077 E1 pop hl
|
||
137: 253+10 0078 C27000 jp nz, mon_start_ram_loop
|
||
138: ;template copy done
|
||
139:
|
||
140: - 007B mon_start_complete:
|
||
141:
|
||
142: ;call keyboard_init_io
|
||
143: ;call vdpconsole_init
|
||
144:
|
||
145: ;call print_str
|
||
146:
|
||
147:
|
||
148: ;jp splash_run
|
||
149:
|
||
150: ;jp ps2demo_run
|
||
151: ;call debug_init
|
||
152: ;call vdp_cursor_on
|
||
153: ;jp COLD
|
||
154:
|
||
155: 263+17 007B CDC702 call print_clear
|
||
156: 280+10 007E 21030F ld hl, [STR_Banner_Start]
|
||
157: 290+17 0081 CDBC02 call print_str
|
||
158:
|
||
159: ;halt
|
||
160:
|
||
161: 307+10 0084 114000 LD DE,0x40
|
||
162: 317+17 0087 CDD40E CALL beep
|
||
163:
|
||
164: ;call vdp_cursor_on
|
||
165: 334+17 008A CD9600 call PROMPT_BEGIN
|
||
166:
|
||
167: ;halt CPU if prompt exits
|
||
168: 351+4 008D 76 halt
|
||
169:
|
||
170: ; Misc Functions
|
||
171: - 008E AY0_WRITE_REG:
|
||
172: 355+4 008E 47 LD B,A
|
||
173: 359+4 008F 7A LD A,D
|
||
174: 363+11 0090 D340 OUT (IO_AY0_ADDR),A
|
||
175: 374+4 0092 78 LD A,B
|
||
176: 378+11 0093 D341 OUT (IO_AY0_DATA),A
|
||
177: 389+10 0095 C9 RET
|
||
178:
|
||
179: - 0096 PROMPT_BEGIN:
|
||
180: 399+17 0096 CDCE02 call print_newLine
|
||
181: ;call A_RTS_ON
|
||
182: 416+7 0099 3E3E ld a,'>'
|
||
183: 423+17 009B CDB402 call print_char
|
||
184: 440+4 009E AF xor a ;reset buffer len
|
||
185: 444+13 009F 320040 ld (var_buffer_len),a
|
||
186:
|
||
187: - 00A2 PROMPT_BEGIN_READ_LOOP:
|
||
188: 457+17 00A2 CDF502 call read_char
|
||
189: ;call keybd_read_ascii
|
||
190: 474+10 00A5 CAA200 jp z, PROMPT_BEGIN_READ_LOOP ; wait until char avail
|
||
191: 484+11 00A8 F5 push af
|
||
192: 495+10 00A9 F1 pop af
|
||
193: ; process special ops
|
||
194: 505+7 00AA FE0D cp 13 ; enter
|
||
195: 512+10 00AC CAF900 jp z,PROMPT_BEGIN_READ_PROCESS
|
||
196: 522+7 00AF FE0A cp 10
|
||
197: 529+10 00B1 CAA200 jp z, PROMPT_BEGIN_READ_LOOP; skip LF for file load
|
||
198: 539+7 00B4 FE08 cp 0x08 ; backspace 0x08 VT102 0x7f Putty
|
||
199: 546+10 00B6 CAD300 jp z,PROMPT_BEGIN_READ_BACKSPACE
|
||
200:
|
||
201: 556+11 00B9 F5 push af
|
||
202: ; a contains latest char
|
||
203: 567+10 00BA 212940 ld hl,[var_buffer]
|
||
204: 577+7 00BD 1600 ld d,0
|
||
205: 584+13 00BF 3A0040 ld a,(var_buffer_len)
|
||
206: 597+4 00C2 5F ld e,a
|
||
207: 601+11 00C3 19 add hl,de ;hl now contains pointer to last position in buffer
|
||
208: 612+4 00C4 3C inc a
|
||
209: 616+13 00C5 320040 ld (var_buffer_len),a ;store incremented buffer length
|
||
210:
|
||
211: 629+10 00C8 F1 pop af
|
||
212: 639+7 00C9 77 ld (hl),a
|
||
213: 646+17 00CA CDB402 call print_char
|
||
214: 663+6 00CD 23 inc hl
|
||
215: 669+4 00CE AF xor a ;a = 0
|
||
216: 673+7 00CF 77 ld (hl),a ;always add null termination after last char
|
||
217: 680+10 00D0 C3A200 jp PROMPT_BEGIN_READ_LOOP
|
||
218:
|
||
219: - 00D3 PROMPT_BEGIN_READ_BACKSPACE:
|
||
220: 690+13 00D3 3A0040 ld a,(var_buffer_len)
|
||
221: 703+4 00D6 A7 and a
|
||
222: 707+10 00D7 CAA200 jp z, PROMPT_BEGIN_READ_LOOP ; do not continue if already at char 0
|
||
223: 717+4 00DA 3D dec a ;decrement length
|
||
224: 721+13 00DB 320040 ld (var_buffer_len),a ;and store it
|
||
225: 734+4 00DE 5F ld e,a ;load de with decremented value
|
||
226: 738+7 00DF 1600 ld d,0
|
||
227: 745+10 00E1 212940 ld hl,[var_buffer]
|
||
228: 755+11 00E4 19 add hl,de ;hl now contains pointer to last position in buffer
|
||
229: 766+4 00E5 AF xor a ; store null byte to current location
|
||
230: 770+7 00E6 77 ld (hl),a
|
||
231: ;call print_delete
|
||
232: 777+7 00E7 3E08 ld a, 0x08
|
||
233: 784+17 00E9 CDB402 call print_char
|
||
234: 801+7 00EC 3E20 ld a, 0x20
|
||
235: 808+17 00EE CDB402 call print_char
|
||
236: 825+7 00F1 3E08 ld a, 0x08
|
||
237: 832+17 00F3 CDB402 call print_char
|
||
238: 849+10 00F6 C3A200 jp PROMPT_BEGIN_READ_LOOP
|
||
239:
|
||
240: - 00F9 PROMPT_BEGIN_READ_PROCESS:
|
||
241: ;call print_newLine
|
||
242: ;ld hl,var_buffer
|
||
243: ;call print_str
|
||
244:
|
||
245: 859+13 00F9 3A2940 ld a,([var_buffer])
|
||
246: 872+7 00FC FE24 cp '$' ;jump to addr
|
||
247: 879+10 00FE CA2C01 jp z, CMD_EXEC
|
||
248: 889+7 0101 FE3F cp '?' ;print hexdump
|
||
249: 896+10 0103 CA4B01 jp z, CMD_VIEW
|
||
250: 906+7 0106 FE21 cp '!' ;set memory
|
||
251: 913+10 0108 CAB501 jp z, CMD_SET
|
||
252: 923+7 010B FE69 cp 'i' ;in IO
|
||
253: 930+10 010D CA1A02 jp z, CMD_IO_READ
|
||
254: 940+7 0110 FE6F cp 'o' ;out IO
|
||
255: 947+10 0112 CAF101 jp z, CMD_IO_WRITE
|
||
256: 957+7 0115 FE64 cp 'd' ;disassemble
|
||
257: 964+10 0117 CA3602 jp z, CMD_DASM
|
||
258: 974+7 011A FE78 cp 'x' ;start xmodem
|
||
259: 981+10 011C CA4F0F jp z, xmodem_init
|
||
260:
|
||
261:
|
||
262: 991+17 011F CDCE02 call print_newLine
|
||
263: 1008+10 0122 212E0F ld hl, [STR_Unknown]
|
||
264: 1018+17 0125 CDBC02 call print_str
|
||
265: 1035+10 0128 C39600 jp PROMPT_BEGIN
|
||
266:
|
||
267: 1045+10 012B C9 ret
|
||
268:
|
||
269: - 012C CMD_EXEC:
|
||
270: 1055+4 012C AF xor a ;write null byte to buffer pos 0 to prevent reexecute the last command
|
||
271: 1059+13 012D 322940 ld (var_buffer),a
|
||
272:
|
||
273: 1072+10 0130 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
274: 1082+17 0133 CD2103 call DHEX_TO_BYTE
|
||
275: 1099+4 0136 47 ld b,a ;store result in b
|
||
276: 1103+4 0137 7B ld a,e ;check for error
|
||
277: 1107+4 0138 A7 and a
|
||
278: 1111+10 0139 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
279:
|
||
280: 1121+10 013C 212C40 ld hl,var_buffer+3 ;load 2nd byte
|
||
281: 1131+17 013F CD2103 call DHEX_TO_BYTE
|
||
282: 1148+4 0142 4F ld c,a
|
||
283: 1152+4 0143 7B ld a,e ;check for error
|
||
284: 1156+4 0144 A7 and a
|
||
285: 1160+10 0145 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
286:
|
||
287: 1170+4 0148 60 ld h,b
|
||
288: 1174+4 0149 69 ld l,c
|
||
289: 1178+4 014A E9 jp (hl)
|
||
290:
|
||
291: - 014B CMD_VIEW:
|
||
292: 1182+17 014B CDCE02 call print_newLine
|
||
293: 1199+10 014E 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
294: 1209+17 0151 CD2103 call DHEX_TO_BYTE
|
||
295: 1226+4 0154 47 ld b,a ;store result in b
|
||
296: 1230+4 0155 7B ld a,e ;check for error
|
||
297: 1234+4 0156 A7 and a
|
||
298: 1238+10 0157 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
299:
|
||
300: 1248+10 015A 212C40 ld hl,var_buffer+3 ;load 2nd byte
|
||
301: 1258+17 015D CD2103 call DHEX_TO_BYTE
|
||
302: 1275+4 0160 4F ld c,a
|
||
303: 1279+4 0161 7B ld a,e ;check for error
|
||
304: 1283+4 0162 A7 and a
|
||
305: 1287+10 0163 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
306:
|
||
307:
|
||
308: 1297+13 0166 3A2E40 ld a,(var_buffer+5)
|
||
309: 1310+7 0169 FE20 cp ' '
|
||
310: 1317+10 016B C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
311:
|
||
312: 1327+10 016E 212F40 ld hl,var_buffer+6 ;load length
|
||
313: 1337+17 0171 CD2103 call DHEX_TO_BYTE
|
||
314: 1354+11 0174 F5 push af
|
||
315: 1365+4 0175 7B ld a,e ;check for error
|
||
316: 1369+4 0176 A7 and a
|
||
317: 1373+10 0177 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
318:
|
||
319: ;draw header
|
||
320: 1383+10 017A 21330F ld hl,[STR_HEXDUMP_HEADER]
|
||
321: 1393+17 017D CDBC02 call print_str
|
||
322:
|
||
323: 1410+10 0180 F1 pop af
|
||
324: ;loading vars done. display results
|
||
325: 1420+4 0181 60 ld h, b ;pointer to current byte
|
||
326: 1424+4 0182 69 ld l, c ;pointer to current byte
|
||
327: 1428+4 0183 47 ld b, a ;bytes counter
|
||
328:
|
||
329: ;draw row
|
||
330: - 0184 CMD_VIEW_ROW:
|
||
331: 1432+17 0184 CDCE02 call print_newLine
|
||
332: 1449+4 0187 7C ld a,h ;print start
|
||
333: 1453+17 0188 CDE402 call print_a_hex
|
||
334: 1470+4 018B 7D ld a,l
|
||
335: 1474+17 018C CDE402 call print_a_hex
|
||
336: 1491+7 018F 3E20 ld a, ' '
|
||
337: 1498+17 0191 CDB402 call print_char
|
||
338: 1515+7 0194 0E08 ld c, 8 ;column counter
|
||
339: - 0196 CMD_VIEW_ROW_LOOP:
|
||
340: 1522+7 0196 7E ld a,(hl)
|
||
341: 1529+17 0197 CDE402 call print_a_hex
|
||
342:
|
||
343: 1546+6 019A 23 inc hl ;increment pointer
|
||
344: 1552+4 019B 05 dec b ;decrement byte counter
|
||
345: 1556+4 019C 0D dec c ;decrement column counter
|
||
346:
|
||
347: 1560+4 019D 78 ld a,b
|
||
348: 1564+4 019E A7 and a
|
||
349: 1568+10 019F CAAF01 jp z,CMD_VIEW_END ;if byte counter = 0 -> end reached
|
||
350:
|
||
351: 1578+4 01A2 79 ld a,c
|
||
352: 1582+4 01A3 A7 and a
|
||
353: 1586+10 01A4 CA8401 jp z,CMD_VIEW_ROW ;else if column counter = 0 -> 16 chars printed. next row
|
||
354:
|
||
355: 1596+7 01A7 3E20 ld a, ' '
|
||
356: 1603+17 01A9 CDB402 call print_char
|
||
357: 1620+10 01AC C39601 jp CMD_VIEW_ROW_LOOP ;else
|
||
358: - 01AF CMD_VIEW_END:
|
||
359: 1630+17 01AF CDCE02 call print_newLine
|
||
360: 1647+10 01B2 C39600 jp PROMPT_BEGIN
|
||
361:
|
||
362: - 01B5 CMD_SET:
|
||
363: 1657+10 01B5 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
364: 1667+17 01B8 CD2103 call DHEX_TO_BYTE
|
||
365: 1684+4 01BB 47 ld b,a ;store result in b
|
||
366: 1688+4 01BC 7B ld a,e ;check for error
|
||
367: 1692+4 01BD A7 and a
|
||
368: 1696+10 01BE C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
369:
|
||
370: 1706+10 01C1 212C40 ld hl,var_buffer+3 ;load 2nd byte
|
||
371: 1716+17 01C4 CD2103 call DHEX_TO_BYTE
|
||
372: 1733+4 01C7 4F ld c,a
|
||
373: 1737+4 01C8 7B ld a,e ;check for error
|
||
374: 1741+4 01C9 A7 and a
|
||
375: 1745+10 01CA C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
376: ;bc now contains the start address
|
||
377:
|
||
378: 1755+10 01CD 212E40 ld hl,var_buffer+5
|
||
379: - 01D0 CMD_SET_LOOP:
|
||
380: 1765+7 01D0 7E ld a,(hl)
|
||
381: 1772+7 01D1 FE00 cp 0 ;if 0 then end
|
||
382: 1779+10 01D3 CAEB01 jp z, CMD_SET_END
|
||
383: 1789+7 01D6 FE20 cp ' '
|
||
384: 1796+10 01D8 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
385: 1806+6 01DB 23 inc hl ;next byte
|
||
386: 1812+17 01DC CD2103 call DHEX_TO_BYTE
|
||
387: 1829+7 01DF 02 ld (bc),a ;load byte to
|
||
388: 1836+4 01E0 7B ld a,e
|
||
389: 1840+4 01E1 A7 and a
|
||
390: 1844+10 01E2 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
391: 1854+6 01E5 03 inc bc
|
||
392: 1860+6 01E6 23 inc hl
|
||
393: 1866+6 01E7 23 inc hl
|
||
394: 1872+10 01E8 C3D001 jp CMD_SET_LOOP
|
||
395: - 01EB CMD_SET_END:
|
||
396: 1882+17 01EB CDCE02 call print_newLine
|
||
397: 1899+10 01EE C39600 jp PROMPT_BEGIN
|
||
398:
|
||
399:
|
||
400: - 01F1 CMD_IO_WRITE:
|
||
401: 1909+10 01F1 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
402: 1919+17 01F4 CD2103 call DHEX_TO_BYTE
|
||
403: 1936+4 01F7 4F ld c,a ;store result in b
|
||
404: 1940+4 01F8 7B ld a,e ;check for error
|
||
405: 1944+4 01F9 A7 and a
|
||
406: 1948+10 01FA C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
407:
|
||
408: 1958+13 01FD 3A2C40 ld a,(var_buffer+3)
|
||
409: 1971+7 0200 FE20 cp ' '
|
||
410: 1978+10 0202 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
411:
|
||
412: 1988+10 0205 212D40 ld hl,var_buffer+4 ;load 1st byte
|
||
413: 1998+17 0208 CD2103 call DHEX_TO_BYTE
|
||
414: 2015+11 020B F5 push af
|
||
415: 2026+4 020C 7B ld a,e ;check for error
|
||
416: 2030+4 020D A7 and a
|
||
417: 2034+10 020E C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
418:
|
||
419: 2044+10 0211 F1 pop af
|
||
420: 2054+12 0212 ED79 out (c),a
|
||
421: 2066+17 0214 CDCE02 call print_newLine
|
||
422: 2083+10 0217 C39600 jp PROMPT_BEGIN
|
||
423:
|
||
424: - 021A CMD_IO_READ:
|
||
425: 2093+10 021A 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
426: 2103+17 021D CD2103 call DHEX_TO_BYTE
|
||
427: 2120+4 0220 4F ld c,a ;store result in b
|
||
428: 2124+4 0221 7B ld a,e ;check for error
|
||
429: 2128+4 0222 A7 and a
|
||
430: 2132+10 0223 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
431:
|
||
432: 2142+12 0226 ED78 in a,(c)
|
||
433: 2154+11 0228 F5 push af
|
||
434: 2165+17 0229 CDCE02 call print_newLine
|
||
435: 2182+10 022C F1 pop af
|
||
436: 2192+17 022D CDE402 call print_a_hex
|
||
437: 2209+17 0230 CDCE02 call print_newLine
|
||
438: 2226+10 0233 C39600 jp PROMPT_BEGIN
|
||
439:
|
||
440: - 0236 CMD_DASM:
|
||
441: 2236+17 0236 CDCE02 call print_newLine
|
||
442: 2253+10 0239 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
443: 2263+17 023C CD2103 call DHEX_TO_BYTE
|
||
444: 2280+4 023F 47 ld b,a ;store result in b
|
||
445: 2284+4 0240 7B ld a,e ;check for error
|
||
446: 2288+4 0241 A7 and a
|
||
447: 2292+10 0242 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
448:
|
||
449: 2302+10 0245 212C40 ld hl,var_buffer+3 ;load 2nd byte
|
||
450: 2312+17 0248 CD2103 call DHEX_TO_BYTE
|
||
451: 2329+4 024B 4F ld c,a
|
||
452: 2333+4 024C 7B ld a,e ;check for error
|
||
453: 2337+4 024D A7 and a
|
||
454: 2341+10 024E C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
455:
|
||
456:
|
||
457: 2351+13 0251 3A2E40 ld a,(var_buffer+5)
|
||
458: 2364+7 0254 FE20 cp ' '
|
||
459: 2371+10 0256 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
460:
|
||
461: 2381+10 0259 212F40 ld hl,var_buffer+6 ;load length
|
||
462: 2391+17 025C CD2103 call DHEX_TO_BYTE
|
||
463: 2408+11 025F F5 push af
|
||
464: 2419+4 0260 7B ld a,e ;check for error
|
||
465: 2423+4 0261 A7 and a
|
||
466: 2427+10 0262 C26F02 jp nz, CMD_SYNTAX_ERROR
|
||
467:
|
||
468: 2437+4 0265 60 ld h,b
|
||
469: 2441+4 0266 69 ld l,c
|
||
470:
|
||
471: 2445+10 0267 F1 pop af ;restore af
|
||
472: 2455+4 0268 47 ld b,a
|
||
473:
|
||
474: 2459+17 0269 CD7203 call disassemble
|
||
475:
|
||
476:
|
||
477: 2476+10 026C C39600 jp PROMPT_BEGIN
|
||
478:
|
||
479: - 026F CMD_SYNTAX_ERROR:
|
||
480: 2486+17 026F CDCE02 call print_newLine
|
||
481: 2503+10 0272 21290F ld hl, [STR_SyntaxError]
|
||
482: 2513+17 0275 CDBC02 call print_str
|
||
483: 2530+10 0278 C39600 jp PROMPT_BEGIN
|
||
484:
|
||
485:
|
||
486:
|
||
487: - 027B Includes:
|
||
488: ;.include "bootldr.s"
|
||
489: .include "console.s"
|
||
**** include/console.s ****
|
||
1: ;DIP SWICTHES
|
||
2: ;1843200 CLK / x16 SIO CLOCK MODE = 115200
|
||
3: ;MAX BAUD RATE = 115200
|
||
4: ;DIP VALUE = 115200/<BAUD>
|
||
5: ;
|
||
6: ;9600 -> 12 / 00110000
|
||
7: ;
|
||
8:
|
||
9: - 027B CONSOLE_INIT:
|
||
10: - 027B CONSOLE_INIT_CTC:
|
||
11: ;LD A,00001111b ; Set /16 Divider, CPU Trigger, Time COnstant Follows
|
||
12: 2540+7 027B 3E4F LD A,01001111b ; External Trigger, Time COnstant Follows
|
||
13: 2547+11 027D D304 OUT (CS_CTC_0),A
|
||
14: 2558+11 027F DB01 IN A,(CS_DIP) ; Read BAUD from DIP-Switches
|
||
15: ;LD A,39
|
||
16: 2569+11 0281 D304 OUT (CS_CTC_0),A
|
||
17: - 0283 CONSOLE_INIT_SIO:
|
||
18: 2580+7 0283 3E30 LD A,00110000b ;write into WR0: error reset, select WR0
|
||
19: 2587+11 0285 D309 OUT (CS_SIO_A_C),A
|
||
20: 2598+7 0287 3E18 LD a,018h ;write into WR0: channel reset
|
||
21: 2605+11 0289 D309 OUT (CS_SIO_A_C),A
|
||
22: 2616+7 028B 3E04 LD a,004h ;write into WR0: select WR4
|
||
23: 2623+11 028D D309 OUT (CS_SIO_A_C),A
|
||
24: 2634+7 028F 3E44 LD a,01000100b ;write into WR4: clkx16,1 stop bit, no parity
|
||
25: 2641+11 0291 D309 OUT (CS_SIO_A_C),A
|
||
26: 2652+7 0293 3E05 LD a,005h ;write into WR0: select WR5
|
||
27: 2659+11 0295 D309 OUT (CS_SIO_A_C),A
|
||
28: 2670+7 0297 3EE8 LD a,11101000b ;DTR inactive, TX 8bit, BREAK off, TX on, RTS inactive
|
||
29: 2677+11 0299 D309 OUT (CS_SIO_A_C),A
|
||
30: 2688+7 029B 3E01 LD a,01h ;write into WR0: select WR1
|
||
31: 2695+11 029D D309 OUT (CS_SIO_A_C),A
|
||
32: 2706+7 029F 3E04 LD a,00000100b ;no interrupt in CH B, special RX condition affects vect
|
||
33: 2713+11 02A1 D309 OUT (CS_SIO_A_C),A
|
||
34: 2724+7 02A3 3E02 LD a,02h ;write into WR0: select WR2
|
||
35: 2731+11 02A5 D309 OUT (CS_SIO_A_C),A
|
||
36: 2742+7 02A7 3E00 LD a,0h ;write into WR2: cmd line int vect (see int vec table)
|
||
37: ;bits D3,D2,D1 are changed according to RX condition
|
||
38: 2749+11 02A9 D309 OUT (CS_SIO_A_C),A
|
||
39: 2760+7 02AB 3E03 LD a,003h ;write into WR0: select WR3
|
||
40: 2767+11 02AD D309 OUT (CS_SIO_A_C),A
|
||
41: 2778+7 02AF 3EC1 LD a,0C1h ;RX 8bit, auto enable off, RX on
|
||
42: 2785+11 02B1 D309 OUT (CS_SIO_A_C),A
|
||
43: ;Channel A RX active
|
||
44: 2796+10 02B3 C9 RET
|
||
45:
|
||
46: ; A contains char
|
||
47: ; Destroys A
|
||
48: - 02B4 print_char:
|
||
49: 2806+11 02B4 F5 push af
|
||
50: 2817+11 02B5 D308 out (CS_SIO_A_D),a
|
||
51: 2828+17 02B7 CDD902 call print_wait_out
|
||
52: 2845+10 02BA F1 pop af
|
||
53: ;call print_char
|
||
54: 2855+10 02BB C9 ret
|
||
55: ; HL contains pointer to string
|
||
56: ; Destroy A, HL
|
||
57:
|
||
58: - 02BC print_str:
|
||
59: 2865+7 02BC 7E ld a, (hl)
|
||
60: 2872+4 02BD B7 or a
|
||
61: 2876+7+5 02BE 2806 jr z,print_str_end
|
||
62: 2883+17 02C0 CDB402 call print_char
|
||
63: 2900+6 02C3 23 inc hl
|
||
64: 2906+12 02C4 18F6 jr print_str
|
||
65: - 02C6 print_str_end:
|
||
66: 2918+10 02C6 C9 ret
|
||
67:
|
||
68: - 02C7 print_clear:
|
||
69: 2928+10 02C7 210703 ld hl, [MSG_CLEAR]
|
||
70: 2938+17 02CA CDBC02 call print_str
|
||
71: 2955+10 02CD C9 ret
|
||
72:
|
||
73: - 02CE print_newLine:
|
||
74: 2965+7 02CE 3E0A ld a,10
|
||
75: 2972+17 02D0 CDB402 call print_char
|
||
76: 2989+7 02D3 3E0D ld a,13
|
||
77: 2996+17 02D5 CDB402 call print_char
|
||
78: 3013+10 02D8 C9 ret
|
||
79: ; destroys a
|
||
80: - 02D9 print_wait_out:
|
||
81: ; check for TX buffer empty
|
||
82: 3023+4 02D9 97 sub a ;clear a, write into WR0: select RR0
|
||
83: 3027+4 02DA 3C inc a ;select RR1
|
||
84: 3031+11 02DB D309 out (CS_SIO_A_C),A
|
||
85: 3042+11 02DD DB09 in A,(CS_SIO_A_C) ;read RRx
|
||
86: 3053+8 02DF CB47 bit 0,A
|
||
87: 3061+7+5 02E1 28F6 jr z,print_wait_out
|
||
88: 3068+10 02E3 C9 ret
|
||
89:
|
||
90: - 02E4 print_a_hex:
|
||
91: 3078+11 02E4 F5 push af
|
||
92: 3089+11 02E5 C5 push bc
|
||
93: 3100+11 02E6 D5 push de
|
||
94: 3111+17 02E7 CD5803 call STRCONV_BYTES_TO_HEX
|
||
95: 3128+4 02EA 78 ld a,b
|
||
96: 3132+17 02EB CDB402 call print_char
|
||
97: 3149+4 02EE 79 ld a,c
|
||
98: 3153+17 02EF CDB402 call print_char
|
||
99: 3170+10 02F2 D1 pop de
|
||
100: 3180+10 02F3 C1 pop bc
|
||
101: 3190+10 02F4 F1 pop af
|
||
102:
|
||
103: - 02F5 read_char:
|
||
104: 3200+17 02F5 CD1803 call A_RTS_ON
|
||
105: 3217+4 02F8 00 nop
|
||
106: 3221+4 02F9 AF xor a ; a = 0
|
||
107: 3225+11 02FA D309 out (CS_SIO_A_C), a ; select reg 0
|
||
108: 3236+11 02FC DB09 in a, (CS_SIO_A_C) ; read reg 0
|
||
109: 3247+7 02FE E601 and 1 ; mask D0 (recieve char available)
|
||
110: 3254+17 0300 CD0F03 call A_RTS_OFF
|
||
111: 3271+5+6 0303 C8 ret Z ; return 0 if no char
|
||
112: 3276+11 0304 DB08 in a, (CS_SIO_A_D) ; read char if avail
|
||
113: 3287+10 0306 C9 ret ; return
|
||
114:
|
||
115: ;MSG_CRSR_0:
|
||
116: ; db 0x1B, "[?25h",0
|
||
117: ;MSG_CRSR_1:
|
||
118: ; db 0x1B, "[?25l",0
|
||
119: - 0307 MSG_CLEAR:
|
||
120: - 0307 1B5B324A db 27, '[2J', 27, '[H',0
|
||
1B5B4800
|
||
121:
|
||
122:
|
||
123:
|
||
124: ; Serial Util Functions
|
||
125: - 030F A_RTS_OFF:
|
||
126: 3297+7 030F 3E05 ld a,005h ;write into WR0: select WR5
|
||
127: 3304+11 0311 D309 out (CS_SIO_A_C),A
|
||
128: 3315+7 0313 3E68 ld a,068h ;DTR inactive, TX 8bit, BREAK off, TX on, RTS inactive
|
||
129: 3322+11 0315 D309 out (CS_SIO_A_C),A
|
||
130: 3333+10 0317 C9 ret
|
||
131: - 0318 A_RTS_ON:
|
||
132: 3343+7 0318 3E05 ld a,005h ;write into WR0: select WR5
|
||
133: 3350+11 031A D309 out (CS_SIO_A_C),A
|
||
134: 3361+7 031C 3EEA ld a,0EAh ;DTR active, TX 8bit, BREAK off, TX on, RTS active
|
||
135: 3368+11 031E D309 out (CS_SIO_A_C),A
|
||
**** main.asm ****
|
||
490: 3379+10 0320 C9 ret
|
||
491: .include "conversions.s"
|
||
**** include/conversions.s ****
|
||
1: ; HL Contains Address to string
|
||
2: ; E is 0xFF if error
|
||
3: ; E is 0x00 if okay
|
||
4: ; A returns byte
|
||
5: ; A,DE are destroyed
|
||
6: - 0321 DHEX_TO_BYTE:
|
||
7: 3389+11 0321 E5 PUSH HL ;Backup pointer
|
||
8: ; Load First Byte
|
||
9: 3400+7 0322 7E LD A,(HL) ;Load first char (high)
|
||
10: 3407+17 0323 CD4103 CALL HEX_TO_BIN ;Conv chart to 4bit
|
||
11: 3424+7+5 0326 3815 jr C, DHEX_TO_BYTE_FAILED ;If error jmp to DHEX_TO_BYTE_FAILED
|
||
12: 3431+8 0328 CB27 SLA A ;shift result to upper 4 bits
|
||
13: 3439+8 032A CB27 SLA A
|
||
14: 3447+8 032C CB27 SLA A
|
||
15: 3455+8 032E CB27 SLA A
|
||
16: 3463+4 0330 57 LD D,A ;store result in D
|
||
17:
|
||
18: 3467+6 0331 23 INC HL ;next byte
|
||
19: 3473+7 0332 7E LD A,(HL) ;load 2nd char (lower)
|
||
20: 3480+17 0333 CD4103 CALL HEX_TO_BIN ;Conv chart to 4bit
|
||
21: 3497+7+5 0336 3805 jr C, DHEX_TO_BYTE_FAILED ;If error jmp to DHEX_TO_BYTE_FAILED
|
||
22: 3504+4 0338 B2 OR D ;merge D with accumulator
|
||
23:
|
||
24: 3508+10 0339 E1 POP HL ;restor original pointer
|
||
25: 3518+7 033A 1E00 LD E,0x00 ;set error to 0x00 = no error
|
||
26: 3525+10 033C C9 RET
|
||
27: - 033D DHEX_TO_BYTE_FAILED:
|
||
28: 3535+7 033D 1EFF LD E,0xFF ;set error to oxFF
|
||
29: ;LD A,0x00
|
||
30: 3542+10 033F E1 POP HL
|
||
31: 3552+10 0340 C9 RET
|
||
32:
|
||
33: ; REG A Contains CHAR-Low
|
||
34: ; If failed, Carry is set
|
||
35: - 0341 HEX_TO_BIN:
|
||
36: 3562+7 0341 D630 SUB 48 ; 0 is 0
|
||
37: 3569+10 0343 EA5603 jp PE, HEX_TO_INVALID_2; to low (SUB overflow)
|
||
38: 3579+7 0346 FE0A CP 10 ; Value is between 0 and 9
|
||
39: 3586+7+5 0348 3805 JR C, HEX_TO_BIN_2
|
||
40: 3593+7 034A D607 SUB 7
|
||
41: 3600+10 034C EA5603 jp PE, HEX_TO_INVALID_2; to low (SUB overflow)
|
||
42: - 034F HEX_TO_BIN_2:
|
||
43: 3610+7 034F FE10 CP 16
|
||
44: 3617+7+5 0351 3003 JR NC, HEX_TO_INVALID_2; if bigger than 15-> fail
|
||
45: 3624+7 0353 E60F AND 0x0F
|
||
46: 3631+10 0355 C9 RET
|
||
47: - 0356 HEX_TO_INVALID_2:
|
||
48: 3641+4 0356 37 SCF ;set carry flag
|
||
49: 3645+10 0357 C9 RET
|
||
50:
|
||
51:
|
||
52: ;*****************
|
||
53: ; Convert Byte to Hex Char (ASCII)
|
||
54: ;*****************
|
||
55: ;Description: the StrLength function inline
|
||
56: ;
|
||
57: ;Inputs: A contains input byte
|
||
58: ;
|
||
59: ;Outputs: BC contains 2 Bytes of ASCII (HEX)
|
||
60: ;
|
||
61: ;Destroys: A, BC,
|
||
62: - 0358 STRCONV_BYTES_TO_HEX:
|
||
63: 3655+11 0358 F5 PUSH AF;Backup A Register
|
||
64: 3666+4 0359 1F RRA
|
||
65: 3670+4 035A 1F RRA
|
||
66: 3674+4 035B 1F RRA
|
||
67: 3678+4 035C 1F RRA
|
||
68: 3682+17 035D CD6703 CALL STRCONV_BYTES_TO_HEX_1
|
||
69: ;LD A,D
|
||
70: 3699+4 0360 47 LD B,A
|
||
71: 3703+10 0361 F1 POP AF ; Reload first Byte
|
||
72: 3713+17 0362 CD6703 CALL STRCONV_BYTES_TO_HEX_1
|
||
73: ;LD A,D
|
||
74: 3730+4 0365 4F LD C,A
|
||
75: 3734+10 0366 C9 RET
|
||
76:
|
||
77: - 0367 STRCONV_BYTES_TO_HEX_1:
|
||
78: 3744+7 0367 E60F AND 0x0F
|
||
79: 3751+7 0369 C630 ADD 48
|
||
80: 3758+7 036B FE3A CP 58 ; Check if less than 58 (less than ASCII 9)
|
||
81: ;JR C, STRCONV_BYTES_TO_HEX_2
|
||
82: 3765+5+6 036D D8 RET C
|
||
83: 3770+7 036E C607 ADD 7 ; A-F
|
||
84: 3777+10 0370 C9 RET
|
||
85: - 0371 STRCONV_BYTES_TO_HEX_2:
|
||
86: ;LD D,A
|
||
87: 3787+10 0371 C9 RET
|
||
88:
|
||
89:
|
||
**** main.asm ****
|
||
492: ;.include "basic.s"
|
||
493: .include "disassembler.s"
|
||
**** include/disassembler.s ****
|
||
1: - 4110 var_opcode_start equ PRG_RAM_START ;16 bit pointer to opcode in mem
|
||
2: - 4112 var_opcode_table equ PRG_RAM_START+2 ;16 bit pointer to opcode in table
|
||
3: - 4114 var_opcode equ PRG_RAM_START+4 ;8 bit opcode value
|
||
4: - 4115 var_opcode_x equ PRG_RAM_START+5 ;8 bit opcode extension value
|
||
5: - 4116 var_opcode_length equ PRG_RAM_START+6 ;8 bit opcode length (in bytes)
|
||
6: - 4117 var_opcode_string equ PRG_RAM_START+7 ;16 bit pointer to opcode string
|
||
7: - 4119 var_opcode_pcount equ PRG_RAM_START+9 ;8 bit opcode param count
|
||
8: - 411A var_bytes_count equ PRG_RAM_START+10 ;bytes to examine
|
||
9: ; HL contains start address
|
||
10: ; B contains length
|
||
11: - 0372 disassemble:
|
||
12: 3797+4 0372 78 ld a,b
|
||
13: 3801+13 0373 321A41 ld (var_bytes_count),a
|
||
14: - 0376 disassemble_next:
|
||
15:
|
||
16:
|
||
17: 3814+16 0376 221041 ld (var_opcode_start), hl ;16 bit pointer to opcode in mem
|
||
18: 3830+7 0379 7E ld a,(hl) ;load opcode to find in A
|
||
19: 3837+13 037A 321441 ld (var_opcode), a ;8 bit opcode value
|
||
20: 3850+6 037D 23 inc hl
|
||
21: 3856+7 037E 7E ld a,(hl) ;load opcode to find in A
|
||
22: 3863+13 037F 321541 ld (var_opcode_x), a ;8 bit opcode extended value
|
||
23: 3876+6 0382 2B dec hl
|
||
24: 3882+17 0383 CD6604 call disassemble_table_seek
|
||
25: 3899+4 0386 78 ld a,b
|
||
26: 3903+4 0387 B1 or c
|
||
27: 3907+10 0388 CA4804 jp z, disassemble_err ;if bc==0000h
|
||
28:
|
||
29: 3917+20 038B ED431241 ld (var_opcode_table), bc ;16 bit pointer to opcode in table
|
||
30:
|
||
31: ;load params
|
||
32: 3937+6 038F 03 inc bc
|
||
33: 3943+6 0390 03 inc bc
|
||
34: 3949+6 0391 03 inc bc
|
||
35: 3955+6 0392 03 inc bc
|
||
36: 3961+7 0393 0A ld a,(bc)
|
||
37: 3968+13 0394 321641 ld (var_opcode_length),A ;8 bit opcode length (in bytes)
|
||
38: 3981+6 0397 03 inc bc
|
||
39: 3987+7 0398 0A ld a, (bc)
|
||
40: 3994+4 0399 5F ld e,a
|
||
41: 3998+6 039A 03 inc bc
|
||
42: 4004+7 039B 0A ld a, (bc)
|
||
43: 4011+4 039C 57 ld d,a
|
||
44: 4015+20 039D ED531741 ld (var_opcode_string),de ;16 bit pointer to opcode string
|
||
45: 4035+6 03A1 03 inc bc
|
||
46: 4041+7 03A2 0A ld a,(bc)
|
||
47: 4048+13 03A3 321941 ld (var_opcode_pcount),A ;8 bit opcode param count
|
||
48:
|
||
49: ;values are prepared. Continue with print
|
||
50:
|
||
51: 4061+16 03A6 2A1041 ld hl,(var_opcode_start) ;print address
|
||
52: 4077+17 03A9 CDAE04 call dasm_print16hex_addr
|
||
53:
|
||
54: 4094+13 03AC 3A1641 ld a,(var_opcode_length)
|
||
55: 4107+4 03AF 47 ld b, a
|
||
56:
|
||
57: ;print up to 4 opcode bytes
|
||
58: 4111+16 03B0 2A1041 ld hl,(var_opcode_start)
|
||
59:
|
||
60: - 03B3 disassemble_print_opcode_raw
|
||
61: 4127+7 03B3 7E ld a,(hl) ;load first byte
|
||
62: 4134+17 03B4 CDE402 call print_a_hex
|
||
63: 4151+6 03B7 23 inc hl
|
||
64: 4157+8+5 03B8 10F9 djnz disassemble_print_opcode_raw
|
||
65:
|
||
66: 4165+7 03BA 3E68 ld a,"h"
|
||
67: 4172+17 03BC CDB402 call print_char
|
||
68: ;fill empty spots
|
||
69: 4189+13 03BF 3A1641 ld a,(var_opcode_length)
|
||
70: 4202+4 03C2 47 ld b,a
|
||
71: 4206+7 03C3 3E06 ld a,6
|
||
72: 4213+4 03C5 90 sub b
|
||
73: 4217+4 03C6 47 ld b,a
|
||
74:
|
||
75: - 03C7 disassemble_print_opcode_raw_fill:
|
||
76: 4221+7 03C7 3E20 ld a," "
|
||
77: 4228+17 03C9 CDB402 call print_char
|
||
78: 4245+7 03CC 3E20 ld a," "
|
||
79: 4252+17 03CE CDB402 call print_char
|
||
80: 4269+8+5 03D1 10F4 djnz disassemble_print_opcode_raw_fill
|
||
81: 4277+7 03D3 3E20 ld a," "
|
||
82: 4284+17 03D5 CDB402 call print_char
|
||
83:
|
||
84: 4301+11 03D8 E5 push hl
|
||
85: ;print opcode
|
||
86: 4312+16 03D9 2A1741 ld hl,(var_opcode_string)
|
||
87: 4328+17 03DC CDBC02 call print_str
|
||
88:
|
||
89:
|
||
90: ;print params
|
||
91: 4345+13 03DF 3A1941 ld a,(var_opcode_pcount)
|
||
92: 4358+4 03E2 B7 or a
|
||
93: 4362+10 03E3 CA4504 jp z, disassemble_print_opcode_params_end ;skip if no params
|
||
94:
|
||
95: 4372+16 03E6 2A1241 ld hl,(var_opcode_table)
|
||
96: 4388+10 03E9 010800 ld bc, 8
|
||
97: 4398+11 03EC 09 add hl,bc ;hl now has address of first param
|
||
98: 4409+13 03ED 3A1941 ld a,(var_opcode_pcount)
|
||
99: 4422+4 03F0 47 ld b,a
|
||
100: - 03F1 disassemble_print_opcode_params_loop:
|
||
101: ;ld a,(hl) ;load param
|
||
102: ;call print_a_hex
|
||
103: 4426+7 03F1 7E ld a,(hl) ;load param
|
||
104:
|
||
105: 4433+7 03F2 FE01 cp 0x01
|
||
106: 4440+10+7 03F4 CCD404 call z, param_01
|
||
107: 4450+7 03F7 FE02 cp 0x02
|
||
108: 4457+10+7 03F9 CCFB04 call z, param_02
|
||
109: 4467+7 03FC FE03 cp 0x03
|
||
110: 4474+10+7 03FE CC1805 call z, param_03
|
||
111: 4484+7 0401 FE04 cp 0x04
|
||
112: 4491+10+7 0403 CC5405 call z, param_04
|
||
113: 4501+7 0406 FE05 cp 0x05
|
||
114: 4508+10+7 0408 CC6A05 call z, param_05
|
||
115: 4518+7 040B FE06 cp 0x06
|
||
116: 4525+10+7 040D CC7705 call z, param_06
|
||
117: 4535+7 0410 FE07 cp 0x07
|
||
118: 4542+10+7 0412 CC9105 call z, param_07
|
||
119: 4552+7 0415 FE08 cp 0x08
|
||
120: 4559+10+7 0417 CC9E05 call z, param_08
|
||
121: 4569+7 041A FE09 cp 0x09
|
||
122: 4576+10+7 041C CCB305 call z, param_09
|
||
123: 4586+7 041F FE10 cp 0x10
|
||
124: 4593+10+7 0421 CCC805 call z, param_10
|
||
125: 4603+7 0424 FE11 cp 0x11
|
||
126: 4610+10+7 0426 CCD805 call z, param_11
|
||
127: 4620+7 0429 FE12 cp 0x12
|
||
128: 4627+10+7 042B CCE005 call z, param_12
|
||
129: 4637+7 042E FE13 cp 0x13
|
||
130: 4644+10+7 0430 CC1806 call z, param_13
|
||
131: 4654+7 0433 FE0A cp 0x0A
|
||
132: 4661+10+7 0435 CCAA05 call z, param_0A
|
||
133: ;strings
|
||
134: 4671+7 0438 FE80 cp 0x80
|
||
135: 4678+10+7 043A CC3706 call z, param_80
|
||
136: 4688+7 043D FE81 cp 0x81
|
||
137: 4695+10+7 043F CC2E06 call z, param_81
|
||
138: 4705+6 0442 23 inc hl
|
||
139: 4711+8+5 0443 10AC djnz disassemble_print_opcode_params_loop
|
||
140: - 0445 disassemble_print_opcode_params_end:
|
||
141: 4719+10 0445 E1 pop hl
|
||
142: 4729+12 0446 1810 jr disassemble_continue
|
||
143:
|
||
144:
|
||
145: - 0448 disassemble_err:
|
||
146: 4741+17 0448 CDAE04 call dasm_print16hex_addr
|
||
147: 4758+7 044B 7E ld a,(hl)
|
||
148: 4765+17 044C CDC604 call dasm_print8hex ;print value
|
||
149: 4782+6 044F 23 inc hl
|
||
150: 4788+11 0450 E5 push hl
|
||
151: 4799+10 0451 21830E ld hl, [dasm_UU]
|
||
152: 4809+17 0454 CDBC02 call print_str
|
||
153: 4826+10 0457 E1 pop hl
|
||
154:
|
||
155: - 0458 disassemble_continue:
|
||
156:
|
||
157: 4836+17 0458 CDCE02 call print_newLine
|
||
158: ;inc hl
|
||
159: 4853+13 045B 3A1A41 ld a,(var_bytes_count)
|
||
160: 4866+4 045E 3D dec a
|
||
161: 4870+13 045F 321A41 ld (var_bytes_count),a
|
||
162: 4883+10 0462 C27603 jp nz, disassemble_next
|
||
163: 4893+10 0465 C9 ret
|
||
164:
|
||
165:
|
||
166:
|
||
167: ;A contains opcode
|
||
168: ;BC contains returned position
|
||
169: - 0466 disassemble_table_seek:
|
||
170: 4903+11 0466 E5 push hl
|
||
171: 4914+10 0467 218106 ld hl, [dasm_opcode_table]
|
||
172: - 046A disassemble_table_seek_loop:
|
||
173: 4924+13 046A 3A1441 ld a,(var_opcode)
|
||
174: 4937+4 046D 4F ld c,a
|
||
175: 4941+7 046E 7E ld a,(hl)
|
||
176: 4948+7 046F FEFF cp 0xFF ; if null
|
||
177: 4955+10 0471 CAA804 jp z, disassemble_table_notfound
|
||
178:
|
||
179: ;apply mask
|
||
180: 4965+11 0474 F5 push af
|
||
181: 4976+6 0475 23 inc hl
|
||
182: 4982+7 0476 46 ld b,(hl) ;load mask
|
||
183: 4989+6 0477 2B dec hl
|
||
184: 4995+4 0478 79 ld a,c
|
||
185: 4999+4 0479 A0 and b ;apply mask
|
||
186: 5003+4 047A 4F ld c,a
|
||
187: 5007+10 047B F1 pop af
|
||
188:
|
||
189: 5017+4 047C B9 cp c ; if match
|
||
190: 5021+7+5 047D 280B jr z, disassemble_table_first_match
|
||
191: 5028+7 047F 0600 ld b,0
|
||
192: 5035+7 0481 0E07 ld c,7
|
||
193: 5042+11 0483 09 add hl,bc
|
||
194: 5053+7 0484 7E ld a,(hl)
|
||
195: 5060+4 0485 4F ld c,a
|
||
196: 5064+11 0486 09 add hl,bc
|
||
197: 5075+6 0487 23 inc hl
|
||
198: 5081+12 0488 18E0 jr disassemble_table_seek_loop
|
||
199:
|
||
200: - 048A disassemble_table_first_match
|
||
201: 5093+6 048A 23 inc hl
|
||
202: 5099+6 048B 23 inc hl
|
||
203: 5105+7 048C 4E ld c,(hl) ;load opcode x from table
|
||
204: 5112+6 048D 23 inc hl
|
||
205: 5118+13 048E 3A1541 ld a,(var_opcode_x) ;load current opcode x
|
||
206: 5131+7 0491 46 ld b,(hl) ;load mask
|
||
207: 5138+4 0492 A0 and b ;apply mask
|
||
208: 5142+4 0493 B9 cp c ;compare to table
|
||
209: 5146+6 0494 2B dec hl
|
||
210: 5152+6 0495 2B dec hl
|
||
211: 5158+6 0496 2B dec hl
|
||
212: 5164+7+5 0497 280B jr z, disassemble_table_found ;IF FOUND
|
||
213: 5171+7 0499 0600 ld b,0 ;else continue with next
|
||
214:
|
||
215: 5178+7 049B 0E07 ld c,7
|
||
216: 5185+11 049D 09 add hl,bc
|
||
217: 5196+7 049E 7E ld a,(hl)
|
||
218: 5203+4 049F 4F ld c,a
|
||
219: 5207+11 04A0 09 add hl,bc
|
||
220: 5218+6 04A1 23 inc hl
|
||
221: 5224+12 04A2 18C6 jr disassemble_table_seek_loop
|
||
222:
|
||
223: - 04A4 disassemble_table_found
|
||
224: 5236+4 04A4 44 ld b,H
|
||
225: 5240+4 04A5 4D ld c,l
|
||
226: 5244+10 04A6 E1 pop hl
|
||
227: 5254+10 04A7 C9 ret
|
||
228:
|
||
229: - 04A8 disassemble_table_notfound
|
||
230: 5264+7 04A8 0600 ld b,0
|
||
231: 5271+7 04AA 0E00 ld c,0
|
||
232: 5278+10 04AC E1 pop hl
|
||
233: 5288+10 04AD C9 ret
|
||
234:
|
||
235:
|
||
236:
|
||
237:
|
||
238: - 04AE dasm_print16hex_addr:
|
||
239: 5298+7 04AE 3E24 ld a,"$"
|
||
240: 5305+17 04B0 CDB402 call print_char
|
||
241: 5322+4 04B3 7C ld a,h
|
||
242: 5326+17 04B4 CDE402 call print_a_hex
|
||
243: 5343+4 04B7 7D ld a,l
|
||
244: 5347+17 04B8 CDE402 call print_a_hex
|
||
245: 5364+7 04BB 3E68 ld a,"h"
|
||
246: 5371+17 04BD CDB402 call print_char
|
||
247: 5388+7 04C0 3E20 ld a," "
|
||
248: 5395+17 04C2 CDB402 call print_char
|
||
249: 5412+10 04C5 C9 ret
|
||
250:
|
||
251: - 04C6 dasm_print8hex:
|
||
252: 5422+17 04C6 CDE402 call print_a_hex
|
||
253: 5439+7 04C9 3E68 ld a,"h"
|
||
254: 5446+17 04CB CDB402 call print_char
|
||
255: 5463+7 04CE 3E20 ld a," "
|
||
256: 5470+17 04D0 CDB402 call print_char
|
||
257: 5487+10 04D3 C9 ret
|
||
258:
|
||
259:
|
||
260:
|
||
261:
|
||
262:
|
||
263:
|
||
264:
|
||
265: - 04D4 param_01: ; 0x01 16bit address pointer
|
||
266: 5497+11 04D4 E5 push hl
|
||
267: 5508+20 04D5 ED5B1041 ld de,(var_opcode_start)
|
||
268: 5528+6 04D9 13 inc de
|
||
269: 5534+7 04DA 1A ld a,(de)
|
||
270: 5541+4 04DB 6F ld l,a
|
||
271: 5545+6 04DC 13 inc de
|
||
272: 5551+7 04DD 1A ld a,(de)
|
||
273: 5558+4 04DE 67 ld h,a
|
||
274:
|
||
275: 5562+7 04DF 3E24 ld a,"$"
|
||
276: 5569+17 04E1 CDB402 call print_char
|
||
277: 5586+4 04E4 7C ld a,h
|
||
278: 5590+17 04E5 CDE402 call print_a_hex
|
||
279: 5607+4 04E8 7D ld a,l
|
||
280: 5611+17 04E9 CDE402 call print_a_hex
|
||
281: 5628+7 04EC 3E68 ld a,"h"
|
||
282: 5635+17 04EE CDB402 call print_char
|
||
283: 5652+7 04F1 3E20 ld a," "
|
||
284: 5659+17 04F3 CDB402 call print_char
|
||
285: 5676+17 04F6 CD7206 call param_comma
|
||
286: 5693+10 04F9 E1 pop hl
|
||
287: 5703+10 04FA C9 ret
|
||
288:
|
||
289: - 04FB param_02:
|
||
290: 5713+11 04FB C5 push bc
|
||
291: 5724+20 04FC ED5B1041 ld de,(var_opcode_start)
|
||
292: 5744+7 0500 1A ld a,(de)
|
||
293: 5751+4 0501 1F rra
|
||
294: 5755+4 0502 1F rra
|
||
295: 5759+7 0503 E60E and 0x0E
|
||
296:
|
||
297: 5766+11 0505 E5 push hl
|
||
298: 5777+10 0506 218C0E ld hl, [dasm_printFlags_table]
|
||
299: 5787+7 0509 0600 ld b,0
|
||
300: 5794+4 050B 4F ld c,a
|
||
301: 5798+11 050C 09 add hl,bc
|
||
302: 5809+17 050D CDBC02 call print_str
|
||
303: 5826+7 0510 3E20 ld a, " "
|
||
304: 5833+17 0512 CDB402 call print_char
|
||
305: 5850+10 0515 E1 pop hl
|
||
306: 5860+10 0516 C1 pop bc
|
||
307: 5870+10 0517 C9 ret
|
||
308:
|
||
309:
|
||
310: - 0518 param_03:
|
||
311: 5880+20 0518 ED5B1041 ld de,(var_opcode_start)
|
||
312: 5900+6 051C 13 inc de
|
||
313: 5906+7 051D 1A ld a,(de)
|
||
314:
|
||
315: 5913+11 051E F5 push af
|
||
316: 5924+7 051F E680 and 0x80
|
||
317: 5931+10 0521 C23905 jp nz, param_03_neg
|
||
318: 5941+7 0524 3E24 ld a,"$"
|
||
319: 5948+17 0526 CDB402 call print_char
|
||
320: 5965+7 0529 3E2B ld a,"+"
|
||
321: 5972+17 052B CDB402 call print_char
|
||
322: 5989+10 052E F1 pop af
|
||
323: 5999+17 052F CDE402 call print_a_hex
|
||
324: 6016+7 0532 3E68 ld a,"h"
|
||
325: 6023+17 0534 CDB402 call print_char
|
||
326: 6040+12 0537 1817 jr param_03_done
|
||
327:
|
||
328: - 0539 param_03_neg:
|
||
329: 6052+7 0539 3E24 ld a,"$"
|
||
330: 6059+17 053B CDB402 call print_char
|
||
331: 6076+7 053E 3E2D ld a,"-"
|
||
332: 6083+17 0540 CDB402 call print_char
|
||
333: 6100+10 0543 F1 pop af
|
||
334: 6110+8 0544 ED44 neg
|
||
335: 6118+17 0546 CDE402 call print_a_hex
|
||
336: 6135+7 0549 3E68 ld a,"h"
|
||
337: 6142+17 054B CDB402 call print_char
|
||
338: 6159+12 054E 1800 jr param_03_done
|
||
339:
|
||
340: - 0550 param_03_done:
|
||
341: 6171+17 0550 CD7206 call param_comma
|
||
342: 6188+10 0553 C9 ret
|
||
343:
|
||
344:
|
||
345: - 0554 param_04:
|
||
346: 6198+20 0554 ED5B1041 ld de,(var_opcode_start)
|
||
347: 6218+6 0558 13 inc de
|
||
348: 6224+7 0559 1A ld a,(de)
|
||
349: 6231+7 055A FE4D cp 0x4D
|
||
350: 6238+7+5 055C 2806 jr z,param_04_i
|
||
351: 6245+7 055E 3E4E ld a,"N"
|
||
352: 6252+17 0560 CDB402 call print_char
|
||
353: 6269+10 0563 C9 ret
|
||
354: - 0564 param_04_i:
|
||
355: 6279+7 0564 3E49 ld a,"I"
|
||
356: 6286+17 0566 CDB402 call print_char
|
||
357: 6303+10 0569 C9 ret
|
||
358:
|
||
359: - 056A param_05:
|
||
360: 6313+11 056A C5 push bc
|
||
361: 6324+20 056B ED5B1041 ld de,(var_opcode_start)
|
||
362: 6344+7 056F 1A ld a,(de)
|
||
363: 6351+7 0570 E638 and 0x38
|
||
364: ; print hex char
|
||
365: 6358+17 0572 CDC604 call dasm_print8hex
|
||
366: 6375+10 0575 C1 pop bc
|
||
367: 6385+10 0576 C9 ret
|
||
368:
|
||
369:
|
||
370: - 0577 param_06:
|
||
371: 6395+11 0577 C5 push bc
|
||
372: 6406+20 0578 ED5B1041 ld de,(var_opcode_start)
|
||
373: 6426+7 057C 1A ld a,(de)
|
||
374: 6433+4 057D 1F rra
|
||
375: 6437+4 057E 1F rra
|
||
376: 6441+4 057F 1F rra
|
||
377: 6445+7 0580 E607 and 0x07
|
||
378: 6452+17 0582 CD4D06 call param_printRegister
|
||
379: 6469+7 0585 3E20 ld a," "
|
||
380: 6476+17 0587 CDB402 call print_char
|
||
381: 6493+7 058A 3E2C ld a,","
|
||
382: 6500+17 058C CDB402 call print_char
|
||
383: 6517+10 058F C1 pop bc
|
||
384: 6527+10 0590 C9 ret
|
||
385:
|
||
386: - 0591 param_07:
|
||
387: 6537+11 0591 C5 push bc
|
||
388: 6548+20 0592 ED5B1041 ld de,(var_opcode_start)
|
||
389: 6568+7 0596 1A ld a,(de)
|
||
390: 6575+7 0597 E607 and 0x07
|
||
391:
|
||
392: 6582+17 0599 CD4D06 call param_printRegister
|
||
393: 6599+10 059C C1 pop bc
|
||
394: 6609+10 059D C9 ret
|
||
395:
|
||
396: - 059E param_08:
|
||
397: 6619+11 059E C5 push bc
|
||
398: 6630+20 059F ED5B1041 ld de,(var_opcode_start)
|
||
399: 6650+6 05A3 13 inc de
|
||
400: 6656+7 05A4 1A ld a,(de)
|
||
401: 6663+17 05A5 CDC604 call dasm_print8hex
|
||
402: 6680+10 05A8 C1 pop bc
|
||
403: 6690+10 05A9 C9 ret
|
||
404:
|
||
405:
|
||
406: - 05AA param_0A:
|
||
407: 6700+11 05AA E5 push hl
|
||
408: 6711+20 05AB ED5B1041 ld de,(var_opcode_start)
|
||
409: 6731+6 05AF 13 inc de
|
||
410: 6737+6 05B0 13 inc de
|
||
411: 6743+12 05B1 1806 jr param_09_0A
|
||
412: - 05B3 param_09:
|
||
413: 6755+11 05B3 E5 push hl
|
||
414: 6766+20 05B4 ED5B1041 ld de,(var_opcode_start)
|
||
415: 6786+6 05B8 13 inc de
|
||
416: - 05B9 param_09_0A:
|
||
417: 6792+7 05B9 1A ld a,(de)
|
||
418: 6799+4 05BA 6F ld l,a
|
||
419: 6803+6 05BB 13 inc de
|
||
420: 6809+7 05BC 1A ld a,(de)
|
||
421: 6816+4 05BD 67 ld h,a
|
||
422: 6820+4 05BE 7C ld a,h
|
||
423: 6824+17 05BF CDE402 call print_a_hex
|
||
424: 6841+4 05C2 7D ld a,l
|
||
425: 6845+17 05C3 CDE402 call print_a_hex
|
||
426: 6862+10 05C6 E1 pop hl
|
||
427: 6872+10 05C7 C9 ret
|
||
428:
|
||
429: - 05C8 param_10:
|
||
430: 6882+11 05C8 C5 push bc
|
||
431: 6893+20 05C9 ED5B1041 ld de,(var_opcode_start)
|
||
432: 6913+7 05CD 1A ld a,(de)
|
||
433: 6920+4 05CE 1F rra
|
||
434: 6924+4 05CF 1F rra
|
||
435: 6928+4 05D0 1F rra
|
||
436: 6932+7 05D1 E607 and 0x07
|
||
437: 6939+17 05D3 CD4D06 call param_printRegister
|
||
438: 6956+10 05D6 C1 pop bc
|
||
439: 6966+10 05D7 C9 ret
|
||
440:
|
||
441:
|
||
442: - 05D8 param_11:
|
||
443: 6976+11 05D8 E5 push hl
|
||
444: 6987+11 05D9 C5 push bc
|
||
445: 6998+20 05DA ED5B1041 ld de,(var_opcode_start)
|
||
446: 7018+12 05DE 1807 jr param_11_12
|
||
447: - 05E0 param_12:
|
||
448: 7030+11 05E0 E5 push hl
|
||
449: 7041+11 05E1 C5 push bc
|
||
450: 7052+20 05E2 ED5B1041 ld de,(var_opcode_start)
|
||
451: 7072+6 05E6 13 inc de
|
||
452:
|
||
453: - 05E7 param_11_12:
|
||
454: 7078+7 05E7 1A ld a,(de)
|
||
455: 7085+4 05E8 1F rra
|
||
456: 7089+4 05E9 1F rra
|
||
457: 7093+4 05EA 1F rra
|
||
458: 7097+7 05EB E606 and 0x06
|
||
459: 7104+11 05ED F5 push af
|
||
460: ;check which table to use
|
||
461: 7115+16 05EE 2A1041 ld hl, (var_opcode_start)
|
||
462: 7131+7 05F1 7E ld a,(hl)
|
||
463: 7138+7 05F2 FEDD cp 0xDD
|
||
464: 7145+7+5 05F4 2809 jr z,param_11_12_ix
|
||
465: 7152+7 05F6 FEFD cp 0xFD
|
||
466: 7159+7+5 05F8 280A jr z,param_11_12_iy
|
||
467: - 05FA param_11_12_def:
|
||
468: 7166+10 05FA 219C0E ld hl, [dasm_printRegister8_table]
|
||
469: 7176+12 05FD 1808 jr param_11_12_all
|
||
470: - 05FF param_11_12_ix:
|
||
471: 7188+10 05FF 21A40E ld hl, [dasm_printRegisterIX_table]
|
||
472: 7198+12 0602 1803 jr param_11_12_all
|
||
473: - 0604 param_11_12_iy:
|
||
474: 7210+10 0604 21AC0E ld hl, [dasm_printRegisterIY_table]
|
||
475: - 0607 param_11_12_all:
|
||
476: 7220+10 0607 F1 pop af
|
||
477: 7230+7 0608 0600 ld b,0
|
||
478: 7237+4 060A 4F ld c,a
|
||
479: 7241+11 060B 09 add hl, bc
|
||
480: 7252+7 060C 7E ld a,(hl)
|
||
481: 7259+17 060D CDB402 call print_char
|
||
482: 7276+6 0610 23 inc hl
|
||
483: 7282+7 0611 7E ld a,(hl)
|
||
484: 7289+17 0612 CDB402 call print_char
|
||
485: 7306+10 0615 C1 pop bc
|
||
486: 7316+10 0616 E1 pop hl
|
||
487: 7326+10 0617 C9 ret
|
||
488:
|
||
489: - 0618 param_13:
|
||
490: 7336+11 0618 E5 push hl
|
||
491: 7347+11 0619 C5 push bc
|
||
492: 7358+20 061A ED5B1041 ld de,(var_opcode_start)
|
||
493: 7378+7 061E 1A ld a,(de)
|
||
494: 7385+4 061F 1F rra
|
||
495: 7389+4 0620 1F rra
|
||
496: 7393+4 0621 1F rra
|
||
497: 7397+7 0622 E606 and 0x06
|
||
498: 7404+11 0624 F5 push af
|
||
499: ;check which table to use
|
||
500: 7415+16 0625 2A1041 ld hl, (var_opcode_start)
|
||
501: 7431+7 0628 7E ld a,(hl)
|
||
502: 7438+10 0629 21B40E ld hl, [dasm_printRegisterSP_table]
|
||
503: 7448+12 062C 18D9 jr param_11_12_all ;reuse code from 11_12
|
||
504:
|
||
505:
|
||
506: - 062E param_81:
|
||
507: 7460+11 062E E5 push hl
|
||
508: 7471+11 062F C5 push bc
|
||
509: 7482+16 0630 2A1741 ld hl, (var_opcode_string)
|
||
510: 7498+7 0633 0602 ld b,2
|
||
511: 7505+12 0635 1807 jr param_80_seek
|
||
512: - 0637 param_80:
|
||
513: 7517+11 0637 E5 push hl
|
||
514: 7528+11 0638 C5 push bc
|
||
515: 7539+16 0639 2A1741 ld hl, (var_opcode_string)
|
||
516: 7555+7 063C 0601 ld b,1
|
||
517: - 063E param_80_seek:
|
||
518: 7562+7 063E 7E ld a,(hl)
|
||
519: 7569+6 063F 23 inc hl
|
||
520: 7575+4 0640 A7 and a
|
||
521: 7579+7+5 0641 20FB jr nz, param_80_seek
|
||
522: ;found
|
||
523: 7586+4 0643 05 dec b ;found but counter too high
|
||
524: 7590+10 0644 C23E06 jp nz, param_80_seek
|
||
525:
|
||
526: 7600+17 0647 CDBC02 call print_str
|
||
527: 7617+10 064A C1 pop bc
|
||
528: 7627+10 064B E1 pop hl
|
||
529: 7637+10 064C C9 ret
|
||
530:
|
||
531:
|
||
532:
|
||
533: - 064D param_printRegister:
|
||
534: 7647+11 064D E5 push hl
|
||
535: 7658+7 064E FE06 cp 0x06
|
||
536: 7665+7+5 0650 2811 jr z, param_printRegisterHL
|
||
537: 7672+7 0652 FE07 cp 0x07
|
||
538: 7679+7+5 0654 2815 jr z, param_printRegisterA
|
||
539: 7686+10 0656 219C0E ld hl, [dasm_printRegister8_table]
|
||
540: 7696+7 0659 0600 ld b,0
|
||
541: 7703+4 065B 4F ld c,a
|
||
542: 7707+11 065C 09 add hl,bc
|
||
543: 7718+7 065D 7E ld a, (hl)
|
||
544: 7725+17 065E CDB402 call print_char
|
||
545: 7742+10 0661 E1 pop hl
|
||
546: 7752+10 0662 C9 ret
|
||
547:
|
||
548: - 0663 param_printRegisterHL:
|
||
549: 7762+10 0663 21BC0E ld hl, [dasm_printRegister8_table_HL]
|
||
550: 7772+17 0666 CDBC02 call print_str
|
||
551: 7789+10 0669 E1 pop hl
|
||
552: 7799+10 066A C9 ret
|
||
553:
|
||
554: - 066B param_printRegisterA:
|
||
555: 7809+7 066B 3E41 ld a,"A"
|
||
556: 7816+17 066D CDB402 call print_char
|
||
557: 7833+10 0670 E1 pop hl
|
||
558: 7843+10 0671 C9 ret
|
||
559:
|
||
560:
|
||
561: - 0672 param_comma:
|
||
562: 7853+4 0672 78 ld a,b
|
||
563: 7857+7 0673 FE01 cp 1
|
||
564: 7864+5+6 0675 C8 ret z
|
||
565: 7869+7 0676 3E20 ld a," "
|
||
566: 7876+17 0678 CDB402 call print_char
|
||
567: 7893+7 067B 3E2C ld a,","
|
||
568: 7900+17 067D CDB402 call print_char
|
||
**** main.asm ****
|
||
494: 7917+10 0680 C9 ret
|
||
495: .include "disassembler_table.s"
|
||
**** include/disassembler_table.s ****
|
||
1: ;disassembler tables
|
||
2:
|
||
3: - 0681 dasm_opcode_table:
|
||
4: ;byte 0 = opcode
|
||
5: ;byte 1 = opcode mask
|
||
6: ;byte 2 = opcode extended
|
||
7: ;byte 3 = opcode extended mask
|
||
8: ;byte 4 = length
|
||
9: ;byte 5+6 = pointer to string
|
||
10: ;byte 7 = params = count of paramters
|
||
11: ;byte 8+ = paramters
|
||
12: ; 0x01 16bit address pointer
|
||
13: ; 0x02 flag bit 3-5
|
||
14: ; 0x03 relative jmp address
|
||
15: ; 0x04 RETI/RETN
|
||
16: ; 0x05 RST Vector
|
||
17: ; 0x06 register (r)
|
||
18: ; 0x07 register (r')
|
||
19: ; 0x08 8-Bit value
|
||
20: ; 0x09 16-Bit value
|
||
21: ; 0x0A 16-bit value with offset +1
|
||
22: ; 0x10 same as 0x06 without ","
|
||
23: ; 0x11 print 16 bit register from 1st byte
|
||
24: ; 0x12 print 16 bit register from 2nd byte
|
||
25: ; 0x13 push/pop register lookup
|
||
26: ; 0x80 print string suffix
|
||
27: ; 0x81 print string suffix 2
|
||
28: - 0681 00FF0000 defb 0x00, 0xFF, 0x00, 0x00, 1, [dasm_00], [dasm_00]>>8,0 ;NOP
|
||
01D90A00
|
||
29: ;General-Purpose Arithmetic and CPU Control Groups
|
||
30: - 0689 27FF0000 defb 0x27, 0xFF, 0x00, 0x00, 1, [dasm_27], [dasm_27]>>8, 0 ;DAA
|
||
01A40B00
|
||
31: - 0691 2FFF0000 defb 0x2F, 0xFF, 0x00, 0x00, 1, [dasm_2F], [dasm_2F]>>8, 0 ;CPL
|
||
01A80B00
|
||
32: - 0699 EDFF44FF defb 0xED, 0xFF, 0x44, 0xFF, 2, [dasm_ED_44], [dasm_ED_44]>>8, 0 ;NEG
|
||
02AC0B00
|
||
33: - 06A1 3FFF0000 defb 0x3f, 0xFF, 0x00, 0x00, 1, [dasm_3F], [dasm_3F]>>8, 0 ;CCF
|
||
01B00B00
|
||
34: - 06A9 37FF0000 defb 0x37, 0xFF, 0x00, 0x00, 1, [dasm_37], [dasm_37]>>8, 0 ;SCF
|
||
01B40B00
|
||
35: ;defb 0x00, 0xFF, 0x00, 0x00, 1, [dasm_00], [dasm_00]>>8,0 ;NOP -> already at top for performance reasons
|
||
36: - 06B1 76FF0000 defb 0x76, 0xFF, 0x00, 0x00, 1, [dasm_76], [dasm_76]>>8, 0 ;HALT
|
||
01B80B00
|
||
37: - 06B9 F3FF0000 defb 0xF3, 0xFF, 0x00, 0x00, 1, [dasm_F3], [dasm_F3]>>8, 0 ;DI
|
||
01BD0B00
|
||
38: - 06C1 FBFF0000 defb 0xFB, 0xFF, 0x00, 0x00, 1, [dasm_FB], [dasm_FB]>>8, 0 ;EI
|
||
01C00B00
|
||
39: - 06C9 EDFF46FF defb 0xED, 0xFF, 0x46, 0xFF, 2, [dasm_ED_46], [dasm_ED_46]>>8, 0 ;IM 0
|
||
02C30B00
|
||
40: - 06D1 EDFF56FF defb 0xED, 0xFF, 0x56, 0xFF, 2, [dasm_ED_56], [dasm_ED_56]>>8, 0 ;IM 1
|
||
02C80B00
|
||
41: - 06D9 EDFF5EFF defb 0xED, 0xFF, 0x5E, 0xFF, 2, [dasm_ED_5E], [dasm_ED_5E]>>8, 0 ;IM 2
|
||
02CD0B00
|
||
42:
|
||
43: ;Exchange, Block Transfer, and Search Group
|
||
44: - 06E1 EBFF0000 defb 0xEB, 0xFF, 0x00, 0x00, 1, [dasm_BE], [dasm_BE]>>8, 0 ;EX DE, HL
|
||
01D20B00
|
||
45: - 06E9 08FF0000 defb 0x08, 0xFF, 0x00, 0x00, 1, [dasm_08], [dasm_08]>>8, 0 ;EX AF, AF′
|
||
01DC0B00
|
||
46: - 06F1 D9FF0000 defb 0xD9, 0xFF, 0x00, 0x00, 1, [dasm_D9], [dasm_D9]>>8, 0 ;EXX
|
||
01E90B00
|
||
47: - 06F9 E3FF0000 defb 0xE3, 0xFF, 0x00, 0x00, 1, [dasm_E3], [dasm_E3]>>8, 0 ;EX (SP), HL
|
||
01ED0B00
|
||
48: - 0701 DDFFE3FF defb 0xDD, 0xFF, 0xE3, 0xFF, 2, [dasm_DD_E3], [dasm_DD_E3]>>8, 0 ;EX (SP), IX
|
||
02F90B00
|
||
49: - 0709 FDFFE3FF defb 0xFD, 0xFF, 0xE3, 0xFF, 2, [dasm_FD_E3], [dasm_FD_E3]>>8, 0 ;EX (SP), IY
|
||
02050C00
|
||
50: - 0711 EDFFA0FF defb 0xED, 0xFF, 0xA0, 0xFF, 2, [dasm_ED_A0], [dasm_ED_A0]>>8, 0 ;LDI
|
||
02110C00
|
||
51: - 0719 EDFFB0FF defb 0xED, 0xFF, 0xB0, 0xFF, 2, [dasm_ED_B0], [dasm_ED_B0]>>8, 0 ;LDIR
|
||
02150C00
|
||
52: - 0721 EDFFA8FF defb 0xED, 0xFF, 0xA8, 0xFF, 2, [dasm_ED_A8], [dasm_ED_A8]>>8, 0 ;LDD
|
||
021A0C00
|
||
53: - 0729 EDFFB8FF defb 0xED, 0xFF, 0xB8, 0xFF, 2, [dasm_ED_B8], [dasm_ED_B8]>>8, 0 ;LDDR
|
||
021E0C00
|
||
54: - 0731 EDFFA1FF defb 0xED, 0xFF, 0xA1, 0xFF, 2, [dasm_ED_A1], [dasm_ED_A1]>>8, 0 ;CPI
|
||
02230C00
|
||
55: - 0739 EDFFB1FF defb 0xED, 0xFF, 0xB1, 0xFF, 2, [dasm_ED_B1], [dasm_ED_B1]>>8, 0 ;CPIR
|
||
02270C00
|
||
56: - 0741 EDFFA9FF defb 0xED, 0xFF, 0xA9, 0xFF, 2, [dasm_ED_A9], [dasm_ED_A9]>>8, 0 ;CPD
|
||
022C0C00
|
||
57: - 0749 EDFFB9FF defb 0xED, 0xFF, 0xB9, 0xFF, 2, [dasm_ED_B9], [dasm_ED_B9]>>8, 0 ;CPDR
|
||
02300C00
|
||
58:
|
||
59: ;JUMP Group
|
||
60: - 0751 C3FF0000 defb 0xC3, 0xFF, 0x00, 0x00, 3, [dasm_C3], [dasm_C3]>>8,1, 0x01 ;JP nn
|
||
03DD0A01
|
||
01
|
||
61: - 075A C2C70000 defb 0xC2, 0xC7, 0x00, 0x00, 3, [dasm_C3], [dasm_C3]>>8,3, 0x02, 0x80, 0x01 ;JP cc,nn
|
||
03DD0A03
|
||
028001
|
||
62: - 0765 18FF0000 defb 0x18, 0xFF, 0x00, 0x00, 2, [dasm_18], [dasm_18]>>8,1, 0x03 ;JR e
|
||
02E40A01
|
||
03
|
||
63: - 076E 38FF0000 defb 0x38, 0xFF, 0x00, 0x00, 2, [dasm_38], [dasm_38]>>8,1, 0x03 ;JR C,e
|
||
02E80A01
|
||
03
|
||
64: - 0777 30FF0000 defb 0x30, 0xFF, 0x00, 0x00, 2, [dasm_30], [dasm_30]>>8,1, 0x03 ;JR NC,e
|
||
02EF0A01
|
||
03
|
||
65: - 0780 28FF0000 defb 0x28, 0xFF, 0x00, 0x00, 2, [dasm_28], [dasm_28]>>8,1, 0x03 ;JR Z,e
|
||
02F70A01
|
||
03
|
||
66: - 0789 20FF0000 defb 0x20, 0xFF, 0x00, 0x00, 2, [dasm_20], [dasm_20]>>8,1, 0x03 ;JR NZ,e
|
||
02FE0A01
|
||
03
|
||
67: - 0792 E9FF0000 defb 0xE9, 0xFF, 0x00, 0x00, 2, [dasm_E9], [dasm_E9]>>8,0 ;JP (HL)
|
||
02060B00
|
||
68: - 079A DDFFE9FF defb 0xDD, 0xFF, 0xE9, 0xFF, 2, [dasm_DD], [dasm_DD]>>8,0 ;JP (IX)
|
||
020F0B00
|
||
69: - 07A2 FDFFE9FF defb 0xFD, 0xFF, 0xE9, 0xFF, 2, [dasm_FD], [dasm_FD]>>8,0 ;JP (IY)
|
||
02180B00
|
||
70: - 07AA 10FF0000 defb 0x10, 0xFF, 0x00, 0x00, 2, [dasm_10], [dasm_10]>>8,1, 0x03 ;DJNZ, e
|
||
02210B01
|
||
03
|
||
71: ;Call and Return Group
|
||
72: - 07B3 CDFF0000 defb 0xCD, 0xFF, 0x00, 0x00, 3, [dasm_CD], [dasm_CD]>>8,1, 0x01 ;CALL nn
|
||
03270B01
|
||
01
|
||
73: - 07BC C4C70000 defb 0xC4, 0xC7, 0x00, 0x00, 3, [dasm_CD], [dasm_CD]>>8,2, 0x02, 0x01 ;CALL cc,nn
|
||
03270B02
|
||
0201
|
||
74: - 07C6 C9FF0000 defb 0xC9, 0xFF, 0x00, 0x00, 1, [dasm_C9], [dasm_C9]>>8,0 ;RET
|
||
012D0B00
|
||
75: - 07CE C0C70000 defb 0xC0, 0xC7, 0x00, 0x00, 1, [dasm_C9], [dasm_C9]>>8,1, 0x02 ;RET cc
|
||
012D0B01
|
||
02
|
||
76: - 07D7 EDFF4DFF defb 0xED, 0xFF, 0x4D, 0xFF, 2, [dasm_ED_4D], [dasm_ED_4D]>>8,0 ;RETI
|
||
02320B00
|
||
77: - 07DF EDFF45FF defb 0xED, 0xFF, 0x45, 0xFF, 2, [dasm_ED_45], [dasm_ED_45]>>8,0 ;RETN
|
||
02370B00
|
||
78:
|
||
79: - 07E7 C7C70000 defb 0xC7, 0xC7, 0x00, 0x00, 1, [dasm_FF], [dasm_FF]>>8,1, 0x05 ;RST
|
||
013C0B01
|
||
05
|
||
80: ;8-Bit load group
|
||
81: - 07F0 0AFF0000 defb 0x0A, 0xFF, 0x00, 0x00, 1, [dasm_0A], [dasm_0A]>>8, 0 ;LD A, (BC)
|
||
01410B00
|
||
82: - 07F8 1AFF0000 defb 0x1A, 0xFF, 0x00, 0x00, 1, [dasm_1A], [dasm_1A]>>8, 0 ;LD A, (DE)
|
||
014B0B00
|
||
83: - 0800 3AFF0000 defb 0x3A, 0xFF, 0x00, 0x00, 3, [dasm_3A], [dasm_3A]>>8, 2, 0x09, 0x80 ;LD A, (nn)
|
||
03550B02
|
||
0980
|
||
84: - 080A 02FF0000 defb 0x02, 0xFF, 0x00, 0x00, 1, [dasm_02], [dasm_02]>>8, 0 ;LD (BC), A
|
||
015F0B00
|
||
85: - 0812 12FF0000 defb 0x12, 0xFF, 0x00, 0x00, 1, [dasm_12], [dasm_12]>>8, 0 ;LD (DE), A
|
||
016A0B00
|
||
86: - 081A 32FF0000 defb 0x32, 0xFF, 0x00, 0x00, 3, [dasm_32], [dasm_32]>>8, 2, 0x09, 0x80 ;LD (nn), A
|
||
03750B02
|
||
0980
|
||
87: - 0824 EDFF57FF defb 0xED, 0xFF, 0x57, 0xFF, 2, [dasm__ED_57], [dasm__ED_57]>>8, 0 ;LD A, I
|
||
02840B00
|
||
88: - 082C EDFF5FFF defb 0xED, 0xFF, 0x5F, 0xFF, 2, [dasm__ED_5F], [dasm__ED_5F]>>8, 0 ;LD A, R
|
||
028C0B00
|
||
89: - 0834 EDFF47FF defb 0xED, 0xFF, 0x47, 0xFF, 2, [dasm__ED_47], [dasm__ED_47]>>8, 0 ;LD I, A
|
||
02940B00
|
||
90: - 083C EDFF4FFF defb 0xED, 0xFF, 0x4F, 0xFF, 2, [dasm__ED_4F], [dasm__ED_4F]>>8, 0 ;LD R, A
|
||
029C0B00
|
||
91:
|
||
92: - 0844 06C70000 defb 0x06, 0xC7, 0x00, 0x00, 2, [dasm__LD], [dasm__LD]>>8, 2, 0x06, 0x08 ;LD r, n
|
||
02800B02
|
||
0608
|
||
93: - 084E 40C00000 defb 0x40, 0xC0, 0x00, 0x00, 1, [dasm__LD], [dasm__LD]>>8, 2, 0x06, 0x07 ;LD r, r' / LD r, (HL) / LD (HL), r
|
||
01800B02
|
||
0607
|
||
94:
|
||
95: ;8-Bit Arithmetic Group
|
||
96: - 0858 80F80000 defb 0x80, 0xF8, 0x00, 0x00, 1, [dasm_80C6], [dasm_80C6]>>8, 1, 0x07 ;ADD A, r / ADD A, (HL)
|
||
01350C01
|
||
07
|
||
97: - 0861 C6FF0000 defb 0xC6, 0xFF, 0x00, 0x00, 2, [dasm_80C6], [dasm_80C6]>>8, 1, 0x08 ;ADD A, n
|
||
02350C01
|
||
08
|
||
98: - 086A DDFF86FF defb 0xDD, 0xFF, 0x86, 0xFF, 3, [dasm_DD_86], [dasm_DD_86]>>8, 2, 0x08, 0x80 ;ADD A, (IX + d)
|
||
033D0C02
|
||
0880
|
||
99: - 0874 FDFF86FF defb 0xFD, 0xFF, 0x86, 0xFF, 3, [dasm_FD_86], [dasm_FD_86]>>8, 2, 0x08, 0x80 ;ADD A, (IY + d)
|
||
034C0C02
|
||
0880
|
||
100: - 087E C8F80000 defb 0xC8, 0xF8, 0x00, 0x00, 1, [dasm_C88E], [dasm_C88E]>>8, 1, 0x07 ;ADC A, r / ADC A, (HL)
|
||
015B0C01
|
||
07
|
||
101: - 0887 8EF80000 defb 0x8E, 0xF8, 0x00, 0x00, 2, [dasm_C88E], [dasm_C88E]>>8, 1, 0x08 ;ADC A, n
|
||
025B0C01
|
||
08
|
||
102: - 0890 DDFF8EFF defb 0xDD, 0xFF, 0x8E, 0xFF, 3, [dasm_DD_8E], [dasm_DD_8E]>>8, 2, 0x08, 0x80 ;ADC A, (IX + d)
|
||
03630C02
|
||
0880
|
||
103: - 089A FDFF8EFF defb 0xFD, 0xFF, 0x8E, 0xFF, 3, [dasm_FD_8E], [dasm_FD_8E]>>8, 2, 0x08, 0x80 ;ADC A, (IY + d)
|
||
03720C02
|
||
0880
|
||
104: - 08A4 90F80000 defb 0x90, 0xF8, 0x00, 0x00, 1, [dasm__SUB], [dasm__SUB]>>8, 1, 0x07 ;SUB r / SUB A, (HL)
|
||
01810C01
|
||
07
|
||
105: - 08AD D6FF0000 defb 0xD6, 0xFF, 0x00, 0x00, 2, [dasm__SUB], [dasm__SUB]>>8, 1, 0x08 ;SUB n
|
||
02810C01
|
||
08
|
||
106: - 08B6 DDFF96FF defb 0xDD, 0xFF, 0x96, 0xFF, 3, [dasm_DD_96], [dasm_DD_96]>>8, 2, 0x08, 0x80 ;SUB (IX + d)
|
||
03860C02
|
||
0880
|
||
107: - 08C0 FDFF96FF defb 0xFD, 0xFF, 0x96, 0xFF, 3, [dasm_FD_96], [dasm_FD_96]>>8, 2, 0x08, 0x80 ;SUB (IY + d)
|
||
03920C02
|
||
0880
|
||
108: - 08CA 94F80000 defb 0x94, 0xF8, 0x00, 0x00, 1, [dasm__SBC], [dasm__SBC]>>8, 1, 0x07 ;SBC A,r / SBC A, (HL)
|
||
019E0C01
|
||
07
|
||
109: - 08D3 DEFF0000 defb 0xDE, 0xFF, 0x00, 0x00, 2, [dasm__SBC], [dasm__SBC]>>8, 1, 0x08 ;SBC A,n
|
||
029E0C01
|
||
08
|
||
110: - 08DC DDFF9EFF defb 0xDD, 0xFF, 0x9E, 0xFF, 3, [dasm_DD_9E], [dasm_DD_9E]>>8, 2, 0x08, 0x80 ;SBC A,(IX + d)
|
||
03A60C02
|
||
0880
|
||
111: - 08E6 FDFF9EFF defb 0xFD, 0xFF, 0x9E, 0xFF, 3, [dasm_FD_9E], [dasm_FD_9E]>>8, 2, 0x08, 0x80 ;SBC A,(IY + d)
|
||
03B40C02
|
||
0880
|
||
112: - 08F0 A0F80000 defb 0xA0, 0xF8, 0x00, 0x00, 1, [dasm__AND], [dasm__AND]>>8, 1, 0x07 ;AND A,r / AND A, (HL)
|
||
01C20C01
|
||
07
|
||
113: - 08F9 E6FF0000 defb 0xE6, 0xFF, 0x00, 0x00, 2, [dasm__AND], [dasm__AND]>>8, 1, 0x08 ;AND A,n
|
||
02C20C01
|
||
08
|
||
114: - 0902 DDFFA6FF defb 0xDD, 0xFF, 0xA6, 0xFF, 3, [dasm_DD_A6], [dasm_DD_A6]>>8, 2, 0x08, 0x80 ;AND A,(IX + d)
|
||
03C70C02
|
||
0880
|
||
115: - 090C FDFFA6FF defb 0xFD, 0xFF, 0xA6, 0xFF, 3, [dasm_FD_A6], [dasm_FD_A6]>>8, 2, 0x08, 0x80 ;AND A,(IY + d)
|
||
03D30C02
|
||
0880
|
||
116: - 0916 B0F80000 defb 0xB0, 0xF8, 0x00, 0x00, 1, [dasm__OR], [dasm__OR]>>8, 1, 0x07 ;OR A,r / OR A, (HL)
|
||
01DF0C01
|
||
07
|
||
117: - 091F F6FF0000 defb 0xF6, 0xFF, 0x00, 0x00, 2, [dasm__OR], [dasm__OR]>>8, 1, 0x08 ;OR A,n
|
||
02DF0C01
|
||
08
|
||
118: - 0928 DDFFB6FF defb 0xDD, 0xFF, 0xB6, 0xFF, 3, [dasm_DD_B6], [dasm_DD_B6]>>8, 2, 0x08, 0x80 ;OR A,(IX + d)
|
||
03E30C02
|
||
0880
|
||
119: - 0932 FDFFB6FF defb 0xFD, 0xFF, 0xB6, 0xFF, 3, [dasm_FD_B6], [dasm_FD_B6]>>8, 2, 0x08, 0x80 ;OR A,(IY + d)
|
||
03EE0C02
|
||
0880
|
||
120: - 093C A8F80000 defb 0xA8, 0xF8, 0x00, 0x00, 1, [dasm__XOR], [dasm__XOR]>>8, 1, 0x07 ;XOR A,r / XOR A, (HL)
|
||
01F90C01
|
||
07
|
||
121: - 0945 EEFF0000 defb 0xEE, 0xFF, 0x00, 0x00, 2, [dasm__XOR], [dasm__XOR]>>8, 1, 0x08 ;XOR A,n
|
||
02F90C01
|
||
08
|
||
122: - 094E DDFFAEFF defb 0xDD, 0xFF, 0xAE, 0xFF, 3, [dasm_DD_AE], [dasm_DD_AE]>>8, 2, 0x08, 0x80 ;XOR A,(IX + d)
|
||
03FE0C02
|
||
0880
|
||
123: - 0958 FDFFAEFF defb 0xFD, 0xFF, 0xAE, 0xFF, 3, [dasm_FD_AE], [dasm_FD_AE]>>8, 2, 0x08, 0x80 ;XOR A,(IY + d)
|
||
030A0D02
|
||
0880
|
||
124: - 0962 B8F80000 defb 0xB8, 0xF8, 0x00, 0x00, 1, [dasm__CP], [dasm__CP]>>8, 1, 0x07 ;CP A,r / CP A, (HL)
|
||
01160D01
|
||
07
|
||
125: - 096B FEFF0000 defb 0xFE, 0xFF, 0x00, 0x00, 2, [dasm__CP], [dasm__CP]>>8, 1, 0x08 ;CP A,n
|
||
02160D01
|
||
08
|
||
126: - 0974 DDFFBEFF defb 0xDD, 0xFF, 0xBE, 0xFF, 3, [dasm_DD_BE], [dasm_DD_BE]>>8, 2, 0x08, 0x80 ;CP A,(IX + d)
|
||
031A0D02
|
||
0880
|
||
127: - 097E FDFFBEFF defb 0xFD, 0xFF, 0xBE, 0xFF, 3, [dasm_FD_BE], [dasm_FD_BE]>>8, 2, 0x08, 0x80 ;CP A,(IY + d)
|
||
03250D02
|
||
0880
|
||
128: - 0988 04C70000 defb 0x04, 0xC7, 0x00, 0x00, 1, [dasm__INC], [dasm__INC]>>8, 1, 0x10 ;INC r / INC (HL)
|
||
01300D01
|
||
10
|
||
129: - 0991 DDFF34FF defb 0xDD, 0xFF, 0x34, 0xFF, 3, [dasm_DD_34], [dasm_DD_34]>>8, 2, 0x08, 0x80 ;INC (IX + d)
|
||
03350D02
|
||
0880
|
||
130: - 099B FDFF34FF defb 0xFD, 0xFF, 0x34, 0xFF, 3, [dasm_FD_34], [dasm_FD_34]>>8, 2, 0x08, 0x80 ;INC (IY + d)
|
||
03410D02
|
||
0880
|
||
131: - 09A5 05C70000 defb 0x05, 0xC7, 0x00, 0x00, 1, [dasm__DEC], [dasm__DEC]>>8, 1, 0x10 ;DEC r / DEC (HL)
|
||
014D0D01
|
||
10
|
||
132: - 09AE DDFF35FF defb 0xDD, 0xFF, 0x35, 0xFF, 3, [dasm_DD_35], [dasm_DD_35]>>8, 2, 0x08, 0x80 ;DEC (IX + d)
|
||
03520D02
|
||
0880
|
||
133: - 09B8 FDFF35FF defb 0xFD, 0xFF, 0x35, 0xFF, 3, [dasm_FD_35], [dasm_FD_35]>>8, 2, 0x08, 0x80 ;DEC (IY + d)
|
||
035E0D02
|
||
0880
|
||
134: ;16-Bit Arithmetic Group
|
||
135: - 09C2 09CF0000 defb 0x09, 0xCF, 0x00, 0x00, 1, [dasm_09], [dasm_09]>>8, 1, 0x11 ;ADD HL, ss
|
||
016A0D01
|
||
11
|
||
136: - 09CB EDFF4ACF defb 0xED, 0xFF, 0x4A, 0xCF, 2, [dasm_ED_4A], [dasm_ED_4A]>>8, 1, 0x12 ;ADC HL, ss
|
||
02730D01
|
||
12
|
||
137: - 09D4 EDFF42CF defb 0xED, 0xFF, 0x42, 0xCF, 2, [dasm_ED_42], [dasm_ED_42]>>8, 1, 0x12 ;SBC HL, ss
|
||
027C0D01
|
||
12
|
||
138: - 09DD DDFF09CF defb 0xDD, 0xFF, 0x09, 0xCF, 2, [dasm_DD_09], [dasm_DD_09]>>8, 1, 0x12 ;ADD IX, ss
|
||
02850D01
|
||
12
|
||
139: - 09E6 FDFF09CF defb 0xFD, 0xFF, 0x09, 0xCF, 2, [dasm_FD_09], [dasm_FD_09]>>8, 1, 0x12 ;ADD IY, ss
|
||
028E0D01
|
||
12
|
||
140: - 09EF 03CF0000 defb 0x03, 0xCF, 0x00, 0x00, 1, [dasm_03], [dasm_03]>>8, 1, 0x11 ;INC ss
|
||
01970D01
|
||
11
|
||
141: - 09F8 DDFF23FF defb 0xDD, 0xFF, 0x23, 0xFF, 2, [dasm_DD_23], [dasm_DD_23]>>8, 0 ;INC IX
|
||
029C0D00
|
||
142: - 0A00 FDFF23FF defb 0xFD, 0xFF, 0x23, 0xFF, 2, [dasm_FD_23], [dasm_FD_23]>>8, 0 ;INC IY
|
||
02A50D00
|
||
143: - 0A08 0BCF0000 defb 0x0B, 0xCF, 0x00, 0x00, 1, [dasm_0B], [dasm_0B]>>8, 1, 0x11 ;DEC ss
|
||
01AE0D01
|
||
11
|
||
144: - 0A11 DDFF2BFF defb 0xDD, 0xFF, 0x2B, 0xFF, 2, [dasm_DD_2B], [dasm_DD_2B]>>8, 0 ;DEC IX
|
||
02B30D00
|
||
145: - 0A19 FDFF2BFF defb 0xFD, 0xFF, 0x2B, 0xFF, 2, [dasm_FD_2B], [dasm_FD_2B]>>8, 0 ;DEC IY
|
||
02BC0D00
|
||
146: ;16-Bit Load Group
|
||
147: - 0A21 01CF0000 defb 0x01, 0xCF, 0x00, 0x00, 3, [dasm_01], [dasm_01]>>8, 3, 0x11, 0x80, 0x09 ;LD dd, nn
|
||
03C50D03
|
||
118009
|
||
148: - 0A2C DDFF21FF defb 0xDD, 0xFF, 0x21, 0xFF, 4, [dasm_DD_01], [dasm_DD_01]>>8, 1, 0x0A ;LD IX, nn
|
||
04CC0D01
|
||
0A
|
||
149: - 0A35 FDFF21FF defb 0xFD, 0xFF, 0x21, 0xFF, 4, [dasm_FD_01], [dasm_FD_01]>>8, 1, 0x0A ;LD IY, nn
|
||
04D40D01
|
||
0A
|
||
150: - 0A3E 2AFF0000 defb 0x2A, 0xFF, 0x00, 0x00, 3, [dasm_2A], [dasm_2A]>>8, 2, 0x09, 0x80 ;LD HL, (nn)
|
||
03DC0D02
|
||
0980
|
||
151: - 0A48 EDFF4BCF defb 0xED, 0xFF, 0x4B, 0xCF, 4, [dasm_ED_4B], [dasm_ED_4B]>>8, 4, 0x12, 0x80, 0x0A, 0x81 ;LD dd, (nn)
|
||
04E80D04
|
||
12800A81
|
||
152: - 0A54 DDFF2AFF defb 0xDD, 0xFF, 0x2A, 0xFF, 4, [dasm_DD_2A], [dasm_DD_2A]>>8, 1, 0x0A ;LD IX, (nn)
|
||
04F30D01
|
||
0A
|
||
153: - 0A5D FDFF2AFF defb 0xFD, 0xFF, 0x2A, 0xFF, 4, [dasm_FD_2A], [dasm_FD_2A]>>8, 1, 0x0A ;LD IY, (nn)
|
||
04FF0D01
|
||
0A
|
||
154: - 0A66 22FF0000 defb 0x22, 0xFF, 0x00, 0x00, 3, [dasm_22], [dasm_22]>>8, 2, 0x0A, 0x80 ;LD (nn), HL
|
||
030B0E02
|
||
0A80
|
||
155: - 0A70 EDFF43CF defb 0xED, 0xFF, 0x43, 0xCF, 4, [dasm_ED_43], [dasm_ED_43]>>8, 3, 0x0A, 0x80, 0x12 ;LD (nn), dd
|
||
04170E03
|
||
0A8012
|
||
156: - 0A7B DDFF22CF defb 0xDD, 0xFF, 0x22, 0xCF, 4, [dasm_DD_22], [dasm_DD_22]>>8, 2, 0x0A, 0x80 ;LD (nn), IX
|
||
04210E02
|
||
0A80
|
||
157: - 0A85 FDFF22CF defb 0xFD, 0xFF, 0x22, 0xCF, 4, [dasm_FD_22], [dasm_FD_22]>>8, 2, 0x0A, 0x80 ;LD (nn), IY
|
||
042D0E02
|
||
0A80
|
||
158: - 0A8F F9FF0000 defb 0xF9, 0xFF, 0x00, 0x00, 1, [dasm_F9], [dasm_F9]>>8, 0 ;LD SP, HL
|
||
01390E00
|
||
159: - 0A97 DDFFF9FF defb 0xDD, 0xFF, 0xF9, 0xFF, 2, [dasm_DD_F9], [dasm_DD_F9]>>8, 0 ;LD SP, IX
|
||
02430E00
|
||
160: - 0A9F FDFFF9FF defb 0xFD, 0xFF, 0xF9, 0xFF, 2, [dasm_FD_F9], [dasm_FD_F9]>>8, 0 ;LD SP, IY
|
||
024D0E00
|
||
161: - 0AA7 C5CF0000 defb 0xC5, 0xCF, 0x00, 0x00, 1, [dasm_E5], [dasm_E5]>>8, 1, 0x13 ;PUSH qq
|
||
01570E01
|
||
13
|
||
162: - 0AB0 DDFFE5FF defb 0xDD, 0xFF, 0xE5, 0xFF, 2, [dasm_DD_E5], [dasm_DD_E5]>>8, 0 ;PUSH IX
|
||
025D0E00
|
||
163: - 0AB8 FDFFE5FF defb 0xFD, 0xFF, 0xE5, 0xFF, 2, [dasm_FD_E5], [dasm_FD_E5]>>8, 0 ;PUSH IY
|
||
02650E00
|
||
164: - 0AC0 C1CF0000 defb 0xC1, 0xCF, 0x00, 0x00, 1, [dasm_E1], [dasm_E1]>>8, 1, 0x13 ;POP qq
|
||
016D0E01
|
||
13
|
||
165: - 0AC9 DDFFE1FF defb 0xDD, 0xFF, 0xE1, 0xFF, 2, [dasm_DD_E1], [dasm_DD_E1]>>8, 0 ;POP IX
|
||
02730E00
|
||
166: - 0AD1 FDFFE1FF defb 0xFD, 0xFF, 0xE1, 0xFF, 2, [dasm_FD_E1], [dasm_FD_E1]>>8, 0 ;POP IY
|
||
027B0E00
|
||
167:
|
||
168:
|
||
169: - 0AD9 4E4F5000 dasm_00: db "NOP",0x00
|
||
170: ;JUMP Group
|
||
171: - 0ADD 4A502000 dasm_C3: db "JP ",0x00,", ",0x00
|
||
2C2000
|
||
172: - 0AE4 4A522000 dasm_18: db "JR ",0x00
|
||
173: - 0AE8 4A522043 dasm_38: db "JR C, ",0x00
|
||
2C2000
|
||
174: - 0AEF 4A52204E dasm_30: db "JR NC, ",0x00
|
||
432C2000
|
||
175: - 0AF7 4A52205A dasm_28: db "JR Z, ",0x00
|
||
2C2000
|
||
176: - 0AFE 4A52204E dasm_20: db "JR NZ, ",0x00
|
||
5A2C2000
|
||
177: - 0B06 4A502028 dasm_E9: db "JP (HL) ",0x00
|
||
484C2920
|
||
00
|
||
178: - 0B0F 4A502028 dasm_DD: db "JP (IX) ",0x00
|
||
49582920
|
||
00
|
||
179: - 0B18 4A502028 dasm_FD: db "JP (IY) ",0x00
|
||
49592920
|
||
00
|
||
180: - 0B21 444A4E5A dasm_10: db "DJNZ ",0x00
|
||
2000
|
||
181: ;Call and Return Group
|
||
182: - 0B27 43414C4C dasm_CD: db "CALL ",0x00
|
||
2000
|
||
183: - 0B2D 52455420 dasm_C9: db "RET ",0x00
|
||
00
|
||
184: - 0B32 52455449 dasm_ED_4D: db "RETI",0x00
|
||
00
|
||
185: - 0B37 5245544E dasm_ED_45: db "RETN",0x00
|
||
00
|
||
186: - 0B3C 52535420 dasm_FF: db "RST ",0x00
|
||
00
|
||
187: ;8-Bit load group
|
||
188: - 0B41 4C442041 dasm_0A: db "LD A,(BC)",0x00
|
||
2C284243
|
||
2900
|
||
189: - 0B4B 4C442041 dasm_1A: db "LD A,(DE)",0x00
|
||
2C284445
|
||
2900
|
||
190: - 0B55 4C442041 dasm_3A: db "LD A,(",0x00, "h)",0x00
|
||
2C280068
|
||
2900
|
||
191: - 0B5F 4C442028 dasm_02: db "LD (BC), A",0x00
|
||
4243292C
|
||
204100
|
||
192: - 0B6A 4C442028 dasm_12: db "LD (DE), A",0x00
|
||
4445292C
|
||
204100
|
||
193: - 0B75 4C442028 dasm_32: db "LD (",0x00, "h), A",0x00
|
||
0068292C
|
||
204100
|
||
194: - 0B80 4C442000 dasm__LD: db "LD ",0x00
|
||
195: - 0B84 4C442041 dasm__ED_57: db "LD A, I",0x00
|
||
2C204900
|
||
196: - 0B8C 4C442041 dasm__ED_5F: db "LD A, R",0x00
|
||
2C205200
|
||
197: - 0B94 4C442049 dasm__ED_47: db "LD I, A",0x00
|
||
2C204100
|
||
198: - 0B9C 4C442052 dasm__ED_4F: db "LD R, A",0x00
|
||
2C204100
|
||
199: ;General-Purpose Arithmetic and CPU Control Groups
|
||
200: - 0BA4 44414100 dasm_27: db "DAA",0x00
|
||
201: - 0BA8 43504C00 dasm_2F: db "CPL",0x00
|
||
202: - 0BAC 4E454700 dasm_ED_44: db "NEG",0x00
|
||
203: - 0BB0 43434600 dasm_3F: db "CCF",0x00
|
||
204: - 0BB4 53434600 dasm_37: db "SCF",0x00
|
||
205: - 0BB8 48414C54 dasm_76: db "HALT",0x00
|
||
00
|
||
206: - 0BBD 444900 dasm_F3: db "DI",0x00
|
||
207: - 0BC0 454900 dasm_FB: db "EI",0x00
|
||
208: - 0BC3 494D2030 dasm_ED_46: db "IM 0",0x00
|
||
00
|
||
209: - 0BC8 494D2031 dasm_ED_56: db "IM 1",0x00
|
||
00
|
||
210: - 0BCD 494D2032 dasm_ED_5E: db "IM 2",0x00
|
||
00
|
||
211: ;Exchange, Block Transfer, and Search Group
|
||
212: - 0BD2 45582044 dasm_BE: db "EX DE, HL",0x00
|
||
452C2048
|
||
4C00
|
||
213: - 0BDC 45582041 dasm_08: db "EX AF, AF′",0x00
|
||
462C2041
|
||
46E280B2
|
||
00
|
||
214: - 0BE9 45585800 dasm_D9: db "EXX",0x00
|
||
215: - 0BED 45582028 dasm_E3: db "EX (SP), HL",0x00
|
||
5350292C
|
||
20484C00
|
||
216: - 0BF9 45582028 dasm_DD_E3: db "EX (SP), IX",0x00
|
||
5350292C
|
||
20495800
|
||
217: - 0C05 45582028 dasm_FD_E3: db "EX (SP), IY",0x00
|
||
5350292C
|
||
20495900
|
||
218: - 0C11 4C444900 dasm_ED_A0: db "LDI",0x00
|
||
219: - 0C15 4C444952 dasm_ED_B0: db "LDIR",0x00
|
||
00
|
||
220: - 0C1A 4C444400 dasm_ED_A8: db "LDD",0x00
|
||
221: - 0C1E 4C444452 dasm_ED_B8: db "LDDR",0x00
|
||
00
|
||
222: - 0C23 43504900 dasm_ED_A1: db "CPI",0x00
|
||
223: - 0C27 43504952 dasm_ED_B1: db "CPIR",0x00
|
||
00
|
||
224: - 0C2C 43504400 dasm_ED_A9: db "CPD",0x00
|
||
225: - 0C30 43504452 dasm_ED_B9: db "CPDR",0x00
|
||
00
|
||
226: ;8-Bit Arithmetic Group
|
||
227: - 0C35 41444420 dasm_80C6: db "ADD A, ", 0x00
|
||
412C2000
|
||
228: - 0C3D 41444420 dasm_DD_86: db "ADD A, (IX+", 0x00, "h)",0x00
|
||
412C2028
|
||
49582B00
|
||
682900
|
||
229: - 0C4C 41444420 dasm_FD_86: db "ADD A, (IY+", 0x00, "h)",0x00
|
||
412C2028
|
||
49592B00
|
||
682900
|
||
230: - 0C5B 41444320 dasm_C88E: db "ADC A, ", 0x00
|
||
412C2000
|
||
231: - 0C63 41444320 dasm_DD_8E: db "ADC A, (IX+", 0x00, "h)",0x00
|
||
412C2028
|
||
49582B00
|
||
682900
|
||
232: - 0C72 41444320 dasm_FD_8E: db "ADC A, (IY+", 0x00, "h)",0x00
|
||
412C2028
|
||
49592B00
|
||
682900
|
||
233: - 0C81 53554220 dasm__SUB: db "SUB ", 0x00
|
||
00
|
||
234: - 0C86 53554220 dasm_DD_96: db "SUB (IX+", 0x00, "h)",0x00
|
||
2849582B
|
||
00682900
|
||
235: - 0C92 53554220 dasm_FD_96: db "SUB (IY+", 0x00, "h)",0x00
|
||
2849592B
|
||
00682900
|
||
236: - 0C9E 53424320 dasm__SBC: db "SBC A, ", 0x00
|
||
412C2000
|
||
237: - 0CA6 53424320 dasm_DD_9E: db "SBC A,(IX+", 0x00, "h)",0x00
|
||
412C2849
|
||
582B0068
|
||
2900
|
||
238: - 0CB4 53424320 dasm_FD_9E: db "SBC A,(IY+", 0x00, "h)",0x00
|
||
412C2849
|
||
592B0068
|
||
2900
|
||
239: - 0CC2 414E4420 dasm__AND: db "AND ", 0x00
|
||
00
|
||
240: - 0CC7 414E4420 dasm_DD_A6: db "AND (IX+", 0x00, "h)",0x00
|
||
2849582B
|
||
00682900
|
||
241: - 0CD3 414E4420 dasm_FD_A6: db "AND (IY+", 0x00, "h)",0x00
|
||
2849592B
|
||
00682900
|
||
242: - 0CDF 4F522000 dasm__OR: db "OR ", 0x00
|
||
243: - 0CE3 4F522028 dasm_DD_B6: db "OR (IX+", 0x00, "h)",0x00
|
||
49582B00
|
||
682900
|
||
244: - 0CEE 4F522028 dasm_FD_B6: db "OR (IY+", 0x00, "h)",0x00
|
||
49592B00
|
||
682900
|
||
245: - 0CF9 584F5220 dasm__XOR: db "XOR ", 0x00
|
||
00
|
||
246: - 0CFE 584F5220 dasm_DD_AE: db "XOR (IX+", 0x00, "h)",0x00
|
||
2849582B
|
||
00682900
|
||
247: - 0D0A 584F5220 dasm_FD_AE: db "XOR (IY+", 0x00, "h)",0x00
|
||
2849592B
|
||
00682900
|
||
248: - 0D16 43502000 dasm__CP: db "CP ", 0x00
|
||
249: - 0D1A 43502028 dasm_DD_BE: db "CP (IX+", 0x00, "h)",0x00
|
||
49582B00
|
||
682900
|
||
250: - 0D25 43502028 dasm_FD_BE: db "CP (IY+", 0x00, "h)",0x00
|
||
49592B00
|
||
682900
|
||
251: - 0D30 494E4320 dasm__INC: db "INC ", 0x00
|
||
00
|
||
252: - 0D35 494E4320 dasm_DD_34: db "INC (IX+", 0x00, "h)",0x00
|
||
2849582B
|
||
00682900
|
||
253: - 0D41 494E4320 dasm_FD_34: db "INC (IY+", 0x00, "h)",0x00
|
||
2849592B
|
||
00682900
|
||
254: - 0D4D 44454320 dasm__DEC: db "DEC ", 0x00
|
||
00
|
||
255: - 0D52 44454320 dasm_DD_35: db "DEC (IX+", 0x00, "h)",0x00
|
||
2849582B
|
||
00682900
|
||
256: - 0D5E 44454320 dasm_FD_35: db "DEC (IY+", 0x00, "h)",0x00
|
||
2849592B
|
||
00682900
|
||
257: ;16-Bit Arithmetic Group
|
||
258: - 0D6A 41444420 dasm_09: db "ADD HL, ",0x00
|
||
484C2C20
|
||
00
|
||
259: - 0D73 41444320 dasm_ED_4A: db "ADC HL, ",0x00
|
||
484C2C20
|
||
00
|
||
260: - 0D7C 53424320 dasm_ED_42: db "SBC HL, ",0x00
|
||
484C2C20
|
||
00
|
||
261: - 0D85 41444420 dasm_DD_09: db "ADD IX, ",0x00
|
||
49582C20
|
||
00
|
||
262: - 0D8E 41444420 dasm_FD_09: db "ADD IY, ",0x00
|
||
49592C20
|
||
00
|
||
263: - 0D97 494E4320 dasm_03: db "INC ",0x00
|
||
00
|
||
264: - 0D9C 494E4320 dasm_DD_23: db "INC IX, ",0x00
|
||
49582C20
|
||
00
|
||
265: - 0DA5 494E4320 dasm_FD_23: db "INC IY, ",0x00
|
||
49592C20
|
||
00
|
||
266: - 0DAE 44454320 dasm_0B: db "DEC ",0x00
|
||
00
|
||
267: - 0DB3 44454320 dasm_DD_2B: db "DEC IX, ",0x00
|
||
49582C20
|
||
00
|
||
268: - 0DBC 44454320 dasm_FD_2B: db "DEC IY, ",0x00
|
||
49592C20
|
||
00
|
||
269: ;16-Bit Load Group
|
||
270: - 0DC5 4C442000 dasm_01: db "LD ",0x00, ", ",0x00
|
||
2C2000
|
||
271: - 0DCC 4C442049 dasm_DD_01: db "LD IX, ",0x00
|
||
582C2000
|
||
272: - 0DD4 4C442049 dasm_FD_01: db "LD IY, ",0x00
|
||
592C2000
|
||
273: - 0DDC 4C442048 dasm_2A: db "LD HL, (",0x00,"h)",0x00
|
||
4C2C2028
|
||
00682900
|
||
274: - 0DE8 4C442000 dasm_ED_4B: db "LD ",0x00,", (",0x00,"h)",0x00
|
||
2C202800
|
||
682900
|
||
275: - 0DF3 4C442049 dasm_DD_2A: db "LD IX, (",0x00,"h)",0x00
|
||
582C2028
|
||
00682900
|
||
276: - 0DFF 4C442049 dasm_FD_2A: db "LD IY, (",0x00,"h)",0x00
|
||
592C2028
|
||
00682900
|
||
277: - 0E0B 4C442028 dasm_22: db "LD (",0x00,"h), HL",0x00
|
||
0068292C
|
||
20484C00
|
||
278: - 0E17 4C442028 dasm_ED_43: db "LD (",0x00,"h), ",0x00
|
||
0068292C
|
||
2000
|
||
279: - 0E21 4C442028 dasm_DD_22: db "LD (",0x00,"h), IX",0x00
|
||
0068292C
|
||
20495800
|
||
280: - 0E2D 4C442028 dasm_FD_22: db "LD (",0x00,"h), IY",0x00
|
||
0068292C
|
||
20495900
|
||
281: - 0E39 4C442053 dasm_F9: db "LD SP, HL",0x00
|
||
502C2048
|
||
4C00
|
||
282: - 0E43 4C442053 dasm_DD_F9: db "LD SP, IX",0x00
|
||
502C2049
|
||
5800
|
||
283: - 0E4D 4C442053 dasm_FD_F9: db "LD SP, IY",0x00
|
||
502C2049
|
||
5900
|
||
284: - 0E57 50555348 dasm_E5: db "PUSH ",0x00
|
||
2000
|
||
285: - 0E5D 50555348 dasm_DD_E5: db "PUSH IX",0x00
|
||
20495800
|
||
286: - 0E65 50555348 dasm_FD_E5: db "PUSH IY",0x00
|
||
20495900
|
||
287: - 0E6D 50555348 dasm_E1: db "PUSH ",0x00
|
||
2000
|
||
288: - 0E73 50555348 dasm_DD_E1: db "PUSH IX",0x00
|
||
20495800
|
||
289: - 0E7B 50555348 dasm_FD_E1: db "PUSH IY",0x00
|
||
20495900
|
||
290:
|
||
291: ;Misc
|
||
292: - 0E83 2E3F2E00 dasm_UU: db ".?.",0x00
|
||
293: - 0E87 20202020 dasm_UW: db " ",0x00
|
||
00
|
||
294:
|
||
295: - 0E8C dasm_printFlags_table:
|
||
296: - 0E8C 4E5A db "NZ"
|
||
297: - 0E8E 5A00 db "Z",0
|
||
298: - 0E90 4E43 db "NC"
|
||
299: - 0E92 4300 db "C",0
|
||
300: - 0E94 504F db "PO"
|
||
301: - 0E96 5045 db "PE"
|
||
302: - 0E98 5000 db "P",0
|
||
303: - 0E9A 4D00 db "M",0
|
||
304:
|
||
305: - 0E9C dasm_printRegister8_table:
|
||
306: - 0E9C 42 db "B"
|
||
307: - 0E9D 43 db "C"
|
||
308: - 0E9E 44 db "D"
|
||
309: - 0E9F 45 db "E"
|
||
310: - 0EA0 48 db "H"
|
||
311: - 0EA1 4C db "L"
|
||
312: - 0EA2 53 db "S" ;only 18 bit (SP)
|
||
313: - 0EA3 50 db "P" ;only 18 bit (SP)
|
||
314:
|
||
315: - 0EA4 dasm_printRegisterIX_table:
|
||
316: - 0EA4 4243 db "BC"
|
||
317: - 0EA6 4445 db "DE"
|
||
318: - 0EA8 4958 db "IX"
|
||
319: - 0EAA 5350 db "SP"
|
||
320: - 0EAC dasm_printRegisterIY_table:
|
||
321: - 0EAC 4243 db "BC"
|
||
322: - 0EAE 4445 db "DE"
|
||
323: - 0EB0 4959 db "IY"
|
||
324: - 0EB2 5350 db "SP"
|
||
325:
|
||
326: - 0EB4 dasm_printRegisterSP_table:
|
||
327: - 0EB4 4243 db "BC"
|
||
328: - 0EB6 4445 db "DE"
|
||
329: - 0EB8 484C db "HL"
|
||
330: - 0EBA 4146 db "AF"
|
||
331:
|
||
332: - 0EBC dasm_printRegister8_table_HL:
|
||
**** main.asm ****
|
||
496: - 0EBC 28484C29 db "(HL)", 0
|
||
00
|
||
497: .include "rst.s"
|
||
**** include/rst.s ****
|
||
1: - 0EC1 EXEC_RST_08:
|
||
2: 7927+17 0EC1 CDB402 call print_char
|
||
3: 7944+10 0EC4 C9 ret
|
||
4:
|
||
5:
|
||
6: - 0EC5 EXEC_RST_10:
|
||
7: 7954+11 0EC5 C5 push bc
|
||
8: 7965+11 0EC6 D5 push de
|
||
9: 7976+11 0EC7 E5 push hl
|
||
10: ;call vdp_cursor_on
|
||
11: 7987+17 0EC8 CDF502 call read_char
|
||
12: 8004+11 0ECB F5 push af
|
||
13: ;call vdp_cursor_off
|
||
14: 8015+10 0ECC F1 pop af
|
||
15: 8025+10 0ECD E1 pop hl
|
||
16: 8035+10 0ECE D1 pop de
|
||
17: 8045+10 0ECF C1 pop bc
|
||
18: 8055+10 0ED0 C9 ret
|
||
19:
|
||
20: - 0ED1 EXEC_RST_18:
|
||
21: 8065+7 0ED1 3E00 ld a,0
|
||
22: 8072+10 0ED3 C9 ret
|
||
**** main.asm ****
|
||
498: .include "beep.s"
|
||
**** include/beep.s ****
|
||
1: ;------------------------------------------------------------------------------
|
||
2: ; beep
|
||
3: ;
|
||
4: ; Beeps the speaker
|
||
5: ; DE sets duration
|
||
6: ;------------------------------------------------------------------------------
|
||
7: - 0ED4 beep:
|
||
8: 8082+11 0ED4 F5 push AF
|
||
9: 8093+11 0ED5 C5 push BC
|
||
10: 8104+11 0ED6 D5 push DE
|
||
11: - 0ED7 beep_loop:
|
||
12: 8115+7 0ED7 3E08 LD A,0x08
|
||
13: 8122+11 0ED9 D3F4 OUT (CS_PIO_AD), A
|
||
14: 8133+10 0EDB 012800 LD BC, 0x28
|
||
15: 8143+17 0EDE CDF40E CALL beep_pause
|
||
16: 8160+7 0EE1 3E00 LD A,0x00
|
||
17: 8167+11 0EE3 D3F4 OUT (CS_PIO_AD), A
|
||
18: 8178+10 0EE5 012400 LD BC, 0x24
|
||
19: 8188+17 0EE8 CDF40E CALL beep_pause
|
||
20: 8205+6 0EEB 1B DEC DE
|
||
21: 8211+4 0EEC 7A ld A,D
|
||
22: 8215+4 0EED B3 or E
|
||
23: 8219+7+5 0EEE 20E7 jr NZ, beep_loop
|
||
24: 8226+10 0EF0 D1 pop de
|
||
25: 8236+10 0EF1 C1 pop bc
|
||
26: 8246+10 0EF2 F1 pop af
|
||
27: 8256+10 0EF3 C9 ret
|
||
28:
|
||
29: - 0EF4 beep_pause:
|
||
30: 8266+8 0EF4 ED44 NEG ; 8 T-states
|
||
31: 8274+8 0EF6 ED44 NEG ; 8 T-states
|
||
32: 8282+8 0EF8 ED44 NEG ; 8 T-states
|
||
33: 8290+8 0EFA ED44 NEG ; 8 T-states
|
||
34: 8298+6 0EFC 0B DEC BC ; 6 T-states
|
||
35: 8304+4 0EFD 79 LD A,C ; 9 T-states
|
||
36: 8308+4 0EFE B0 OR B ; 4 T-states
|
||
37: 8312+10 0EFF C2F40E JP NZ,beep_pause ; 10 T-states
|
||
**** main.asm ****
|
||
499: 8322+10 0F02 C9 RET ; Pause complete, RETurn
|
||
500: ; Strings
|
||
501: - 0F03 STR_Banner_Start:
|
||
502: - 0F03 5A384320 db "Z8C Monitor V2 by Dennis Gunia (2022)",0
|
||
4D6F6E69
|
||
746F7220
|
||
56322062
|
||
79204465
|
||
6E6E6973
|
||
2047756E
|
||
69612028
|
||
32303232
|
||
2900
|
||
503: - 0F29 STR_SyntaxError:
|
||
504: - 0F29 73796E3F db "syn?",0
|
||
00
|
||
505: - 0F2E STR_Unknown:
|
||
506: - 0F2E 636D643F db "cmd?",0
|
||
00
|
||
507: - 0F33 STR_HEXDUMP_HEADER:
|
||
508: - 0F33 42415345 db 'BASE 0 1 2 3 4 5 6 7',0
|
||
20302020
|
||
31202032
|
||
20203320
|
||
20342020
|
||
35202036
|
||
20203700
|
||
509:
|
||
510: .include "xmodem.s"
|
||
**** include/xmodem.s ****
|
||
1: ;-------------------------------------------------------------------------
|
||
2: ; Z80 XMODEM implementation by Dennis Gunia
|
||
3: ; 2022 - www,dennisgunia.de
|
||
4: ;
|
||
5: ; important doc: https://web.mit.edu/6.115/www/amulet/xmodem.htm
|
||
6: ; http://www.blunk-electronic.de/train-z/pdf/xymodem.pdf
|
||
7: ;-------------------------------------------------------------------------
|
||
8:
|
||
9: ;Symbols
|
||
10: - 0001 SYM_SOH equ 0x01
|
||
11: - 0004 SYM_EOT equ 0x04
|
||
12: - 0006 SYM_ACK equ 0x06
|
||
13: - 0015 SYM_NAK equ 0x15
|
||
14: - 0017 SYM_ETB equ 0x17
|
||
15: - 0018 SYM_CAN equ 0x18
|
||
16: - 0043 SYM_C equ 0x43
|
||
17:
|
||
18: ;Memory locations
|
||
19: - 40FB MEM_VAR_BLOCK equ 0x40FB ;last block
|
||
20: - 40FC MEM_VAR_TIMEA equ 0x40FC ;timer var (mills)
|
||
21: - 40FE MEM_VAR_TIMER equ 0x40FE ;timer var (seconds)
|
||
22: - 40FE MEM_INT_VEC_T equ 0x40FE ;interrupt vector table
|
||
23:
|
||
24: - 4400 MEM_LOC_LOAD equ 0x4400 ;load location for program
|
||
25:
|
||
26: ;XMODEM routine
|
||
27: - 0F4F xmodem_init:
|
||
28: 8332+17 0F4F CD0F03 call A_RTS_OFF
|
||
29:
|
||
30: 8349+7 0F52 3EA7 LD A,10100111b ; Init CTC Channel 3
|
||
31: 8356+11 0F54 D306 OUT (CS_CTC_2),A
|
||
32: 8367+7 0F56 3E0E LD A,14 ; 1028.57Hz ISR
|
||
33: 8374+11 0F58 D306 OUT (CS_CTC_2),A
|
||
34: 8385+7 0F5A 3E00 LD A,00h ; Set CTC Ch3 Interrupt Vector
|
||
35: 8392+11 0F5C D304 OUT (CS_CTC_0),A
|
||
36: ;load int vector to ram
|
||
37: 8403+10 0F5E 212F10 ld hl,xmodem_int ;CTC Ch3 INT routine
|
||
38: 8413+16 0F61 220442 ld (0x4200 + 0x04),hl
|
||
39: ;reset timer vars
|
||
40: 8429+10 0F64 210000 ld hl,0x0000
|
||
41: 8439+16 0F67 22FC40 ld (MEM_VAR_TIMEA),hl
|
||
42: 8455+16 0F6A 22FE40 ld (MEM_VAR_TIMER),hl
|
||
43:
|
||
44: 8471+7 0F6D 3E42 ld a,0x42 ; Set interrupt vector register
|
||
45: 8478+9 0F6F ED47 ld i,a
|
||
46: 8487+8 0F71 ED5E im 2 ; Z80 Interrupt mode
|
||
47:
|
||
48: 8495+10 0F73 21AA10 ld hl,MSG_START ; Print start banner
|
||
49: 8505+17 0F76 CDBC02 call print_str
|
||
50: 8522+4 0F79 FB ei ; Enable interrupts
|
||
51: ; init done. Continue with xmodem_await_conn
|
||
52: 8526+17 0F7A CDE010 call xmodem_wait
|
||
53:
|
||
54: - 0F7D xmodem_await_conn: ;Wait for initial connection
|
||
55: 8543+7 0F7D 3E43 ld a, SYM_C ;Send C to notify sender, that we want CRC
|
||
56: 8550+17 0F7F CD8010 call xmodem_out
|
||
57: 8567+17 0F82 CD5310 call xmodem_read_wait ;Read with timeout
|
||
58: 8584+10 0F85 DA7D0F jp c, xmodem_await_conn ;Carry flag set = timeout -> repeat
|
||
59: ;else continue
|
||
60:
|
||
61: - 0F88 xmodem_packet: ;XmodemCRC packet start
|
||
62: ;use 1st byte to decide further processing
|
||
63: 8594+7 0F88 FE04 cp SYM_EOT ;End of Transmission
|
||
64: 8601+10 0F8A CAE60F jp z, xmodem_packet_EOT
|
||
65: 8611+7 0F8D FE18 cp SYM_CAN ;Cancel (Force receiver to start sending C's)
|
||
66: 8618+10 0F8F CA7D0F jp z, xmodem_await_conn
|
||
67: 8628+7 0F92 FE01 cp SYM_SOH ;Start of
|
||
68: 8635+10 0F94 CA9A0F jp z, xmodem_packet_get
|
||
69:
|
||
70: 8645+10 0F97 C3EE0F jp xmodem_err ;anything else is an error -> abort transmission
|
||
71:
|
||
72: - 0F9A xmodem_packet_get: ;if first byte == SYM_SOH -> receive block
|
||
73: 8655+17 0F9A CD5310 call xmodem_read_wait ;get byte 2 => block ID
|
||
74: 8672+10 0F9D DAD210 jp c, xmodem_nak
|
||
75: 8682+4 0FA0 47 ld b,a
|
||
76: 8686+13 0FA1 32FB40 ld (MEM_VAR_BLOCK), a ;store block id to memory
|
||
77: 8699+17 0FA4 CD5310 call xmodem_read_wait ;get byte 3 => block ID complement
|
||
78: 8716+10 0FA7 DAD210 jp c, xmodem_nak
|
||
79: 8726+4 0FAA 80 add b
|
||
80: 8730+7 0FAB FEFF cp 255 ;both size infos should always sum to 255
|
||
81: 8737+10 0FAD C2EE0F jp nz,xmodem_err ;if not 255 then its an error
|
||
82:
|
||
83: ;calculate block start address in RAM
|
||
84: ;multiply by 128
|
||
85: ;use more efficient bit-wise operations
|
||
86: 8747+4 0FB0 3D dec a ;a-1 to remove 1 sector offset
|
||
87: 8751+4 0FB1 78 ld a,b
|
||
88: 8755+4 0FB2 1F rra ;shift 1 bit to the right
|
||
89: 8759+7 0FB3 E67F and 0x7F
|
||
90: 8766+4 0FB5 67 ld h,a
|
||
91: 8770+4 0FB6 78 ld a,b
|
||
92: 8774+4 0FB7 3D dec a ;a-1 to remove 1 sector offset
|
||
93: 8778+4 0FB8 0F rrca ;shift bit0 to bit 7
|
||
94: 8782+7 0FB9 E680 and 0x80 ;mask out all other bits
|
||
95: 8789+4 0FBB 6F ld l,a
|
||
96: ;result:
|
||
97: ;hl = 0aaaaaaa a000000
|
||
98:
|
||
99: 8793+10 0FBC 110044 ld de,MEM_LOC_LOAD
|
||
100: 8803+11 0FBF 19 add hl,de ;add calculated offset to base address
|
||
101: ;hl now contains the true start address of this sector
|
||
102:
|
||
103: 8814+7 0FC0 0680 ld b,128 ;preload counter for data baytes
|
||
104: 8821+7 0FC2 0E00 ld c,0 ;packet length counter ( used for overflow error )
|
||
105:
|
||
106: - 0FC4 xmodem_packet_get_data: ;get 128 data bytes (loop)
|
||
107: 8828+11 0FC4 E5 push hl ;push hl onto stack because xmodem_read_wait destroys hl
|
||
108: 8839+17 0FC5 CD5310 call xmodem_read_wait ;read byte or timeout
|
||
109: 8856+10 0FC8 DAD210 jp c, xmodem_nak ;if timeout -> nak and retry
|
||
110: 8866+10 0FCB E1 pop hl ;restore hl
|
||
111: 8876+7 0FCC 77 ld (hl), a ;store received byte in memory
|
||
112: 8883+6 0FCD 23 inc hl ;increment pointer
|
||
113: 8889+4 0FCE 0C inc c ;increment packet length counter
|
||
114: 8893+4 0FCF 05 dec b ;decerment data bytes remmaining
|
||
115: 8897+10 0FD0 C2C40F jp nz, xmodem_packet_get_data ;if bytes remaining, loop
|
||
116: ;else continue with crc bytes
|
||
117:
|
||
118: - 0FD3 xmodem_packet_get_crc: ;get 16-Bit CRC
|
||
119: 8907+17 0FD3 CD5310 call xmodem_read_wait
|
||
120: 8924+10 0FD6 DAD210 jp c, xmodem_nak
|
||
121: 8934+4 0FD9 57 ld d,a
|
||
122: 8938+4 0FDA 0C inc c
|
||
123: 8942+17 0FDB CD5310 call xmodem_read_wait
|
||
124: 8959+10 0FDE DAD210 jp c, xmodem_nak
|
||
125: 8969+4 0FE1 5F ld e,a
|
||
126: 8973+4 0FE2 0C inc c
|
||
127: ;de now contains CRC value
|
||
128: ;check if c is not bigger than 130 byte (128 data + 2crc)
|
||
129: ;TODO if so NACK
|
||
130:
|
||
131: ;de contains 16-bit CRC
|
||
132: ;TODO if crc error NACK
|
||
133: 8977+10 0FE3 C3C410 jp xmodem_ack ;ack block -> then jump to start again
|
||
134:
|
||
135: - 0FE6 xmodem_packet_EOT: ;End of transmission SUB.
|
||
136: 8987+7 0FE6 3E06 ld a, SYM_ACK ;Acknowledge EOT
|
||
137: 8994+17 0FE8 CD8010 call xmodem_out
|
||
138: 9011+10 0FEB C32810 jp xmodem_end ;and end xmodem
|
||
139:
|
||
140:
|
||
141:
|
||
142: - 0FEE xmodem_err: ;non recoverable error -> abort
|
||
143: 9021+7 0FEE 3E18 ld a, SYM_CAN
|
||
144: 9028+17 0FF0 CD8010 call xmodem_out
|
||
145: 9045+7 0FF3 3E18 ld a, SYM_CAN
|
||
146: 9052+17 0FF5 CD8010 call xmodem_out
|
||
147: 9069+7 0FF8 3E18 ld a, SYM_CAN
|
||
148: 9076+17 0FFA CD8010 call xmodem_out
|
||
149: 9093+7 0FFD 3E18 ld a, SYM_CAN
|
||
150: 9100+17 0FFF CD8010 call xmodem_out
|
||
151: 9117+7 1002 3E18 ld a, SYM_CAN
|
||
152: 9124+17 1004 CD8010 call xmodem_out
|
||
153: 9141+7 1007 3E18 ld a, SYM_CAN
|
||
154: 9148+17 1009 CD8010 call xmodem_out
|
||
155: 9165+7 100C 3E18 ld a, SYM_CAN
|
||
156: 9172+17 100E CD8010 call xmodem_out
|
||
157: 9189+7 1011 3E18 ld a, SYM_CAN
|
||
158: 9196+17 1013 CD8010 call xmodem_out
|
||
159: 9213+7 1016 3E18 ld a, SYM_CAN
|
||
160: 9220+17 1018 CD8010 call xmodem_out
|
||
161: 9237+7 101B 3E18 ld a, SYM_CAN
|
||
162: 9244+17 101D CD8010 call xmodem_out
|
||
163: 9261+7 1020 3E18 ld a, SYM_CAN
|
||
164:
|
||
165: 9268+10 1022 219110 ld hl, MSG_ERROR
|
||
166: 9278+17 1025 CDBC02 call print_str
|
||
167:
|
||
168: ;overflow to end
|
||
169: - 1028 xmodem_end:
|
||
170: 9295+4 1028 F3 di ;disable interrupts
|
||
171: 9299+17 1029 CDCE02 call print_newLine ;print new line
|
||
172: 9316+10 102C C39600 jp PROMPT_BEGIN ;return ti prompt
|
||
173:
|
||
174: ;isr is used as counter for timeouts
|
||
175: - 102F xmodem_int:
|
||
176: 9326+4 102F F3 di ;setup ISR (disable further interrupts, exchange registers)
|
||
177: 9330+4 1030 08 ex AF,AF'
|
||
178: 9334+4 1031 D9 exx
|
||
179:
|
||
180: 9338+16 1032 2AFC40 ld hl,(MEM_VAR_TIMEA) ;millis counter
|
||
181: 9354+6 1035 23 inc hl
|
||
182: 9360+16 1036 22FC40 ld (MEM_VAR_TIMEA),hl
|
||
183:
|
||
184: 9376+10 1039 110404 ld de,1028 ;every 1028 millis counter
|
||
185: 9386+15 103C ED52 sbc hl,de
|
||
186: 9401+10 103E C24E10 jp nz, xmodem_int_cont ;if less than 1028 millis, loop
|
||
187:
|
||
188: 9411+10 1041 210000 ld hl,0 ;reset millis
|
||
189: 9421+16 1044 22FC40 ld (MEM_VAR_TIMEA),hl
|
||
190: 9437+16 1047 2AFE40 ld hl,(MEM_VAR_TIMER) ;incement seconds
|
||
191: 9453+6 104A 23 inc hl
|
||
192: 9459+16 104B 22FE40 ld (MEM_VAR_TIMER),hl
|
||
193: - 104E xmodem_int_cont: ;end isr
|
||
194: 9475+4 104E 08 ex AF,AF' ;restore registers
|
||
195: 9479+4 104F D9 exx
|
||
196: 9483+4 1050 FB EI ;enable interrupts
|
||
197: 9487+14 1051 ED4D reti ;exit ISR
|
||
198:
|
||
199:
|
||
200:
|
||
201:
|
||
202:
|
||
203: ; A returns char
|
||
204: ; Carry is set if timeout
|
||
205: - 0003 xmodem_read_timeount equ 3 ;3 seconds timeout
|
||
206: - 1053 xmodem_read_wait:
|
||
207: 9501+4 1053 F3 di
|
||
208: 9505+10 1054 210000 ld hl,0
|
||
209: 9515+16 1057 22FC40 ld (MEM_VAR_TIMEA),hl
|
||
210: 9531+16 105A 22FE40 ld (MEM_VAR_TIMER),hl
|
||
211: 9547+4 105D FB ei
|
||
212: 9551+17 105E CD1803 call A_RTS_ON
|
||
213: - 1061 xmodem_read_wait_loop:
|
||
214: ;check timeout
|
||
215: 9568+16 1061 2AFE40 ld hl,(MEM_VAR_TIMER)
|
||
216: 9584+4 1064 7D ld a, l
|
||
217: 9588+7 1065 FE03 cp xmodem_read_timeount
|
||
218: 9595+10 1067 CA7E10 jp z, xmodem_read_wait_timeout ;if timeout retry
|
||
219:
|
||
220: ; if no timeout
|
||
221: 9605+4 106A AF xor a ; a = 0
|
||
222: 9609+11 106B D309 out (CS_SIO_A_C), a ; select reg 0
|
||
223: 9620+11 106D DB09 in a, (CS_SIO_A_C) ; read reg 0
|
||
224: 9631+7 106F E601 and 1 ; mask D0 (recieve char available)
|
||
225: 9638+10 1071 CA6110 jp Z,xmodem_read_wait_loop ; wait if no char
|
||
226:
|
||
227: ; if char avail
|
||
228: 9648+11 1074 DB08 in a, (CS_SIO_A_D) ; read char
|
||
229: ;call debug_a_hex
|
||
230: 9659+11 1076 F5 push af
|
||
231: 9670+17 1077 CD0F03 call A_RTS_OFF
|
||
232: 9687+10 107A F1 pop af
|
||
233: 9697+4 107B 37 scf
|
||
234: 9701+4 107C 3F ccf
|
||
235: 9705+10 107D C9 ret ; return
|
||
236: - 107E xmodem_read_wait_timeout:
|
||
237: 9715+4 107E 37 scf
|
||
238: 9719+10 107F C9 ret
|
||
239:
|
||
240:
|
||
241: - 1080 xmodem_out:
|
||
242: 9729+11 1080 D308 out (CS_SIO_A_D), a
|
||
243: 9740+17 1082 CD8610 call xmodem_wait_out
|
||
244: 9757+10 1085 C9 ret
|
||
245:
|
||
246: - 1086 xmodem_wait_out:
|
||
247: 9767+4 1086 97 sub a ;clear a, write into WR0: select RR0
|
||
248: 9771+4 1087 3C inc a ;select RR1
|
||
249: 9775+11 1088 D309 out (CS_SIO_A_C),A
|
||
250: 9786+11 108A DB09 in A,(CS_SIO_A_C) ;read RRx
|
||
251: 9797+8 108C CB47 bit 0,A
|
||
252: 9805+7+5 108E 28F6 jr z,xmodem_wait_out
|
||
253: 9812+10 1090 C9 ret
|
||
254:
|
||
255: - 1091 MSG_ERROR:
|
||
256: - 1091 4572726F db "Error: unexpected byte",13,10,0
|
||
723A2075
|
||
6E657870
|
||
65637465
|
||
64206279
|
||
74650D0A
|
||
00
|
||
257:
|
||
258: - 10AA MSG_START:
|
||
259: - 10AA 41776169 db "Await xmodem connection",13,10,0
|
||
7420786D
|
||
6F64656D
|
||
20636F6E
|
||
6E656374
|
||
696F6E0D
|
||
0A00
|
||
260:
|
||
261:
|
||
262: - 10C4 xmodem_ack: ;ack routine. Only use when expecting transmission afterwards.
|
||
263: 9822+7 10C4 3E06 ld a, SYM_ACK ;send ACK
|
||
264: 9829+17 10C6 CD8010 call xmodem_out
|
||
265: 9846+17 10C9 CD5310 call xmodem_read_wait ;wait for response
|
||
266: 9863+10 10CC DAC410 jp c, xmodem_ack ;if timeout repeat
|
||
267: 9873+10 10CF C3880F jp xmodem_packet ;if received, continue with new packet
|
||
268:
|
||
269: - 10D2 xmodem_nak: ;nak routine. Only use when expecting transmission afterwards.
|
||
270: 9883+7 10D2 3E15 ld a, SYM_NAK ;send NAK
|
||
271: 9890+17 10D4 CD8010 call xmodem_out
|
||
272: 9907+17 10D7 CD5310 call xmodem_read_wait ;wait for response
|
||
273: 9924+10 10DA DAD210 jp c, xmodem_nak ;if timeout repeat
|
||
274: 9934+10 10DD C3880F jp xmodem_packet ;if received, continue with new packet
|
||
275:
|
||
276: - 10E0 xmodem_wait:
|
||
277: 9944+10 10E0 21FF00 ld hl, 0xFF
|
||
278: 9954+10 10E3 010100 ld bc, 0x01
|
||
279: - 10E6 xmodem_wait_1:
|
||
280: 9964+4 10E6 00 nop
|
||
281: 9968+4 10E7 00 nop
|
||
282: 9972+4 10E8 00 nop
|
||
283: 9976+4 10E9 00 nop
|
||
284: 9980+15 10EA ED42 sbc hl,bc
|
||
285: 9995+5+6 10EC C8 ret Z
|
||
**** main.asm ****
|
||
511:10000+12 10ED 18F7 jr xmodem_wait_1
|
||
**** main.asm ****
|
||
512: ;.include "debug.s"
|
||
|
||
|
||
|
||
Statistics:
|
||
|
||
4 passes
|
||
0 jr promotions
|
||
331 symbols
|
||
4314 bytes
|
||
|
||
|
||
|
||
Symbol Table:
|
||
|
||
AY0_WRITE_REG 8E 142
|
||
A_RTS_OFF 30F 783
|
||
A_RTS_ON 318 792
|
||
CMD_DASM 236 566
|
||
CMD_EXEC 12C 300
|
||
CMD_IO_READ 21A 538
|
||
CMD_IO_WRITE 1F1 497
|
||
CMD_SET 1B5 437
|
||
CMD_SET_END 1EB 491
|
||
CMD_SET_LOOP 1D0 464
|
||
CMD_SYNTAX_ERROR 26F 623
|
||
CMD_VIEW 14B 331
|
||
CMD_VIEW_END 1AF 431
|
||
CMD_VIEW_ROW 184 388
|
||
CMD_VIEW_ROW_LOOP 196 406
|
||
CONSOLE_INIT 27B 635
|
||
CONSOLE_INIT_CTC 27B 635
|
||
CONSOLE_INIT_SIO 283 643
|
||
CS_BANK =00 0
|
||
CS_CTC_0 =04 4
|
||
CS_CTC_1 =05 5
|
||
CS_CTC_2 =06 6
|
||
CS_CTC_3 =07 7
|
||
CS_DIP =01 1
|
||
CS_PIO_AC =F6 246
|
||
CS_PIO_AD =F4 244
|
||
CS_PIO_BC =F7 247
|
||
CS_PIO_BD =F5 245
|
||
CS_SIO_A_C =09 9
|
||
CS_SIO_A_D =08 8
|
||
CS_SIO_B_C =0B 11
|
||
CS_SIO_B_D =0A 10
|
||
DHEX_TO_BYTE 321 801
|
||
DHEX_TO_BYTE_FAILED 33D 829
|
||
EXEC_RST_08 EC1 3777
|
||
EXEC_RST_10 EC5 3781
|
||
EXEC_RST_18 ED1 3793
|
||
HEX_TO_BIN 341 833
|
||
HEX_TO_BIN_2 34F 847
|
||
HEX_TO_INVALID_2 356 854
|
||
INT_VEC 1B 27
|
||
IO_AY0_ADDR =40 64
|
||
IO_AY0_DATA =41 65
|
||
IO_AY1_ADDR =42 66
|
||
IO_AY1_DATA =43 67
|
||
IO_REG0 =20 32
|
||
IO_RTC_AMPM =25 37
|
||
IO_RTC_CTR_D =2D 45
|
||
IO_RTC_CTR_E =2E 46
|
||
IO_RTC_CTR_F =2F 47
|
||
IO_RTC_DAY0 =26 38
|
||
IO_RTC_DAY1 =27 39
|
||
IO_RTC_HOUR =24 36
|
||
IO_RTC_MIN0 =22 34
|
||
IO_RTC_MIN1 =23 35
|
||
IO_RTC_MON0 =28 40
|
||
IO_RTC_MON1 =29 41
|
||
IO_RTC_SEC0 =20 32
|
||
IO_RTC_SEC1 =21 33
|
||
IO_RTC_WEEK =2C 44
|
||
IO_RTC_YEAR1 =2B 43
|
||
IO_RTC_YERR0 =2A 42
|
||
Includes 27B 635
|
||
MEM_INT_VEC_T =40FE 16638
|
||
MEM_LOC_LOAD =4400 17408
|
||
MEM_VAR_BLOCK =40FB 16635
|
||
MEM_VAR_TIMEA =40FC 16636
|
||
MEM_VAR_TIMER =40FE 16638
|
||
MSG_CLEAR 307 775
|
||
MSG_ERROR 1091 4241
|
||
MSG_START 10AA 4266
|
||
PRG_RAM_START =4110 16656
|
||
PRG_RAM_TOP =FF00 65280
|
||
PROG_MEM_START =4000 16384
|
||
PROG_ROM_START = 100 256
|
||
PROMPT_BEGIN 96 150
|
||
PROMPT_BEGIN_READ_BACKSPACE D3 211
|
||
PROMPT_BEGIN_READ_LOOP A2 162
|
||
PROMPT_BEGIN_READ_PROCESS F9 249
|
||
RST_00 00 0
|
||
RST_08 08 8
|
||
RST_10 10 16
|
||
RST_18 18 24
|
||
STACK_RAM_TOP =FFFF 65535
|
||
START_ROM =00 0
|
||
STRCONV_BYTES_TO_HEX 358 856
|
||
STRCONV_BYTES_TO_HEX_1 367 871
|
||
STRCONV_BYTES_TO_HEX_2 371 881
|
||
STR_Banner_Start F03 3843
|
||
STR_HEXDUMP_HEADER F33 3891
|
||
STR_SyntaxError F29 3881
|
||
STR_Unknown F2E 3886
|
||
SYM_ACK =06 6
|
||
SYM_C =43 67
|
||
SYM_CAN =18 24
|
||
SYM_EOT =04 4
|
||
SYM_ETB =17 23
|
||
SYM_NAK =15 21
|
||
SYM_SOH =01 1
|
||
SYS_BUF_START =4010 16400
|
||
SYS_RAM_START =4000 16384
|
||
VAR_CONSOLE_BAUD=18 24
|
||
VAR_CONSOLE_CONF=0F 15
|
||
VDP_MEM =80 128
|
||
VDP_REG =81 129
|
||
beep ED4 3796
|
||
beep_loop ED7 3799
|
||
beep_pause EF4 3828
|
||
dasm_00 AD9 2777
|
||
dasm_01 DC5 3525
|
||
dasm_02 B5F 2911
|
||
dasm_03 D97 3479
|
||
dasm_08 BDC 3036
|
||
dasm_09 D6A 3434
|
||
dasm_0A B41 2881
|
||
dasm_0B DAE 3502
|
||
dasm_10 B21 2849
|
||
dasm_12 B6A 2922
|
||
dasm_18 AE4 2788
|
||
dasm_1A B4B 2891
|
||
dasm_20 AFE 2814
|
||
dasm_22 E0B 3595
|
||
dasm_27 BA4 2980
|
||
dasm_28 AF7 2807
|
||
dasm_2A DDC 3548
|
||
dasm_2F BA8 2984
|
||
dasm_30 AEF 2799
|
||
dasm_32 B75 2933
|
||
dasm_37 BB4 2996
|
||
dasm_38 AE8 2792
|
||
dasm_3A B55 2901
|
||
dasm_3F BB0 2992
|
||
dasm_76 BB8 3000
|
||
dasm_80C6 C35 3125
|
||
dasm_BE BD2 3026
|
||
dasm_C3 ADD 2781
|
||
dasm_C88E C5B 3163
|
||
dasm_C9 B2D 2861
|
||
dasm_CD B27 2855
|
||
dasm_D9 BE9 3049
|
||
dasm_DD B0F 2831
|
||
dasm_DD_01 DCC 3532
|
||
dasm_DD_09 D85 3461
|
||
dasm_DD_22 E21 3617
|
||
dasm_DD_23 D9C 3484
|
||
dasm_DD_2A DF3 3571
|
||
dasm_DD_2B DB3 3507
|
||
dasm_DD_34 D35 3381
|
||
dasm_DD_35 D52 3410
|
||
dasm_DD_86 C3D 3133
|
||
dasm_DD_8E C63 3171
|
||
dasm_DD_96 C86 3206
|
||
dasm_DD_9E CA6 3238
|
||
dasm_DD_A6 CC7 3271
|
||
dasm_DD_AE CFE 3326
|
||
dasm_DD_B6 CE3 3299
|
||
dasm_DD_BE D1A 3354
|
||
dasm_DD_E1 E73 3699
|
||
dasm_DD_E3 BF9 3065
|
||
dasm_DD_E5 E5D 3677
|
||
dasm_DD_F9 E43 3651
|
||
dasm_E1 E6D 3693
|
||
dasm_E3 BED 3053
|
||
dasm_E5 E57 3671
|
||
dasm_E9 B06 2822
|
||
dasm_ED_42 D7C 3452
|
||
dasm_ED_43 E17 3607
|
||
dasm_ED_44 BAC 2988
|
||
dasm_ED_45 B37 2871
|
||
dasm_ED_46 BC3 3011
|
||
dasm_ED_4A D73 3443
|
||
dasm_ED_4B DE8 3560
|
||
dasm_ED_4D B32 2866
|
||
dasm_ED_56 BC8 3016
|
||
dasm_ED_5E BCD 3021
|
||
dasm_ED_A0 C11 3089
|
||
dasm_ED_A1 C23 3107
|
||
dasm_ED_A8 C1A 3098
|
||
dasm_ED_A9 C2C 3116
|
||
dasm_ED_B0 C15 3093
|
||
dasm_ED_B1 C27 3111
|
||
dasm_ED_B8 C1E 3102
|
||
dasm_ED_B9 C30 3120
|
||
dasm_F3 BBD 3005
|
||
dasm_F9 E39 3641
|
||
dasm_FB BC0 3008
|
||
dasm_FD B18 2840
|
||
dasm_FD_01 DD4 3540
|
||
dasm_FD_09 D8E 3470
|
||
dasm_FD_22 E2D 3629
|
||
dasm_FD_23 DA5 3493
|
||
dasm_FD_2A DFF 3583
|
||
dasm_FD_2B DBC 3516
|
||
dasm_FD_34 D41 3393
|
||
dasm_FD_35 D5E 3422
|
||
dasm_FD_86 C4C 3148
|
||
dasm_FD_8E C72 3186
|
||
dasm_FD_96 C92 3218
|
||
dasm_FD_9E CB4 3252
|
||
dasm_FD_A6 CD3 3283
|
||
dasm_FD_AE D0A 3338
|
||
dasm_FD_B6 CEE 3310
|
||
dasm_FD_BE D25 3365
|
||
dasm_FD_E1 E7B 3707
|
||
dasm_FD_E3 C05 3077
|
||
dasm_FD_E5 E65 3685
|
||
dasm_FD_F9 E4D 3661
|
||
dasm_FF B3C 2876
|
||
dasm_UU E83 3715
|
||
dasm_UW E87 3719
|
||
dasm__AND CC2 3266
|
||
dasm__CP D16 3350
|
||
dasm__DEC D4D 3405
|
||
dasm__ED_47 B94 2964
|
||
dasm__ED_4F B9C 2972
|
||
dasm__ED_57 B84 2948
|
||
dasm__ED_5F B8C 2956
|
||
dasm__INC D30 3376
|
||
dasm__LD B80 2944
|
||
dasm__OR CDF 3295
|
||
dasm__SBC C9E 3230
|
||
dasm__SUB C81 3201
|
||
dasm__XOR CF9 3321
|
||
dasm_opcode_table 681 1665
|
||
dasm_print16hex_addr 4AE 1198
|
||
dasm_print8hex 4C6 1222
|
||
dasm_printFlags_table E8C 3724
|
||
dasm_printRegister8_table E9C 3740
|
||
dasm_printRegister8_table_HL EBC 3772
|
||
dasm_printRegisterIX_table EA4 3748
|
||
dasm_printRegisterIY_table EAC 3756
|
||
dasm_printRegisterSP_table EB4 3764
|
||
disassemble 372 882
|
||
disassemble_continue 458 1112
|
||
disassemble_err 448 1096
|
||
disassemble_next 376 886
|
||
disassemble_print_opcode_params_end 445 1093
|
||
disassemble_print_opcode_params_loop 3F1 1009
|
||
disassemble_print_opcode_raw 3B3 947
|
||
disassemble_print_opcode_raw_fill 3C7 967
|
||
disassemble_table_first_match 48A 1162
|
||
disassemble_table_found 4A4 1188
|
||
disassemble_table_notfound 4A8 1192
|
||
disassemble_table_seek 466 1126
|
||
disassemble_table_seek_loop 46A 1130
|
||
mon_start_complete 7B 123
|
||
mon_start_init_ctc 50 80
|
||
mon_start_init_serial 64 100
|
||
mon_start_init_sound 50 80
|
||
mon_start_ram 67 103
|
||
mon_start_ram_loop 70 112
|
||
mon_var_template 44 68
|
||
mon_var_template_end 6E 110
|
||
param_01 4D4 1236
|
||
param_02 4FB 1275
|
||
param_03 518 1304
|
||
param_03_done 550 1360
|
||
param_03_neg 539 1337
|
||
param_04 554 1364
|
||
param_04_i 564 1380
|
||
param_05 56A 1386
|
||
param_06 577 1399
|
||
param_07 591 1425
|
||
param_08 59E 1438
|
||
param_09 5B3 1459
|
||
param_09_0A 5B9 1465
|
||
param_0A 5AA 1450
|
||
param_10 5C8 1480
|
||
param_11 5D8 1496
|
||
param_11_12 5E7 1511
|
||
param_11_12_all 607 1543
|
||
param_11_12_def 5FA 1530
|
||
param_11_12_ix 5FF 1535
|
||
param_11_12_iy 604 1540
|
||
param_12 5E0 1504
|
||
param_13 618 1560
|
||
param_80 637 1591
|
||
param_80_seek 63E 1598
|
||
param_81 62E 1582
|
||
param_comma 672 1650
|
||
param_printRegister 64D 1613
|
||
param_printRegisterA 66B 1643
|
||
param_printRegisterHL 663 1635
|
||
print_a_hex 2E4 740
|
||
print_char 2B4 692
|
||
print_clear 2C7 711
|
||
print_newLine 2CE 718
|
||
print_str 2BC 700
|
||
print_str_end 2C6 710
|
||
print_wait_out 2D9 729
|
||
read_char 2F5 757
|
||
var_buffer 4029 16425
|
||
var_buffer_len 4000 16384
|
||
var_bytes_count=411A 16666
|
||
var_curserchar 4006 16390
|
||
var_curserlastaddr 4007 16391
|
||
var_curseron 4005 16389
|
||
var_curserstate 4004 16388
|
||
var_curserx 4002 16386
|
||
var_cursery 4003 16387
|
||
var_last_char 4001 16385
|
||
var_opcode =4114 16660
|
||
var_opcode_length=4116 16662
|
||
var_opcode_pcount=4119 16665
|
||
var_opcode_start=4110 16656
|
||
var_opcode_string=4117 16663
|
||
var_opcode_table=4112 16658
|
||
var_opcode_x =4115 16661
|
||
var_ps2mem 4019 16409
|
||
var_scratch 4009 16393
|
||
xmodem_ack 10C4 4292
|
||
xmodem_await_conn F7D 3965
|
||
xmodem_end 1028 4136
|
||
xmodem_err FEE 4078
|
||
xmodem_init F4F 3919
|
||
xmodem_int 102F 4143
|
||
xmodem_int_cont 104E 4174
|
||
xmodem_nak 10D2 4306
|
||
xmodem_out 1080 4224
|
||
xmodem_packet F88 3976
|
||
xmodem_packet_EOT FE6 4070
|
||
xmodem_packet_get F9A 3994
|
||
xmodem_packet_get_crc FD3 4051
|
||
xmodem_packet_get_data FC4 4036
|
||
xmodem_read_timeount=03 3
|
||
xmodem_read_wait 1053 4179
|
||
xmodem_read_wait_loop 1061 4193
|
||
xmodem_read_wait_timeout 107E 4222
|
||
xmodem_wait 10E0 4320
|
||
xmodem_wait_1 10E6 4326
|
||
xmodem_wait_out 1086 4230
|