3386 lines
144 KiB
Plaintext
3386 lines
144 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 C3C40E jp EXEC_RST_08
|
||
29:
|
||
30: - 0010 org 0x0010
|
||
31: - 0010 RST_10 ;receive char
|
||
32: 34+10 0010 C3C80E jp EXEC_RST_10
|
||
33:
|
||
34: - 0018 org 0x0018
|
||
35: - 0018 RST_18 ;Buffer length
|
||
36: 44+10 0018 C3D40E 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 CD7E02 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 CDCA02 call print_clear
|
||
156: 280+10 007E 216013 ld hl, [STR_Banner_Start]
|
||
157: 290+17 0081 CDBF02 call print_str
|
||
158:
|
||
159: 307+17 0084 CDF411 call ideif_init_drive
|
||
160:
|
||
161: 324+10 0087 114000 LD DE,0x40
|
||
162: 334+17 008A CDD70E CALL beep
|
||
163:
|
||
164: ;call vdp_cursor_on
|
||
165: 351+17 008D CD9900 call PROMPT_BEGIN
|
||
166:
|
||
167: ;halt CPU if prompt exits
|
||
168: 368+4 0090 76 halt
|
||
169:
|
||
170: ; Misc Functions
|
||
171: - 0091 AY0_WRITE_REG:
|
||
172: 372+4 0091 47 LD B,A
|
||
173: 376+4 0092 7A LD A,D
|
||
174: 380+11 0093 D340 OUT (IO_AY0_ADDR),A
|
||
175: 391+4 0095 78 LD A,B
|
||
176: 395+11 0096 D341 OUT (IO_AY0_DATA),A
|
||
177: 406+10 0098 C9 RET
|
||
178:
|
||
179: - 0099 PROMPT_BEGIN:
|
||
180: 416+17 0099 CDD102 call print_newLine
|
||
181: ;call A_RTS_ON
|
||
182: 433+7 009C 3E3E ld a,'>'
|
||
183: 440+17 009E CDB702 call print_char
|
||
184: 457+4 00A1 AF xor a ;reset buffer len
|
||
185: 461+13 00A2 320040 ld (var_buffer_len),a
|
||
186:
|
||
187: - 00A5 PROMPT_BEGIN_READ_LOOP:
|
||
188: 474+17 00A5 CDF802 call read_char
|
||
189: ;call keybd_read_ascii
|
||
190: 491+10 00A8 CAA500 jp z, PROMPT_BEGIN_READ_LOOP ; wait until char avail
|
||
191: 501+11 00AB F5 push af
|
||
192: 512+10 00AC F1 pop af
|
||
193: ; process special ops
|
||
194: 522+7 00AD FE0D cp 13 ; enter
|
||
195: 529+10 00AF CAFC00 jp z,PROMPT_BEGIN_READ_PROCESS
|
||
196: 539+7 00B2 FE0A cp 10
|
||
197: 546+10 00B4 CAA500 jp z, PROMPT_BEGIN_READ_LOOP; skip LF for file load
|
||
198: 556+7 00B7 FE08 cp 0x08 ; backspace 0x08 VT102 0x7f Putty
|
||
199: 563+10 00B9 CAD600 jp z,PROMPT_BEGIN_READ_BACKSPACE
|
||
200:
|
||
201: 573+11 00BC F5 push af
|
||
202: ; a contains latest char
|
||
203: 584+10 00BD 212940 ld hl,[var_buffer]
|
||
204: 594+7 00C0 1600 ld d,0
|
||
205: 601+13 00C2 3A0040 ld a,(var_buffer_len)
|
||
206: 614+4 00C5 5F ld e,a
|
||
207: 618+11 00C6 19 add hl,de ;hl now contains pointer to last position in buffer
|
||
208: 629+4 00C7 3C inc a
|
||
209: 633+13 00C8 320040 ld (var_buffer_len),a ;store incremented buffer length
|
||
210:
|
||
211: 646+10 00CB F1 pop af
|
||
212: 656+7 00CC 77 ld (hl),a
|
||
213: 663+17 00CD CDB702 call print_char
|
||
214: 680+6 00D0 23 inc hl
|
||
215: 686+4 00D1 AF xor a ;a = 0
|
||
216: 690+7 00D2 77 ld (hl),a ;always add null termination after last char
|
||
217: 697+10 00D3 C3A500 jp PROMPT_BEGIN_READ_LOOP
|
||
218:
|
||
219: - 00D6 PROMPT_BEGIN_READ_BACKSPACE:
|
||
220: 707+13 00D6 3A0040 ld a,(var_buffer_len)
|
||
221: 720+4 00D9 A7 and a
|
||
222: 724+10 00DA CAA500 jp z, PROMPT_BEGIN_READ_LOOP ; do not continue if already at char 0
|
||
223: 734+4 00DD 3D dec a ;decrement length
|
||
224: 738+13 00DE 320040 ld (var_buffer_len),a ;and store it
|
||
225: 751+4 00E1 5F ld e,a ;load de with decremented value
|
||
226: 755+7 00E2 1600 ld d,0
|
||
227: 762+10 00E4 212940 ld hl,[var_buffer]
|
||
228: 772+11 00E7 19 add hl,de ;hl now contains pointer to last position in buffer
|
||
229: 783+4 00E8 AF xor a ; store null byte to current location
|
||
230: 787+7 00E9 77 ld (hl),a
|
||
231: ;call print_delete
|
||
232: 794+7 00EA 3E08 ld a, 0x08
|
||
233: 801+17 00EC CDB702 call print_char
|
||
234: 818+7 00EF 3E20 ld a, 0x20
|
||
235: 825+17 00F1 CDB702 call print_char
|
||
236: 842+7 00F4 3E08 ld a, 0x08
|
||
237: 849+17 00F6 CDB702 call print_char
|
||
238: 866+10 00F9 C3A500 jp PROMPT_BEGIN_READ_LOOP
|
||
239:
|
||
240: - 00FC PROMPT_BEGIN_READ_PROCESS:
|
||
241: ;call print_newLine
|
||
242: ;ld hl,var_buffer
|
||
243: ;call print_str
|
||
244:
|
||
245: 876+13 00FC 3A2940 ld a,([var_buffer])
|
||
246: 889+7 00FF FE24 cp '$' ;jump to addr
|
||
247: 896+10 0101 CA2F01 jp z, CMD_EXEC
|
||
248: 906+7 0104 FE3F cp '?' ;print hexdump
|
||
249: 913+10 0106 CA4E01 jp z, CMD_VIEW
|
||
250: 923+7 0109 FE21 cp '!' ;set memory
|
||
251: 930+10 010B CAB801 jp z, CMD_SET
|
||
252: 940+7 010E FE69 cp 'i' ;in IO
|
||
253: 947+10 0110 CA1D02 jp z, CMD_IO_READ
|
||
254: 957+7 0113 FE6F cp 'o' ;out IO
|
||
255: 964+10 0115 CAF401 jp z, CMD_IO_WRITE
|
||
256: 974+7 0118 FE64 cp 'd' ;disassemble
|
||
257: 981+10 011A CA3902 jp z, CMD_DASM
|
||
258: 991+7 011D FE78 cp 'x' ;start xmodem
|
||
259: 998+10 011F CA060F jp z, xmodem_init
|
||
260:
|
||
261:
|
||
262: 1008+17 0122 CDD102 call print_newLine
|
||
263: 1025+10 0125 218B13 ld hl, [STR_Unknown]
|
||
264: 1035+17 0128 CDBF02 call print_str
|
||
265: 1052+10 012B C39900 jp PROMPT_BEGIN
|
||
266:
|
||
267: 1062+10 012E C9 ret
|
||
268:
|
||
269: - 012F CMD_EXEC:
|
||
270: 1072+4 012F AF xor a ;write null byte to buffer pos 0 to prevent reexecute the last command
|
||
271: 1076+13 0130 322940 ld (var_buffer),a
|
||
272:
|
||
273: 1089+10 0133 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
274: 1099+17 0136 CD2403 call DHEX_TO_BYTE
|
||
275: 1116+4 0139 47 ld b,a ;store result in b
|
||
276: 1120+4 013A 7B ld a,e ;check for error
|
||
277: 1124+4 013B A7 and a
|
||
278: 1128+10 013C C27202 jp nz, CMD_SYNTAX_ERROR
|
||
279:
|
||
280: 1138+10 013F 212C40 ld hl,var_buffer+3 ;load 2nd byte
|
||
281: 1148+17 0142 CD2403 call DHEX_TO_BYTE
|
||
282: 1165+4 0145 4F ld c,a
|
||
283: 1169+4 0146 7B ld a,e ;check for error
|
||
284: 1173+4 0147 A7 and a
|
||
285: 1177+10 0148 C27202 jp nz, CMD_SYNTAX_ERROR
|
||
286:
|
||
287: 1187+4 014B 60 ld h,b
|
||
288: 1191+4 014C 69 ld l,c
|
||
289: 1195+4 014D E9 jp (hl)
|
||
290:
|
||
291: - 014E CMD_VIEW:
|
||
292: 1199+17 014E CDD102 call print_newLine
|
||
293: 1216+10 0151 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
294: 1226+17 0154 CD2403 call DHEX_TO_BYTE
|
||
295: 1243+4 0157 47 ld b,a ;store result in b
|
||
296: 1247+4 0158 7B ld a,e ;check for error
|
||
297: 1251+4 0159 A7 and a
|
||
298: 1255+10 015A C27202 jp nz, CMD_SYNTAX_ERROR
|
||
299:
|
||
300: 1265+10 015D 212C40 ld hl,var_buffer+3 ;load 2nd byte
|
||
301: 1275+17 0160 CD2403 call DHEX_TO_BYTE
|
||
302: 1292+4 0163 4F ld c,a
|
||
303: 1296+4 0164 7B ld a,e ;check for error
|
||
304: 1300+4 0165 A7 and a
|
||
305: 1304+10 0166 C27202 jp nz, CMD_SYNTAX_ERROR
|
||
306:
|
||
307:
|
||
308: 1314+13 0169 3A2E40 ld a,(var_buffer+5)
|
||
309: 1327+7 016C FE20 cp ' '
|
||
310: 1334+10 016E C27202 jp nz, CMD_SYNTAX_ERROR
|
||
311:
|
||
312: 1344+10 0171 212F40 ld hl,var_buffer+6 ;load length
|
||
313: 1354+17 0174 CD2403 call DHEX_TO_BYTE
|
||
314: 1371+11 0177 F5 push af
|
||
315: 1382+4 0178 7B ld a,e ;check for error
|
||
316: 1386+4 0179 A7 and a
|
||
317: 1390+10 017A C27202 jp nz, CMD_SYNTAX_ERROR
|
||
318:
|
||
319: ;draw header
|
||
320: 1400+10 017D 219013 ld hl,[STR_HEXDUMP_HEADER]
|
||
321: 1410+17 0180 CDBF02 call print_str
|
||
322:
|
||
323: 1427+10 0183 F1 pop af
|
||
324: ;loading vars done. display results
|
||
325: 1437+4 0184 60 ld h, b ;pointer to current byte
|
||
326: 1441+4 0185 69 ld l, c ;pointer to current byte
|
||
327: 1445+4 0186 47 ld b, a ;bytes counter
|
||
328:
|
||
329: ;draw row
|
||
330: - 0187 CMD_VIEW_ROW:
|
||
331: 1449+17 0187 CDD102 call print_newLine
|
||
332: 1466+4 018A 7C ld a,h ;print start
|
||
333: 1470+17 018B CDE702 call print_a_hex
|
||
334: 1487+4 018E 7D ld a,l
|
||
335: 1491+17 018F CDE702 call print_a_hex
|
||
336: 1508+7 0192 3E20 ld a, ' '
|
||
337: 1515+17 0194 CDB702 call print_char
|
||
338: 1532+7 0197 0E10 ld c, 16 ;column counter
|
||
339: - 0199 CMD_VIEW_ROW_LOOP:
|
||
340: 1539+7 0199 7E ld a,(hl)
|
||
341: 1546+17 019A CDE702 call print_a_hex
|
||
342:
|
||
343: 1563+6 019D 23 inc hl ;increment pointer
|
||
344: 1569+4 019E 05 dec b ;decrement byte counter
|
||
345: 1573+4 019F 0D dec c ;decrement column counter
|
||
346:
|
||
347: 1577+4 01A0 78 ld a,b
|
||
348: 1581+4 01A1 A7 and a
|
||
349: 1585+10 01A2 CAB201 jp z,CMD_VIEW_END ;if byte counter = 0 -> end reached
|
||
350:
|
||
351: 1595+4 01A5 79 ld a,c
|
||
352: 1599+4 01A6 A7 and a
|
||
353: 1603+10 01A7 CA8701 jp z,CMD_VIEW_ROW ;else if column counter = 0 -> 16 chars printed. next row
|
||
354:
|
||
355: 1613+7 01AA 3E20 ld a, ' '
|
||
356: 1620+17 01AC CDB702 call print_char
|
||
357: 1637+10 01AF C39901 jp CMD_VIEW_ROW_LOOP ;else
|
||
358: - 01B2 CMD_VIEW_END:
|
||
359: 1647+17 01B2 CDD102 call print_newLine
|
||
360: 1664+10 01B5 C39900 jp PROMPT_BEGIN
|
||
361:
|
||
362: - 01B8 CMD_SET:
|
||
363: 1674+10 01B8 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
364: 1684+17 01BB CD2403 call DHEX_TO_BYTE
|
||
365: 1701+4 01BE 47 ld b,a ;store result in b
|
||
366: 1705+4 01BF 7B ld a,e ;check for error
|
||
367: 1709+4 01C0 A7 and a
|
||
368: 1713+10 01C1 C27202 jp nz, CMD_SYNTAX_ERROR
|
||
369:
|
||
370: 1723+10 01C4 212C40 ld hl,var_buffer+3 ;load 2nd byte
|
||
371: 1733+17 01C7 CD2403 call DHEX_TO_BYTE
|
||
372: 1750+4 01CA 4F ld c,a
|
||
373: 1754+4 01CB 7B ld a,e ;check for error
|
||
374: 1758+4 01CC A7 and a
|
||
375: 1762+10 01CD C27202 jp nz, CMD_SYNTAX_ERROR
|
||
376: ;bc now contains the start address
|
||
377:
|
||
378: 1772+10 01D0 212E40 ld hl,var_buffer+5
|
||
379: - 01D3 CMD_SET_LOOP:
|
||
380: 1782+7 01D3 7E ld a,(hl)
|
||
381: 1789+7 01D4 FE00 cp 0 ;if 0 then end
|
||
382: 1796+10 01D6 CAEE01 jp z, CMD_SET_END
|
||
383: 1806+7 01D9 FE20 cp ' '
|
||
384: 1813+10 01DB C27202 jp nz, CMD_SYNTAX_ERROR
|
||
385: 1823+6 01DE 23 inc hl ;next byte
|
||
386: 1829+17 01DF CD2403 call DHEX_TO_BYTE
|
||
387: 1846+7 01E2 02 ld (bc),a ;load byte to
|
||
388: 1853+4 01E3 7B ld a,e
|
||
389: 1857+4 01E4 A7 and a
|
||
390: 1861+10 01E5 C27202 jp nz, CMD_SYNTAX_ERROR
|
||
391: 1871+6 01E8 03 inc bc
|
||
392: 1877+6 01E9 23 inc hl
|
||
393: 1883+6 01EA 23 inc hl
|
||
394: 1889+10 01EB C3D301 jp CMD_SET_LOOP
|
||
395: - 01EE CMD_SET_END:
|
||
396: 1899+17 01EE CDD102 call print_newLine
|
||
397: 1916+10 01F1 C39900 jp PROMPT_BEGIN
|
||
398:
|
||
399:
|
||
400: - 01F4 CMD_IO_WRITE:
|
||
401: 1926+10 01F4 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
402: 1936+17 01F7 CD2403 call DHEX_TO_BYTE
|
||
403: 1953+4 01FA 4F ld c,a ;store result in b
|
||
404: 1957+4 01FB 7B ld a,e ;check for error
|
||
405: 1961+4 01FC A7 and a
|
||
406: 1965+10 01FD C27202 jp nz, CMD_SYNTAX_ERROR
|
||
407:
|
||
408: 1975+13 0200 3A2C40 ld a,(var_buffer+3)
|
||
409: 1988+7 0203 FE20 cp ' '
|
||
410: 1995+10 0205 C27202 jp nz, CMD_SYNTAX_ERROR
|
||
411:
|
||
412: 2005+10 0208 212D40 ld hl,var_buffer+4 ;load 1st byte
|
||
413: 2015+17 020B CD2403 call DHEX_TO_BYTE
|
||
414: 2032+11 020E F5 push af
|
||
415: 2043+4 020F 7B ld a,e ;check for error
|
||
416: 2047+4 0210 A7 and a
|
||
417: 2051+10 0211 C27202 jp nz, CMD_SYNTAX_ERROR
|
||
418:
|
||
419: 2061+10 0214 F1 pop af
|
||
420: 2071+12 0215 ED79 out (c),a
|
||
421: 2083+17 0217 CDD102 call print_newLine
|
||
422: 2100+10 021A C39900 jp PROMPT_BEGIN
|
||
423:
|
||
424: - 021D CMD_IO_READ:
|
||
425: 2110+10 021D 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
426: 2120+17 0220 CD2403 call DHEX_TO_BYTE
|
||
427: 2137+4 0223 4F ld c,a ;store result in b
|
||
428: 2141+4 0224 7B ld a,e ;check for error
|
||
429: 2145+4 0225 A7 and a
|
||
430: 2149+10 0226 C27202 jp nz, CMD_SYNTAX_ERROR
|
||
431:
|
||
432: 2159+12 0229 ED78 in a,(c)
|
||
433: 2171+11 022B F5 push af
|
||
434: 2182+17 022C CDD102 call print_newLine
|
||
435: 2199+10 022F F1 pop af
|
||
436: 2209+17 0230 CDE702 call print_a_hex
|
||
437: 2226+17 0233 CDD102 call print_newLine
|
||
438: 2243+10 0236 C39900 jp PROMPT_BEGIN
|
||
439:
|
||
440: - 0239 CMD_DASM:
|
||
441: 2253+17 0239 CDD102 call print_newLine
|
||
442: 2270+10 023C 212A40 ld hl,var_buffer+1 ;load 1st byte
|
||
443: 2280+17 023F CD2403 call DHEX_TO_BYTE
|
||
444: 2297+4 0242 47 ld b,a ;store result in b
|
||
445: 2301+4 0243 7B ld a,e ;check for error
|
||
446: 2305+4 0244 A7 and a
|
||
447: 2309+10 0245 C27202 jp nz, CMD_SYNTAX_ERROR
|
||
448:
|
||
449: 2319+10 0248 212C40 ld hl,var_buffer+3 ;load 2nd byte
|
||
450: 2329+17 024B CD2403 call DHEX_TO_BYTE
|
||
451: 2346+4 024E 4F ld c,a
|
||
452: 2350+4 024F 7B ld a,e ;check for error
|
||
453: 2354+4 0250 A7 and a
|
||
454: 2358+10 0251 C27202 jp nz, CMD_SYNTAX_ERROR
|
||
455:
|
||
456:
|
||
457: 2368+13 0254 3A2E40 ld a,(var_buffer+5)
|
||
458: 2381+7 0257 FE20 cp ' '
|
||
459: 2388+10 0259 C27202 jp nz, CMD_SYNTAX_ERROR
|
||
460:
|
||
461: 2398+10 025C 212F40 ld hl,var_buffer+6 ;load length
|
||
462: 2408+17 025F CD2403 call DHEX_TO_BYTE
|
||
463: 2425+11 0262 F5 push af
|
||
464: 2436+4 0263 7B ld a,e ;check for error
|
||
465: 2440+4 0264 A7 and a
|
||
466: 2444+10 0265 C27202 jp nz, CMD_SYNTAX_ERROR
|
||
467:
|
||
468: 2454+4 0268 60 ld h,b
|
||
469: 2458+4 0269 69 ld l,c
|
||
470:
|
||
471: 2462+10 026A F1 pop af ;restore af
|
||
472: 2472+4 026B 47 ld b,a
|
||
473:
|
||
474: 2476+17 026C CD7503 call disassemble
|
||
475:
|
||
476:
|
||
477: 2493+10 026F C39900 jp PROMPT_BEGIN
|
||
478:
|
||
479: - 0272 CMD_SYNTAX_ERROR:
|
||
480: 2503+17 0272 CDD102 call print_newLine
|
||
481: 2520+10 0275 218613 ld hl, [STR_SyntaxError]
|
||
482: 2530+17 0278 CDBF02 call print_str
|
||
483: 2547+10 027B C39900 jp PROMPT_BEGIN
|
||
484:
|
||
485:
|
||
486:
|
||
487: - 027E 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: - 027E CONSOLE_INIT:
|
||
10: - 027E CONSOLE_INIT_CTC:
|
||
11: ;LD A,00001111b ; Set /16 Divider, CPU Trigger, Time COnstant Follows
|
||
12: 2557+7 027E 3E4F LD A,01001111b ; External Trigger, Time COnstant Follows
|
||
13: 2564+11 0280 D304 OUT (CS_CTC_0),A
|
||
14: 2575+11 0282 DB01 IN A,(CS_DIP) ; Read BAUD from DIP-Switches
|
||
15: ;LD A,39
|
||
16: 2586+11 0284 D304 OUT (CS_CTC_0),A
|
||
17: - 0286 CONSOLE_INIT_SIO:
|
||
18: 2597+7 0286 3E30 LD A,00110000b ;write into WR0: error reset, select WR0
|
||
19: 2604+11 0288 D309 OUT (CS_SIO_A_C),A
|
||
20: 2615+7 028A 3E18 LD a,018h ;write into WR0: channel reset
|
||
21: 2622+11 028C D309 OUT (CS_SIO_A_C),A
|
||
22: 2633+7 028E 3E04 LD a,004h ;write into WR0: select WR4
|
||
23: 2640+11 0290 D309 OUT (CS_SIO_A_C),A
|
||
24: 2651+7 0292 3E44 LD a,01000100b ;write into WR4: clkx16,1 stop bit, no parity
|
||
25: 2658+11 0294 D309 OUT (CS_SIO_A_C),A
|
||
26: 2669+7 0296 3E05 LD a,005h ;write into WR0: select WR5
|
||
27: 2676+11 0298 D309 OUT (CS_SIO_A_C),A
|
||
28: 2687+7 029A 3EE8 LD a,11101000b ;DTR inactive, TX 8bit, BREAK off, TX on, RTS inactive
|
||
29: 2694+11 029C D309 OUT (CS_SIO_A_C),A
|
||
30: 2705+7 029E 3E01 LD a,01h ;write into WR0: select WR1
|
||
31: 2712+11 02A0 D309 OUT (CS_SIO_A_C),A
|
||
32: 2723+7 02A2 3E04 LD a,00000100b ;no interrupt in CH B, special RX condition affects vect
|
||
33: 2730+11 02A4 D309 OUT (CS_SIO_A_C),A
|
||
34: 2741+7 02A6 3E02 LD a,02h ;write into WR0: select WR2
|
||
35: 2748+11 02A8 D309 OUT (CS_SIO_A_C),A
|
||
36: 2759+7 02AA 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: 2766+11 02AC D309 OUT (CS_SIO_A_C),A
|
||
39: 2777+7 02AE 3E03 LD a,003h ;write into WR0: select WR3
|
||
40: 2784+11 02B0 D309 OUT (CS_SIO_A_C),A
|
||
41: 2795+7 02B2 3EC1 LD a,0C1h ;RX 8bit, auto enable off, RX on
|
||
42: 2802+11 02B4 D309 OUT (CS_SIO_A_C),A
|
||
43: ;Channel A RX active
|
||
44: 2813+10 02B6 C9 RET
|
||
45:
|
||
46: ; A contains char
|
||
47: ; Destroys A
|
||
48: - 02B7 print_char:
|
||
49: 2823+11 02B7 F5 push af
|
||
50: 2834+11 02B8 D308 out (CS_SIO_A_D),a
|
||
51: 2845+17 02BA CDDC02 call print_wait_out
|
||
52: 2862+10 02BD F1 pop af
|
||
53: ;call print_char
|
||
54: 2872+10 02BE C9 ret
|
||
55: ; HL contains pointer to string
|
||
56: ; Destroy A, HL
|
||
57:
|
||
58: - 02BF print_str:
|
||
59: 2882+7 02BF 7E ld a, (hl)
|
||
60: 2889+4 02C0 B7 or a
|
||
61: 2893+7+5 02C1 2806 jr z,print_str_end
|
||
62: 2900+17 02C3 CDB702 call print_char
|
||
63: 2917+6 02C6 23 inc hl
|
||
64: 2923+12 02C7 18F6 jr print_str
|
||
65: - 02C9 print_str_end:
|
||
66: 2935+10 02C9 C9 ret
|
||
67:
|
||
68: - 02CA print_clear:
|
||
69: 2945+10 02CA 210A03 ld hl, [MSG_CLEAR]
|
||
70: 2955+17 02CD CDBF02 call print_str
|
||
71: 2972+10 02D0 C9 ret
|
||
72:
|
||
73: - 02D1 print_newLine:
|
||
74: 2982+7 02D1 3E0A ld a,10
|
||
75: 2989+17 02D3 CDB702 call print_char
|
||
76: 3006+7 02D6 3E0D ld a,13
|
||
77: 3013+17 02D8 CDB702 call print_char
|
||
78: 3030+10 02DB C9 ret
|
||
79: ; destroys a
|
||
80: - 02DC print_wait_out:
|
||
81: ; check for TX buffer empty
|
||
82: 3040+4 02DC 97 sub a ;clear a, write into WR0: select RR0
|
||
83: 3044+4 02DD 3C inc a ;select RR1
|
||
84: 3048+11 02DE D309 out (CS_SIO_A_C),A
|
||
85: 3059+11 02E0 DB09 in A,(CS_SIO_A_C) ;read RRx
|
||
86: 3070+8 02E2 CB47 bit 0,A
|
||
87: 3078+7+5 02E4 28F6 jr z,print_wait_out
|
||
88: 3085+10 02E6 C9 ret
|
||
89:
|
||
90: - 02E7 print_a_hex:
|
||
91: 3095+11 02E7 F5 push af
|
||
92: 3106+11 02E8 C5 push bc
|
||
93: 3117+11 02E9 D5 push de
|
||
94: 3128+17 02EA CD5B03 call STRCONV_BYTES_TO_HEX
|
||
95: 3145+4 02ED 78 ld a,b
|
||
96: 3149+17 02EE CDB702 call print_char
|
||
97: 3166+4 02F1 79 ld a,c
|
||
98: 3170+17 02F2 CDB702 call print_char
|
||
99: 3187+10 02F5 D1 pop de
|
||
100: 3197+10 02F6 C1 pop bc
|
||
101: 3207+10 02F7 F1 pop af
|
||
102:
|
||
103: - 02F8 read_char:
|
||
104: 3217+17 02F8 CD1B03 call A_RTS_ON
|
||
105: 3234+4 02FB 00 nop
|
||
106: 3238+4 02FC AF xor a ; a = 0
|
||
107: 3242+11 02FD D309 out (CS_SIO_A_C), a ; select reg 0
|
||
108: 3253+11 02FF DB09 in a, (CS_SIO_A_C) ; read reg 0
|
||
109: 3264+7 0301 E601 and 1 ; mask D0 (recieve char available)
|
||
110: 3271+17 0303 CD1203 call A_RTS_OFF
|
||
111: 3288+5+6 0306 C8 ret Z ; return 0 if no char
|
||
112: 3293+11 0307 DB08 in a, (CS_SIO_A_D) ; read char if avail
|
||
113: 3304+10 0309 C9 ret ; return
|
||
114:
|
||
115: ;MSG_CRSR_0:
|
||
116: ; db 0x1B, "[?25h",0
|
||
117: ;MSG_CRSR_1:
|
||
118: ; db 0x1B, "[?25l",0
|
||
119: - 030A MSG_CLEAR:
|
||
120: - 030A 1B5B324A db 27, '[2J', 27, '[H',0
|
||
1B5B4800
|
||
121:
|
||
122:
|
||
123:
|
||
124: ; Serial Util Functions
|
||
125: - 0312 A_RTS_OFF:
|
||
126: 3314+7 0312 3E05 ld a,005h ;write into WR0: select WR5
|
||
127: 3321+11 0314 D309 out (CS_SIO_A_C),A
|
||
128: 3332+7 0316 3E68 ld a,068h ;DTR inactive, TX 8bit, BREAK off, TX on, RTS inactive
|
||
129: 3339+11 0318 D309 out (CS_SIO_A_C),A
|
||
130: 3350+10 031A C9 ret
|
||
131: - 031B A_RTS_ON:
|
||
132: 3360+7 031B 3E05 ld a,005h ;write into WR0: select WR5
|
||
133: 3367+11 031D D309 out (CS_SIO_A_C),A
|
||
134: 3378+7 031F 3EEA ld a,0EAh ;DTR active, TX 8bit, BREAK off, TX on, RTS active
|
||
135: 3385+11 0321 D309 out (CS_SIO_A_C),A
|
||
**** main.asm ****
|
||
490: 3396+10 0323 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: - 0324 DHEX_TO_BYTE:
|
||
7: 3406+11 0324 E5 PUSH HL ;Backup pointer
|
||
8: ; Load First Byte
|
||
9: 3417+7 0325 7E LD A,(HL) ;Load first char (high)
|
||
10: 3424+17 0326 CD4403 CALL HEX_TO_BIN ;Conv chart to 4bit
|
||
11: 3441+7+5 0329 3815 jr C, DHEX_TO_BYTE_FAILED ;If error jmp to DHEX_TO_BYTE_FAILED
|
||
12: 3448+8 032B CB27 SLA A ;shift result to upper 4 bits
|
||
13: 3456+8 032D CB27 SLA A
|
||
14: 3464+8 032F CB27 SLA A
|
||
15: 3472+8 0331 CB27 SLA A
|
||
16: 3480+4 0333 57 LD D,A ;store result in D
|
||
17:
|
||
18: 3484+6 0334 23 INC HL ;next byte
|
||
19: 3490+7 0335 7E LD A,(HL) ;load 2nd char (lower)
|
||
20: 3497+17 0336 CD4403 CALL HEX_TO_BIN ;Conv chart to 4bit
|
||
21: 3514+7+5 0339 3805 jr C, DHEX_TO_BYTE_FAILED ;If error jmp to DHEX_TO_BYTE_FAILED
|
||
22: 3521+4 033B B2 OR D ;merge D with accumulator
|
||
23:
|
||
24: 3525+10 033C E1 POP HL ;restor original pointer
|
||
25: 3535+7 033D 1E00 LD E,0x00 ;set error to 0x00 = no error
|
||
26: 3542+10 033F C9 RET
|
||
27: - 0340 DHEX_TO_BYTE_FAILED:
|
||
28: 3552+7 0340 1EFF LD E,0xFF ;set error to oxFF
|
||
29: ;LD A,0x00
|
||
30: 3559+10 0342 E1 POP HL
|
||
31: 3569+10 0343 C9 RET
|
||
32:
|
||
33: ; REG A Contains CHAR-Low
|
||
34: ; If failed, Carry is set
|
||
35: - 0344 HEX_TO_BIN:
|
||
36: 3579+7 0344 D630 SUB 48 ; 0 is 0
|
||
37: 3586+10 0346 EA5903 jp PE, HEX_TO_INVALID_2; to low (SUB overflow)
|
||
38: 3596+7 0349 FE0A CP 10 ; Value is between 0 and 9
|
||
39: 3603+7+5 034B 3805 JR C, HEX_TO_BIN_2
|
||
40: 3610+7 034D D607 SUB 7
|
||
41: 3617+10 034F EA5903 jp PE, HEX_TO_INVALID_2; to low (SUB overflow)
|
||
42: - 0352 HEX_TO_BIN_2:
|
||
43: 3627+7 0352 FE10 CP 16
|
||
44: 3634+7+5 0354 3003 JR NC, HEX_TO_INVALID_2; if bigger than 15-> fail
|
||
45: 3641+7 0356 E60F AND 0x0F
|
||
46: 3648+10 0358 C9 RET
|
||
47: - 0359 HEX_TO_INVALID_2:
|
||
48: 3658+4 0359 37 SCF ;set carry flag
|
||
49: 3662+10 035A 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: - 035B STRCONV_BYTES_TO_HEX:
|
||
63: 3672+11 035B F5 PUSH AF;Backup A Register
|
||
64: 3683+4 035C 1F RRA
|
||
65: 3687+4 035D 1F RRA
|
||
66: 3691+4 035E 1F RRA
|
||
67: 3695+4 035F 1F RRA
|
||
68: 3699+17 0360 CD6A03 CALL STRCONV_BYTES_TO_HEX_1
|
||
69: ;LD A,D
|
||
70: 3716+4 0363 47 LD B,A
|
||
71: 3720+10 0364 F1 POP AF ; Reload first Byte
|
||
72: 3730+17 0365 CD6A03 CALL STRCONV_BYTES_TO_HEX_1
|
||
73: ;LD A,D
|
||
74: 3747+4 0368 4F LD C,A
|
||
75: 3751+10 0369 C9 RET
|
||
76:
|
||
77: - 036A STRCONV_BYTES_TO_HEX_1:
|
||
78: 3761+7 036A E60F AND 0x0F
|
||
79: 3768+7 036C C630 ADD 48
|
||
80: 3775+7 036E FE3A CP 58 ; Check if less than 58 (less than ASCII 9)
|
||
81: ;JR C, STRCONV_BYTES_TO_HEX_2
|
||
82: 3782+5+6 0370 D8 RET C
|
||
83: 3787+7 0371 C607 ADD 7 ; A-F
|
||
84: 3794+10 0373 C9 RET
|
||
85: - 0374 STRCONV_BYTES_TO_HEX_2:
|
||
86: ;LD D,A
|
||
87: 3804+10 0374 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: - 0375 disassemble:
|
||
12: 3814+4 0375 78 ld a,b
|
||
13: 3818+13 0376 321A41 ld (var_bytes_count),a
|
||
14: - 0379 disassemble_next:
|
||
15:
|
||
16:
|
||
17: 3831+16 0379 221041 ld (var_opcode_start), hl ;16 bit pointer to opcode in mem
|
||
18: 3847+7 037C 7E ld a,(hl) ;load opcode to find in A
|
||
19: 3854+13 037D 321441 ld (var_opcode), a ;8 bit opcode value
|
||
20: 3867+6 0380 23 inc hl
|
||
21: 3873+7 0381 7E ld a,(hl) ;load opcode to find in A
|
||
22: 3880+13 0382 321541 ld (var_opcode_x), a ;8 bit opcode extended value
|
||
23: 3893+6 0385 2B dec hl
|
||
24: 3899+17 0386 CD6904 call disassemble_table_seek
|
||
25: 3916+4 0389 78 ld a,b
|
||
26: 3920+4 038A B1 or c
|
||
27: 3924+10 038B CA4B04 jp z, disassemble_err ;if bc==0000h
|
||
28:
|
||
29: 3934+20 038E ED431241 ld (var_opcode_table), bc ;16 bit pointer to opcode in table
|
||
30:
|
||
31: ;load params
|
||
32: 3954+6 0392 03 inc bc
|
||
33: 3960+6 0393 03 inc bc
|
||
34: 3966+6 0394 03 inc bc
|
||
35: 3972+6 0395 03 inc bc
|
||
36: 3978+7 0396 0A ld a,(bc)
|
||
37: 3985+13 0397 321641 ld (var_opcode_length),A ;8 bit opcode length (in bytes)
|
||
38: 3998+6 039A 03 inc bc
|
||
39: 4004+7 039B 0A ld a, (bc)
|
||
40: 4011+4 039C 5F ld e,a
|
||
41: 4015+6 039D 03 inc bc
|
||
42: 4021+7 039E 0A ld a, (bc)
|
||
43: 4028+4 039F 57 ld d,a
|
||
44: 4032+20 03A0 ED531741 ld (var_opcode_string),de ;16 bit pointer to opcode string
|
||
45: 4052+6 03A4 03 inc bc
|
||
46: 4058+7 03A5 0A ld a,(bc)
|
||
47: 4065+13 03A6 321941 ld (var_opcode_pcount),A ;8 bit opcode param count
|
||
48:
|
||
49: ;values are prepared. Continue with print
|
||
50:
|
||
51: 4078+16 03A9 2A1041 ld hl,(var_opcode_start) ;print address
|
||
52: 4094+17 03AC CDB104 call dasm_print16hex_addr
|
||
53:
|
||
54: 4111+13 03AF 3A1641 ld a,(var_opcode_length)
|
||
55: 4124+4 03B2 47 ld b, a
|
||
56:
|
||
57: ;print up to 4 opcode bytes
|
||
58: 4128+16 03B3 2A1041 ld hl,(var_opcode_start)
|
||
59:
|
||
60: - 03B6 disassemble_print_opcode_raw
|
||
61: 4144+7 03B6 7E ld a,(hl) ;load first byte
|
||
62: 4151+17 03B7 CDE702 call print_a_hex
|
||
63: 4168+6 03BA 23 inc hl
|
||
64: 4174+8+5 03BB 10F9 djnz disassemble_print_opcode_raw
|
||
65:
|
||
66: 4182+7 03BD 3E68 ld a,"h"
|
||
67: 4189+17 03BF CDB702 call print_char
|
||
68: ;fill empty spots
|
||
69: 4206+13 03C2 3A1641 ld a,(var_opcode_length)
|
||
70: 4219+4 03C5 47 ld b,a
|
||
71: 4223+7 03C6 3E06 ld a,6
|
||
72: 4230+4 03C8 90 sub b
|
||
73: 4234+4 03C9 47 ld b,a
|
||
74:
|
||
75: - 03CA disassemble_print_opcode_raw_fill:
|
||
76: 4238+7 03CA 3E20 ld a," "
|
||
77: 4245+17 03CC CDB702 call print_char
|
||
78: 4262+7 03CF 3E20 ld a," "
|
||
79: 4269+17 03D1 CDB702 call print_char
|
||
80: 4286+8+5 03D4 10F4 djnz disassemble_print_opcode_raw_fill
|
||
81: 4294+7 03D6 3E20 ld a," "
|
||
82: 4301+17 03D8 CDB702 call print_char
|
||
83:
|
||
84: 4318+11 03DB E5 push hl
|
||
85: ;print opcode
|
||
86: 4329+16 03DC 2A1741 ld hl,(var_opcode_string)
|
||
87: 4345+17 03DF CDBF02 call print_str
|
||
88:
|
||
89:
|
||
90: ;print params
|
||
91: 4362+13 03E2 3A1941 ld a,(var_opcode_pcount)
|
||
92: 4375+4 03E5 B7 or a
|
||
93: 4379+10 03E6 CA4804 jp z, disassemble_print_opcode_params_end ;skip if no params
|
||
94:
|
||
95: 4389+16 03E9 2A1241 ld hl,(var_opcode_table)
|
||
96: 4405+10 03EC 010800 ld bc, 8
|
||
97: 4415+11 03EF 09 add hl,bc ;hl now has address of first param
|
||
98: 4426+13 03F0 3A1941 ld a,(var_opcode_pcount)
|
||
99: 4439+4 03F3 47 ld b,a
|
||
100: - 03F4 disassemble_print_opcode_params_loop:
|
||
101: ;ld a,(hl) ;load param
|
||
102: ;call print_a_hex
|
||
103: 4443+7 03F4 7E ld a,(hl) ;load param
|
||
104:
|
||
105: 4450+7 03F5 FE01 cp 0x01
|
||
106: 4457+10+7 03F7 CCD704 call z, param_01
|
||
107: 4467+7 03FA FE02 cp 0x02
|
||
108: 4474+10+7 03FC CCFE04 call z, param_02
|
||
109: 4484+7 03FF FE03 cp 0x03
|
||
110: 4491+10+7 0401 CC1B05 call z, param_03
|
||
111: 4501+7 0404 FE04 cp 0x04
|
||
112: 4508+10+7 0406 CC5705 call z, param_04
|
||
113: 4518+7 0409 FE05 cp 0x05
|
||
114: 4525+10+7 040B CC6D05 call z, param_05
|
||
115: 4535+7 040E FE06 cp 0x06
|
||
116: 4542+10+7 0410 CC7A05 call z, param_06
|
||
117: 4552+7 0413 FE07 cp 0x07
|
||
118: 4559+10+7 0415 CC9405 call z, param_07
|
||
119: 4569+7 0418 FE08 cp 0x08
|
||
120: 4576+10+7 041A CCA105 call z, param_08
|
||
121: 4586+7 041D FE09 cp 0x09
|
||
122: 4593+10+7 041F CCB605 call z, param_09
|
||
123: 4603+7 0422 FE10 cp 0x10
|
||
124: 4610+10+7 0424 CCCB05 call z, param_10
|
||
125: 4620+7 0427 FE11 cp 0x11
|
||
126: 4627+10+7 0429 CCDB05 call z, param_11
|
||
127: 4637+7 042C FE12 cp 0x12
|
||
128: 4644+10+7 042E CCE305 call z, param_12
|
||
129: 4654+7 0431 FE13 cp 0x13
|
||
130: 4661+10+7 0433 CC1B06 call z, param_13
|
||
131: 4671+7 0436 FE0A cp 0x0A
|
||
132: 4678+10+7 0438 CCAD05 call z, param_0A
|
||
133: ;strings
|
||
134: 4688+7 043B FE80 cp 0x80
|
||
135: 4695+10+7 043D CC3A06 call z, param_80
|
||
136: 4705+7 0440 FE81 cp 0x81
|
||
137: 4712+10+7 0442 CC3106 call z, param_81
|
||
138: 4722+6 0445 23 inc hl
|
||
139: 4728+8+5 0446 10AC djnz disassemble_print_opcode_params_loop
|
||
140: - 0448 disassemble_print_opcode_params_end:
|
||
141: 4736+10 0448 E1 pop hl
|
||
142: 4746+12 0449 1810 jr disassemble_continue
|
||
143:
|
||
144:
|
||
145: - 044B disassemble_err:
|
||
146: 4758+17 044B CDB104 call dasm_print16hex_addr
|
||
147: 4775+7 044E 7E ld a,(hl)
|
||
148: 4782+17 044F CDC904 call dasm_print8hex ;print value
|
||
149: 4799+6 0452 23 inc hl
|
||
150: 4805+11 0453 E5 push hl
|
||
151: 4816+10 0454 21860E ld hl, [dasm_UU]
|
||
152: 4826+17 0457 CDBF02 call print_str
|
||
153: 4843+10 045A E1 pop hl
|
||
154:
|
||
155: - 045B disassemble_continue:
|
||
156:
|
||
157: 4853+17 045B CDD102 call print_newLine
|
||
158: ;inc hl
|
||
159: 4870+13 045E 3A1A41 ld a,(var_bytes_count)
|
||
160: 4883+4 0461 3D dec a
|
||
161: 4887+13 0462 321A41 ld (var_bytes_count),a
|
||
162: 4900+10 0465 C27903 jp nz, disassemble_next
|
||
163: 4910+10 0468 C9 ret
|
||
164:
|
||
165:
|
||
166:
|
||
167: ;A contains opcode
|
||
168: ;BC contains returned position
|
||
169: - 0469 disassemble_table_seek:
|
||
170: 4920+11 0469 E5 push hl
|
||
171: 4931+10 046A 218406 ld hl, [dasm_opcode_table]
|
||
172: - 046D disassemble_table_seek_loop:
|
||
173: 4941+13 046D 3A1441 ld a,(var_opcode)
|
||
174: 4954+4 0470 4F ld c,a
|
||
175: 4958+7 0471 7E ld a,(hl)
|
||
176: 4965+7 0472 FEFF cp 0xFF ; if null
|
||
177: 4972+10 0474 CAAB04 jp z, disassemble_table_notfound
|
||
178:
|
||
179: ;apply mask
|
||
180: 4982+11 0477 F5 push af
|
||
181: 4993+6 0478 23 inc hl
|
||
182: 4999+7 0479 46 ld b,(hl) ;load mask
|
||
183: 5006+6 047A 2B dec hl
|
||
184: 5012+4 047B 79 ld a,c
|
||
185: 5016+4 047C A0 and b ;apply mask
|
||
186: 5020+4 047D 4F ld c,a
|
||
187: 5024+10 047E F1 pop af
|
||
188:
|
||
189: 5034+4 047F B9 cp c ; if match
|
||
190: 5038+7+5 0480 280B jr z, disassemble_table_first_match
|
||
191: 5045+7 0482 0600 ld b,0
|
||
192: 5052+7 0484 0E07 ld c,7
|
||
193: 5059+11 0486 09 add hl,bc
|
||
194: 5070+7 0487 7E ld a,(hl)
|
||
195: 5077+4 0488 4F ld c,a
|
||
196: 5081+11 0489 09 add hl,bc
|
||
197: 5092+6 048A 23 inc hl
|
||
198: 5098+12 048B 18E0 jr disassemble_table_seek_loop
|
||
199:
|
||
200: - 048D disassemble_table_first_match
|
||
201: 5110+6 048D 23 inc hl
|
||
202: 5116+6 048E 23 inc hl
|
||
203: 5122+7 048F 4E ld c,(hl) ;load opcode x from table
|
||
204: 5129+6 0490 23 inc hl
|
||
205: 5135+13 0491 3A1541 ld a,(var_opcode_x) ;load current opcode x
|
||
206: 5148+7 0494 46 ld b,(hl) ;load mask
|
||
207: 5155+4 0495 A0 and b ;apply mask
|
||
208: 5159+4 0496 B9 cp c ;compare to table
|
||
209: 5163+6 0497 2B dec hl
|
||
210: 5169+6 0498 2B dec hl
|
||
211: 5175+6 0499 2B dec hl
|
||
212: 5181+7+5 049A 280B jr z, disassemble_table_found ;IF FOUND
|
||
213: 5188+7 049C 0600 ld b,0 ;else continue with next
|
||
214:
|
||
215: 5195+7 049E 0E07 ld c,7
|
||
216: 5202+11 04A0 09 add hl,bc
|
||
217: 5213+7 04A1 7E ld a,(hl)
|
||
218: 5220+4 04A2 4F ld c,a
|
||
219: 5224+11 04A3 09 add hl,bc
|
||
220: 5235+6 04A4 23 inc hl
|
||
221: 5241+12 04A5 18C6 jr disassemble_table_seek_loop
|
||
222:
|
||
223: - 04A7 disassemble_table_found
|
||
224: 5253+4 04A7 44 ld b,H
|
||
225: 5257+4 04A8 4D ld c,l
|
||
226: 5261+10 04A9 E1 pop hl
|
||
227: 5271+10 04AA C9 ret
|
||
228:
|
||
229: - 04AB disassemble_table_notfound
|
||
230: 5281+7 04AB 0600 ld b,0
|
||
231: 5288+7 04AD 0E00 ld c,0
|
||
232: 5295+10 04AF E1 pop hl
|
||
233: 5305+10 04B0 C9 ret
|
||
234:
|
||
235:
|
||
236:
|
||
237:
|
||
238: - 04B1 dasm_print16hex_addr:
|
||
239: 5315+7 04B1 3E24 ld a,"$"
|
||
240: 5322+17 04B3 CDB702 call print_char
|
||
241: 5339+4 04B6 7C ld a,h
|
||
242: 5343+17 04B7 CDE702 call print_a_hex
|
||
243: 5360+4 04BA 7D ld a,l
|
||
244: 5364+17 04BB CDE702 call print_a_hex
|
||
245: 5381+7 04BE 3E68 ld a,"h"
|
||
246: 5388+17 04C0 CDB702 call print_char
|
||
247: 5405+7 04C3 3E20 ld a," "
|
||
248: 5412+17 04C5 CDB702 call print_char
|
||
249: 5429+10 04C8 C9 ret
|
||
250:
|
||
251: - 04C9 dasm_print8hex:
|
||
252: 5439+17 04C9 CDE702 call print_a_hex
|
||
253: 5456+7 04CC 3E68 ld a,"h"
|
||
254: 5463+17 04CE CDB702 call print_char
|
||
255: 5480+7 04D1 3E20 ld a," "
|
||
256: 5487+17 04D3 CDB702 call print_char
|
||
257: 5504+10 04D6 C9 ret
|
||
258:
|
||
259:
|
||
260:
|
||
261:
|
||
262:
|
||
263:
|
||
264:
|
||
265: - 04D7 param_01: ; 0x01 16bit address pointer
|
||
266: 5514+11 04D7 E5 push hl
|
||
267: 5525+20 04D8 ED5B1041 ld de,(var_opcode_start)
|
||
268: 5545+6 04DC 13 inc de
|
||
269: 5551+7 04DD 1A ld a,(de)
|
||
270: 5558+4 04DE 6F ld l,a
|
||
271: 5562+6 04DF 13 inc de
|
||
272: 5568+7 04E0 1A ld a,(de)
|
||
273: 5575+4 04E1 67 ld h,a
|
||
274:
|
||
275: 5579+7 04E2 3E24 ld a,"$"
|
||
276: 5586+17 04E4 CDB702 call print_char
|
||
277: 5603+4 04E7 7C ld a,h
|
||
278: 5607+17 04E8 CDE702 call print_a_hex
|
||
279: 5624+4 04EB 7D ld a,l
|
||
280: 5628+17 04EC CDE702 call print_a_hex
|
||
281: 5645+7 04EF 3E68 ld a,"h"
|
||
282: 5652+17 04F1 CDB702 call print_char
|
||
283: 5669+7 04F4 3E20 ld a," "
|
||
284: 5676+17 04F6 CDB702 call print_char
|
||
285: 5693+17 04F9 CD7506 call param_comma
|
||
286: 5710+10 04FC E1 pop hl
|
||
287: 5720+10 04FD C9 ret
|
||
288:
|
||
289: - 04FE param_02:
|
||
290: 5730+11 04FE C5 push bc
|
||
291: 5741+20 04FF ED5B1041 ld de,(var_opcode_start)
|
||
292: 5761+7 0503 1A ld a,(de)
|
||
293: 5768+4 0504 1F rra
|
||
294: 5772+4 0505 1F rra
|
||
295: 5776+7 0506 E60E and 0x0E
|
||
296:
|
||
297: 5783+11 0508 E5 push hl
|
||
298: 5794+10 0509 218F0E ld hl, [dasm_printFlags_table]
|
||
299: 5804+7 050C 0600 ld b,0
|
||
300: 5811+4 050E 4F ld c,a
|
||
301: 5815+11 050F 09 add hl,bc
|
||
302: 5826+17 0510 CDBF02 call print_str
|
||
303: 5843+7 0513 3E20 ld a, " "
|
||
304: 5850+17 0515 CDB702 call print_char
|
||
305: 5867+10 0518 E1 pop hl
|
||
306: 5877+10 0519 C1 pop bc
|
||
307: 5887+10 051A C9 ret
|
||
308:
|
||
309:
|
||
310: - 051B param_03:
|
||
311: 5897+20 051B ED5B1041 ld de,(var_opcode_start)
|
||
312: 5917+6 051F 13 inc de
|
||
313: 5923+7 0520 1A ld a,(de)
|
||
314:
|
||
315: 5930+11 0521 F5 push af
|
||
316: 5941+7 0522 E680 and 0x80
|
||
317: 5948+10 0524 C23C05 jp nz, param_03_neg
|
||
318: 5958+7 0527 3E24 ld a,"$"
|
||
319: 5965+17 0529 CDB702 call print_char
|
||
320: 5982+7 052C 3E2B ld a,"+"
|
||
321: 5989+17 052E CDB702 call print_char
|
||
322: 6006+10 0531 F1 pop af
|
||
323: 6016+17 0532 CDE702 call print_a_hex
|
||
324: 6033+7 0535 3E68 ld a,"h"
|
||
325: 6040+17 0537 CDB702 call print_char
|
||
326: 6057+12 053A 1817 jr param_03_done
|
||
327:
|
||
328: - 053C param_03_neg:
|
||
329: 6069+7 053C 3E24 ld a,"$"
|
||
330: 6076+17 053E CDB702 call print_char
|
||
331: 6093+7 0541 3E2D ld a,"-"
|
||
332: 6100+17 0543 CDB702 call print_char
|
||
333: 6117+10 0546 F1 pop af
|
||
334: 6127+8 0547 ED44 neg
|
||
335: 6135+17 0549 CDE702 call print_a_hex
|
||
336: 6152+7 054C 3E68 ld a,"h"
|
||
337: 6159+17 054E CDB702 call print_char
|
||
338: 6176+12 0551 1800 jr param_03_done
|
||
339:
|
||
340: - 0553 param_03_done:
|
||
341: 6188+17 0553 CD7506 call param_comma
|
||
342: 6205+10 0556 C9 ret
|
||
343:
|
||
344:
|
||
345: - 0557 param_04:
|
||
346: 6215+20 0557 ED5B1041 ld de,(var_opcode_start)
|
||
347: 6235+6 055B 13 inc de
|
||
348: 6241+7 055C 1A ld a,(de)
|
||
349: 6248+7 055D FE4D cp 0x4D
|
||
350: 6255+7+5 055F 2806 jr z,param_04_i
|
||
351: 6262+7 0561 3E4E ld a,"N"
|
||
352: 6269+17 0563 CDB702 call print_char
|
||
353: 6286+10 0566 C9 ret
|
||
354: - 0567 param_04_i:
|
||
355: 6296+7 0567 3E49 ld a,"I"
|
||
356: 6303+17 0569 CDB702 call print_char
|
||
357: 6320+10 056C C9 ret
|
||
358:
|
||
359: - 056D param_05:
|
||
360: 6330+11 056D C5 push bc
|
||
361: 6341+20 056E ED5B1041 ld de,(var_opcode_start)
|
||
362: 6361+7 0572 1A ld a,(de)
|
||
363: 6368+7 0573 E638 and 0x38
|
||
364: ; print hex char
|
||
365: 6375+17 0575 CDC904 call dasm_print8hex
|
||
366: 6392+10 0578 C1 pop bc
|
||
367: 6402+10 0579 C9 ret
|
||
368:
|
||
369:
|
||
370: - 057A param_06:
|
||
371: 6412+11 057A C5 push bc
|
||
372: 6423+20 057B ED5B1041 ld de,(var_opcode_start)
|
||
373: 6443+7 057F 1A ld a,(de)
|
||
374: 6450+4 0580 1F rra
|
||
375: 6454+4 0581 1F rra
|
||
376: 6458+4 0582 1F rra
|
||
377: 6462+7 0583 E607 and 0x07
|
||
378: 6469+17 0585 CD5006 call param_printRegister
|
||
379: 6486+7 0588 3E20 ld a," "
|
||
380: 6493+17 058A CDB702 call print_char
|
||
381: 6510+7 058D 3E2C ld a,","
|
||
382: 6517+17 058F CDB702 call print_char
|
||
383: 6534+10 0592 C1 pop bc
|
||
384: 6544+10 0593 C9 ret
|
||
385:
|
||
386: - 0594 param_07:
|
||
387: 6554+11 0594 C5 push bc
|
||
388: 6565+20 0595 ED5B1041 ld de,(var_opcode_start)
|
||
389: 6585+7 0599 1A ld a,(de)
|
||
390: 6592+7 059A E607 and 0x07
|
||
391:
|
||
392: 6599+17 059C CD5006 call param_printRegister
|
||
393: 6616+10 059F C1 pop bc
|
||
394: 6626+10 05A0 C9 ret
|
||
395:
|
||
396: - 05A1 param_08:
|
||
397: 6636+11 05A1 C5 push bc
|
||
398: 6647+20 05A2 ED5B1041 ld de,(var_opcode_start)
|
||
399: 6667+6 05A6 13 inc de
|
||
400: 6673+7 05A7 1A ld a,(de)
|
||
401: 6680+17 05A8 CDC904 call dasm_print8hex
|
||
402: 6697+10 05AB C1 pop bc
|
||
403: 6707+10 05AC C9 ret
|
||
404:
|
||
405:
|
||
406: - 05AD param_0A:
|
||
407: 6717+11 05AD E5 push hl
|
||
408: 6728+20 05AE ED5B1041 ld de,(var_opcode_start)
|
||
409: 6748+6 05B2 13 inc de
|
||
410: 6754+6 05B3 13 inc de
|
||
411: 6760+12 05B4 1806 jr param_09_0A
|
||
412: - 05B6 param_09:
|
||
413: 6772+11 05B6 E5 push hl
|
||
414: 6783+20 05B7 ED5B1041 ld de,(var_opcode_start)
|
||
415: 6803+6 05BB 13 inc de
|
||
416: - 05BC param_09_0A:
|
||
417: 6809+7 05BC 1A ld a,(de)
|
||
418: 6816+4 05BD 6F ld l,a
|
||
419: 6820+6 05BE 13 inc de
|
||
420: 6826+7 05BF 1A ld a,(de)
|
||
421: 6833+4 05C0 67 ld h,a
|
||
422: 6837+4 05C1 7C ld a,h
|
||
423: 6841+17 05C2 CDE702 call print_a_hex
|
||
424: 6858+4 05C5 7D ld a,l
|
||
425: 6862+17 05C6 CDE702 call print_a_hex
|
||
426: 6879+10 05C9 E1 pop hl
|
||
427: 6889+10 05CA C9 ret
|
||
428:
|
||
429: - 05CB param_10:
|
||
430: 6899+11 05CB C5 push bc
|
||
431: 6910+20 05CC ED5B1041 ld de,(var_opcode_start)
|
||
432: 6930+7 05D0 1A ld a,(de)
|
||
433: 6937+4 05D1 1F rra
|
||
434: 6941+4 05D2 1F rra
|
||
435: 6945+4 05D3 1F rra
|
||
436: 6949+7 05D4 E607 and 0x07
|
||
437: 6956+17 05D6 CD5006 call param_printRegister
|
||
438: 6973+10 05D9 C1 pop bc
|
||
439: 6983+10 05DA C9 ret
|
||
440:
|
||
441:
|
||
442: - 05DB param_11:
|
||
443: 6993+11 05DB E5 push hl
|
||
444: 7004+11 05DC C5 push bc
|
||
445: 7015+20 05DD ED5B1041 ld de,(var_opcode_start)
|
||
446: 7035+12 05E1 1807 jr param_11_12
|
||
447: - 05E3 param_12:
|
||
448: 7047+11 05E3 E5 push hl
|
||
449: 7058+11 05E4 C5 push bc
|
||
450: 7069+20 05E5 ED5B1041 ld de,(var_opcode_start)
|
||
451: 7089+6 05E9 13 inc de
|
||
452:
|
||
453: - 05EA param_11_12:
|
||
454: 7095+7 05EA 1A ld a,(de)
|
||
455: 7102+4 05EB 1F rra
|
||
456: 7106+4 05EC 1F rra
|
||
457: 7110+4 05ED 1F rra
|
||
458: 7114+7 05EE E606 and 0x06
|
||
459: 7121+11 05F0 F5 push af
|
||
460: ;check which table to use
|
||
461: 7132+16 05F1 2A1041 ld hl, (var_opcode_start)
|
||
462: 7148+7 05F4 7E ld a,(hl)
|
||
463: 7155+7 05F5 FEDD cp 0xDD
|
||
464: 7162+7+5 05F7 2809 jr z,param_11_12_ix
|
||
465: 7169+7 05F9 FEFD cp 0xFD
|
||
466: 7176+7+5 05FB 280A jr z,param_11_12_iy
|
||
467: - 05FD param_11_12_def:
|
||
468: 7183+10 05FD 219F0E ld hl, [dasm_printRegister8_table]
|
||
469: 7193+12 0600 1808 jr param_11_12_all
|
||
470: - 0602 param_11_12_ix:
|
||
471: 7205+10 0602 21A70E ld hl, [dasm_printRegisterIX_table]
|
||
472: 7215+12 0605 1803 jr param_11_12_all
|
||
473: - 0607 param_11_12_iy:
|
||
474: 7227+10 0607 21AF0E ld hl, [dasm_printRegisterIY_table]
|
||
475: - 060A param_11_12_all:
|
||
476: 7237+10 060A F1 pop af
|
||
477: 7247+7 060B 0600 ld b,0
|
||
478: 7254+4 060D 4F ld c,a
|
||
479: 7258+11 060E 09 add hl, bc
|
||
480: 7269+7 060F 7E ld a,(hl)
|
||
481: 7276+17 0610 CDB702 call print_char
|
||
482: 7293+6 0613 23 inc hl
|
||
483: 7299+7 0614 7E ld a,(hl)
|
||
484: 7306+17 0615 CDB702 call print_char
|
||
485: 7323+10 0618 C1 pop bc
|
||
486: 7333+10 0619 E1 pop hl
|
||
487: 7343+10 061A C9 ret
|
||
488:
|
||
489: - 061B param_13:
|
||
490: 7353+11 061B E5 push hl
|
||
491: 7364+11 061C C5 push bc
|
||
492: 7375+20 061D ED5B1041 ld de,(var_opcode_start)
|
||
493: 7395+7 0621 1A ld a,(de)
|
||
494: 7402+4 0622 1F rra
|
||
495: 7406+4 0623 1F rra
|
||
496: 7410+4 0624 1F rra
|
||
497: 7414+7 0625 E606 and 0x06
|
||
498: 7421+11 0627 F5 push af
|
||
499: ;check which table to use
|
||
500: 7432+16 0628 2A1041 ld hl, (var_opcode_start)
|
||
501: 7448+7 062B 7E ld a,(hl)
|
||
502: 7455+10 062C 21B70E ld hl, [dasm_printRegisterSP_table]
|
||
503: 7465+12 062F 18D9 jr param_11_12_all ;reuse code from 11_12
|
||
504:
|
||
505:
|
||
506: - 0631 param_81:
|
||
507: 7477+11 0631 E5 push hl
|
||
508: 7488+11 0632 C5 push bc
|
||
509: 7499+16 0633 2A1741 ld hl, (var_opcode_string)
|
||
510: 7515+7 0636 0602 ld b,2
|
||
511: 7522+12 0638 1807 jr param_80_seek
|
||
512: - 063A param_80:
|
||
513: 7534+11 063A E5 push hl
|
||
514: 7545+11 063B C5 push bc
|
||
515: 7556+16 063C 2A1741 ld hl, (var_opcode_string)
|
||
516: 7572+7 063F 0601 ld b,1
|
||
517: - 0641 param_80_seek:
|
||
518: 7579+7 0641 7E ld a,(hl)
|
||
519: 7586+6 0642 23 inc hl
|
||
520: 7592+4 0643 A7 and a
|
||
521: 7596+7+5 0644 20FB jr nz, param_80_seek
|
||
522: ;found
|
||
523: 7603+4 0646 05 dec b ;found but counter too high
|
||
524: 7607+10 0647 C24106 jp nz, param_80_seek
|
||
525:
|
||
526: 7617+17 064A CDBF02 call print_str
|
||
527: 7634+10 064D C1 pop bc
|
||
528: 7644+10 064E E1 pop hl
|
||
529: 7654+10 064F C9 ret
|
||
530:
|
||
531:
|
||
532:
|
||
533: - 0650 param_printRegister:
|
||
534: 7664+11 0650 E5 push hl
|
||
535: 7675+7 0651 FE06 cp 0x06
|
||
536: 7682+7+5 0653 2811 jr z, param_printRegisterHL
|
||
537: 7689+7 0655 FE07 cp 0x07
|
||
538: 7696+7+5 0657 2815 jr z, param_printRegisterA
|
||
539: 7703+10 0659 219F0E ld hl, [dasm_printRegister8_table]
|
||
540: 7713+7 065C 0600 ld b,0
|
||
541: 7720+4 065E 4F ld c,a
|
||
542: 7724+11 065F 09 add hl,bc
|
||
543: 7735+7 0660 7E ld a, (hl)
|
||
544: 7742+17 0661 CDB702 call print_char
|
||
545: 7759+10 0664 E1 pop hl
|
||
546: 7769+10 0665 C9 ret
|
||
547:
|
||
548: - 0666 param_printRegisterHL:
|
||
549: 7779+10 0666 21BF0E ld hl, [dasm_printRegister8_table_HL]
|
||
550: 7789+17 0669 CDBF02 call print_str
|
||
551: 7806+10 066C E1 pop hl
|
||
552: 7816+10 066D C9 ret
|
||
553:
|
||
554: - 066E param_printRegisterA:
|
||
555: 7826+7 066E 3E41 ld a,"A"
|
||
556: 7833+17 0670 CDB702 call print_char
|
||
557: 7850+10 0673 E1 pop hl
|
||
558: 7860+10 0674 C9 ret
|
||
559:
|
||
560:
|
||
561: - 0675 param_comma:
|
||
562: 7870+4 0675 78 ld a,b
|
||
563: 7874+7 0676 FE01 cp 1
|
||
564: 7881+5+6 0678 C8 ret z
|
||
565: 7886+7 0679 3E20 ld a," "
|
||
566: 7893+17 067B CDB702 call print_char
|
||
567: 7910+7 067E 3E2C ld a,","
|
||
568: 7917+17 0680 CDB702 call print_char
|
||
**** main.asm ****
|
||
494: 7934+10 0683 C9 ret
|
||
495: .include "disassembler_table.s"
|
||
**** include/disassembler_table.s ****
|
||
1: ;disassembler tables
|
||
2:
|
||
3: - 0684 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: - 0684 00FF0000 defb 0x00, 0xFF, 0x00, 0x00, 1, [dasm_00], [dasm_00]>>8,0 ;NOP
|
||
01DC0A00
|
||
29: ;General-Purpose Arithmetic and CPU Control Groups
|
||
30: - 068C 27FF0000 defb 0x27, 0xFF, 0x00, 0x00, 1, [dasm_27], [dasm_27]>>8, 0 ;DAA
|
||
01A70B00
|
||
31: - 0694 2FFF0000 defb 0x2F, 0xFF, 0x00, 0x00, 1, [dasm_2F], [dasm_2F]>>8, 0 ;CPL
|
||
01AB0B00
|
||
32: - 069C EDFF44FF defb 0xED, 0xFF, 0x44, 0xFF, 2, [dasm_ED_44], [dasm_ED_44]>>8, 0 ;NEG
|
||
02AF0B00
|
||
33: - 06A4 3FFF0000 defb 0x3f, 0xFF, 0x00, 0x00, 1, [dasm_3F], [dasm_3F]>>8, 0 ;CCF
|
||
01B30B00
|
||
34: - 06AC 37FF0000 defb 0x37, 0xFF, 0x00, 0x00, 1, [dasm_37], [dasm_37]>>8, 0 ;SCF
|
||
01B70B00
|
||
35: ;defb 0x00, 0xFF, 0x00, 0x00, 1, [dasm_00], [dasm_00]>>8,0 ;NOP -> already at top for performance reasons
|
||
36: - 06B4 76FF0000 defb 0x76, 0xFF, 0x00, 0x00, 1, [dasm_76], [dasm_76]>>8, 0 ;HALT
|
||
01BB0B00
|
||
37: - 06BC F3FF0000 defb 0xF3, 0xFF, 0x00, 0x00, 1, [dasm_F3], [dasm_F3]>>8, 0 ;DI
|
||
01C00B00
|
||
38: - 06C4 FBFF0000 defb 0xFB, 0xFF, 0x00, 0x00, 1, [dasm_FB], [dasm_FB]>>8, 0 ;EI
|
||
01C30B00
|
||
39: - 06CC EDFF46FF defb 0xED, 0xFF, 0x46, 0xFF, 2, [dasm_ED_46], [dasm_ED_46]>>8, 0 ;IM 0
|
||
02C60B00
|
||
40: - 06D4 EDFF56FF defb 0xED, 0xFF, 0x56, 0xFF, 2, [dasm_ED_56], [dasm_ED_56]>>8, 0 ;IM 1
|
||
02CB0B00
|
||
41: - 06DC EDFF5EFF defb 0xED, 0xFF, 0x5E, 0xFF, 2, [dasm_ED_5E], [dasm_ED_5E]>>8, 0 ;IM 2
|
||
02D00B00
|
||
42:
|
||
43: ;Exchange, Block Transfer, and Search Group
|
||
44: - 06E4 EBFF0000 defb 0xEB, 0xFF, 0x00, 0x00, 1, [dasm_BE], [dasm_BE]>>8, 0 ;EX DE, HL
|
||
01D50B00
|
||
45: - 06EC 08FF0000 defb 0x08, 0xFF, 0x00, 0x00, 1, [dasm_08], [dasm_08]>>8, 0 ;EX AF, AF′
|
||
01DF0B00
|
||
46: - 06F4 D9FF0000 defb 0xD9, 0xFF, 0x00, 0x00, 1, [dasm_D9], [dasm_D9]>>8, 0 ;EXX
|
||
01EC0B00
|
||
47: - 06FC E3FF0000 defb 0xE3, 0xFF, 0x00, 0x00, 1, [dasm_E3], [dasm_E3]>>8, 0 ;EX (SP), HL
|
||
01F00B00
|
||
48: - 0704 DDFFE3FF defb 0xDD, 0xFF, 0xE3, 0xFF, 2, [dasm_DD_E3], [dasm_DD_E3]>>8, 0 ;EX (SP), IX
|
||
02FC0B00
|
||
49: - 070C FDFFE3FF defb 0xFD, 0xFF, 0xE3, 0xFF, 2, [dasm_FD_E3], [dasm_FD_E3]>>8, 0 ;EX (SP), IY
|
||
02080C00
|
||
50: - 0714 EDFFA0FF defb 0xED, 0xFF, 0xA0, 0xFF, 2, [dasm_ED_A0], [dasm_ED_A0]>>8, 0 ;LDI
|
||
02140C00
|
||
51: - 071C EDFFB0FF defb 0xED, 0xFF, 0xB0, 0xFF, 2, [dasm_ED_B0], [dasm_ED_B0]>>8, 0 ;LDIR
|
||
02180C00
|
||
52: - 0724 EDFFA8FF defb 0xED, 0xFF, 0xA8, 0xFF, 2, [dasm_ED_A8], [dasm_ED_A8]>>8, 0 ;LDD
|
||
021D0C00
|
||
53: - 072C EDFFB8FF defb 0xED, 0xFF, 0xB8, 0xFF, 2, [dasm_ED_B8], [dasm_ED_B8]>>8, 0 ;LDDR
|
||
02210C00
|
||
54: - 0734 EDFFA1FF defb 0xED, 0xFF, 0xA1, 0xFF, 2, [dasm_ED_A1], [dasm_ED_A1]>>8, 0 ;CPI
|
||
02260C00
|
||
55: - 073C EDFFB1FF defb 0xED, 0xFF, 0xB1, 0xFF, 2, [dasm_ED_B1], [dasm_ED_B1]>>8, 0 ;CPIR
|
||
022A0C00
|
||
56: - 0744 EDFFA9FF defb 0xED, 0xFF, 0xA9, 0xFF, 2, [dasm_ED_A9], [dasm_ED_A9]>>8, 0 ;CPD
|
||
022F0C00
|
||
57: - 074C EDFFB9FF defb 0xED, 0xFF, 0xB9, 0xFF, 2, [dasm_ED_B9], [dasm_ED_B9]>>8, 0 ;CPDR
|
||
02330C00
|
||
58:
|
||
59: ;JUMP Group
|
||
60: - 0754 C3FF0000 defb 0xC3, 0xFF, 0x00, 0x00, 3, [dasm_C3], [dasm_C3]>>8,1, 0x01 ;JP nn
|
||
03E00A01
|
||
01
|
||
61: - 075D C2C70000 defb 0xC2, 0xC7, 0x00, 0x00, 3, [dasm_C3], [dasm_C3]>>8,3, 0x02, 0x80, 0x01 ;JP cc,nn
|
||
03E00A03
|
||
028001
|
||
62: - 0768 18FF0000 defb 0x18, 0xFF, 0x00, 0x00, 2, [dasm_18], [dasm_18]>>8,1, 0x03 ;JR e
|
||
02E70A01
|
||
03
|
||
63: - 0771 38FF0000 defb 0x38, 0xFF, 0x00, 0x00, 2, [dasm_38], [dasm_38]>>8,1, 0x03 ;JR C,e
|
||
02EB0A01
|
||
03
|
||
64: - 077A 30FF0000 defb 0x30, 0xFF, 0x00, 0x00, 2, [dasm_30], [dasm_30]>>8,1, 0x03 ;JR NC,e
|
||
02F20A01
|
||
03
|
||
65: - 0783 28FF0000 defb 0x28, 0xFF, 0x00, 0x00, 2, [dasm_28], [dasm_28]>>8,1, 0x03 ;JR Z,e
|
||
02FA0A01
|
||
03
|
||
66: - 078C 20FF0000 defb 0x20, 0xFF, 0x00, 0x00, 2, [dasm_20], [dasm_20]>>8,1, 0x03 ;JR NZ,e
|
||
02010B01
|
||
03
|
||
67: - 0795 E9FF0000 defb 0xE9, 0xFF, 0x00, 0x00, 2, [dasm_E9], [dasm_E9]>>8,0 ;JP (HL)
|
||
02090B00
|
||
68: - 079D DDFFE9FF defb 0xDD, 0xFF, 0xE9, 0xFF, 2, [dasm_DD], [dasm_DD]>>8,0 ;JP (IX)
|
||
02120B00
|
||
69: - 07A5 FDFFE9FF defb 0xFD, 0xFF, 0xE9, 0xFF, 2, [dasm_FD], [dasm_FD]>>8,0 ;JP (IY)
|
||
021B0B00
|
||
70: - 07AD 10FF0000 defb 0x10, 0xFF, 0x00, 0x00, 2, [dasm_10], [dasm_10]>>8,1, 0x03 ;DJNZ, e
|
||
02240B01
|
||
03
|
||
71: ;Call and Return Group
|
||
72: - 07B6 CDFF0000 defb 0xCD, 0xFF, 0x00, 0x00, 3, [dasm_CD], [dasm_CD]>>8,1, 0x01 ;CALL nn
|
||
032A0B01
|
||
01
|
||
73: - 07BF C4C70000 defb 0xC4, 0xC7, 0x00, 0x00, 3, [dasm_CD], [dasm_CD]>>8,2, 0x02, 0x01 ;CALL cc,nn
|
||
032A0B02
|
||
0201
|
||
74: - 07C9 C9FF0000 defb 0xC9, 0xFF, 0x00, 0x00, 1, [dasm_C9], [dasm_C9]>>8,0 ;RET
|
||
01300B00
|
||
75: - 07D1 C0C70000 defb 0xC0, 0xC7, 0x00, 0x00, 1, [dasm_C9], [dasm_C9]>>8,1, 0x02 ;RET cc
|
||
01300B01
|
||
02
|
||
76: - 07DA EDFF4DFF defb 0xED, 0xFF, 0x4D, 0xFF, 2, [dasm_ED_4D], [dasm_ED_4D]>>8,0 ;RETI
|
||
02350B00
|
||
77: - 07E2 EDFF45FF defb 0xED, 0xFF, 0x45, 0xFF, 2, [dasm_ED_45], [dasm_ED_45]>>8,0 ;RETN
|
||
023A0B00
|
||
78:
|
||
79: - 07EA C7C70000 defb 0xC7, 0xC7, 0x00, 0x00, 1, [dasm_FF], [dasm_FF]>>8,1, 0x05 ;RST
|
||
013F0B01
|
||
05
|
||
80: ;8-Bit load group
|
||
81: - 07F3 0AFF0000 defb 0x0A, 0xFF, 0x00, 0x00, 1, [dasm_0A], [dasm_0A]>>8, 0 ;LD A, (BC)
|
||
01440B00
|
||
82: - 07FB 1AFF0000 defb 0x1A, 0xFF, 0x00, 0x00, 1, [dasm_1A], [dasm_1A]>>8, 0 ;LD A, (DE)
|
||
014E0B00
|
||
83: - 0803 3AFF0000 defb 0x3A, 0xFF, 0x00, 0x00, 3, [dasm_3A], [dasm_3A]>>8, 2, 0x09, 0x80 ;LD A, (nn)
|
||
03580B02
|
||
0980
|
||
84: - 080D 02FF0000 defb 0x02, 0xFF, 0x00, 0x00, 1, [dasm_02], [dasm_02]>>8, 0 ;LD (BC), A
|
||
01620B00
|
||
85: - 0815 12FF0000 defb 0x12, 0xFF, 0x00, 0x00, 1, [dasm_12], [dasm_12]>>8, 0 ;LD (DE), A
|
||
016D0B00
|
||
86: - 081D 32FF0000 defb 0x32, 0xFF, 0x00, 0x00, 3, [dasm_32], [dasm_32]>>8, 2, 0x09, 0x80 ;LD (nn), A
|
||
03780B02
|
||
0980
|
||
87: - 0827 EDFF57FF defb 0xED, 0xFF, 0x57, 0xFF, 2, [dasm__ED_57], [dasm__ED_57]>>8, 0 ;LD A, I
|
||
02870B00
|
||
88: - 082F EDFF5FFF defb 0xED, 0xFF, 0x5F, 0xFF, 2, [dasm__ED_5F], [dasm__ED_5F]>>8, 0 ;LD A, R
|
||
028F0B00
|
||
89: - 0837 EDFF47FF defb 0xED, 0xFF, 0x47, 0xFF, 2, [dasm__ED_47], [dasm__ED_47]>>8, 0 ;LD I, A
|
||
02970B00
|
||
90: - 083F EDFF4FFF defb 0xED, 0xFF, 0x4F, 0xFF, 2, [dasm__ED_4F], [dasm__ED_4F]>>8, 0 ;LD R, A
|
||
029F0B00
|
||
91:
|
||
92: - 0847 06C70000 defb 0x06, 0xC7, 0x00, 0x00, 2, [dasm__LD], [dasm__LD]>>8, 2, 0x06, 0x08 ;LD r, n
|
||
02830B02
|
||
0608
|
||
93: - 0851 40C00000 defb 0x40, 0xC0, 0x00, 0x00, 1, [dasm__LD], [dasm__LD]>>8, 2, 0x06, 0x07 ;LD r, r' / LD r, (HL) / LD (HL), r
|
||
01830B02
|
||
0607
|
||
94:
|
||
95: ;8-Bit Arithmetic Group
|
||
96: - 085B 80F80000 defb 0x80, 0xF8, 0x00, 0x00, 1, [dasm_80C6], [dasm_80C6]>>8, 1, 0x07 ;ADD A, r / ADD A, (HL)
|
||
01380C01
|
||
07
|
||
97: - 0864 C6FF0000 defb 0xC6, 0xFF, 0x00, 0x00, 2, [dasm_80C6], [dasm_80C6]>>8, 1, 0x08 ;ADD A, n
|
||
02380C01
|
||
08
|
||
98: - 086D DDFF86FF defb 0xDD, 0xFF, 0x86, 0xFF, 3, [dasm_DD_86], [dasm_DD_86]>>8, 2, 0x08, 0x80 ;ADD A, (IX + d)
|
||
03400C02
|
||
0880
|
||
99: - 0877 FDFF86FF defb 0xFD, 0xFF, 0x86, 0xFF, 3, [dasm_FD_86], [dasm_FD_86]>>8, 2, 0x08, 0x80 ;ADD A, (IY + d)
|
||
034F0C02
|
||
0880
|
||
100: - 0881 C8F80000 defb 0xC8, 0xF8, 0x00, 0x00, 1, [dasm_C88E], [dasm_C88E]>>8, 1, 0x07 ;ADC A, r / ADC A, (HL)
|
||
015E0C01
|
||
07
|
||
101: - 088A 8EF80000 defb 0x8E, 0xF8, 0x00, 0x00, 2, [dasm_C88E], [dasm_C88E]>>8, 1, 0x08 ;ADC A, n
|
||
025E0C01
|
||
08
|
||
102: - 0893 DDFF8EFF defb 0xDD, 0xFF, 0x8E, 0xFF, 3, [dasm_DD_8E], [dasm_DD_8E]>>8, 2, 0x08, 0x80 ;ADC A, (IX + d)
|
||
03660C02
|
||
0880
|
||
103: - 089D FDFF8EFF defb 0xFD, 0xFF, 0x8E, 0xFF, 3, [dasm_FD_8E], [dasm_FD_8E]>>8, 2, 0x08, 0x80 ;ADC A, (IY + d)
|
||
03750C02
|
||
0880
|
||
104: - 08A7 90F80000 defb 0x90, 0xF8, 0x00, 0x00, 1, [dasm__SUB], [dasm__SUB]>>8, 1, 0x07 ;SUB r / SUB A, (HL)
|
||
01840C01
|
||
07
|
||
105: - 08B0 D6FF0000 defb 0xD6, 0xFF, 0x00, 0x00, 2, [dasm__SUB], [dasm__SUB]>>8, 1, 0x08 ;SUB n
|
||
02840C01
|
||
08
|
||
106: - 08B9 DDFF96FF defb 0xDD, 0xFF, 0x96, 0xFF, 3, [dasm_DD_96], [dasm_DD_96]>>8, 2, 0x08, 0x80 ;SUB (IX + d)
|
||
03890C02
|
||
0880
|
||
107: - 08C3 FDFF96FF defb 0xFD, 0xFF, 0x96, 0xFF, 3, [dasm_FD_96], [dasm_FD_96]>>8, 2, 0x08, 0x80 ;SUB (IY + d)
|
||
03950C02
|
||
0880
|
||
108: - 08CD 94F80000 defb 0x94, 0xF8, 0x00, 0x00, 1, [dasm__SBC], [dasm__SBC]>>8, 1, 0x07 ;SBC A,r / SBC A, (HL)
|
||
01A10C01
|
||
07
|
||
109: - 08D6 DEFF0000 defb 0xDE, 0xFF, 0x00, 0x00, 2, [dasm__SBC], [dasm__SBC]>>8, 1, 0x08 ;SBC A,n
|
||
02A10C01
|
||
08
|
||
110: - 08DF DDFF9EFF defb 0xDD, 0xFF, 0x9E, 0xFF, 3, [dasm_DD_9E], [dasm_DD_9E]>>8, 2, 0x08, 0x80 ;SBC A,(IX + d)
|
||
03A90C02
|
||
0880
|
||
111: - 08E9 FDFF9EFF defb 0xFD, 0xFF, 0x9E, 0xFF, 3, [dasm_FD_9E], [dasm_FD_9E]>>8, 2, 0x08, 0x80 ;SBC A,(IY + d)
|
||
03B70C02
|
||
0880
|
||
112: - 08F3 A0F80000 defb 0xA0, 0xF8, 0x00, 0x00, 1, [dasm__AND], [dasm__AND]>>8, 1, 0x07 ;AND A,r / AND A, (HL)
|
||
01C50C01
|
||
07
|
||
113: - 08FC E6FF0000 defb 0xE6, 0xFF, 0x00, 0x00, 2, [dasm__AND], [dasm__AND]>>8, 1, 0x08 ;AND A,n
|
||
02C50C01
|
||
08
|
||
114: - 0905 DDFFA6FF defb 0xDD, 0xFF, 0xA6, 0xFF, 3, [dasm_DD_A6], [dasm_DD_A6]>>8, 2, 0x08, 0x80 ;AND A,(IX + d)
|
||
03CA0C02
|
||
0880
|
||
115: - 090F FDFFA6FF defb 0xFD, 0xFF, 0xA6, 0xFF, 3, [dasm_FD_A6], [dasm_FD_A6]>>8, 2, 0x08, 0x80 ;AND A,(IY + d)
|
||
03D60C02
|
||
0880
|
||
116: - 0919 B0F80000 defb 0xB0, 0xF8, 0x00, 0x00, 1, [dasm__OR], [dasm__OR]>>8, 1, 0x07 ;OR A,r / OR A, (HL)
|
||
01E20C01
|
||
07
|
||
117: - 0922 F6FF0000 defb 0xF6, 0xFF, 0x00, 0x00, 2, [dasm__OR], [dasm__OR]>>8, 1, 0x08 ;OR A,n
|
||
02E20C01
|
||
08
|
||
118: - 092B DDFFB6FF defb 0xDD, 0xFF, 0xB6, 0xFF, 3, [dasm_DD_B6], [dasm_DD_B6]>>8, 2, 0x08, 0x80 ;OR A,(IX + d)
|
||
03E60C02
|
||
0880
|
||
119: - 0935 FDFFB6FF defb 0xFD, 0xFF, 0xB6, 0xFF, 3, [dasm_FD_B6], [dasm_FD_B6]>>8, 2, 0x08, 0x80 ;OR A,(IY + d)
|
||
03F10C02
|
||
0880
|
||
120: - 093F A8F80000 defb 0xA8, 0xF8, 0x00, 0x00, 1, [dasm__XOR], [dasm__XOR]>>8, 1, 0x07 ;XOR A,r / XOR A, (HL)
|
||
01FC0C01
|
||
07
|
||
121: - 0948 EEFF0000 defb 0xEE, 0xFF, 0x00, 0x00, 2, [dasm__XOR], [dasm__XOR]>>8, 1, 0x08 ;XOR A,n
|
||
02FC0C01
|
||
08
|
||
122: - 0951 DDFFAEFF defb 0xDD, 0xFF, 0xAE, 0xFF, 3, [dasm_DD_AE], [dasm_DD_AE]>>8, 2, 0x08, 0x80 ;XOR A,(IX + d)
|
||
03010D02
|
||
0880
|
||
123: - 095B FDFFAEFF defb 0xFD, 0xFF, 0xAE, 0xFF, 3, [dasm_FD_AE], [dasm_FD_AE]>>8, 2, 0x08, 0x80 ;XOR A,(IY + d)
|
||
030D0D02
|
||
0880
|
||
124: - 0965 B8F80000 defb 0xB8, 0xF8, 0x00, 0x00, 1, [dasm__CP], [dasm__CP]>>8, 1, 0x07 ;CP A,r / CP A, (HL)
|
||
01190D01
|
||
07
|
||
125: - 096E FEFF0000 defb 0xFE, 0xFF, 0x00, 0x00, 2, [dasm__CP], [dasm__CP]>>8, 1, 0x08 ;CP A,n
|
||
02190D01
|
||
08
|
||
126: - 0977 DDFFBEFF defb 0xDD, 0xFF, 0xBE, 0xFF, 3, [dasm_DD_BE], [dasm_DD_BE]>>8, 2, 0x08, 0x80 ;CP A,(IX + d)
|
||
031D0D02
|
||
0880
|
||
127: - 0981 FDFFBEFF defb 0xFD, 0xFF, 0xBE, 0xFF, 3, [dasm_FD_BE], [dasm_FD_BE]>>8, 2, 0x08, 0x80 ;CP A,(IY + d)
|
||
03280D02
|
||
0880
|
||
128: - 098B 04C70000 defb 0x04, 0xC7, 0x00, 0x00, 1, [dasm__INC], [dasm__INC]>>8, 1, 0x10 ;INC r / INC (HL)
|
||
01330D01
|
||
10
|
||
129: - 0994 DDFF34FF defb 0xDD, 0xFF, 0x34, 0xFF, 3, [dasm_DD_34], [dasm_DD_34]>>8, 2, 0x08, 0x80 ;INC (IX + d)
|
||
03380D02
|
||
0880
|
||
130: - 099E FDFF34FF defb 0xFD, 0xFF, 0x34, 0xFF, 3, [dasm_FD_34], [dasm_FD_34]>>8, 2, 0x08, 0x80 ;INC (IY + d)
|
||
03440D02
|
||
0880
|
||
131: - 09A8 05C70000 defb 0x05, 0xC7, 0x00, 0x00, 1, [dasm__DEC], [dasm__DEC]>>8, 1, 0x10 ;DEC r / DEC (HL)
|
||
01500D01
|
||
10
|
||
132: - 09B1 DDFF35FF defb 0xDD, 0xFF, 0x35, 0xFF, 3, [dasm_DD_35], [dasm_DD_35]>>8, 2, 0x08, 0x80 ;DEC (IX + d)
|
||
03550D02
|
||
0880
|
||
133: - 09BB FDFF35FF defb 0xFD, 0xFF, 0x35, 0xFF, 3, [dasm_FD_35], [dasm_FD_35]>>8, 2, 0x08, 0x80 ;DEC (IY + d)
|
||
03610D02
|
||
0880
|
||
134: ;16-Bit Arithmetic Group
|
||
135: - 09C5 09CF0000 defb 0x09, 0xCF, 0x00, 0x00, 1, [dasm_09], [dasm_09]>>8, 1, 0x11 ;ADD HL, ss
|
||
016D0D01
|
||
11
|
||
136: - 09CE EDFF4ACF defb 0xED, 0xFF, 0x4A, 0xCF, 2, [dasm_ED_4A], [dasm_ED_4A]>>8, 1, 0x12 ;ADC HL, ss
|
||
02760D01
|
||
12
|
||
137: - 09D7 EDFF42CF defb 0xED, 0xFF, 0x42, 0xCF, 2, [dasm_ED_42], [dasm_ED_42]>>8, 1, 0x12 ;SBC HL, ss
|
||
027F0D01
|
||
12
|
||
138: - 09E0 DDFF09CF defb 0xDD, 0xFF, 0x09, 0xCF, 2, [dasm_DD_09], [dasm_DD_09]>>8, 1, 0x12 ;ADD IX, ss
|
||
02880D01
|
||
12
|
||
139: - 09E9 FDFF09CF defb 0xFD, 0xFF, 0x09, 0xCF, 2, [dasm_FD_09], [dasm_FD_09]>>8, 1, 0x12 ;ADD IY, ss
|
||
02910D01
|
||
12
|
||
140: - 09F2 03CF0000 defb 0x03, 0xCF, 0x00, 0x00, 1, [dasm_03], [dasm_03]>>8, 1, 0x11 ;INC ss
|
||
019A0D01
|
||
11
|
||
141: - 09FB DDFF23FF defb 0xDD, 0xFF, 0x23, 0xFF, 2, [dasm_DD_23], [dasm_DD_23]>>8, 0 ;INC IX
|
||
029F0D00
|
||
142: - 0A03 FDFF23FF defb 0xFD, 0xFF, 0x23, 0xFF, 2, [dasm_FD_23], [dasm_FD_23]>>8, 0 ;INC IY
|
||
02A80D00
|
||
143: - 0A0B 0BCF0000 defb 0x0B, 0xCF, 0x00, 0x00, 1, [dasm_0B], [dasm_0B]>>8, 1, 0x11 ;DEC ss
|
||
01B10D01
|
||
11
|
||
144: - 0A14 DDFF2BFF defb 0xDD, 0xFF, 0x2B, 0xFF, 2, [dasm_DD_2B], [dasm_DD_2B]>>8, 0 ;DEC IX
|
||
02B60D00
|
||
145: - 0A1C FDFF2BFF defb 0xFD, 0xFF, 0x2B, 0xFF, 2, [dasm_FD_2B], [dasm_FD_2B]>>8, 0 ;DEC IY
|
||
02BF0D00
|
||
146: ;16-Bit Load Group
|
||
147: - 0A24 01CF0000 defb 0x01, 0xCF, 0x00, 0x00, 3, [dasm_01], [dasm_01]>>8, 3, 0x11, 0x80, 0x09 ;LD dd, nn
|
||
03C80D03
|
||
118009
|
||
148: - 0A2F DDFF21FF defb 0xDD, 0xFF, 0x21, 0xFF, 4, [dasm_DD_01], [dasm_DD_01]>>8, 1, 0x0A ;LD IX, nn
|
||
04CF0D01
|
||
0A
|
||
149: - 0A38 FDFF21FF defb 0xFD, 0xFF, 0x21, 0xFF, 4, [dasm_FD_01], [dasm_FD_01]>>8, 1, 0x0A ;LD IY, nn
|
||
04D70D01
|
||
0A
|
||
150: - 0A41 2AFF0000 defb 0x2A, 0xFF, 0x00, 0x00, 3, [dasm_2A], [dasm_2A]>>8, 2, 0x09, 0x80 ;LD HL, (nn)
|
||
03DF0D02
|
||
0980
|
||
151: - 0A4B EDFF4BCF defb 0xED, 0xFF, 0x4B, 0xCF, 4, [dasm_ED_4B], [dasm_ED_4B]>>8, 4, 0x12, 0x80, 0x0A, 0x81 ;LD dd, (nn)
|
||
04EB0D04
|
||
12800A81
|
||
152: - 0A57 DDFF2AFF defb 0xDD, 0xFF, 0x2A, 0xFF, 4, [dasm_DD_2A], [dasm_DD_2A]>>8, 1, 0x0A ;LD IX, (nn)
|
||
04F60D01
|
||
0A
|
||
153: - 0A60 FDFF2AFF defb 0xFD, 0xFF, 0x2A, 0xFF, 4, [dasm_FD_2A], [dasm_FD_2A]>>8, 1, 0x0A ;LD IY, (nn)
|
||
04020E01
|
||
0A
|
||
154: - 0A69 22FF0000 defb 0x22, 0xFF, 0x00, 0x00, 3, [dasm_22], [dasm_22]>>8, 2, 0x0A, 0x80 ;LD (nn), HL
|
||
030E0E02
|
||
0A80
|
||
155: - 0A73 EDFF43CF defb 0xED, 0xFF, 0x43, 0xCF, 4, [dasm_ED_43], [dasm_ED_43]>>8, 3, 0x0A, 0x80, 0x12 ;LD (nn), dd
|
||
041A0E03
|
||
0A8012
|
||
156: - 0A7E DDFF22CF defb 0xDD, 0xFF, 0x22, 0xCF, 4, [dasm_DD_22], [dasm_DD_22]>>8, 2, 0x0A, 0x80 ;LD (nn), IX
|
||
04240E02
|
||
0A80
|
||
157: - 0A88 FDFF22CF defb 0xFD, 0xFF, 0x22, 0xCF, 4, [dasm_FD_22], [dasm_FD_22]>>8, 2, 0x0A, 0x80 ;LD (nn), IY
|
||
04300E02
|
||
0A80
|
||
158: - 0A92 F9FF0000 defb 0xF9, 0xFF, 0x00, 0x00, 1, [dasm_F9], [dasm_F9]>>8, 0 ;LD SP, HL
|
||
013C0E00
|
||
159: - 0A9A DDFFF9FF defb 0xDD, 0xFF, 0xF9, 0xFF, 2, [dasm_DD_F9], [dasm_DD_F9]>>8, 0 ;LD SP, IX
|
||
02460E00
|
||
160: - 0AA2 FDFFF9FF defb 0xFD, 0xFF, 0xF9, 0xFF, 2, [dasm_FD_F9], [dasm_FD_F9]>>8, 0 ;LD SP, IY
|
||
02500E00
|
||
161: - 0AAA C5CF0000 defb 0xC5, 0xCF, 0x00, 0x00, 1, [dasm_E5], [dasm_E5]>>8, 1, 0x13 ;PUSH qq
|
||
015A0E01
|
||
13
|
||
162: - 0AB3 DDFFE5FF defb 0xDD, 0xFF, 0xE5, 0xFF, 2, [dasm_DD_E5], [dasm_DD_E5]>>8, 0 ;PUSH IX
|
||
02600E00
|
||
163: - 0ABB FDFFE5FF defb 0xFD, 0xFF, 0xE5, 0xFF, 2, [dasm_FD_E5], [dasm_FD_E5]>>8, 0 ;PUSH IY
|
||
02680E00
|
||
164: - 0AC3 C1CF0000 defb 0xC1, 0xCF, 0x00, 0x00, 1, [dasm_E1], [dasm_E1]>>8, 1, 0x13 ;POP qq
|
||
01700E01
|
||
13
|
||
165: - 0ACC DDFFE1FF defb 0xDD, 0xFF, 0xE1, 0xFF, 2, [dasm_DD_E1], [dasm_DD_E1]>>8, 0 ;POP IX
|
||
02760E00
|
||
166: - 0AD4 FDFFE1FF defb 0xFD, 0xFF, 0xE1, 0xFF, 2, [dasm_FD_E1], [dasm_FD_E1]>>8, 0 ;POP IY
|
||
027E0E00
|
||
167:
|
||
168:
|
||
169: - 0ADC 4E4F5000 dasm_00: db "NOP",0x00
|
||
170: ;JUMP Group
|
||
171: - 0AE0 4A502000 dasm_C3: db "JP ",0x00,", ",0x00
|
||
2C2000
|
||
172: - 0AE7 4A522000 dasm_18: db "JR ",0x00
|
||
173: - 0AEB 4A522043 dasm_38: db "JR C, ",0x00
|
||
2C2000
|
||
174: - 0AF2 4A52204E dasm_30: db "JR NC, ",0x00
|
||
432C2000
|
||
175: - 0AFA 4A52205A dasm_28: db "JR Z, ",0x00
|
||
2C2000
|
||
176: - 0B01 4A52204E dasm_20: db "JR NZ, ",0x00
|
||
5A2C2000
|
||
177: - 0B09 4A502028 dasm_E9: db "JP (HL) ",0x00
|
||
484C2920
|
||
00
|
||
178: - 0B12 4A502028 dasm_DD: db "JP (IX) ",0x00
|
||
49582920
|
||
00
|
||
179: - 0B1B 4A502028 dasm_FD: db "JP (IY) ",0x00
|
||
49592920
|
||
00
|
||
180: - 0B24 444A4E5A dasm_10: db "DJNZ ",0x00
|
||
2000
|
||
181: ;Call and Return Group
|
||
182: - 0B2A 43414C4C dasm_CD: db "CALL ",0x00
|
||
2000
|
||
183: - 0B30 52455420 dasm_C9: db "RET ",0x00
|
||
00
|
||
184: - 0B35 52455449 dasm_ED_4D: db "RETI",0x00
|
||
00
|
||
185: - 0B3A 5245544E dasm_ED_45: db "RETN",0x00
|
||
00
|
||
186: - 0B3F 52535420 dasm_FF: db "RST ",0x00
|
||
00
|
||
187: ;8-Bit load group
|
||
188: - 0B44 4C442041 dasm_0A: db "LD A,(BC)",0x00
|
||
2C284243
|
||
2900
|
||
189: - 0B4E 4C442041 dasm_1A: db "LD A,(DE)",0x00
|
||
2C284445
|
||
2900
|
||
190: - 0B58 4C442041 dasm_3A: db "LD A,(",0x00, "h)",0x00
|
||
2C280068
|
||
2900
|
||
191: - 0B62 4C442028 dasm_02: db "LD (BC), A",0x00
|
||
4243292C
|
||
204100
|
||
192: - 0B6D 4C442028 dasm_12: db "LD (DE), A",0x00
|
||
4445292C
|
||
204100
|
||
193: - 0B78 4C442028 dasm_32: db "LD (",0x00, "h), A",0x00
|
||
0068292C
|
||
204100
|
||
194: - 0B83 4C442000 dasm__LD: db "LD ",0x00
|
||
195: - 0B87 4C442041 dasm__ED_57: db "LD A, I",0x00
|
||
2C204900
|
||
196: - 0B8F 4C442041 dasm__ED_5F: db "LD A, R",0x00
|
||
2C205200
|
||
197: - 0B97 4C442049 dasm__ED_47: db "LD I, A",0x00
|
||
2C204100
|
||
198: - 0B9F 4C442052 dasm__ED_4F: db "LD R, A",0x00
|
||
2C204100
|
||
199: ;General-Purpose Arithmetic and CPU Control Groups
|
||
200: - 0BA7 44414100 dasm_27: db "DAA",0x00
|
||
201: - 0BAB 43504C00 dasm_2F: db "CPL",0x00
|
||
202: - 0BAF 4E454700 dasm_ED_44: db "NEG",0x00
|
||
203: - 0BB3 43434600 dasm_3F: db "CCF",0x00
|
||
204: - 0BB7 53434600 dasm_37: db "SCF",0x00
|
||
205: - 0BBB 48414C54 dasm_76: db "HALT",0x00
|
||
00
|
||
206: - 0BC0 444900 dasm_F3: db "DI",0x00
|
||
207: - 0BC3 454900 dasm_FB: db "EI",0x00
|
||
208: - 0BC6 494D2030 dasm_ED_46: db "IM 0",0x00
|
||
00
|
||
209: - 0BCB 494D2031 dasm_ED_56: db "IM 1",0x00
|
||
00
|
||
210: - 0BD0 494D2032 dasm_ED_5E: db "IM 2",0x00
|
||
00
|
||
211: ;Exchange, Block Transfer, and Search Group
|
||
212: - 0BD5 45582044 dasm_BE: db "EX DE, HL",0x00
|
||
452C2048
|
||
4C00
|
||
213: - 0BDF 45582041 dasm_08: db "EX AF, AF′",0x00
|
||
462C2041
|
||
46E280B2
|
||
00
|
||
214: - 0BEC 45585800 dasm_D9: db "EXX",0x00
|
||
215: - 0BF0 45582028 dasm_E3: db "EX (SP), HL",0x00
|
||
5350292C
|
||
20484C00
|
||
216: - 0BFC 45582028 dasm_DD_E3: db "EX (SP), IX",0x00
|
||
5350292C
|
||
20495800
|
||
217: - 0C08 45582028 dasm_FD_E3: db "EX (SP), IY",0x00
|
||
5350292C
|
||
20495900
|
||
218: - 0C14 4C444900 dasm_ED_A0: db "LDI",0x00
|
||
219: - 0C18 4C444952 dasm_ED_B0: db "LDIR",0x00
|
||
00
|
||
220: - 0C1D 4C444400 dasm_ED_A8: db "LDD",0x00
|
||
221: - 0C21 4C444452 dasm_ED_B8: db "LDDR",0x00
|
||
00
|
||
222: - 0C26 43504900 dasm_ED_A1: db "CPI",0x00
|
||
223: - 0C2A 43504952 dasm_ED_B1: db "CPIR",0x00
|
||
00
|
||
224: - 0C2F 43504400 dasm_ED_A9: db "CPD",0x00
|
||
225: - 0C33 43504452 dasm_ED_B9: db "CPDR",0x00
|
||
00
|
||
226: ;8-Bit Arithmetic Group
|
||
227: - 0C38 41444420 dasm_80C6: db "ADD A, ", 0x00
|
||
412C2000
|
||
228: - 0C40 41444420 dasm_DD_86: db "ADD A, (IX+", 0x00, "h)",0x00
|
||
412C2028
|
||
49582B00
|
||
682900
|
||
229: - 0C4F 41444420 dasm_FD_86: db "ADD A, (IY+", 0x00, "h)",0x00
|
||
412C2028
|
||
49592B00
|
||
682900
|
||
230: - 0C5E 41444320 dasm_C88E: db "ADC A, ", 0x00
|
||
412C2000
|
||
231: - 0C66 41444320 dasm_DD_8E: db "ADC A, (IX+", 0x00, "h)",0x00
|
||
412C2028
|
||
49582B00
|
||
682900
|
||
232: - 0C75 41444320 dasm_FD_8E: db "ADC A, (IY+", 0x00, "h)",0x00
|
||
412C2028
|
||
49592B00
|
||
682900
|
||
233: - 0C84 53554220 dasm__SUB: db "SUB ", 0x00
|
||
00
|
||
234: - 0C89 53554220 dasm_DD_96: db "SUB (IX+", 0x00, "h)",0x00
|
||
2849582B
|
||
00682900
|
||
235: - 0C95 53554220 dasm_FD_96: db "SUB (IY+", 0x00, "h)",0x00
|
||
2849592B
|
||
00682900
|
||
236: - 0CA1 53424320 dasm__SBC: db "SBC A, ", 0x00
|
||
412C2000
|
||
237: - 0CA9 53424320 dasm_DD_9E: db "SBC A,(IX+", 0x00, "h)",0x00
|
||
412C2849
|
||
582B0068
|
||
2900
|
||
238: - 0CB7 53424320 dasm_FD_9E: db "SBC A,(IY+", 0x00, "h)",0x00
|
||
412C2849
|
||
592B0068
|
||
2900
|
||
239: - 0CC5 414E4420 dasm__AND: db "AND ", 0x00
|
||
00
|
||
240: - 0CCA 414E4420 dasm_DD_A6: db "AND (IX+", 0x00, "h)",0x00
|
||
2849582B
|
||
00682900
|
||
241: - 0CD6 414E4420 dasm_FD_A6: db "AND (IY+", 0x00, "h)",0x00
|
||
2849592B
|
||
00682900
|
||
242: - 0CE2 4F522000 dasm__OR: db "OR ", 0x00
|
||
243: - 0CE6 4F522028 dasm_DD_B6: db "OR (IX+", 0x00, "h)",0x00
|
||
49582B00
|
||
682900
|
||
244: - 0CF1 4F522028 dasm_FD_B6: db "OR (IY+", 0x00, "h)",0x00
|
||
49592B00
|
||
682900
|
||
245: - 0CFC 584F5220 dasm__XOR: db "XOR ", 0x00
|
||
00
|
||
246: - 0D01 584F5220 dasm_DD_AE: db "XOR (IX+", 0x00, "h)",0x00
|
||
2849582B
|
||
00682900
|
||
247: - 0D0D 584F5220 dasm_FD_AE: db "XOR (IY+", 0x00, "h)",0x00
|
||
2849592B
|
||
00682900
|
||
248: - 0D19 43502000 dasm__CP: db "CP ", 0x00
|
||
249: - 0D1D 43502028 dasm_DD_BE: db "CP (IX+", 0x00, "h)",0x00
|
||
49582B00
|
||
682900
|
||
250: - 0D28 43502028 dasm_FD_BE: db "CP (IY+", 0x00, "h)",0x00
|
||
49592B00
|
||
682900
|
||
251: - 0D33 494E4320 dasm__INC: db "INC ", 0x00
|
||
00
|
||
252: - 0D38 494E4320 dasm_DD_34: db "INC (IX+", 0x00, "h)",0x00
|
||
2849582B
|
||
00682900
|
||
253: - 0D44 494E4320 dasm_FD_34: db "INC (IY+", 0x00, "h)",0x00
|
||
2849592B
|
||
00682900
|
||
254: - 0D50 44454320 dasm__DEC: db "DEC ", 0x00
|
||
00
|
||
255: - 0D55 44454320 dasm_DD_35: db "DEC (IX+", 0x00, "h)",0x00
|
||
2849582B
|
||
00682900
|
||
256: - 0D61 44454320 dasm_FD_35: db "DEC (IY+", 0x00, "h)",0x00
|
||
2849592B
|
||
00682900
|
||
257: ;16-Bit Arithmetic Group
|
||
258: - 0D6D 41444420 dasm_09: db "ADD HL, ",0x00
|
||
484C2C20
|
||
00
|
||
259: - 0D76 41444320 dasm_ED_4A: db "ADC HL, ",0x00
|
||
484C2C20
|
||
00
|
||
260: - 0D7F 53424320 dasm_ED_42: db "SBC HL, ",0x00
|
||
484C2C20
|
||
00
|
||
261: - 0D88 41444420 dasm_DD_09: db "ADD IX, ",0x00
|
||
49582C20
|
||
00
|
||
262: - 0D91 41444420 dasm_FD_09: db "ADD IY, ",0x00
|
||
49592C20
|
||
00
|
||
263: - 0D9A 494E4320 dasm_03: db "INC ",0x00
|
||
00
|
||
264: - 0D9F 494E4320 dasm_DD_23: db "INC IX, ",0x00
|
||
49582C20
|
||
00
|
||
265: - 0DA8 494E4320 dasm_FD_23: db "INC IY, ",0x00
|
||
49592C20
|
||
00
|
||
266: - 0DB1 44454320 dasm_0B: db "DEC ",0x00
|
||
00
|
||
267: - 0DB6 44454320 dasm_DD_2B: db "DEC IX, ",0x00
|
||
49582C20
|
||
00
|
||
268: - 0DBF 44454320 dasm_FD_2B: db "DEC IY, ",0x00
|
||
49592C20
|
||
00
|
||
269: ;16-Bit Load Group
|
||
270: - 0DC8 4C442000 dasm_01: db "LD ",0x00, ", ",0x00
|
||
2C2000
|
||
271: - 0DCF 4C442049 dasm_DD_01: db "LD IX, ",0x00
|
||
582C2000
|
||
272: - 0DD7 4C442049 dasm_FD_01: db "LD IY, ",0x00
|
||
592C2000
|
||
273: - 0DDF 4C442048 dasm_2A: db "LD HL, (",0x00,"h)",0x00
|
||
4C2C2028
|
||
00682900
|
||
274: - 0DEB 4C442000 dasm_ED_4B: db "LD ",0x00,", (",0x00,"h)",0x00
|
||
2C202800
|
||
682900
|
||
275: - 0DF6 4C442049 dasm_DD_2A: db "LD IX, (",0x00,"h)",0x00
|
||
582C2028
|
||
00682900
|
||
276: - 0E02 4C442049 dasm_FD_2A: db "LD IY, (",0x00,"h)",0x00
|
||
592C2028
|
||
00682900
|
||
277: - 0E0E 4C442028 dasm_22: db "LD (",0x00,"h), HL",0x00
|
||
0068292C
|
||
20484C00
|
||
278: - 0E1A 4C442028 dasm_ED_43: db "LD (",0x00,"h), ",0x00
|
||
0068292C
|
||
2000
|
||
279: - 0E24 4C442028 dasm_DD_22: db "LD (",0x00,"h), IX",0x00
|
||
0068292C
|
||
20495800
|
||
280: - 0E30 4C442028 dasm_FD_22: db "LD (",0x00,"h), IY",0x00
|
||
0068292C
|
||
20495900
|
||
281: - 0E3C 4C442053 dasm_F9: db "LD SP, HL",0x00
|
||
502C2048
|
||
4C00
|
||
282: - 0E46 4C442053 dasm_DD_F9: db "LD SP, IX",0x00
|
||
502C2049
|
||
5800
|
||
283: - 0E50 4C442053 dasm_FD_F9: db "LD SP, IY",0x00
|
||
502C2049
|
||
5900
|
||
284: - 0E5A 50555348 dasm_E5: db "PUSH ",0x00
|
||
2000
|
||
285: - 0E60 50555348 dasm_DD_E5: db "PUSH IX",0x00
|
||
20495800
|
||
286: - 0E68 50555348 dasm_FD_E5: db "PUSH IY",0x00
|
||
20495900
|
||
287: - 0E70 50555348 dasm_E1: db "PUSH ",0x00
|
||
2000
|
||
288: - 0E76 50555348 dasm_DD_E1: db "PUSH IX",0x00
|
||
20495800
|
||
289: - 0E7E 50555348 dasm_FD_E1: db "PUSH IY",0x00
|
||
20495900
|
||
290:
|
||
291: ;Misc
|
||
292: - 0E86 2E3F2E00 dasm_UU: db ".?.",0x00
|
||
293: - 0E8A 20202020 dasm_UW: db " ",0x00
|
||
00
|
||
294:
|
||
295: - 0E8F dasm_printFlags_table:
|
||
296: - 0E8F 4E5A db "NZ"
|
||
297: - 0E91 5A00 db "Z",0
|
||
298: - 0E93 4E43 db "NC"
|
||
299: - 0E95 4300 db "C",0
|
||
300: - 0E97 504F db "PO"
|
||
301: - 0E99 5045 db "PE"
|
||
302: - 0E9B 5000 db "P",0
|
||
303: - 0E9D 4D00 db "M",0
|
||
304:
|
||
305: - 0E9F dasm_printRegister8_table:
|
||
306: - 0E9F 42 db "B"
|
||
307: - 0EA0 43 db "C"
|
||
308: - 0EA1 44 db "D"
|
||
309: - 0EA2 45 db "E"
|
||
310: - 0EA3 48 db "H"
|
||
311: - 0EA4 4C db "L"
|
||
312: - 0EA5 53 db "S" ;only 18 bit (SP)
|
||
313: - 0EA6 50 db "P" ;only 18 bit (SP)
|
||
314:
|
||
315: - 0EA7 dasm_printRegisterIX_table:
|
||
316: - 0EA7 4243 db "BC"
|
||
317: - 0EA9 4445 db "DE"
|
||
318: - 0EAB 4958 db "IX"
|
||
319: - 0EAD 5350 db "SP"
|
||
320: - 0EAF dasm_printRegisterIY_table:
|
||
321: - 0EAF 4243 db "BC"
|
||
322: - 0EB1 4445 db "DE"
|
||
323: - 0EB3 4959 db "IY"
|
||
324: - 0EB5 5350 db "SP"
|
||
325:
|
||
326: - 0EB7 dasm_printRegisterSP_table:
|
||
327: - 0EB7 4243 db "BC"
|
||
328: - 0EB9 4445 db "DE"
|
||
329: - 0EBB 484C db "HL"
|
||
330: - 0EBD 4146 db "AF"
|
||
331:
|
||
332: - 0EBF dasm_printRegister8_table_HL:
|
||
**** main.asm ****
|
||
496: - 0EBF 28484C29 db "(HL)", 0
|
||
00
|
||
497: .include "rst.s"
|
||
**** include/rst.s ****
|
||
1: - 0EC4 EXEC_RST_08:
|
||
2: 7944+17 0EC4 CDB702 call print_char
|
||
3: 7961+10 0EC7 C9 ret
|
||
4:
|
||
5:
|
||
6: - 0EC8 EXEC_RST_10:
|
||
7: 7971+11 0EC8 C5 push bc
|
||
8: 7982+11 0EC9 D5 push de
|
||
9: 7993+11 0ECA E5 push hl
|
||
10: ;call vdp_cursor_on
|
||
11: 8004+17 0ECB CDF802 call read_char
|
||
12: 8021+11 0ECE F5 push af
|
||
13: ;call vdp_cursor_off
|
||
14: 8032+10 0ECF F1 pop af
|
||
15: 8042+10 0ED0 E1 pop hl
|
||
16: 8052+10 0ED1 D1 pop de
|
||
17: 8062+10 0ED2 C1 pop bc
|
||
18: 8072+10 0ED3 C9 ret
|
||
19:
|
||
20: - 0ED4 EXEC_RST_18:
|
||
21: 8082+7 0ED4 3E00 ld a,0
|
||
22: 8089+10 0ED6 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: - 0ED7 beep:
|
||
8: 8099+11 0ED7 F5 push AF
|
||
9: 8110+11 0ED8 C5 push BC
|
||
10: 8121+11 0ED9 D5 push DE
|
||
11: - 0EDA beep_loop:
|
||
12: 8132+7 0EDA 3E08 LD A,0x08
|
||
13: 8139+11 0EDC D3F4 OUT (CS_PIO_AD), A
|
||
14: 8150+10 0EDE 012800 LD BC, 0x28
|
||
15: 8160+17 0EE1 CDF70E CALL beep_pause
|
||
16: 8177+7 0EE4 3E00 LD A,0x00
|
||
17: 8184+11 0EE6 D3F4 OUT (CS_PIO_AD), A
|
||
18: 8195+10 0EE8 012400 LD BC, 0x24
|
||
19: 8205+17 0EEB CDF70E CALL beep_pause
|
||
20: 8222+6 0EEE 1B DEC DE
|
||
21: 8228+4 0EEF 7A ld A,D
|
||
22: 8232+4 0EF0 B3 or E
|
||
23: 8236+7+5 0EF1 20E7 jr NZ, beep_loop
|
||
24: 8243+10 0EF3 D1 pop de
|
||
25: 8253+10 0EF4 C1 pop bc
|
||
26: 8263+10 0EF5 F1 pop af
|
||
27: 8273+10 0EF6 C9 ret
|
||
28:
|
||
29: - 0EF7 beep_pause:
|
||
30: 8283+8 0EF7 ED44 NEG ; 8 T-states
|
||
31: 8291+8 0EF9 ED44 NEG ; 8 T-states
|
||
32: 8299+8 0EFB ED44 NEG ; 8 T-states
|
||
33: 8307+8 0EFD ED44 NEG ; 8 T-states
|
||
34: 8315+6 0EFF 0B DEC BC ; 6 T-states
|
||
35: 8321+4 0F00 79 LD A,C ; 9 T-states
|
||
36: 8325+4 0F01 B0 OR B ; 4 T-states
|
||
37: 8329+10 0F02 C2F70E JP NZ,beep_pause ; 10 T-states
|
||
**** main.asm ****
|
||
499: 8339+10 0F05 C9 RET ; Pause complete, RETurn
|
||
500: .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: - 0F06 xmodem_init:
|
||
28: 8349+17 0F06 CD1203 call A_RTS_OFF
|
||
29:
|
||
30: 8366+7 0F09 3EA7 LD A,10100111b ; Init CTC Channel 3
|
||
31: 8373+11 0F0B D306 OUT (CS_CTC_2),A
|
||
32: 8384+7 0F0D 3E0E LD A,14 ; 1028.57Hz ISR
|
||
33: 8391+11 0F0F D306 OUT (CS_CTC_2),A
|
||
34: 8402+7 0F11 3E00 LD A,00h ; Set CTC Ch3 Interrupt Vector
|
||
35: 8409+11 0F13 D304 OUT (CS_CTC_0),A
|
||
36: ;load int vector to ram
|
||
37: 8420+10 0F15 21E60F ld hl,xmodem_int ;CTC Ch3 INT routine
|
||
38: 8430+16 0F18 220442 ld (0x4200 + 0x04),hl
|
||
39: ;reset timer vars
|
||
40: 8446+10 0F1B 210000 ld hl,0x0000
|
||
41: 8456+16 0F1E 22FC40 ld (MEM_VAR_TIMEA),hl
|
||
42: 8472+16 0F21 22FE40 ld (MEM_VAR_TIMER),hl
|
||
43:
|
||
44: 8488+7 0F24 3E42 ld a,0x42 ; Set interrupt vector register
|
||
45: 8495+9 0F26 ED47 ld i,a
|
||
46: 8504+8 0F28 ED5E im 2 ; Z80 Interrupt mode
|
||
47:
|
||
48: 8512+10 0F2A 216110 ld hl,MSG_START ; Print start banner
|
||
49: 8522+17 0F2D CDBF02 call print_str
|
||
50: 8539+4 0F30 FB ei ; Enable interrupts
|
||
51: ; init done. Continue with xmodem_await_conn
|
||
52: 8543+17 0F31 CD9710 call xmodem_wait
|
||
53:
|
||
54: - 0F34 xmodem_await_conn: ;Wait for initial connection
|
||
55: 8560+7 0F34 3E43 ld a, SYM_C ;Send C to notify sender, that we want CRC
|
||
56: 8567+17 0F36 CD3710 call xmodem_out
|
||
57: 8584+17 0F39 CD0A10 call xmodem_read_wait ;Read with timeout
|
||
58: 8601+10 0F3C DA340F jp c, xmodem_await_conn ;Carry flag set = timeout -> repeat
|
||
59: ;else continue
|
||
60:
|
||
61: - 0F3F xmodem_packet: ;XmodemCRC packet start
|
||
62: ;use 1st byte to decide further processing
|
||
63: 8611+7 0F3F FE04 cp SYM_EOT ;End of Transmission
|
||
64: 8618+10 0F41 CA9D0F jp z, xmodem_packet_EOT
|
||
65: 8628+7 0F44 FE18 cp SYM_CAN ;Cancel (Force receiver to start sending C's)
|
||
66: 8635+10 0F46 CA340F jp z, xmodem_await_conn
|
||
67: 8645+7 0F49 FE01 cp SYM_SOH ;Start of
|
||
68: 8652+10 0F4B CA510F jp z, xmodem_packet_get
|
||
69:
|
||
70: 8662+10 0F4E C3A50F jp xmodem_err ;anything else is an error -> abort transmission
|
||
71:
|
||
72: - 0F51 xmodem_packet_get: ;if first byte == SYM_SOH -> receive block
|
||
73: 8672+17 0F51 CD0A10 call xmodem_read_wait ;get byte 2 => block ID
|
||
74: 8689+10 0F54 DA8910 jp c, xmodem_nak
|
||
75: 8699+4 0F57 47 ld b,a
|
||
76: 8703+13 0F58 32FB40 ld (MEM_VAR_BLOCK), a ;store block id to memory
|
||
77: 8716+17 0F5B CD0A10 call xmodem_read_wait ;get byte 3 => block ID complement
|
||
78: 8733+10 0F5E DA8910 jp c, xmodem_nak
|
||
79: 8743+4 0F61 80 add b
|
||
80: 8747+7 0F62 FEFF cp 255 ;both size infos should always sum to 255
|
||
81: 8754+10 0F64 C2A50F 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: 8764+4 0F67 3D dec a ;a-1 to remove 1 sector offset
|
||
87: 8768+4 0F68 78 ld a,b
|
||
88: 8772+4 0F69 1F rra ;shift 1 bit to the right
|
||
89: 8776+7 0F6A E67F and 0x7F
|
||
90: 8783+4 0F6C 67 ld h,a
|
||
91: 8787+4 0F6D 78 ld a,b
|
||
92: 8791+4 0F6E 3D dec a ;a-1 to remove 1 sector offset
|
||
93: 8795+4 0F6F 0F rrca ;shift bit0 to bit 7
|
||
94: 8799+7 0F70 E680 and 0x80 ;mask out all other bits
|
||
95: 8806+4 0F72 6F ld l,a
|
||
96: ;result:
|
||
97: ;hl = 0aaaaaaa a000000
|
||
98:
|
||
99: 8810+10 0F73 110044 ld de,MEM_LOC_LOAD
|
||
100: 8820+11 0F76 19 add hl,de ;add calculated offset to base address
|
||
101: ;hl now contains the true start address of this sector
|
||
102:
|
||
103: 8831+7 0F77 0680 ld b,128 ;preload counter for data baytes
|
||
104: 8838+7 0F79 0E00 ld c,0 ;packet length counter ( used for overflow error )
|
||
105:
|
||
106: - 0F7B xmodem_packet_get_data: ;get 128 data bytes (loop)
|
||
107: 8845+11 0F7B E5 push hl ;push hl onto stack because xmodem_read_wait destroys hl
|
||
108: 8856+17 0F7C CD0A10 call xmodem_read_wait ;read byte or timeout
|
||
109: 8873+10 0F7F DA8910 jp c, xmodem_nak ;if timeout -> nak and retry
|
||
110: 8883+10 0F82 E1 pop hl ;restore hl
|
||
111: 8893+7 0F83 77 ld (hl), a ;store received byte in memory
|
||
112: 8900+6 0F84 23 inc hl ;increment pointer
|
||
113: 8906+4 0F85 0C inc c ;increment packet length counter
|
||
114: 8910+4 0F86 05 dec b ;decerment data bytes remmaining
|
||
115: 8914+10 0F87 C27B0F jp nz, xmodem_packet_get_data ;if bytes remaining, loop
|
||
116: ;else continue with crc bytes
|
||
117:
|
||
118: - 0F8A xmodem_packet_get_crc: ;get 16-Bit CRC
|
||
119: 8924+17 0F8A CD0A10 call xmodem_read_wait
|
||
120: 8941+10 0F8D DA8910 jp c, xmodem_nak
|
||
121: 8951+4 0F90 57 ld d,a
|
||
122: 8955+4 0F91 0C inc c
|
||
123: 8959+17 0F92 CD0A10 call xmodem_read_wait
|
||
124: 8976+10 0F95 DA8910 jp c, xmodem_nak
|
||
125: 8986+4 0F98 5F ld e,a
|
||
126: 8990+4 0F99 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: 8994+10 0F9A C37B10 jp xmodem_ack ;ack block -> then jump to start again
|
||
134:
|
||
135: - 0F9D xmodem_packet_EOT: ;End of transmission SUB.
|
||
136: 9004+7 0F9D 3E06 ld a, SYM_ACK ;Acknowledge EOT
|
||
137: 9011+17 0F9F CD3710 call xmodem_out
|
||
138: 9028+10 0FA2 C3DF0F jp xmodem_end ;and end xmodem
|
||
139:
|
||
140:
|
||
141:
|
||
142: - 0FA5 xmodem_err: ;non recoverable error -> abort
|
||
143: 9038+7 0FA5 3E18 ld a, SYM_CAN
|
||
144: 9045+17 0FA7 CD3710 call xmodem_out
|
||
145: 9062+7 0FAA 3E18 ld a, SYM_CAN
|
||
146: 9069+17 0FAC CD3710 call xmodem_out
|
||
147: 9086+7 0FAF 3E18 ld a, SYM_CAN
|
||
148: 9093+17 0FB1 CD3710 call xmodem_out
|
||
149: 9110+7 0FB4 3E18 ld a, SYM_CAN
|
||
150: 9117+17 0FB6 CD3710 call xmodem_out
|
||
151: 9134+7 0FB9 3E18 ld a, SYM_CAN
|
||
152: 9141+17 0FBB CD3710 call xmodem_out
|
||
153: 9158+7 0FBE 3E18 ld a, SYM_CAN
|
||
154: 9165+17 0FC0 CD3710 call xmodem_out
|
||
155: 9182+7 0FC3 3E18 ld a, SYM_CAN
|
||
156: 9189+17 0FC5 CD3710 call xmodem_out
|
||
157: 9206+7 0FC8 3E18 ld a, SYM_CAN
|
||
158: 9213+17 0FCA CD3710 call xmodem_out
|
||
159: 9230+7 0FCD 3E18 ld a, SYM_CAN
|
||
160: 9237+17 0FCF CD3710 call xmodem_out
|
||
161: 9254+7 0FD2 3E18 ld a, SYM_CAN
|
||
162: 9261+17 0FD4 CD3710 call xmodem_out
|
||
163: 9278+7 0FD7 3E18 ld a, SYM_CAN
|
||
164:
|
||
165: 9285+10 0FD9 214810 ld hl, MSG_ERROR
|
||
166: 9295+17 0FDC CDBF02 call print_str
|
||
167:
|
||
168: ;overflow to end
|
||
169: - 0FDF xmodem_end:
|
||
170: 9312+4 0FDF F3 di ;disable interrupts
|
||
171: 9316+17 0FE0 CDD102 call print_newLine ;print new line
|
||
172: 9333+10 0FE3 C39900 jp PROMPT_BEGIN ;return ti prompt
|
||
173:
|
||
174: ;isr is used as counter for timeouts
|
||
175: - 0FE6 xmodem_int:
|
||
176: 9343+4 0FE6 F3 di ;setup ISR (disable further interrupts, exchange registers)
|
||
177: 9347+4 0FE7 08 ex AF,AF'
|
||
178: 9351+4 0FE8 D9 exx
|
||
179:
|
||
180: 9355+16 0FE9 2AFC40 ld hl,(MEM_VAR_TIMEA) ;millis counter
|
||
181: 9371+6 0FEC 23 inc hl
|
||
182: 9377+16 0FED 22FC40 ld (MEM_VAR_TIMEA),hl
|
||
183:
|
||
184: 9393+10 0FF0 110404 ld de,1028 ;every 1028 millis counter
|
||
185: 9403+15 0FF3 ED52 sbc hl,de
|
||
186: 9418+10 0FF5 C20510 jp nz, xmodem_int_cont ;if less than 1028 millis, loop
|
||
187:
|
||
188: 9428+10 0FF8 210000 ld hl,0 ;reset millis
|
||
189: 9438+16 0FFB 22FC40 ld (MEM_VAR_TIMEA),hl
|
||
190: 9454+16 0FFE 2AFE40 ld hl,(MEM_VAR_TIMER) ;incement seconds
|
||
191: 9470+6 1001 23 inc hl
|
||
192: 9476+16 1002 22FE40 ld (MEM_VAR_TIMER),hl
|
||
193: - 1005 xmodem_int_cont: ;end isr
|
||
194: 9492+4 1005 08 ex AF,AF' ;restore registers
|
||
195: 9496+4 1006 D9 exx
|
||
196: 9500+4 1007 FB EI ;enable interrupts
|
||
197: 9504+14 1008 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: - 100A xmodem_read_wait:
|
||
207: 9518+4 100A F3 di
|
||
208: 9522+10 100B 210000 ld hl,0
|
||
209: 9532+16 100E 22FC40 ld (MEM_VAR_TIMEA),hl
|
||
210: 9548+16 1011 22FE40 ld (MEM_VAR_TIMER),hl
|
||
211: 9564+4 1014 FB ei
|
||
212: 9568+17 1015 CD1B03 call A_RTS_ON
|
||
213: - 1018 xmodem_read_wait_loop:
|
||
214: ;check timeout
|
||
215: 9585+16 1018 2AFE40 ld hl,(MEM_VAR_TIMER)
|
||
216: 9601+4 101B 7D ld a, l
|
||
217: 9605+7 101C FE03 cp xmodem_read_timeount
|
||
218: 9612+10 101E CA3510 jp z, xmodem_read_wait_timeout ;if timeout retry
|
||
219:
|
||
220: ; if no timeout
|
||
221: 9622+4 1021 AF xor a ; a = 0
|
||
222: 9626+11 1022 D309 out (CS_SIO_A_C), a ; select reg 0
|
||
223: 9637+11 1024 DB09 in a, (CS_SIO_A_C) ; read reg 0
|
||
224: 9648+7 1026 E601 and 1 ; mask D0 (recieve char available)
|
||
225: 9655+10 1028 CA1810 jp Z,xmodem_read_wait_loop ; wait if no char
|
||
226:
|
||
227: ; if char avail
|
||
228: 9665+11 102B DB08 in a, (CS_SIO_A_D) ; read char
|
||
229: ;call debug_a_hex
|
||
230: 9676+11 102D F5 push af
|
||
231: 9687+17 102E CD1203 call A_RTS_OFF
|
||
232: 9704+10 1031 F1 pop af
|
||
233: 9714+4 1032 37 scf
|
||
234: 9718+4 1033 3F ccf
|
||
235: 9722+10 1034 C9 ret ; return
|
||
236: - 1035 xmodem_read_wait_timeout:
|
||
237: 9732+4 1035 37 scf
|
||
238: 9736+10 1036 C9 ret
|
||
239:
|
||
240:
|
||
241: - 1037 xmodem_out:
|
||
242: 9746+11 1037 D308 out (CS_SIO_A_D), a
|
||
243: 9757+17 1039 CD3D10 call xmodem_wait_out
|
||
244: 9774+10 103C C9 ret
|
||
245:
|
||
246: - 103D xmodem_wait_out:
|
||
247: 9784+4 103D 97 sub a ;clear a, write into WR0: select RR0
|
||
248: 9788+4 103E 3C inc a ;select RR1
|
||
249: 9792+11 103F D309 out (CS_SIO_A_C),A
|
||
250: 9803+11 1041 DB09 in A,(CS_SIO_A_C) ;read RRx
|
||
251: 9814+8 1043 CB47 bit 0,A
|
||
252: 9822+7+5 1045 28F6 jr z,xmodem_wait_out
|
||
253: 9829+10 1047 C9 ret
|
||
254:
|
||
255: - 1048 MSG_ERROR:
|
||
256: - 1048 4572726F db "Error: unexpected byte",13,10,0
|
||
723A2075
|
||
6E657870
|
||
65637465
|
||
64206279
|
||
74650D0A
|
||
00
|
||
257:
|
||
258: - 1061 MSG_START:
|
||
259: - 1061 41776169 db "Await xmodem connection",13,10,0
|
||
7420786D
|
||
6F64656D
|
||
20636F6E
|
||
6E656374
|
||
696F6E0D
|
||
0A00
|
||
260:
|
||
261:
|
||
262: - 107B xmodem_ack: ;ack routine. Only use when expecting transmission afterwards.
|
||
263: 9839+7 107B 3E06 ld a, SYM_ACK ;send ACK
|
||
264: 9846+17 107D CD3710 call xmodem_out
|
||
265: 9863+17 1080 CD0A10 call xmodem_read_wait ;wait for response
|
||
266: 9880+10 1083 DA7B10 jp c, xmodem_ack ;if timeout repeat
|
||
267: 9890+10 1086 C33F0F jp xmodem_packet ;if received, continue with new packet
|
||
268:
|
||
269: - 1089 xmodem_nak: ;nak routine. Only use when expecting transmission afterwards.
|
||
270: 9900+7 1089 3E15 ld a, SYM_NAK ;send NAK
|
||
271: 9907+17 108B CD3710 call xmodem_out
|
||
272: 9924+17 108E CD0A10 call xmodem_read_wait ;wait for response
|
||
273: 9941+10 1091 DA8910 jp c, xmodem_nak ;if timeout repeat
|
||
274: 9951+10 1094 C33F0F jp xmodem_packet ;if received, continue with new packet
|
||
275:
|
||
276: - 1097 xmodem_wait:
|
||
277: 9961+10 1097 21FF00 ld hl, 0xFF
|
||
278: 9971+10 109A 010100 ld bc, 0x01
|
||
279: - 109D xmodem_wait_1:
|
||
280: 9981+4 109D 00 nop
|
||
281: 9985+4 109E 00 nop
|
||
282: 9989+4 109F 00 nop
|
||
283: 9993+4 10A0 00 nop
|
||
284: 9997+15 10A1 ED42 sbc hl,bc
|
||
285:10012+5+6 10A3 C8 ret Z
|
||
**** main.asm ****
|
||
501:10017+12 10A4 18F7 jr xmodem_wait_1
|
||
502: .include "kdrv_ide8255.s" ;include ide interface driver.
|
||
**** include/kdrv_ide8255.s ****
|
||
1: ;----------------------------------------------------------------
|
||
2: ;BIOS Driver for IDE Interface 82C55
|
||
3: ;by Dennis Gunia (01/2023)
|
||
4: ;----------------------------------------------------------------
|
||
5:
|
||
6: ;================================================================
|
||
7: ; I/O registers
|
||
8: ;================================================================
|
||
9: - 0030 CS_PIA_PA .EQU 0x30 ; D0-7
|
||
10: - 0031 CS_PIA_PB .EQU 0x31 ; D8-15
|
||
11: - 0032 CS_PIA_PC .EQU 0x32 ; Controll Lines
|
||
12: - 0033 CS_PIA_CR .EQU 0x33
|
||
13:
|
||
14: ;================================================================
|
||
15: ; I/O pins
|
||
16: ;================================================================
|
||
17: - 0020 IDE_WR .EQU 00100000b
|
||
18: - 0040 IDE_RD .EQU 01000000b
|
||
19: - 0080 IDE_RST .EQU 10000000b
|
||
20:
|
||
21: ;================================================================
|
||
22: ; IDE registers
|
||
23: ;================================================================
|
||
24: - 0008 IDE_REG_DATA .EQU 01000b ;data I/O register (16-bits)
|
||
25: - 0009 IDE_REG_ERROR .EQU 01001b ;error information register when read; write precompensation register when written.
|
||
26: - 000A IDE_REG_SECTOR .EQU 01010b ;Sector counter register
|
||
27: - 000B IDE_REG_SSECTOR .EQU 01011b ;Start sector register
|
||
28: - 000C IDE_REG_LCYL .EQU 01100b ;Low byte of the cylinder number
|
||
29: - 000D IDE_REG_HCYL .EQU 01101b ;High two bits of the cylinder number
|
||
30: - 000E IDE_REG_HEAD .EQU 01110b ;Head and device select register
|
||
31: - 000F IDE_REG_CMDSTS .EQU 01111b ;command/status register
|
||
32: - 0016 IDE_REG_ALTSTS .EQU 10110b ;Alternate Status/Digital Output
|
||
33: - 0017 IDE_REG_DRVADDR .EQU 10111b ;Drive Address
|
||
34:
|
||
35:
|
||
36: ;================================================================
|
||
37: ; I/O access functions
|
||
38: ;================================================================
|
||
39:
|
||
40: ;------------------------------------------------------------------------------
|
||
41: ; ide_reset
|
||
42: ;
|
||
43: ; resets drives on bus
|
||
44: ;------------------------------------------------------------------------------
|
||
45: - 10A6 ide_reset:
|
||
46:
|
||
47:10029+7 10A6 3E80 LD A, 10000000b ;CommandByte-A, Mode 0, PA Out, PC Out, PB Out
|
||
48:10036+11 10A8 D333 OUT (CS_PIA_CR), A ;Set Data direction to out
|
||
49:10047+7 10AA 3E80 LD A, IDE_RST
|
||
50:10054+11 10AC D332 OUT (CS_PIA_PC), A ;Reset IDE Device
|
||
51:10065+4 10AE 00 NOP
|
||
52:10069+4 10AF AF XOR A
|
||
53:10073+11 10B0 D332 OUT (CS_PIA_PC), A ;end device reset
|
||
54:10084+10 10B2 C9 RET
|
||
55:
|
||
56:
|
||
57: ;------------------------------------------------------------------------------
|
||
58: ; ide_regwrite_8
|
||
59: ;
|
||
60: ; Sends data to the IDE device
|
||
61: ; A contains DATA
|
||
62: ; B contains register number
|
||
63: ;------------------------------------------------------------------------------
|
||
64: - 10B3 ide_regwrite_8:
|
||
65:10094+11 10B3 F5 PUSH AF ;store date to stack
|
||
66: ; Prepare PIA Data Direction
|
||
67:10105+7 10B4 3E80 LD A, 10000000b ;CommandByte-A, Mode 0, PA Out, PC Out, PB Out
|
||
68:10112+11 10B6 D333 OUT (CS_PIA_CR), A ;Set Data direction to out
|
||
69: ; Write Data out
|
||
70:10123+10 10B8 F1 POP AF
|
||
71:10133+11 10B9 D330 OUT (CS_PIA_PA), A ;Write Data to bit 0-7
|
||
72: ;Prepare Address
|
||
73:10144+4 10BB 78 LD A, B ;Load register address
|
||
74:10148+7 10BC E61F AND 00011111b ;Mask unused bits
|
||
75:10155+11 10BE D332 OUT (CS_PIA_PC), A ;Write Data to bit controll lines
|
||
76:10166+7 10C0 F620 OR IDE_WR ;Set Write bit
|
||
77:10173+11 10C2 D332 OUT (CS_PIA_PC), A ;Set write signal
|
||
78:10184+4 10C4 00 NOP ;delay to wait for processing
|
||
79:10188+4 10C5 78 LD A, B ;Load register address
|
||
80:10192+7 10C6 E61F AND 00011111b ;Mask unused bits
|
||
81:10199+11 10C8 D332 OUT (CS_PIA_PC), A ;disable write signal
|
||
82:10210+4 10CA 00 NOP
|
||
83:10214+4 10CB AF XOR A ;clear register A
|
||
84:10218+11 10CC D332 OUT (CS_PIA_PC), A ;clear controll lines
|
||
85:10229+10 10CE C9 RET
|
||
86:
|
||
87:
|
||
88: ;------------------------------------------------------------------------------
|
||
89: ; ide_regread_8
|
||
90: ;
|
||
91: ; Sends data to the IDE device
|
||
92: ; B contains register number
|
||
93: ; A returns data
|
||
94: ;------------------------------------------------------------------------------
|
||
95: - 10CF ide_regread_8:
|
||
96:10239+7 10CF 3E92 LD A, 10010010b ;CommandByte-A, Mode 0, PA IN, PC Out, PB IN
|
||
97:10246+11 10D1 D333 OUT (CS_PIA_CR), A ;Set Data direction to in
|
||
98: ;Prepare Address
|
||
99:10257+4 10D3 78 LD A, B ;Load register address
|
||
100:10261+7 10D4 E61F AND 00011111b ;Mask unused bits
|
||
101:10268+11 10D6 D332 OUT (CS_PIA_PC), A ;Write Data to bit controll lines
|
||
102:10279+7 10D8 F640 OR IDE_RD ;Set Write bit
|
||
103:10286+11 10DA D332 OUT (CS_PIA_PC), A ;Write Data to bit controll lines
|
||
104:10297+4 10DC 00 NOP ;delay to wait for processing
|
||
105:10301+11 10DD F5 PUSH AF
|
||
106:10312+10 10DE F1 POP AF
|
||
107:10322+11 10DF F5 PUSH AF
|
||
108:10333+10 10E0 F1 POP AF
|
||
109:10343+11 10E1 F5 PUSH AF
|
||
110:10354+10 10E2 F1 POP AF
|
||
111:10364+11 10E3 F5 PUSH AF
|
||
112:10375+10 10E4 F1 POP AF
|
||
113:10385+11 10E5 DB30 IN A,(CS_PIA_PA) ;read data from ide device to b (because a is used later)
|
||
114:10396+11 10E7 F5 PUSH AF
|
||
115:10407+4 10E8 AF XOR A ;clear register A
|
||
116:10411+11 10E9 D332 OUT (CS_PIA_PC), A ;clear controll lines
|
||
117:10422+10 10EB F1 POP AF ;put data in accumulator
|
||
118:10432+10 10EC C9 RET
|
||
119:
|
||
120:
|
||
121: ;------------------------------------------------------------------------------
|
||
122: ; ide_readsector_256
|
||
123: ;
|
||
124: ; Reads IDE Data
|
||
125: ; HL contains destination address
|
||
126: ;------------------------------------------------------------------------------
|
||
127: - 10ED ide_readsector_256:
|
||
128:10442+7 10ED 0EFF LD C,255 ;Setup counter for 256 words
|
||
129:
|
||
130: - 10EF ide_readsector_256_waitloop:
|
||
131:10449+7 10EF 060F LD B, IDE_REG_CMDSTS
|
||
132:10456+17 10F1 CDCF10 CALL ide_regread_8
|
||
133:10473+8 10F4 CB47 BIT 0,a ;Error Bit set.
|
||
134:10481+10 10F6 C26E11 JP NZ, ide_printerror
|
||
135:10491+8 10F9 CB5F BIT 3,a ;DRQ Bit set. If set, disk has data
|
||
136:10499+7+5 10FB 28F2 JR Z, ide_readsector_256_waitloop ;If not set, wait
|
||
137:
|
||
138:10506+7 10FD 3E92 LD A, 10010010b ;CommandByte-A, Mode 0, PA IN, PC Out, PB IN
|
||
139:10513+11 10FF D333 OUT (CS_PIA_CR), A ;Set Data direction to IN
|
||
140:10524+7 1101 3E08 LD A, IDE_REG_DATA ;CS0 and A=0 -> I/O register
|
||
141:10531+11 1103 D332 OUT (CS_PIA_PC), A ;set register
|
||
142:10542+7 1105 F640 OR IDE_RD ;Set Read bit
|
||
143:10549+11 1107 D332 OUT (CS_PIA_PC), A ;Write Read to bit controll lines
|
||
144:10560+4 1109 00 NOP
|
||
145:10564+4 110A 00 NOP
|
||
146:10568+4 110B 00 NOP
|
||
147:10572+11 110C DB31 IN A,(CS_PIA_PB) ;Load 16-Bit data to buffer
|
||
148:10583+7 110E 77 LD (HL), A
|
||
149:10590+6 110F 23 INC HL
|
||
150:10596+11 1110 DB30 IN A,(CS_PIA_PA)
|
||
151:10607+7 1112 77 LD (HL), A
|
||
152:10614+6 1113 23 INC HL
|
||
153:
|
||
154:10620+4 1114 79 LD A,C
|
||
155:10624+4 1115 B7 OR A
|
||
156:10628+10 1116 CA1C11 JP Z,ide_readsector_256_done
|
||
157:10638+4 1119 0D DEC C
|
||
158:10642+12 111A 18D3 JR ide_readsector_256_waitloop
|
||
159:
|
||
160: - 111C ide_readsector_256_done:
|
||
161:10654+10 111C C9 RET
|
||
162:
|
||
163: - 111D ide_readsector_512_inv:
|
||
164:10664+7 111D 0EFF LD C,255 ;Setup counter for 256 words
|
||
165:10671+10 111F 110010 LD DE, 4096 ;Timeout counter
|
||
166: - 1122 ide_readsector_512_inv_waitloop:
|
||
167:10681+6 1122 1B DEC DE
|
||
168:10687+4 1123 7A LD A,D
|
||
169:10691+4 1124 B3 OR E
|
||
170:10695+10 1125 CA5811 JP Z, ide_readsector_timeout
|
||
171:10705+7 1128 060F LD B, IDE_REG_CMDSTS
|
||
172:10712+17 112A CDCF10 CALL ide_regread_8
|
||
173:10729+8 112D CB47 BIT 0,a ;Error Bit set.
|
||
174:10737+10 112F C26E11 JP NZ, ide_printerror
|
||
175:10747+8 1132 CB5F BIT 3,a ;DRQ Bit set. If set, disk has data
|
||
176:10755+7+5 1134 28EC JR Z, ide_readsector_512_inv_waitloop ;If not set, wait
|
||
177:10762+10 1136 110008 LD DE, 2048 ;Timeout counter
|
||
178:10772+7 1139 3E92 LD A, 10010010b ;CommandByte-A, Mode 0, PA IN, PC Out, PB IN
|
||
179:10779+11 113B D333 OUT (CS_PIA_CR), A ;Set Data direction to IN
|
||
180:10790+7 113D 3E08 LD A, IDE_REG_DATA ;CS0 and A=0 -> I/O register
|
||
181:10797+11 113F D332 OUT (CS_PIA_PC), A ;set register
|
||
182:10808+7 1141 F640 OR IDE_RD ;Set Read bit
|
||
183:10815+11 1143 D332 OUT (CS_PIA_PC), A ;Write Read to bit controll lines
|
||
184:10826+4 1145 00 NOP
|
||
185:10830+4 1146 00 NOP
|
||
186:10834+4 1147 00 NOP
|
||
187:10838+11 1148 DB30 IN A,(CS_PIA_PA) ;Load 16-Bit data to buffer
|
||
188:10849+7 114A 77 LD (HL), A
|
||
189:10856+6 114B 23 INC HL
|
||
190:10862+11 114C DB31 IN A,(CS_PIA_PB)
|
||
191:10873+7 114E 77 LD (HL), A
|
||
192:10880+6 114F 23 INC HL
|
||
193:
|
||
194:10886+4 1150 79 LD A,C
|
||
195:10890+4 1151 B7 OR A
|
||
196:10894+10 1152 CA1C11 JP Z,ide_readsector_256_done
|
||
197:10904+4 1155 0D DEC C
|
||
198:10908+12 1156 18CA JR ide_readsector_512_inv_waitloop
|
||
199:
|
||
200: - 1158 ide_readsector_timeout:
|
||
201:10920+10 1158 21D011 LD HL, [str_error_time]
|
||
202:10930+17 115B CDBF02 CALL print_str
|
||
203:10947+4 115E 79 LD A, C
|
||
204:10951+17 115F CDE702 CALL print_a_hex
|
||
205:10968+7 1162 3E0A LD A,10
|
||
206:10975+17 1164 CDB702 CALL print_char
|
||
207:10992+7 1167 3E0D LD A,13
|
||
208:10999+17 1169 CDB702 CALL print_char
|
||
209:11016+10 116C C9 RET
|
||
210:
|
||
211:
|
||
212:
|
||
213:
|
||
214: ;------------------------------------------------------------------------------
|
||
215: ; ide_writesector_256
|
||
216: ;
|
||
217: ; Writes 512 bytes (256 words) of IDE Data
|
||
218: ; HL contains data start address
|
||
219: ;------------------------------------------------------------------------------
|
||
220: - 116D ide_writesector_256:
|
||
221:11026+10 116D C9 RET ;NOT IMPLEMENTED
|
||
222:
|
||
223:
|
||
224: ;================================================================
|
||
225: ; utility functions
|
||
226: ;================================================================
|
||
227:
|
||
228: ;------------------------------------------------------------------------------
|
||
229: ; ide_printerror
|
||
230: ;
|
||
231: ; prints IDE error to console
|
||
232: ;------------------------------------------------------------------------------
|
||
233: - 116E ide_printerror:
|
||
234:11036+10 116E 21A111 LD HL, [str_error_start]
|
||
235:11046+17 1171 CDBF02 CALL print_str
|
||
236:11063+7 1174 060F LD B, IDE_REG_CMDSTS
|
||
237:11070+17 1176 CDCF10 CALL ide_regread_8
|
||
238:11087+17 1179 CDE702 CALL print_a_hex
|
||
239:11104+10 117C 21BE11 LD HL, [str_error_start1]
|
||
240:11114+17 117F CDBF02 CALL print_str
|
||
241:11131+13 1182 3A0050 LD A,(MEM_IDE_DEVICE)
|
||
242:11144+17 1185 CDE702 CALL print_a_hex
|
||
243:11161+10 1188 21C711 LD HL, [str_error_start2]
|
||
244:11171+17 118B CDBF02 CALL print_str
|
||
245:11188+7 118E 0609 LD B, IDE_REG_ERROR
|
||
246:11195+17 1190 CDCF10 CALL ide_regread_8
|
||
247:11212+17 1193 CDE702 CALL print_a_hex
|
||
248:11229+7 1196 3E0A LD A,10
|
||
249:11236+17 1198 CDB702 CALL print_char
|
||
250:11253+7 119B 3E0D LD A,13
|
||
251:11260+17 119D CDB702 CALL print_char
|
||
252:
|
||
253:11277+10 11A0 C9 RET
|
||
254:
|
||
255: - 11A1 str_error_start:
|
||
256: - 11A1 0D0A4469 db 13,10,"Disk I/O error. Status: 0x",0
|
||
736B2049
|
||
2F4F2065
|
||
72726F72
|
||
2E205374
|
||
61747573
|
||
3A203078
|
||
00
|
||
257: - 11BE str_error_start1:
|
||
258: - 11BE 20446576 db " Dev: 0x",0
|
||
3A203078
|
||
00
|
||
259: - 11C7 str_error_start2:
|
||
260: - 11C7 20457272 db " Err: 0x",0
|
||
3A203078
|
||
00
|
||
261:
|
||
262: - 11D0 str_error_time:
|
||
263: - 11D0 0D0A4469 db 13,10,"Disk I/O error. Data timeout @ 0x",0
|
||
736B2049
|
||
2F4F2065
|
||
72726F72
|
||
2E204461
|
||
74612074
|
||
696D656F
|
||
75742040
|
||
20307800
|
||
**** main.asm ****
|
||
503: .include "kdrv_ideif.s" ;include ide driver.
|
||
**** include/kdrv_ideif.s ****
|
||
1: ;----------------------------------------------------------------
|
||
2: ;BIOS Driver for IDE Access
|
||
3: ;by Dennis Gunia (01/2023)
|
||
4: ;----------------------------------------------------------------
|
||
5:
|
||
6: ;================================================================
|
||
7: ; IDE commands
|
||
8: ;================================================================
|
||
9: - 00EC IDE_CMD_IDENT .EQU 0xEC ;Identify drive.
|
||
10: - 0020 IDE_CMD_READSEC .EQU 0x20 ;Read sectors.
|
||
11:
|
||
12: ;================================================================
|
||
13: ; IDE Variables
|
||
14: ;================================================================
|
||
15: - 5000 MEM_IDE_BASE .EQU 0x5000
|
||
16: - 5000 MEM_IDE_DEVICE .EQU MEM_IDE_BASE
|
||
17: - 5001 MEM_IDE_STATUS .EQU MEM_IDE_BASE + 1 ;1Byte: 0x00 if status is okay
|
||
18:
|
||
19: - 5002 MEM_IDE_PARTITION .EQU MEM_IDE_BASE + 2 ;4*16Bytes: LBA first sector
|
||
20: - 5006 MEM_IDE_POINTER .EQU MEM_IDE_BASE + 6 ;4*16Bytes: LBA first sector
|
||
21:
|
||
22: - 5041 MEM_IDE_BUFFER .EQU MEM_IDE_BASE + 65 ;512Byte: buffer for read/write data
|
||
23:
|
||
24: ;================================================================
|
||
25: ; IDE funtions
|
||
26: ;================================================================
|
||
27:
|
||
28: ;------------------------------------------------------------------------------
|
||
29: ; ideif_init_drive
|
||
30: ;
|
||
31: ; initializes drive
|
||
32: ;------------------------------------------------------------------------------
|
||
33: - 11F4 ideif_init_drive:
|
||
34:11287+4 11F4 AF xor a
|
||
35:11291+13 11F5 320050 ld (MEM_IDE_DEVICE),A ;Set device to 0
|
||
36:11304+13 11F8 320150 ld (MEM_IDE_STATUS),A ;Set status to 0 (OK)
|
||
37:11317+4 11FB F3 di ;disable interrupt
|
||
38:11321+17 11FC CDA610 call ide_reset ;Reset drives on bus
|
||
39:11338+10 11FF 218912 ld hl, [str_dev_waitready]
|
||
40:11348+17 1202 CDBF02 call print_str ;print waiting message
|
||
41:11365+10 1205 11FF1F ld DE, 0x1FFF ;preload timeout counter
|
||
42: - 1208 ideif_init_drive_loop1:
|
||
43:11375+7 1208 060F ld b, IDE_REG_CMDSTS
|
||
44:11382+17 120A CDCF10 call ide_regread_8 ;read drive status register
|
||
45:11399+4 120D B7 OR A
|
||
46:11403+7+5 120E 280B JR Z, ideif_init_drive_nodrv ;no drive found
|
||
47:11410+8 1210 CB77 BIT 6,A ;Wait for device ready
|
||
48:11418+7+5 1212 200E JR NZ, ideif_init_drive_detected
|
||
49:11425+6 1214 1B DEC DE ; decrement timeout
|
||
50:11431+4 1215 7A LD A,D
|
||
51:11435+4 1216 B3 OR E
|
||
52:11439+7+5 1217 2802 JR Z, ideif_init_drive_nodrv
|
||
53:11446+12 1219 18ED JR ideif_init_drive_loop1
|
||
54:
|
||
55: - 121B ideif_init_drive_nodrv:
|
||
56:11458+10 121B 21B312 ld hl, [str_dev_notfound]
|
||
57:11468+17 121E CDBF02 call print_str
|
||
58:11485+10 1221 C9 RET
|
||
59:
|
||
60: - 1222 ideif_init_drive_detected:
|
||
61:11495+10 1222 219D12 ld hl, [str_dev_ready]
|
||
62:11505+17 1225 CDBF02 call print_str
|
||
63:11522+7 1228 060F LD B, IDE_REG_CMDSTS ;Get drive identification
|
||
64:11529+7 122A 3EEC LD A, IDE_CMD_IDENT
|
||
65:11536+17 122C CDB310 call ide_regwrite_8 ;Write command to drive
|
||
66:11553+10 122F 214150 LD HL,MEM_IDE_BUFFER ;set read/write buffer start address
|
||
67:11563+17 1232 CDED10 call ide_readsector_256 ;read 256 words from device
|
||
68:11580+10 1235 215550 LD HL,MEM_IDE_BUFFER + 20 ;print device serial
|
||
69:11590+7 1238 0614 LD B, 20
|
||
70:11597+17 123A CD5813 CALL print_str_fixed
|
||
71:11614+10 123D 21AA12 ld hl, [str_dev_ready2]
|
||
72:11624+17 1240 CDBF02 call print_str
|
||
73:11641+10 1243 217750 LD HL,MEM_IDE_BUFFER + 54 ;print device name
|
||
74:11651+7 1246 0628 LD B, 40
|
||
75:11658+17 1248 CD5813 CALL print_str_fixed
|
||
76:11675+7 124B 3E0A LD A,10 ;New line
|
||
77:11682+17 124D CDB702 CALL print_char
|
||
78:11699+7 1250 3E0D LD A,13
|
||
79:11706+17 1252 CDB702 CALL print_char
|
||
80:11723+10 1255 C9 RET
|
||
81:
|
||
82: ;------------------------------------------------------------------------------
|
||
83: ; read_lba_sector
|
||
84: ;
|
||
85: ; Reads A*512 byte sector into memory
|
||
86: ; HL contains pointer to LBA address
|
||
87: ; A contains sector count
|
||
88: ;------------------------------------------------------------------------------
|
||
89: - 1256 read_lba_sector:
|
||
90:11733+7 1256 060A LD B,IDE_REG_SECTOR ;amount of sectores
|
||
91:11740+17 1258 CDB310 CALL ide_regwrite_8
|
||
92:
|
||
93:11757+7 125B 7E LD A,(HL)
|
||
94:11764+7 125C E60F AND 00001111b
|
||
95:11771+7 125E F6E0 OR 11100000b
|
||
96:11778+7 1260 060E LD B,IDE_REG_HEAD
|
||
97:11785+17 1262 CDB310 CALL ide_regwrite_8
|
||
98:11802+6 1265 23 INC HL
|
||
99:11808+7 1266 7E LD A,(HL)
|
||
100:11815+7 1267 060D LD B,IDE_REG_HCYL
|
||
101:11822+17 1269 CDB310 CALL ide_regwrite_8
|
||
102:11839+6 126C 23 INC HL
|
||
103:11845+7 126D 7E LD A,(HL)
|
||
104:11852+7 126E 060C LD B,IDE_REG_LCYL
|
||
105:11859+17 1270 CDB310 CALL ide_regwrite_8
|
||
106:11876+6 1273 23 INC HL
|
||
107:11882+7 1274 7E LD A,(HL)
|
||
108:11889+7 1275 060B LD B,IDE_REG_SSECTOR
|
||
109:11896+17 1277 CDB310 CALL ide_regwrite_8
|
||
110:11913+6 127A 23 INC HL
|
||
111:
|
||
112:11919+7 127B 3E20 LD A,IDE_CMD_READSEC ;send read command
|
||
113:11926+7 127D 060F LD B,IDE_REG_CMDSTS
|
||
114:11933+17 127F CDB310 CALL ide_regwrite_8
|
||
115:11950+10 1282 214150 LD HL,MEM_IDE_BUFFER ;set read/write buffer start address
|
||
116:11960+17 1285 CD1D11 call ide_readsector_512_inv ;read 256 words from device
|
||
117:11977+10 1288 C9 ret
|
||
118:
|
||
119:
|
||
120: ;================================================================
|
||
121: ; IDE strings
|
||
122: ;===============================================================
|
||
123:
|
||
124: - 1289 str_dev_waitready:
|
||
125: - 1289 0D0A4465 db 13,10,"Detecting drives ",0
|
||
74656374
|
||
696E6720
|
||
64726976
|
||
65732000
|
||
126:
|
||
127: - 129D str_dev_ready:
|
||
128: - 129D 666F756E db "found!",13,10,"ID: ",0
|
||
64210D0A
|
||
49443A20
|
||
00
|
||
129: - 12AA str_dev_ready2:
|
||
130: - 12AA 20204465 db " Desc: ",0
|
||
73633A20
|
||
00
|
||
131:
|
||
132: - 12B3 str_dev_notfound:
|
||
133: - 12B3 6E6F2064 db "no drive",13,10,0
|
||
72697665
|
||
0D0A00
|
||
**** main.asm ****
|
||
504: .include "prettydump.s" ;include monitor symbols.
|
||
**** include/prettydump.s ****
|
||
1: ;----------------------------------------------------------------
|
||
2: ;HEX and ASCII dump function
|
||
3: ;by Dennis Gunia (01/2023)
|
||
4: ;----------------------------------------------------------------
|
||
5:
|
||
6: ;------------------------------------------------------------------------------
|
||
7: ; dump_pretty
|
||
8: ;
|
||
9: ; Dumps memory content
|
||
10: ; B contains amount of rows
|
||
11: ; HL contains start address
|
||
12: ; Destroys BC, HL
|
||
13: ;------------------------------------------------------------------------------
|
||
14: - 12BE dump_pretty:
|
||
15:11987+11 12BE E5 PUSH HL
|
||
16:11998+10 12BF 211913 LD HL,[STR_PD_HEADER] ;Print header
|
||
17:12008+17 12C2 CDBF02 CALL print_str
|
||
18:12025+10 12C5 E1 POP HL
|
||
19: - 12C6 dump_pretty_row:
|
||
20:12035+4 12C6 78 LD A,B ;Check row counter
|
||
21:12039+4 12C7 B7 OR A
|
||
22:12043+10 12C8 CA1813 JP Z, dump_pretty_end ;If counter is 0, exit
|
||
23:12053+4 12CB 05 DEC B ;Decrement row counter by 1
|
||
24:12057+7 12CC 0E10 LD C, 16 ;Load column counter
|
||
25:12064+4 12CE 7C LD A, H ;Print base address
|
||
26:12068+17 12CF CDE702 CALL print_a_hex
|
||
27:12085+4 12D2 7D LD A, L
|
||
28:12089+17 12D3 CDE702 CALL print_a_hex
|
||
29:12106+7 12D6 3E20 LD A, ' '
|
||
30:12113+17 12D8 CDB702 CALL print_char
|
||
31: - 12DB dump_pretty_col: ;Loop for column
|
||
32:12130+7 12DB 7E LD A,(HL) ;Load byte to disply
|
||
33:12137+17 12DC CDE702 CALL print_a_hex
|
||
34:12154+7 12DF 3E20 LD A, ' '
|
||
35:12161+17 12E1 CDB702 CALL print_char
|
||
36:12178+6 12E4 23 INC HL
|
||
37:12184+4 12E5 0D DEC C ;Decrement column counter
|
||
38:12188+7+5 12E6 20F3 JR NZ, dump_pretty_col ;Loop if not 0
|
||
39: - 12E8 dump_pretty_ascii:
|
||
40:12195+11 12E8 C5 PUSH BC
|
||
41:12206+11 12E9 E5 PUSH HL
|
||
42:12217+7 12EA 0600 LD B,0
|
||
43:12224+7 12EC 0E10 LD C,16
|
||
44:12231+15 12EE ED42 SBC HL,BC ;Reset HL by column count
|
||
45: - 12F0 dump_pretty_ascii_loop:
|
||
46:12246+7 12F0 7E LD A,(HL)
|
||
47:12253+6 12F1 23 INC HL
|
||
48:12259+7 12F2 FE20 CP 32
|
||
49:12266+10 12F4 DA0113 JP C, dump_pretty_ascii_none ;if less than 32, it is not a char
|
||
50:12276+7 12F7 FE7F CP 127
|
||
51:12283+10 12F9 D20113 JP NC, dump_pretty_ascii_none ;if greater or equal than 128, it is not a char
|
||
52:12293+17 12FC CDB702 call print_char
|
||
53:12310+12 12FF 1805 jr dump_pretty_ascii_cont
|
||
54: - 1301 dump_pretty_ascii_none:
|
||
55:12322+7 1301 3E2E LD A,'.'
|
||
56:12329+17 1303 CDB702 call print_char
|
||
57: - 1306 dump_pretty_ascii_cont:
|
||
58:12346+4 1306 0D DEC C
|
||
59:12350+10 1307 C2F012 JP NZ, dump_pretty_ascii_loop
|
||
60:
|
||
61:
|
||
62:12360+10 130A E1 POP HL
|
||
63:12370+10 130B C1 POP BC
|
||
64: - 130C dump_pretty_nextrow:
|
||
65:12380+7 130C 3E0A LD A,10 ;New line
|
||
66:12387+17 130E CDB702 CALL print_char
|
||
67:12404+7 1311 3E0D LD A,13
|
||
68:12411+17 1313 CDB702 CALL print_char
|
||
69:12428+12 1316 18AE JR dump_pretty_row ;Else next line
|
||
70: - 1318 dump_pretty_end:
|
||
71:12440+10 1318 C9 RET
|
||
72:
|
||
73: - 1319 STR_PD_HEADER:
|
||
74: - 1319 0D0A4241 db 13,10,'BASE 0 1 2 3 4 5 6 7 8 9 A B C D E F ASCII',13,10,0
|
||
53452030
|
||
20203120
|
||
20322020
|
||
33202034
|
||
20203520
|
||
20362020
|
||
37202038
|
||
20203920
|
||
20412020
|
||
42202043
|
||
20204420
|
||
20452020
|
||
46202041
|
||
53434949
|
||
0D0A00
|
||
75:
|
||
76:
|
||
77: ;------------------------------------------------------------------------------
|
||
78: ; print_str_fixed
|
||
79: ;
|
||
80: ; Prints string with fixed length
|
||
81: ; B contains length
|
||
82: ; HL contains start address
|
||
83: ;------------------------------------------------------------------------------
|
||
84: - 1358 print_str_fixed:
|
||
85:12450+7 1358 7E LD A,(HL)
|
||
86:12457+6 1359 23 INC HL
|
||
87:12463+17 135A CDB702 CALL print_char
|
||
88:12480+8+5 135D 10F9 DJNZ print_str_fixed
|
||
89:12488+10 135F C9 RET
|
||
90:
|
||
**** main.asm ****
|
||
505: ; Strings
|
||
506: - 1360 STR_Banner_Start:
|
||
507: - 1360 5A384320 db "Z8C Monitor V2 by Dennis Gunia (2022)",0
|
||
4D6F6E69
|
||
746F7220
|
||
56322062
|
||
79204465
|
||
6E6E6973
|
||
2047756E
|
||
69612028
|
||
32303232
|
||
2900
|
||
508: - 1386 STR_SyntaxError:
|
||
509: - 1386 73796E3F db "syn?",0
|
||
00
|
||
510: - 138B STR_Unknown:
|
||
511: - 138B 636D643F db "cmd?",0
|
||
00
|
||
512: - 1390 STR_HEXDUMP_HEADER:
|
||
513: - 1390 42415345 db 'BASE 0 1 2 3 4 5 6 7 8 9 A B C D E F',0
|
||
20302020
|
||
31202032
|
||
20203320
|
||
20342020
|
||
35202036
|
||
20203720
|
||
20382020
|
||
39202041
|
||
20204220
|
||
20432020
|
||
44202045
|
||
20204600
|
||
514:
|
||
515:
|
||
516:
|
||
**** main.asm ****
|
||
517: ;.include "debug.s"
|
||
|
||
|
||
|
||
Statistics:
|
||
|
||
4 passes
|
||
0 jr promotions
|
||
391 symbols
|
||
5039 bytes
|
||
|
||
|
||
|
||
Symbol Table:
|
||
|
||
AY0_WRITE_REG 91 145
|
||
A_RTS_OFF 312 786
|
||
A_RTS_ON 31B 795
|
||
CMD_DASM 239 569
|
||
CMD_EXEC 12F 303
|
||
CMD_IO_READ 21D 541
|
||
CMD_IO_WRITE 1F4 500
|
||
CMD_SET 1B8 440
|
||
CMD_SET_END 1EE 494
|
||
CMD_SET_LOOP 1D3 467
|
||
CMD_SYNTAX_ERROR 272 626
|
||
CMD_VIEW 14E 334
|
||
CMD_VIEW_END 1B2 434
|
||
CMD_VIEW_ROW 187 391
|
||
CMD_VIEW_ROW_LOOP 199 409
|
||
CONSOLE_INIT 27E 638
|
||
CONSOLE_INIT_CTC 27E 638
|
||
CONSOLE_INIT_SIO 286 646
|
||
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_PIA_CR =33 51
|
||
CS_PIA_PA =30 48
|
||
CS_PIA_PB =31 49
|
||
CS_PIA_PC =32 50
|
||
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 324 804
|
||
DHEX_TO_BYTE_FAILED 340 832
|
||
EXEC_RST_08 EC4 3780
|
||
EXEC_RST_10 EC8 3784
|
||
EXEC_RST_18 ED4 3796
|
||
HEX_TO_BIN 344 836
|
||
HEX_TO_BIN_2 352 850
|
||
HEX_TO_INVALID_2 359 857
|
||
IDE_CMD_IDENT =EC 236
|
||
IDE_CMD_READSEC=20 32
|
||
IDE_RD =40 64
|
||
IDE_REG_ALTSTS =16 22
|
||
IDE_REG_CMDSTS =0F 15
|
||
IDE_REG_DATA =08 8
|
||
IDE_REG_DRVADDR=17 23
|
||
IDE_REG_ERROR =09 9
|
||
IDE_REG_HCYL =0D 13
|
||
IDE_REG_HEAD =0E 14
|
||
IDE_REG_LCYL =0C 12
|
||
IDE_REG_SECTOR =0A 10
|
||
IDE_REG_SSECTOR=0B 11
|
||
IDE_RST =80 128
|
||
IDE_WR =20 32
|
||
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 27E 638
|
||
MEM_IDE_BASE =5000 20480
|
||
MEM_IDE_BUFFER =5041 20545
|
||
MEM_IDE_DEVICE =5000 20480
|
||
MEM_IDE_PARTITION=5002 20482
|
||
MEM_IDE_POINTER=5006 20486
|
||
MEM_IDE_STATUS =5001 20481
|
||
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 30A 778
|
||
MSG_ERROR 1048 4168
|
||
MSG_START 1061 4193
|
||
PRG_RAM_START =4110 16656
|
||
PRG_RAM_TOP =FF00 65280
|
||
PROG_MEM_START =4000 16384
|
||
PROG_ROM_START = 100 256
|
||
PROMPT_BEGIN 99 153
|
||
PROMPT_BEGIN_READ_BACKSPACE D6 214
|
||
PROMPT_BEGIN_READ_LOOP A5 165
|
||
PROMPT_BEGIN_READ_PROCESS FC 252
|
||
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 35B 859
|
||
STRCONV_BYTES_TO_HEX_1 36A 874
|
||
STRCONV_BYTES_TO_HEX_2 374 884
|
||
STR_Banner_Start 1360 4960
|
||
STR_HEXDUMP_HEADER 1390 5008
|
||
STR_PD_HEADER 1319 4889
|
||
STR_SyntaxError 1386 4998
|
||
STR_Unknown 138B 5003
|
||
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 ED7 3799
|
||
beep_loop EDA 3802
|
||
beep_pause EF7 3831
|
||
dasm_00 ADC 2780
|
||
dasm_01 DC8 3528
|
||
dasm_02 B62 2914
|
||
dasm_03 D9A 3482
|
||
dasm_08 BDF 3039
|
||
dasm_09 D6D 3437
|
||
dasm_0A B44 2884
|
||
dasm_0B DB1 3505
|
||
dasm_10 B24 2852
|
||
dasm_12 B6D 2925
|
||
dasm_18 AE7 2791
|
||
dasm_1A B4E 2894
|
||
dasm_20 B01 2817
|
||
dasm_22 E0E 3598
|
||
dasm_27 BA7 2983
|
||
dasm_28 AFA 2810
|
||
dasm_2A DDF 3551
|
||
dasm_2F BAB 2987
|
||
dasm_30 AF2 2802
|
||
dasm_32 B78 2936
|
||
dasm_37 BB7 2999
|
||
dasm_38 AEB 2795
|
||
dasm_3A B58 2904
|
||
dasm_3F BB3 2995
|
||
dasm_76 BBB 3003
|
||
dasm_80C6 C38 3128
|
||
dasm_BE BD5 3029
|
||
dasm_C3 AE0 2784
|
||
dasm_C88E C5E 3166
|
||
dasm_C9 B30 2864
|
||
dasm_CD B2A 2858
|
||
dasm_D9 BEC 3052
|
||
dasm_DD B12 2834
|
||
dasm_DD_01 DCF 3535
|
||
dasm_DD_09 D88 3464
|
||
dasm_DD_22 E24 3620
|
||
dasm_DD_23 D9F 3487
|
||
dasm_DD_2A DF6 3574
|
||
dasm_DD_2B DB6 3510
|
||
dasm_DD_34 D38 3384
|
||
dasm_DD_35 D55 3413
|
||
dasm_DD_86 C40 3136
|
||
dasm_DD_8E C66 3174
|
||
dasm_DD_96 C89 3209
|
||
dasm_DD_9E CA9 3241
|
||
dasm_DD_A6 CCA 3274
|
||
dasm_DD_AE D01 3329
|
||
dasm_DD_B6 CE6 3302
|
||
dasm_DD_BE D1D 3357
|
||
dasm_DD_E1 E76 3702
|
||
dasm_DD_E3 BFC 3068
|
||
dasm_DD_E5 E60 3680
|
||
dasm_DD_F9 E46 3654
|
||
dasm_E1 E70 3696
|
||
dasm_E3 BF0 3056
|
||
dasm_E5 E5A 3674
|
||
dasm_E9 B09 2825
|
||
dasm_ED_42 D7F 3455
|
||
dasm_ED_43 E1A 3610
|
||
dasm_ED_44 BAF 2991
|
||
dasm_ED_45 B3A 2874
|
||
dasm_ED_46 BC6 3014
|
||
dasm_ED_4A D76 3446
|
||
dasm_ED_4B DEB 3563
|
||
dasm_ED_4D B35 2869
|
||
dasm_ED_56 BCB 3019
|
||
dasm_ED_5E BD0 3024
|
||
dasm_ED_A0 C14 3092
|
||
dasm_ED_A1 C26 3110
|
||
dasm_ED_A8 C1D 3101
|
||
dasm_ED_A9 C2F 3119
|
||
dasm_ED_B0 C18 3096
|
||
dasm_ED_B1 C2A 3114
|
||
dasm_ED_B8 C21 3105
|
||
dasm_ED_B9 C33 3123
|
||
dasm_F3 BC0 3008
|
||
dasm_F9 E3C 3644
|
||
dasm_FB BC3 3011
|
||
dasm_FD B1B 2843
|
||
dasm_FD_01 DD7 3543
|
||
dasm_FD_09 D91 3473
|
||
dasm_FD_22 E30 3632
|
||
dasm_FD_23 DA8 3496
|
||
dasm_FD_2A E02 3586
|
||
dasm_FD_2B DBF 3519
|
||
dasm_FD_34 D44 3396
|
||
dasm_FD_35 D61 3425
|
||
dasm_FD_86 C4F 3151
|
||
dasm_FD_8E C75 3189
|
||
dasm_FD_96 C95 3221
|
||
dasm_FD_9E CB7 3255
|
||
dasm_FD_A6 CD6 3286
|
||
dasm_FD_AE D0D 3341
|
||
dasm_FD_B6 CF1 3313
|
||
dasm_FD_BE D28 3368
|
||
dasm_FD_E1 E7E 3710
|
||
dasm_FD_E3 C08 3080
|
||
dasm_FD_E5 E68 3688
|
||
dasm_FD_F9 E50 3664
|
||
dasm_FF B3F 2879
|
||
dasm_UU E86 3718
|
||
dasm_UW E8A 3722
|
||
dasm__AND CC5 3269
|
||
dasm__CP D19 3353
|
||
dasm__DEC D50 3408
|
||
dasm__ED_47 B97 2967
|
||
dasm__ED_4F B9F 2975
|
||
dasm__ED_57 B87 2951
|
||
dasm__ED_5F B8F 2959
|
||
dasm__INC D33 3379
|
||
dasm__LD B83 2947
|
||
dasm__OR CE2 3298
|
||
dasm__SBC CA1 3233
|
||
dasm__SUB C84 3204
|
||
dasm__XOR CFC 3324
|
||
dasm_opcode_table 684 1668
|
||
dasm_print16hex_addr 4B1 1201
|
||
dasm_print8hex 4C9 1225
|
||
dasm_printFlags_table E8F 3727
|
||
dasm_printRegister8_table E9F 3743
|
||
dasm_printRegister8_table_HL EBF 3775
|
||
dasm_printRegisterIX_table EA7 3751
|
||
dasm_printRegisterIY_table EAF 3759
|
||
dasm_printRegisterSP_table EB7 3767
|
||
disassemble 375 885
|
||
disassemble_continue 45B 1115
|
||
disassemble_err 44B 1099
|
||
disassemble_next 379 889
|
||
disassemble_print_opcode_params_end 448 1096
|
||
disassemble_print_opcode_params_loop 3F4 1012
|
||
disassemble_print_opcode_raw 3B6 950
|
||
disassemble_print_opcode_raw_fill 3CA 970
|
||
disassemble_table_first_match 48D 1165
|
||
disassemble_table_found 4A7 1191
|
||
disassemble_table_notfound 4AB 1195
|
||
disassemble_table_seek 469 1129
|
||
disassemble_table_seek_loop 46D 1133
|
||
dump_pretty 12BE 4798
|
||
dump_pretty_ascii 12E8 4840
|
||
dump_pretty_ascii_cont 1306 4870
|
||
dump_pretty_ascii_loop 12F0 4848
|
||
dump_pretty_ascii_none 1301 4865
|
||
dump_pretty_col 12DB 4827
|
||
dump_pretty_end 1318 4888
|
||
dump_pretty_nextrow 130C 4876
|
||
dump_pretty_row 12C6 4806
|
||
ide_printerror 116E 4462
|
||
ide_readsector_256 10ED 4333
|
||
ide_readsector_256_done 111C 4380
|
||
ide_readsector_256_waitloop 10EF 4335
|
||
ide_readsector_512_inv 111D 4381
|
||
ide_readsector_512_inv_waitloop 1122 4386
|
||
ide_readsector_timeout 1158 4440
|
||
ide_regread_8 10CF 4303
|
||
ide_regwrite_8 10B3 4275
|
||
ide_reset 10A6 4262
|
||
ide_writesector_256 116D 4461
|
||
ideif_init_drive 11F4 4596
|
||
ideif_init_drive_detected 1222 4642
|
||
ideif_init_drive_loop1 1208 4616
|
||
ideif_init_drive_nodrv 121B 4635
|
||
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 4D7 1239
|
||
param_02 4FE 1278
|
||
param_03 51B 1307
|
||
param_03_done 553 1363
|
||
param_03_neg 53C 1340
|
||
param_04 557 1367
|
||
param_04_i 567 1383
|
||
param_05 56D 1389
|
||
param_06 57A 1402
|
||
param_07 594 1428
|
||
param_08 5A1 1441
|
||
param_09 5B6 1462
|
||
param_09_0A 5BC 1468
|
||
param_0A 5AD 1453
|
||
param_10 5CB 1483
|
||
param_11 5DB 1499
|
||
param_11_12 5EA 1514
|
||
param_11_12_all 60A 1546
|
||
param_11_12_def 5FD 1533
|
||
param_11_12_ix 602 1538
|
||
param_11_12_iy 607 1543
|
||
param_12 5E3 1507
|
||
param_13 61B 1563
|
||
param_80 63A 1594
|
||
param_80_seek 641 1601
|
||
param_81 631 1585
|
||
param_comma 675 1653
|
||
param_printRegister 650 1616
|
||
param_printRegisterA 66E 1646
|
||
param_printRegisterHL 666 1638
|
||
print_a_hex 2E7 743
|
||
print_char 2B7 695
|
||
print_clear 2CA 714
|
||
print_newLine 2D1 721
|
||
print_str 2BF 703
|
||
print_str_end 2C9 713
|
||
print_str_fixed 1358 4952
|
||
print_wait_out 2DC 732
|
||
read_char 2F8 760
|
||
read_lba_sector 1256 4694
|
||
str_dev_notfound 12B3 4787
|
||
str_dev_ready 129D 4765
|
||
str_dev_ready2 12AA 4778
|
||
str_dev_waitready 1289 4745
|
||
str_error_start 11A1 4513
|
||
str_error_start1 11BE 4542
|
||
str_error_start2 11C7 4551
|
||
str_error_time 11D0 4560
|
||
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 107B 4219
|
||
xmodem_await_conn F34 3892
|
||
xmodem_end FDF 4063
|
||
xmodem_err FA5 4005
|
||
xmodem_init F06 3846
|
||
xmodem_int FE6 4070
|
||
xmodem_int_cont 1005 4101
|
||
xmodem_nak 1089 4233
|
||
xmodem_out 1037 4151
|
||
xmodem_packet F3F 3903
|
||
xmodem_packet_EOT F9D 3997
|
||
xmodem_packet_get F51 3921
|
||
xmodem_packet_get_crc F8A 3978
|
||
xmodem_packet_get_data F7B 3963
|
||
xmodem_read_timeount=03 3
|
||
xmodem_read_wait 100A 4106
|
||
xmodem_read_wait_loop 1018 4120
|
||
xmodem_read_wait_timeout 1035 4149
|
||
xmodem_wait 1097 4247
|
||
xmodem_wait_1 109D 4253
|
||
xmodem_wait_out 103D 4157
|