]> cloudbase.mooo.com Git - ddt180.git/blob - ddtz.z80
Bugfix: remove invalid opcode from disassembler (L command).
[ddt180.git] / ddtz.z80
1 ; Disassembled ddtz.com, version "DDT/Z [8101]"
2 ; with modified relocater.
3 ;
4 ; Build steps:
5 ; - Assemble to a .REL file with M80 or a compatible assembler.
6 ; - Use Digital Research Link-80 to generate a .PRL file (op switch).
7 ; - Cut the .PRL header (first 256 byte) end rename the result to DDTZ.COM.
8
9 ;-------------------------------------------------------------------------------
10 ; Relocation loader
11 ;
12
13 TPA equ 0100h
14 cseg
15 .phase TPA
16
17 LD SP,ldr_end+(stack-ddtz_base)
18 LD DE,ldr_end+(expr_buf-ddtz_base)
19 LD C,BDOS_PSTR
20 CALL BDOS
21
22 LD HL,ldr_end+ddtz_size ;start of reloc bitmap
23 ld bc,0108h ;init bit counter
24
25 EXX
26 LD HL,(BDOS+1)
27 LD (ldr_end+1),HL
28 LD BC,ddtz_size-1
29 LD D,B
30 LD E,0FFH
31 INC DE ;size rounded up to next page boundary
32 INC BC ;ddtz_size
33 OR A
34 SBC HL,DE ;BDOS - size
35 LD (BDOS+1),HL ;-> new BDOS entry
36
37 push hl
38 PUSH BC
39 ld de,ldr_end
40 sbc hl,de
41 EX DE,HL ;-> DE
42 LD HL,ldr_size
43 add hl,bc
44 ld b,h
45 ld c,l
46 LD HL,TPA
47 reloc_lp:
48 EXX
49 djnz reloc_nl
50 ld b,c ;reload bit counter
51 LD e,(HL) ;get next 8 relocation bits
52 INC HL
53 reloc_nl:
54 sla e
55 EXX
56 JR NC,reloc_next
57 DEC HL
58 LD A,(HL)
59 ADD A,E
60 LD (HL),A
61 INC HL
62 LD A,(HL)
63 ADC A,D
64 LD (HL),A
65 reloc_next:
66 cpi
67 jp pe,reloc_lp
68 dec hl
69
70 POP BC
71 pop de
72 EX DE,HL
73 ADD HL,BC
74 EX DE,HL
75 DEC DE
76 LDDR
77 LD HL,conbuf+2-ddtz_base
78 ADD HL,DE
79 JP (HL)
80
81 ldr_end:
82 ldr_size equ $ - TPA
83
84 .dephase
85 ;-------------------------------------------------------------------------------
86 ; DDT/Z core
87 ;
88
89 ; Some greneral definitions
90
91 TAB equ 9
92 LF equ 10
93 CR equ 13
94
95 ; CP/M memory layout
96
97 BDOS equ 5
98 FCB equ 05ch
99 FCB2 equ 06ch
100 DMA_BUF equ 080h
101 TPA equ 0100h
102
103 ; BDOS function calls
104
105 BDOS_CIN equ 1 ;Console Input
106 BDOS_COUT equ 2 ;Console Output
107 BDOS_PSTR equ 9 ;Print String
108 BDOS_CBUF equ 10 ;Read Console Buffer
109 BDOS_CSTAT equ 11 ;Get Console Status
110 BDOS_OPEN equ 15 ;Open File
111 BDOS_CLOSE equ 16 ;Close File
112 BDOS_DELETE equ 19 ;Delete File
113 BDOS_READ equ 20 ;Read Sequential
114 BDOS_WRITE equ 21 ;Write Sequential
115 BDOS_CREATE equ 22 ;Make File
116 BDOS_SETDMA equ 26 ;Set DMA Address
117
118 ; ddtz specific definitions
119
120 STACK_SIZE equ 64 ;ddtz internal stack
121 CONBUF_SIZE equ 80 ;Size of console input buffer
122 EXPR_BUF_SIZE equ 128 ;expressen buffer for conditional breakpoints
123 BP_CNT equ 12 ;Number of breakpoints
124 BP_SIZE equ 8 ;Size of a breakpoint record
125 YREG_CNT equ 10 ;Number of Y registers (0..9)
126
127 ;-------------------------------------------------------------------------------
128
129 ddtz_base:
130 jp 0 ;0000 c3 00 00 . . .
131 l0003h:
132 rst 30h ;0003 f7 .
133 sub_0004h:
134 nop ;0004 00 .
135 ret ;0005 c9 .
136
137 ds STACK_SIZE
138
139 stack:
140 reg.l2: db 000h ;0046 00 .
141 reg.h2: db 000h ;0047 00 .
142 reg.e2: db 000h ;0048 00 .
143 reg.d2: db 000h ;0049 00 .
144 reg.c2: db 000h ;004a 00 .
145 reg.b2: db 000h ;004b 00 .
146 reg.f2: db 000h ;004c 00 .
147 reg.a2: db 000h ;004d 00 .
148 l004eh: db 000h ;004e 00 .
149 reg.i: db 000h ;004f 00 .
150 reg.iy: dw 0000h ;0050 00 .
151 reg.ix: dw 0000h ;0052 00 .
152 reg.f: db 000h ;0054 00 .
153 reg.a: db 000h ;0055 00 .
154 reg.c: db 000h ;0056 00 .
155 reg.b: db 000h ;0057 00 .
156 reg.e: db 000h ;0058 00 .
157 reg.d: db 000h ;0059 00 .
158 reg.l: db 000h ;005a 00 .
159 reg.h: db 000h ;005b 00 .
160 reg_sp: dw TPA ;005c 00 01 .
161 reg.iff:
162 db 0f3h ;005e f3 .
163 db 0c3h ;005f c3 .
164 REG.PC: dw TPA ;0060 00 01 .
165 l0062h: dw 0000h ;0062 00 00 .
166 offs.@: dw 0 ;0064 00 00 .
167
168 CMD_ERR:dw l0146h ;0066 46 01 F .
169 cmd_rpt:dw mainloop ;0068 bd 00 . .
170
171 conbuf:
172 db CONBUF_SIZE ;006a 50 P
173
174 ld sp,stack ;006b 31 46 00 1 F .
175 exx ;006e d9 .
176 ld de,ddtz_base ;006f 11 00 00 . . .
177 or a ;0072 b7 .
178 sbc hl,de ;0073 ed 52 . R
179 add hl,de ;0075 19 .
180 jr c,l0079h ;0076 38 01 8 .
181 ex de,hl ;0078 eb .
182 l0079h:
183 ld de,TPA ;0079 11 00 01 . . .
184 l007ch:
185 dec hl ;007c 2b +
186 ld (hl),000h ;007d 36 00 6 .
187 ld a,h ;007f 7c |
188 sub d ;0080 92 .
189 ld b,a ;0081 47 G
190 ld a,l ;0082 7d }
191 sub e ;0083 93 .
192 or b ;0084 b0 .
193 jr nz,l007ch ;0085 20 f5 .
194 ld a,i ;0087 ed 57 . W
195 ld (reg.i),a ;0089 32 4f 00 2 O .
196 ld a,0f3h ;008c 3e f3 > .
197 jp po,l0093h ;008e e2 93 00 . . .
198 ld a,0fbh ;0091 3e fb > .
199 l0093h:
200 ld (reg.iff),a ;0093 32 5e 00 2 ^ .
201 call sub_0004h ;0096 cd 04 00 . . .
202 ld hl,ddtz_base ;0099 21 00 00 ! . .
203 ld l,000h ;009c 2e 00 . .
204 ld (reg_sp),hl ;009e 22 5c 00 " \ .
205 ld a,(FCB+1) ;00a1 3a 5d 00 : ] .
206 cp ' ' ;00a4 fe 20 .
207 ld hl,0 ;00a6 21 00 00 ! . .
208 call nz,read_file ;00a9 c4 68 10 . h .
209 jr mainloop ;00ac 18 0f . .
210
211 ds CONBUF_SIZE + 3 - ($ - conbuf)
212
213 mainloop:
214 ld sp,stack ;00bd 31 46 00 1 F .
215 ld hl,l0146h ;00c0 21 46 01 ! F .
216 ld (CMD_ERR),hl ;00c3 22 66 00 " f .
217 ld hl,(REG.PC) ;00c6 2a 60 00 * ` .
218 ld (l0062h),hl ;00c9 22 62 00 " b .
219 call bp_clr_temporary ;00cc cd 54 07 . T .
220 ld hl,(cmd_rpt) ;00cf 2a 68 00 * h .
221 ld de,mainloop ;00d2 11 bd 00 . . .
222 call cp_hl_de ;00d5 cd ee 02 . . .
223 ld a,'>' ;00d8 3e 3e > >
224 call outchar ;00da cd 5d 02 . ] .
225 call nz,outchar ;00dd c4 5d 02 . ] .
226 call z,outbl ;00e0 cc 9f 02 . . .
227 call get_line ;00e3 cd 4e 01 . N .
228 call skipbl ;00e6 cd bf 02 . . .
229 jr z,exe_hl ;00e9 28 1f ( .
230 ld hl,mainloop ;00eb 21 bd 00 ! . .
231 ld (cmd_rpt),hl ;00ee 22 68 00 " h .
232 inc de ;00f1 13 .
233 sub '@' ;00f2 d6 40 . @
234 jr c,ERROR ;00f4 38 11 8 .
235 cp 'Z'+1-'@' ;00f6 fe 1b . .
236 jr nc,ERROR ;00f8 30 0d 0 .
237 add a,a ;00fa 87 .
238 ld hl,CMDTAB ;00fb 21 10 01 ! . .
239 call add_hl_a ;00fe cd b9 02 . . .
240 ld a,(hl) ;0101 7e ~
241 inc hl ;0102 23 #
242 ld h,(hl) ;0103 66 f
243 ld l,a ;0104 6f o
244 jr exe_hl ;0105 18 03 . .
245 ERROR:
246 ld hl,(CMD_ERR) ;0107 2a 66 00 * f .
247 exe_hl:
248 call CALL_HL ;010a cd 0f 01 . . .
249 jr mainloop ;010d 18 ae . .
250 CALL_HL:
251 jp (hl) ;010f e9 .
252
253 CMDTAB:
254 defw cmd_@ ;0110 92 0d . .
255 defw cmd_A ;0112 fe 11 . .
256 defw cmd_B ;0114 6d 07 m .
257 defw cmd_C ;0116 17 21 . !
258 defw cmd_D ;0118 48 0f H .
259 defw ERROR ;011a 07 01 . .
260 defw cmd_F ;011c af 0f . .
261 defw cmd_G ;011e 31 07 1 .
262 defw cmd_H ;0120 3d 0e = .
263 defw cmd_I ;0122 a3 0d . .
264 defw ERROR ;0124 07 01 . .
265 defw ERROR ;0126 07 01 . .
266 defw cmd_L ;0128 cd 18 . .
267 defw cmd_M ;012a 19 0e . .
268 defw ERROR ;012c 07 01 . .
269 defw cmd_O ;012e c7 0d . .
270 defw ERROR ;0130 07 01 . .
271 defw cmd_Q ;0132 84 0e . .
272 defw cmd_R ;0134 62 10 b .
273 defw cmd_S ;0136 5a 0d Z .
274 defw cmd_T ;0138 1e 21 . !
275 defw ERROR ;013a 07 01 . .
276 defw cmd_V ;013c ea 0d . .
277 defw cmd_W ;013e a0 11 . .
278 defw cmd_X ;0140 f1 0b . .
279 defw cmd_Y ;0142 b2 0b . .
280 defw cmd_Z ;0144 ba 0e . .
281
282 l0146h:
283 ld a,'?' ;0146 3e 3f > ?
284 call outchar ;0148 cd 5d 02 . ] .
285 jp crlf ;014b c3 a3 02 . . .
286 get_line:
287 push hl ;014e e5 .
288 ld de,conbuf ;014f 11 6a 00 . j .
289 ld c,BDOS_CBUF ;0152 0e 0a . .
290 call ddtz_base ;0154 cd 00 00 . . .
291 call crlf ;0157 cd a3 02 . . .
292 ld de,conbuf+1 ;015a 11 6b 00 . k .
293 ld a,(de) ;015d 1a .
294 ld b,a ;015e 47 G
295 ld c,000h ;015f 0e 00 . .
296 inc b ;0161 04 .
297 l0162h:
298 inc de ;0162 13 .
299 dec b ;0163 05 .
300 jr z,l0194h ;0164 28 2e ( .
301 ld a,(de) ;0166 1a .
302 bit 0,c ;0167 cb 41 . A
303 call z,toupper ;0169 cc 9b 01 . . .
304 ld (de),a ;016c 12 .
305 cp '''' ;016d fe 27 . '
306 jr nz,l0162h ;016f 20 f1 .
307 push de ;0171 d5 .
308 dec de ;0172 1b .
309 ld a,(de) ;0173 1a .
310 cp '''' ;0174 fe 27 . '
311 jr z,l0190h ;0176 28 18 ( .
312 dec de ;0178 1b .
313 ld a,(de) ;0179 1a .
314 cp '^' ;017a fe 5e . ^
315 jr z,l0184h ;017c 28 06 ( .
316 dec de ;017e 1b .
317 ld a,(de) ;017f 1a .
318 cp '^' ;0180 fe 5e . ^
319 jr nz,l0190h ;0182 20 0c .
320 l0184h:
321 inc de ;0184 13 .
322 push bc ;0185 c5 .
323 call sub_0303h ;0186 cd 03 03 . . .
324 pop bc ;0189 c1 .
325 dec de ;018a 1b .
326 ld a,(de) ;018b 1a .
327 cp '''' ;018c fe 27 . '
328 jr z,l0191h ;018e 28 01 ( .
329 l0190h:
330 inc c ;0190 0c .
331 l0191h:
332 pop de ;0191 d1 .
333 jr l0162h ;0192 18 ce . .
334 l0194h:
335 xor a ;0194 af .
336 ld (de),a ;0195 12 .
337 ld de,conbuf+2 ;0196 11 6c 00 . l .
338 pop hl ;0199 e1 .
339 ret ;019a c9 .
340
341 toupper:
342 cp 'a' ;019b fe 61 . a
343 ret c ;019d d8 .
344 cp 'z'+1 ;019e fe 7b . {
345 ret nc ;01a0 d0 .
346 and 05fh ;01a1 e6 5f . _
347 ret ;01a3 c9 .
348
349 out.hl.@:
350 call out_hl ;01a4 cd 13 02 . . .
351 push de ;01a7 d5 .
352 push hl ;01a8 e5 .
353 ld de,(offs.@) ;01a9 ed 5b 64 00 . [ d .
354 ld a,d ;01ad 7a z
355 or e ;01ae b3 .
356 jr z,l01bfh ;01af 28 0e ( .
357 call outbl ;01b1 cd 9f 02 . . .
358 ld a,'@' ;01b4 3e 40 > @
359 call outchar ;01b6 cd 5d 02 . ] .
360 and a ;01b9 a7 .
361 sbc hl,de ;01ba ed 52 . R
362 call out_hl ;01bc cd 13 02 . . .
363 l01bfh:
364 pop hl ;01bf e1 .
365 pop de ;01c0 d1 .
366 ret ;01c1 c9 .
367 out.bin.w:
368 ld a,h ;01c2 7c |
369 call out.bin.b ;01c3 cd c7 01 . . .
370 ld a,l ;01c6 7d }
371 out.bin.b:
372 ld b,8 ;01c7 06 08 . .
373 l01c9h:
374 add a,a ;01c9 87 .
375 push af ;01ca f5 .
376 ld a,00 ;01cb 3e 00 > .
377 adc a,a ;01cd 8f .
378 call out_dgt ;01ce cd 21 02 . ! .
379 pop af ;01d1 f1 .
380 djnz l01c9h ;01d2 10 f5 . .
381 ld a,'"' ;01d4 3e 22 > "
382 jp outchar ;01d6 c3 5d 02 . ] .
383
384 sub_01d9h:
385 ld a,'-' ;01d9 3e 2d > -
386 call outchar ;01db cd 5d 02 . ] .
387 dec hl ;01de 2b +
388 jp cpl.hl ;01df c3 79 05 . y .
389
390 out_hl_dec_neg:
391 push hl ;01e2 e5 .
392 call sub_01d9h ;01e3 cd d9 01 . . .
393 defb 03eh ;01e6 3e >
394 out.hl.dec:
395 push hl ;01e7 e5 .
396 ld b,006h ;01e8 06 06 . .
397 call sub_01f9h ;01ea cd f9 01 . . .
398 pop hl ;01ed e1 .
399 ld a,'.' ;01ee 3e 2e > .
400 call outchar ;01f0 cd 5d 02 . ] .
401 l01f3h:
402 call outbl ;01f3 cd 9f 02 . . .
403 djnz l01f3h ;01f6 10 fb . .
404 ret ;01f8 c9 .
405 sub_01f9h:
406 dec b ;01f9 05 .
407 push de ;01fa d5 .
408 ld de,10 ;01fb 11 0a 00 . . .
409 call div_hl_de ;01fe cd 75 04 . u .
410 ld a,h ;0201 7c |
411 or l ;0202 b5 .
412 call nz,sub_01f9h ;0203 c4 f9 01 . . .
413 ld a,e ;0206 7b {
414 pop de ;0207 d1 .
415 jr out_dgt ;0208 18 17 . .
416
417 out_hl_neg:
418 push hl ;020a e5 .
419 call sub_01d9h ;020b cd d9 01 . . .
420 call out_hl ;020e cd 13 02 . . .
421 pop hl ;0211 e1 .
422 ret ;0212 c9 .
423
424 out_hl:
425 ld a,h ;0213 7c |
426 call out_hex ;0214 cd 18 02 . . .
427 ld a,l ;0217 7d }
428
429 out_hex:
430 push af ;0218 f5 .
431 rra ;0219 1f .
432 rra ;021a 1f .
433 rra ;021b 1f .
434 rra ;021c 1f .
435 call out_dgt ;021d cd 21 02 . ! .
436 pop af ;0220 f1 .
437
438 out_dgt:
439 and 0fh ;0221 e6 0f . .
440 cp 10 ;0223 fe 0a . .
441 jr c,l0229h ;0225 38 02 8 .
442 add a,007h ;0227 c6 07 . .
443 l0229h:
444 add a,'0' ;0229 c6 30 . 0
445 jr outchar ;022b 18 30 . 0
446 l022dh:
447 ld a,'-' ;022d 3e 2d > -
448 call outchar ;022f cd 5d 02 . ] .
449 ld a,040h ;0232 3e 40 > @
450 out.ascii:
451 ex af,af' ;0234 08 .
452 call outquote ;0235 cd 5b 02 . [ .
453 ex af,af' ;0238 08 .
454 push af ;0239 f5 .
455 res 7,a ;023a cb bf . .
456 cp ' ' ;023c fe 20 .
457 jr nc,l0242h ;023e 30 02 0 .
458 sub 0c0h ;0240 d6 c0 . .
459 l0242h:
460 call outchar ;0242 cd 5d 02 . ] .
461 push af ;0245 f5 .
462 cp '''' ;0246 fe 27 . '
463 call z,outchar ;0248 cc 5d 02 . ] .
464 pop af ;024b f1 .
465 ex af,af' ;024c 08 .
466 call outquote ;024d cd 5b 02 . [ .
467 pop af ;0250 f1 .
468 or a ;0251 b7 .
469 ld a,'.' ;0252 3e 2e > .
470 call m,outchar ;0254 fc 5d 02 . ] .
471 ex af,af' ;0257 08 .
472 jr c,l022dh ;0258 38 d3 8 .
473 ret ;025a c9 .
474 outquote:
475 ld a,'''' ;025b 3e 27 > '
476 outchar:
477 push hl ;025d e5 .
478 push de ;025e d5 .
479 push bc ;025f c5 .
480 push af ;0260 f5 .
481 and 07fh ;0261 e6 7f . \7f
482 ld e,a ;0263 5f _
483 ld c,BDOS_COUT ;0264 0e 02 . .
484 call ddtz_base ;0266 cd 00 00 . . .
485 ld hl,con_col ;0269 21 72 02 ! r .
486 inc (hl) ;026c 34 4
487 pop af ;026d f1 .
488 pop bc ;026e c1 .
489 pop de ;026f d1 .
490 pop hl ;0270 e1 .
491 ret ;0271 c9 .
492 con_col:
493 db 0 ;0272 00 .
494 inchar:
495 push hl ;0273 e5 .
496 push de ;0274 d5 .
497 push bc ;0275 c5 .
498 ld c,BDOS_CSTAT ;0276 0e 0b . .
499 call ddtz_base ;0278 cd 00 00 . . .
500 and a ;027b a7 .
501 jr z,l0284h ;027c 28 06 ( .
502 ld c,BDOS_CIN ;027e 0e 01 . .
503 call ddtz_base ;0280 cd 00 00 . . .
504 scf ;0283 37 7
505 l0284h:
506 pop bc ;0284 c1 .
507 pop de ;0285 d1 .
508 pop hl ;0286 e1 .
509 ret ;0287 c9 .
510 pstr:
511 ld c,000h ;0288 0e 00 . .
512 l028ah:
513 ld a,(hl) ;028a 7e ~
514 and a ;028b a7 .
515 ret z ;028c c8 .
516 call outchar ;028d cd 5d 02 . ] .
517 inc c ;0290 0c .
518 inc hl ;0291 23 #
519 and a ;0292 a7 .
520 ret m ;0293 f8 .
521 jr l028ah ;0294 18 f4 . .
522
523 outbl6:
524 call outbl2 ;0296 cd 9c 02 . . .
525 outbl4:
526 call outbl2 ;0299 cd 9c 02 . . .
527 outbl2:
528 call outbl ;029c cd 9f 02 . . .
529 outbl:
530 ld a,' ' ;029f 3e 20 >
531 jr outchar ;02a1 18 ba . .
532 crlf:
533 call inchar ;02a3 cd 73 02 . s .
534 ld a,CR ;02a6 3e 0d > .
535 call outchar ;02a8 cd 5d 02 . ] .
536 ld a,LF ;02ab 3e 0a > .
537 call outchar ;02ad cd 5d 02 . ] .
538 ld a,0 ;02b0 3e 00 > .
539 ld (con_col),a ;02b2 32 72 02 2 r .
540 jp c,mainloop ;02b5 da bd 00 . . .
541 ret ;02b8 c9 .
542 add_hl_a:
543 add a,l ;02b9 85 .
544 ld l,a ;02ba 6f o
545 ret nc ;02bb d0 .
546 inc h ;02bc 24 $
547 ret ;02bd c9 .
548
549 skipbl0:
550 inc de ;02be 13 .
551 skipbl:
552 ld a,(de) ;02bf 1a .
553 cp ' ' ;02c0 fe 20 .
554 jr z,skipbl0 ;02c2 28 fa ( .
555 cp TAB ;02c4 fe 09 . .
556 jr z,skipbl0 ;02c6 28 f6 ( .
557 or a ;02c8 b7 .
558 ret ;02c9 c9 .
559
560 next_arg:
561 call skipbl ;02ca cd bf 02 . . .
562 cp ',' ;02cd fe 2c . ,
563 ret nz ;02cf c0 .
564 inc de ;02d0 13 .
565 call skipbl ;02d1 cd bf 02 . . .
566 cp a ;02d4 bf .
567 ret ;02d5 c9 .
568
569 assert_eol:
570 call skipbl ;02d6 cd bf 02 . . .
571 ret z ;02d9 c8 .
572 to_error:
573 jp ERROR ;02da c3 07 01 . . .
574
575 chk_sp:
576 push hl ;02dd e5 .
577 push de ;02de d5 .
578 ld hl,0 ;02df 21 00 00 ! . .
579 add hl,sp ;02e2 39 9
580 ld de,stack-40 ;02e3 11 1e 00 . . .
581 call cp_hl_de ;02e6 cd ee 02 . . .
582 pop de ;02e9 d1 .
583 pop hl ;02ea e1 .
584 jr c,to_error ;02eb 38 ed 8 .
585 ret ;02ed c9 .
586
587 cp_hl_de:
588 and a ;02ee a7 .
589 sbc hl,de ;02ef ed 52 . R
590 add hl,de ;02f1 19 .
591 ret ;02f2 c9 .
592
593 lookupch:
594 ld b,0 ;02f3 06 00 . .
595 l02f5h:
596 ld a,(hl) ;02f5 7e ~
597 and a ;02f6 a7 .
598 ret z ;02f7 c8 .
599 ld a,(de) ;02f8 1a .
600 cp (hl) ;02f9 be .
601 jr z,l0300h ;02fa 28 04 ( .
602 inc hl ;02fc 23 #
603 inc b ;02fd 04 .
604 jr l02f5h ;02fe 18 f5 . .
605 l0300h:
606 scf ;0300 37 7
607 inc de ;0301 13 .
608 ret ;0302 c9 .
609
610 sub_0303h:
611 ld hl,b_0cc3_start ;0303 21 c3 0c ! . .
612 ld b,07fh ;0306 06 7f .
613 jr l030ch ;0308 18 02 . .
614 sub_030ah:
615 ld b,0ffh ;030a 06 ff . .
616 l030ch:
617 inc b ;030c 04 .
618 ld a,(hl) ;030d 7e ~
619 and a ;030e a7 .
620 ret z ;030f c8 .
621 call sub_031ch ;0310 cd 1c 03 . . .
622 jr nc,l030ch ;0313 30 f7 0 .
623 res 7,b ;0315 cb b8 . .
624 ret ;0317 c9 .
625
626 sub_0318h:
627 push bc ;0318 c5 .
628 res 7,b ;0319 cb b8 . .
629 defb 03eh ;031b 3e >
630 sub_031ch:
631 push bc ;031c c5 .
632 push de ;031d d5 .
633 l031eh:
634 ld a,(de) ;031e 1a .
635 xor (hl) ;031f ae .
636 and 07fh ;0320 e6 7f .
637 jr nz,l0336h ;0322 20 12 .
638 bit 7,(hl) ;0324 cb 7e . ~
639 inc hl ;0326 23 #
640 inc de ;0327 13 .
641 jr z,l031eh ;0328 28 f4 ( .
642 scf ;032a 37 7
643 bit 7,b ;032b cb 78 . x
644 call z,sub_060ch ;032d cc 0c 06 . . .
645 jr nc,l0339h ;0330 30 07 0 .
646 pop af ;0332 f1 .
647 scf ;0333 37 7
648 pop bc ;0334 c1 .
649 ret ;0335 c9 .
650 l0336h:
651 call sub_0345h ;0336 cd 45 03 . E .
652 l0339h:
653 pop de ;0339 d1 .
654 and a ;033a a7 .
655 pop bc ;033b c1 .
656 ret ;033c c9 .
657 sub_033dh:
658 inc b ;033d 04 .
659 l033eh:
660 dec b ;033e 05 .
661 ret z ;033f c8 .
662 call sub_0345h ;0340 cd 45 03 . E .
663 jr l033eh ;0343 18 f9 . .
664 sub_0345h:
665 ld a,(hl) ;0345 7e ~
666 and a ;0346 a7 .
667 ret z ;0347 c8 .
668 l0348h:
669 ld a,(hl) ;0348 7e ~
670 inc hl ;0349 23 #
671 and a ;034a a7 .
672 ret m ;034b f8 .
673 jr l0348h ;034c 18 fa . .
674 sub_034eh:
675 call get_arg_range ;034e cd 7d 03 . } .
676 push hl ;0351 e5 .
677 push bc ;0352 c5 .
678 call next_arg ;0353 cd ca 02 . . .
679 call sub_0363h ;0356 cd 63 03 . c .
680 ex de,hl ;0359 eb .
681 pop bc ;035a c1 .
682 pop hl ;035b e1 .
683 ret ;035c c9 .
684
685 sub_035dh:
686 call expr ;035d cd be 03 . . .
687 jr c,error0 ;0360 38 33 8 3
688 ret ;0362 c9 .
689
690 sub_0363h:
691 call sub_035dh ;0363 cd 5d 03 . ] .
692 l0366h:
693 jp assert_eol ;0366 c3 d6 02 . . .
694
695 get_lastarg_def:
696 call get_arg_def ;0369 cd 6e 03 . n .
697 jr l0366h ;036c 18 f8 . .
698 get_arg_def:
699 push hl ;036e e5 .
700 call expr ;036f cd be 03 . . .
701 jr c,l0375h ;0372 38 01 8 .
702 ex (sp),hl ;0374 e3 .
703 l0375h:
704 pop hl ;0375 e1 .
705 ret ;0376 c9 .
706 sub_0377h:
707 call b_037c_start ;0377 cd 7c 03 . | .
708 jr l0366h ;037a 18 ea . .
709
710 b_037c_start:
711 defb 0e6h ;037c e6 .
712 get_arg_range:
713 scf ;037d 37 7
714 ex af,af' ;037e 08 .
715 push bc ;037f c5 .
716 push hl ;0380 e5 .
717 call expr ;0381 cd be 03 . . .
718 jr nc,l038ch ;0384 30 06 0 .
719 ex af,af' ;0386 08 .
720 jr c,error0 ;0387 38 0c 8 .
721 ex af,af' ;0389 08 .
722 pop hl ;038a e1 .
723 defb 03eh ;038b 3e >
724 l038ch:
725 pop af ;038c f1 .
726 call sub_039ah ;038d cd 9a 03 . . .
727 jr nc,l0398h ;0390 30 06 0 .
728 ex af,af' ;0392 08 .
729 pop bc ;0393 c1 .
730 ret nc ;0394 d0 .
731 error0:
732 jp ERROR ;0395 c3 07 01 . . .
733 l0398h:
734 pop af ;0398 f1 .
735 ret ;0399 c9 .
736
737 sub_039ah:
738 call next_arg ;039a cd ca 02 . . .
739 cp 'S' ;039d fe 53 . S
740 jr nz,l03a2h ;039f 20 01 .
741 inc de ;03a1 13 .
742 l03a2h:
743 push hl ;03a2 e5 .
744 push af ;03a3 f5 .
745 call expr ;03a4 cd be 03 . . .
746 jr c,l03b8h ;03a7 38 0f 8 .
747 ld b,h ;03a9 44 D
748 ld c,l ;03aa 4d M
749 pop af ;03ab f1 .
750 pop hl ;03ac e1 .
751 jr z,l03b6h ;03ad 28 07 ( .
752 ld a,c ;03af 79 y
753 sub l ;03b0 95 .
754 ld c,a ;03b1 4f O
755 ld a,b ;03b2 78 x
756 sbc a,h ;03b3 9c .
757 ld b,a ;03b4 47 G
758 inc bc ;03b5 03 .
759 l03b6h:
760 and a ;03b6 a7 .
761 ret ;03b7 c9 .
762 l03b8h:
763 pop af ;03b8 f1 .
764 pop hl ;03b9 e1 .
765 jr z,error0 ;03ba 28 d9 ( .
766 scf ;03bc 37 7
767 ret ;03bd c9 .
768
769 expr:
770 call skipbl ;03be cd bf 02 . . .
771 expr1:
772 call do_subexpr ;03c1 cd 2f 04 . / .
773 ret c ;03c4 d8 .
774 call do_rel_op ;03c5 cd ef 03 . . .
775 ret nc ;03c8 d0 .
776 push bc ;03c9 c5 .
777 push hl ;03ca e5 .
778 call do_subexpr ;03cb cd 2f 04 . / .
779 jr c,error0 ;03ce 38 c5 8 .
780 ex de,hl ;03d0 eb .
781 ex (sp),hl ;03d1 e3 .
782 and a ;03d2 a7 .
783 sbc hl,de ;03d3 ed 52 . R
784 ld hl,0ffffh ;03d5 21 ff ff ! . .
785 pop de ;03d8 d1 .
786 ret ;03d9 c9 .
787
788 do_op_eq:
789 jr z,l03edh ;03da 28 11 ( .
790 jr l03ech ;03dc 18 0e . .
791 do_op_ne:
792 jr nz,l03edh ;03de 20 0d .
793 jr l03ech ;03e0 18 0a . .
794 do_op_le:
795 jr z,l03edh ;03e2 28 09 ( .
796 do_op_lt:
797 jr c,l03edh ;03e4 38 07 8 .
798 jr l03ech ;03e6 18 04 . .
799 do_op_gt:
800 jr z,l03ech ;03e8 28 02 ( .
801 do_op_ge:
802 jr nc,l03edh ;03ea 30 01 0 .
803 l03ech:
804 inc hl ;03ec 23 #
805 l03edh:
806 and a ;03ed a7 .
807 ret ;03ee c9 .
808 do_rel_op:
809 push hl ;03ef e5 .
810 ld hl,tab_eq_le_ge ;03f0 21 1f 04 ! . .
811 call lookupch ;03f3 cd f3 02 . . .
812 jr nc,l041dh ;03f6 30 25 0 %
813 ld a,b ;03f8 78 x
814 or a ;03f9 b7 .
815 jr z,l0411h ;03fa 28 15 ( .
816 ld a,(de) ;03fc 1a .
817 cp '=' ;03fd fe 3d . =
818 jr nz,l0406h ;03ff 20 05 .
819 inc de ;0401 13 .
820 inc b ;0402 04 .
821 inc b ;0403 04 .
822 jr l0411h ;0404 18 0b . .
823 l0406h:
824 bit 0,b ;0406 cb 40 . @
825 jr z,l0411h ;0408 28 07 ( .
826 cp '>' ;040a fe 3e . >
827 jr nz,l0411h ;040c 20 03 .
828 inc de ;040e 13 .
829 ld b,005h ;040f 06 05 . .
830 l0411h:
831 ld hl,tab_func_eqlege ;0411 21 23 04 ! # .
832 ld a,b ;0414 78 x
833 add a,a ;0415 87 .
834 call add_hl_a ;0416 cd b9 02 . . .
835 ld c,(hl) ;0419 4e N
836 inc hl ;041a 23 #
837 ld b,(hl) ;041b 46 F
838 scf ;041c 37 7
839 l041dh:
840 pop hl ;041d e1 .
841 ret ;041e c9 .
842
843 tab_eq_le_ge:
844 db '=<>',0
845
846 tab_func_eqlege:
847 defw do_op_eq ;0423 da 03 . .
848 defw do_op_lt ;0425 e4 03 . .
849 defw do_op_gt ;0427 e8 03 . .
850 defw do_op_le ;0429 e2 03 . .
851 defw do_op_ge ;042b ea 03 . .
852 defw do_op_ne ;042d de 03 . .
853
854 do_subexpr:
855 call do_factor ;042f cd e4 04 . . .
856 ret c ;0432 d8 .
857 l0433h:
858 call do_binary_op ;0433 cd ae 04 . . .
859 push hl ;0436 e5 .
860 push bc ;0437 c5 .
861 call do_factor ;0438 cd e4 04 . . .
862 pop bc ;043b c1 .
863 ex de,hl ;043c eb .
864 ex (sp),hl ;043d e3 .
865 jr nc,l0447h ;043e 30 07 0 .
866 pop de ;0440 d1 .
867 ld a,b ;0441 78 x
868 or c ;0442 b1 .
869 ret z ;0443 c8 .
870 jp ERROR ;0444 c3 07 01 . . .
871
872 l0447h:
873 ld a,b ;0447 78 x
874 or c ;0448 b1 .
875 push bc ;0449 c5 .
876 ret nz ;044a c0 .
877 pop bc ;044b c1 .
878
879 doop_add:
880 add hl,de ;044c 19 .
881 l044dh:
882 pop de ;044d d1 .
883 jr l0433h ;044e 18 e3 . .
884
885 doop_sub:
886 and a ;0450 a7 .
887 sbc hl,de ;0451 ed 52 . R
888 jr l044dh ;0453 18 f8 . .
889
890 doop_mlt:
891 push bc ;0455 c5 .
892 ld b,h ;0456 44 D
893 ld c,l ;0457 4d M
894 ld hl,0 ;0458 21 00 00 ! . .
895 ld a,010h ;045b 3e 10 > .
896 l045dh:
897 add hl,hl ;045d 29 )
898 ex de,hl ;045e eb .
899 add hl,hl ;045f 29 )
900 ex de,hl ;0460 eb .
901 jr nc,l0464h ;0461 30 01 0 .
902 add hl,bc ;0463 09 .
903 l0464h:
904 dec a ;0464 3d =
905 jr nz,l045dh ;0465 20 f6 .
906 pop bc ;0467 c1 .
907 jr l044dh ;0468 18 e3 . .
908
909 doop_div:
910 call div_hl_de ;046a cd 75 04 . u .
911 jr l044dh ;046d 18 de . .
912
913 doop_mod:
914 call div_hl_de ;046f cd 75 04 . u .
915 ex de,hl ;0472 eb .
916 jr l044dh ;0473 18 d8 . .
917
918 ; divide x/y
919 ; hl: x
920 ; de: y
921 ; return:
922 ; hl: q (x/y)
923 ; de: r (x%y)
924
925 div_hl_de:
926 push bc ;0475 c5 .
927 ex de,hl ;0476 eb .
928 ld b,h ;0477 44 D
929 ld c,l ;0478 4d M
930 ld hl,0 ;0479 21 00 00 ! . .
931 ld a,16 ;047c 3e 10 > .
932
933 ; de: x (x shifted out, q shifted in)
934 ; bc: y
935 ; hl: r (initially 0)
936
937 l047eh:
938 push af ;047e f5 .
939 add hl,hl ;047f 29 )
940 ex de,hl ;0480 eb .
941 xor a ;0481 af .
942 add hl,hl ;0482 29 )
943 ex de,hl ;0483 eb .
944 adc a,l ;0484 8d .
945 sub c ;0485 91 .
946 ld l,a ;0486 6f o
947 ld a,h ;0487 7c |
948 sbc a,b ;0488 98 .
949 ld h,a ;0489 67 g
950 inc de ;048a 13 .
951 jr nc,l048fh ;048b 30 02 0 .
952 add hl,bc ;048d 09 .
953 dec de ;048e 1b .
954 l048fh:
955 pop af ;048f f1 .
956 dec a ;0490 3d =
957 jr nz,l047eh ;0491 20 eb .
958 ex de,hl ;0493 eb .
959 pop bc ;0494 c1 .
960 ret ;0495 c9 .
961
962 doop_and:
963 ld a,h ;0496 7c |
964 and d ;0497 a2 .
965 ld h,a ;0498 67 g
966 ld a,l ;0499 7d }
967 and e ;049a a3 .
968 ld l,a ;049b 6f o
969 jr l044dh ;049c 18 af . .
970
971 doop_or:
972 ld a,h ;049e 7c |
973 or d ;049f b2 .
974 ld h,a ;04a0 67 g
975 ld a,l ;04a1 7d }
976 or e ;04a2 b3 .
977 ld l,a ;04a3 6f o
978 jr l044dh ;04a4 18 a7 . .
979
980 doop_xor:
981 ld a,h ;04a6 7c |
982 xor d ;04a7 aa .
983 ld h,a ;04a8 67 g
984 ld a,l ;04a9 7d }
985 xor e ;04aa ab .
986 ld l,a ;04ab 6f o
987 jr l044dh ;04ac 18 9f . .
988
989 do_binary_op:
990 push hl ;04ae e5 .
991 ld hl,tab_op_a ;04af 21 c2 04 ! . .
992 call lookupch ;04b2 cd f3 02 . . .
993 ld a,b ;04b5 78 x
994 ld hl,tblf_opa ;04b6 21 cb 04 ! . .
995 add a,a ;04b9 87 .
996 call add_hl_a ;04ba cd b9 02 . . .
997 ld c,(hl) ;04bd 4e N
998 inc hl ;04be 23 #
999 ld b,(hl) ;04bf 46 F
1000 pop hl ;04c0 e1 .
1001 ret ;04c1 c9 .
1002
1003 tab_op_a:
1004 DB '+-*/%&!#',0
1005
1006 tblf_opa:
1007 defw doop_add ;04cb 4c 04 L .
1008 defw doop_sub ;04cd 50 04 P .
1009 defw doop_mlt ;04cf 55 04 U .
1010 defw doop_div ;04d1 6a 04 j .
1011 defw doop_mod ;04d3 6f 04 o .
1012 defw doop_and ;04d5 96 04 . .
1013 defw doop_or ;04d7 9e 04 . .
1014 defw doop_xor ;04d9 a6 04 . .
1015 defw 0 ;04db 00 00 . .
1016
1017 fact_factor:
1018 call do_factor ;04dd cd e4 04 . . .
1019 ret nc ;04e0 d0 .
1020 jp ERROR ;04e1 c3 07 01 . . .
1021
1022 do_factor:
1023 call chk_sp ;04e4 cd dd 02 . . .
1024 call get.number ;04e7 cd aa 05 . . .
1025 ret nc ;04ea d0 .
1026 inc de ;04eb 13 .
1027 ld hl,ddtz_base-1 ;04ec 21 ff ff ! . .
1028 cp 'T' ;04ef fe 54 . T
1029 ret z ;04f1 c8 .
1030 ld hl,(high_load) ;04f2 2a 9c 11 * . .
1031 cp 'H' ;04f5 fe 48 . H
1032 ret z ;04f7 c8 .
1033 ld hl,(max_load) ;04f8 2a 9e 11 * . .
1034 cp 'M' ;04fb fe 4d . M
1035 ret z ;04fd c8 .
1036 ld hl,TPA ;04fe 21 00 01 ! . .
1037 cp 'L' ;0501 fe 4c . L
1038 ret z ;0503 c8 .
1039 ld hl,(offs.@) ;0504 2a 64 00 * d .
1040 cp '@' ;0507 fe 40 . @
1041 ret z ;0509 c8 .
1042 ld hl,(l0062h) ;050a 2a 62 00 * b .
1043 cp '$' ;050d fe 24 . $
1044 ret z ;050f c8 .
1045 cp '-' ;0510 fe 2d . -
1046 jr z,fact_factneg ;0512 28 61 ( a
1047 cp '~' ;0514 fe 7e . ~
1048 jr z,fact_factinv ;0516 28 68 ( h
1049 cp '+' ;0518 fe 2b . +
1050 jr z,fact_factor ;051a 28 c1 ( .
1051 cp '^' ;051c fe 5e . ^
1052 jr z,fact_reg.CPU ;051e 28 45 ( E
1053 cp 'Y' ;0520 fe 59 . Y
1054 jr z,fact_reg.Y ;0522 28 10 ( .
1055 cp '(' ;0524 fe 28 . (
1056 jr z,fact_mem ;0526 28 5d ( ]
1057 cp '[' ;0528 fe 5b . [
1058 jp z,expr_brckt ;052a ca 9d 05 . . .
1059 cp '''' ;052d fe 27 . '
1060 jr z,fact_factstring ;052f 28 17 ( .
1061 dec de ;0531 1b .
1062 scf ;0532 37 7
1063 ret ;0533 c9 .
1064
1065 fact_reg.Y:
1066 call get.decdigit ;0534 cd 1d 06 . . .
1067 jp c,ERROR ;0537 da 07 01 . . .
1068 inc de ;053a 13 .
1069 add a,a ;053b 87 .
1070 ld hl,reg_Y ;053c 21 9e 0b ! . .
1071 call add_hl_a ;053f cd b9 02 . . .
1072 ld a,(hl) ;0542 7e ~
1073 inc hl ;0543 23 #
1074 ld h,(hl) ;0544 66 f
1075 ld l,a ;0545 6f o
1076 and a ;0546 a7 .
1077 ret ;0547 c9 .
1078
1079 fact_factstring:
1080 ld hl,0 ;0548 21 00 00 ! . .
1081 l054bh:
1082 ld a,(de) ;054b 1a .
1083 cp '''' ;054c fe 27 . '
1084 jr z,l0557h ;054e 28 07 ( .
1085 and a ;0550 a7 .
1086 ret z ;0551 c8 .
1087 l0552h:
1088 ld h,l ;0552 65 e
1089 ld l,a ;0553 6f o
1090 inc de ;0554 13 .
1091 jr l054bh ;0555 18 f4 . .
1092 l0557h:
1093 inc de ;0557 13 .
1094 ld a,(de) ;0558 1a .
1095 cp '''' ;0559 fe 27 . '
1096 jr z,l0552h ;055b 28 f5 ( .
1097 sub '.' ;055d d6 2e . .
1098 or a ;055f b7 .
1099 ret nz ;0560 c0 .
1100 inc de ;0561 13 .
1101 set 7,l ;0562 cb fd . .
1102 ret ;0564 c9 .
1103
1104 fact_reg.CPU:
1105 call sub_0caeh ;0565 cd ae 0c . . .
1106 jr nc,error4 ;0568 30 3d 0 =
1107 ld a,(hl) ;056a 7e ~
1108 inc hl ;056b 23 #
1109 ld h,(hl) ;056c 66 f
1110 ld l,a ;056d 6f o
1111 and a ;056e a7 .
1112 bit 0,c ;056f cb 41 . A
1113 ret nz ;0571 c0 .
1114 ld h,000h ;0572 26 00 & .
1115 ret ;0574 c9 .
1116
1117 fact_factneg:
1118 call fact_factor ;0575 cd dd 04 . . .
1119 dec hl ;0578 2b +
1120 cpl.hl:
1121 ld a,h ;0579 7c |
1122 cpl ;057a 2f /
1123 ld h,a ;057b 67 g
1124 ld a,l ;057c 7d }
1125 cpl ;057d 2f /
1126 ld l,a ;057e 6f o
1127 ret ;057f c9 .
1128
1129 fact_factinv:
1130 call fact_factor ;0580 cd dd 04 . . .
1131 jr cpl.hl ;0583 18 f4 . .
1132
1133 fact_mem:
1134 call expr1 ;0585 cd c1 03 . . .
1135 jr c,error4 ;0588 38 1d 8 .
1136 ld a,(de) ;058a 1a .
1137 cp ')' ;058b fe 29 . )
1138 jr nz,error4 ;058d 20 18 .
1139 inc de ;058f 13 .
1140 ld a,(hl) ;0590 7e ~
1141 inc hl ;0591 23 #
1142 ld h,(hl) ;0592 66 f
1143 ld l,a ;0593 6f o
1144 ld a,(de) ;0594 1a .
1145 inc de ;0595 13 .
1146 cp '.' ;0596 fe 2e . .
1147 ret z ;0598 c8 .
1148 dec de ;0599 1b .
1149 xor a ;059a af .
1150 ld h,a ;059b 67 g
1151 ret ;059c c9 .
1152
1153 expr_brckt:
1154 call expr1 ;059d cd c1 03 . . .
1155 jr c,error4 ;05a0 38 05 8 .
1156 ld a,(de) ;05a2 1a .
1157 cp ']' ;05a3 fe 5d . ]
1158 inc de ;05a5 13 .
1159 ret z ;05a6 c8 .
1160 error4:
1161 jp ERROR ;05a7 c3 07 01 . . .
1162
1163 get.number:
1164 call get.hexdigit ;05aa cd 11 06 . . .
1165 ret c ;05ad d8 .
1166 push de ;05ae d5 .
1167 test_number:
1168 inc de ;05af 13 .
1169 call get.hexdigit ;05b0 cd 11 06 . . .
1170 jr nc,test_number ;05b3 30 fa 0 .
1171 pop de ;05b5 d1 .
1172 cp '.' ;05b6 fe 2e . .
1173 jr z,get_dec_number ;05b8 28 36 ( 6
1174 cp '"' ;05ba fe 22 . "
1175 jr z,get_bin_number ;05bc 28 17 ( .
1176 ld hl,0 ;05be 21 00 00 ! . .
1177 next_hexdigit:
1178 call get.hexdigit ;05c1 cd 11 06 . . .
1179 jr c,hexnum_done ;05c4 38 0a 8 .
1180 add hl,hl ;05c6 29 )
1181 add hl,hl ;05c7 29 )
1182 add hl,hl ;05c8 29 )
1183 add hl,hl ;05c9 29 )
1184 call add_hl_a ;05ca cd b9 02 . . .
1185 inc de ;05cd 13 .
1186 jr next_hexdigit ;05ce 18 f1 . .
1187
1188 hexnum_done:
1189 xor 'H' ;05d0 ee 48 . H
1190 ret nz ;05d2 c0 .
1191 inc de ;05d3 13 .
1192 ret ;05d4 c9 .
1193
1194 get_bin_number:
1195 ld hl,0 ;05d5 21 00 00 ! . .
1196 next_bindigit:
1197 call get.bindigit ;05d8 cd 22 06 . " .
1198 l05dbh:
1199 inc de ;05db 13 .
1200 jr c,l05e4h ;05dc 38 06 8 .
1201 add hl,hl ;05de 29 )
1202 call add_hl_a ;05df cd b9 02 . . .
1203 jr next_bindigit ;05e2 18 f4 . .
1204 l05e4h:
1205 cp '"' ;05e4 fe 22 . "
1206 jp nz,ERROR ;05e6 c2 07 01 . . .
1207 call get.bindigit ;05e9 cd 22 06 . " .
1208 jr nc,l05dbh ;05ec 30 ed 0 .
1209 or a ;05ee b7 .
1210 ret ;05ef c9 .
1211
1212 get_dec_number:
1213 ld hl,0 ;05f0 21 00 00 ! . .
1214 next_decdigit:
1215 call get.decdigit ;05f3 cd 1d 06 . . .
1216 inc de ;05f6 13 .
1217 jr c,decnum_done ;05f7 38 0d 8 .
1218 push bc ;05f9 c5 .
1219 add hl,hl ;05fa 29 )
1220 ld b,h ;05fb 44 D
1221 ld c,l ;05fc 4d M
1222 add hl,hl ;05fd 29 )
1223 add hl,hl ;05fe 29 )
1224 add hl,bc ;05ff 09 .
1225 pop bc ;0600 c1 .
1226 call add_hl_a ;0601 cd b9 02 . . .
1227 jr next_decdigit ;0604 18 ed . .
1228 decnum_done:
1229 cp '.' ;0606 fe 2e . .
1230 ret z ;0608 c8 .
1231 jp ERROR ;0609 c3 07 01 . . .
1232
1233 sub_060ch:
1234 ld a,(de) ;060c 1a .
1235 cp '[' ;060d fe 5b . [
1236 jr l0614h ;060f 18 03 . .
1237
1238 get.hexdigit:
1239 ld a,(de) ;0611 1a .
1240 hex_digit:
1241 cp 'F'+1 ;0612 fe 47 . G
1242 l0614h:
1243 ccf ;0614 3f ?
1244 ret c ;0615 d8 .
1245 cp 'A' ;0616 fe 41 . A
1246 jr c,l061eh ;0618 38 04 8 .
1247 sub 'A'-10 ;061a d6 37 . 7
1248 ret ;061c c9 .
1249
1250 get.decdigit:
1251 ld a,(de) ;061d 1a .
1252 l061eh:
1253 cp '9'+1 ;061e fe 3a . :
1254 jr l0625h ;0620 18 03 . .
1255
1256 get.bindigit:
1257 ld a,(de) ;0622 1a .
1258 cp '1'+1 ;0623 fe 32 . 2
1259 l0625h:
1260 ccf ;0625 3f ?
1261 ret c ;0626 d8 .
1262 cp '0' ;0627 fe 30 . 0
1263 ret c ;0629 d8 .
1264 sub '0' ;062a d6 30 . 0
1265 ret ;062c c9 .
1266
1267 prnt_cpustat0:
1268 call assert_eol ;062d cd d6 02 . . .
1269 prnt_cpustat:
1270 call prnt_f ;0630 cd 6e 06 . n .
1271 call outbl2 ;0633 cd 9c 02 . . .
1272 ld hl,b_06e9_start ;0636 21 e9 06 ! . .
1273 ld de,b_0709_start ;0639 11 09 07 . . .
1274 ld b,6 ;063c 06 06 . .
1275 l063eh:
1276 call prnt_regs ;063e cd b2 06 . . .
1277 djnz l063eh ;0641 10 fb . .
1278 push hl ;0643 e5 .
1279 push de ;0644 d5 .
1280 ld iy,(REG.PC) ;0645 fd 2a 60 00 . * ` .
1281 call sub_1965h ;0649 cd 65 19 . e .
1282 exx ;064c d9 .
1283 ex af,af' ;064d 08 .
1284 call crlf ;064e cd a3 02 . . .
1285 call prnt_f2 ;0651 cd 81 06 . . .
1286 call outbl2 ;0654 cd 9c 02 . . .
1287 pop de ;0657 d1 .
1288 pop hl ;0658 e1 .
1289 ld b,7 ;0659 06 07 . .
1290 l065bh:
1291 call prnt_regs ;065b cd b2 06 . . .
1292 djnz l065bh ;065e 10 fb . .
1293 exx ;0660 d9 .
1294 ex af,af' ;0661 08 .
1295 and a ;0662 a7 .
1296 jr z,l066bh ;0663 28 06 ( .
1297 call outbl6 ;0665 cd 96 02 . . .
1298 call prnt_offset ;0668 cd 49 19 . I .
1299 l066bh:
1300 jp crlf ;066b c3 a3 02 . . .
1301
1302 prnt_f:
1303 ld a,(reg.f) ;066e 3a 54 00 : T .
1304 call prnt_flags ;0671 cd 8a 06 . . .
1305 ld a,(reg.iff) ;0674 3a 5e 00 : ^ .
1306 cp 0f3h ;0677 fe f3 . .
1307 jp z,outbl ;0679 ca 9f 02 . . .
1308 ld a,'E' ;067c 3e 45 > E
1309 jp outchar ;067e c3 5d 02 . ] .
1310 prnt_f2:
1311 ld a,(reg.f2) ;0681 3a 4c 00 : L .
1312 call prnt_flags ;0684 cd 8a 06 . . .
1313 jp outbl ;0687 c3 9f 02 . . .
1314 prnt_flags:
1315 ld b,a ;068a 47 G
1316 ld a,'S' ;068b 3e 53 > S
1317 call sub_06aah ;068d cd aa 06 . . .
1318 ld a,'Z' ;0690 3e 5a > Z
1319 call sub_06aah ;0692 cd aa 06 . . .
1320 rl b ;0695 cb 10 . .
1321 ld a,'H' ;0697 3e 48 > H
1322 call sub_06aah ;0699 cd aa 06 . . .
1323 rl b ;069c cb 10 . .
1324 ld a,'V' ;069e 3e 56 > V
1325 call sub_06aah ;06a0 cd aa 06 . . .
1326 ld a,'N' ;06a3 3e 4e > N
1327 call sub_06aah ;06a5 cd aa 06 . . .
1328 ld a,'C' ;06a8 3e 43 > C
1329 sub_06aah:
1330 rl b ;06aa cb 10 . .
1331 jp c,outchar ;06ac da 5d 02 . ] .
1332 jp outbl ;06af c3 9f 02 . . .
1333 prnt_regs:
1334 push bc ;06b2 c5 .
1335 push de ;06b3 d5 .
1336 call pstr ;06b4 cd 88 02 . . .
1337 ld a,'=' ;06b7 3e 3d > =
1338 call outchar ;06b9 cd 5d 02 . ] .
1339 ex (sp),hl ;06bc e3 .
1340 ld e,(hl) ;06bd 5e ^
1341 inc hl ;06be 23 #
1342 ld d,(hl) ;06bf 56 V
1343 inc hl ;06c0 23 #
1344 ld a,(hl) ;06c1 7e ~
1345 inc hl ;06c2 23 #
1346 push hl ;06c3 e5 .
1347 and a ;06c4 a7 .
1348 jr z,l06deh ;06c5 28 17 ( .
1349 push af ;06c7 f5 .
1350 ld a,(de) ;06c8 1a .
1351 ld l,a ;06c9 6f o
1352 inc de ;06ca 13 .
1353 ld a,(de) ;06cb 1a .
1354 ld h,a ;06cc 67 g
1355 pop af ;06cd f1 .
1356 dec a ;06ce 3d =
1357 jr z,l06d9h ;06cf 28 08 ( .
1358 call out.hl.@ ;06d1 cd a4 01 . . .
1359 call z,outbl6 ;06d4 cc 96 02 . . .
1360 jr l06e2h ;06d7 18 09 . .
1361 l06d9h:
1362 call out_hl ;06d9 cd 13 02 . . .
1363 jr l06e2h ;06dc 18 04 . .
1364 l06deh:
1365 ld a,(de) ;06de 1a .
1366 call out_hex ;06df cd 18 02 . . .
1367 l06e2h:
1368 call outbl ;06e2 cd 9f 02 . . .
1369 pop de ;06e5 d1 .
1370 pop hl ;06e6 e1 .
1371 pop bc ;06e7 c1 .
1372 ret ;06e8 c9 .
1373
1374 b_06e9_start:
1375 DC 'A '
1376 DC 'BC '
1377 DC 'DE '
1378 DC 'HL '
1379 DC 'SP'
1380 DC 'PC'
1381 DC 'A'''
1382 DC 'BC'''
1383 DC 'DE'''
1384 DC 'HL'''
1385 DC 'IX'
1386 DC 'IY'
1387 DC 'I'
1388 DB 0
1389
1390 b_0709_start:
1391 defw reg.a ;0709 55 00 U .
1392 defb 000h ;070b 00 .
1393 defw reg.c ;070c 56 00 V .
1394 defb 001h ;070e 01 .
1395 defw reg.e ;070f 58 00 X .
1396 defb 001h ;0711 01 .
1397 defw reg.l ;0712 5a 00 Z .
1398 defb 001h ;0714 01 .
1399 defw reg_sp ;0715 5c 00 \ .
1400 defb 001h ;0717 01 .
1401 defw REG.PC ;0718 60 00 ` .
1402 defb 002h ;071a 02 .
1403 defw reg.a2 ;071b 4d 00 M .
1404 defb 000h ;071d 00 .
1405 defw reg.c2 ;071e 4a 00 J .
1406 defb 001h ;0720 01 .
1407 defw reg.e2 ;0721 48 00 H .
1408 defb 001h ;0723 01 .
1409 defw reg.l2 ;0724 46 00 F .
1410 defb 001h ;0726 01 .
1411 defw reg.ix ;0727 52 00 R .
1412 defb 001h ;0729 01 .
1413 defw reg.iy ;072a 50 00 P .
1414 defb 001h ;072c 01 .
1415 defw reg.i ;072d 4f 00 O .
1416 defb 000h ;072f 00 .
1417 defb 000h ;0730 00 .
1418
1419 cmd_G:
1420 sub a ;0731 97 .
1421 ld (trace_call_flag),a ;0732 32 e3 21 2 . !
1422 ld (l0941h),a ;0735 32 41 09 2 A .
1423 call expr ;0738 cd be 03 . . .
1424 jr c,l0740h ;073b 38 03 8 .
1425 ld (REG.PC),hl ;073d 22 60 00 " ` .
1426 l0740h:
1427 call skipbl ;0740 cd bf 02 . . .
1428 jp z,user_go ;0743 ca 25 0a . % .
1429 cp ';' ;0746 fe 3b . ;
1430 jp nz,ERROR ;0748 c2 07 01 . . .
1431 inc de ;074b 13 .
1432 ld a,002h ;074c 3e 02 > .
1433 call bp_enter ;074e cd 10 08 . . .
1434 jp user_go ;0751 c3 25 0a . % .
1435
1436 bp_clr_temporary:
1437 ld b,BP_CNT ;0754 06 0c . .
1438 ld ix,bp_tab ;0756 dd 21 b8 0a . ! . .
1439 l075ah:
1440 ld a,(ix+000h) ;075a dd 7e 00 . ~ .
1441 and 0f1h ;075d e6 f1 . .
1442 ld (ix+000h),a ;075f dd 77 00 . w .
1443 call bp_clr_condition ;0762 cd 5f 0a . _ .
1444 ld de,BP_SIZE ;0765 11 08 00 . . .
1445 add ix,de ;0768 dd 19 . .
1446 djnz l075ah ;076a 10 ee . .
1447 ret ;076c c9 .
1448
1449 cmd_B:
1450 call skipbl ;076d cd bf 02 . . .
1451 jr z,l07b7h ;0770 28 45 ( E
1452 inc de ;0772 13 .
1453 cp 'X' ;0773 fe 58 . X
1454 jr z,l077dh ;0775 28 06 ( .
1455 dec de ;0777 1b .
1456 ld a,001h ;0778 3e 01 > .
1457 jp bp_enter ;077a c3 10 08 . . .
1458 l077dh:
1459 call skipbl ;077d cd bf 02 . . .
1460 jr z,bp_clr_all ;0780 28 10 ( .
1461 l0782h:
1462 call expr ;0782 cd be 03 . . .
1463 jp c,assert_eol ;0785 da d6 02 . . .
1464 push de ;0788 d5 .
1465 call bp_clr ;0789 cd 93 07 . . .
1466 pop de ;078c d1 .
1467 call next_arg ;078d cd ca 02 . . .
1468 jr l0782h ;0790 18 f0 . .
1469
1470 bp_clr_all:
1471 scf ;0792 37 7
1472 bp_clr:
1473 ld b,BP_CNT ;0793 06 0c . .
1474 ld ix,bp_tab ;0795 dd 21 b8 0a . ! . .
1475 l0799h:
1476 push af ;0799 f5 .
1477 jr c,l07a7h ;079a 38 0b 8 .
1478 ld e,(ix+002h) ;079c dd 5e 02 . ^ .
1479 ld d,(ix+003h) ;079f dd 56 03 . V .
1480 call cp_hl_de ;07a2 cd ee 02 . . .
1481 jr nz,l07aeh ;07a5 20 07 .
1482 l07a7h:
1483 ld (ix+000h),000h ;07a7 dd 36 00 00 . 6 . .
1484 call bp_clr_condition ;07ab cd 5f 0a . _ .
1485 l07aeh:
1486 ld de,BP_SIZE ;07ae 11 08 00 . . .
1487 add ix,de ;07b1 dd 19 . .
1488 pop af ;07b3 f1 .
1489 djnz l0799h ;07b4 10 e3 . .
1490 ret ;07b6 c9 .
1491
1492 l07b7h:
1493 ld b,BP_CNT ;07b7 06 0c . .
1494 ld ix,bp_tab ;07b9 dd 21 b8 0a . ! . .
1495 l07bdh:
1496 bit 0,(ix+000h) ;07bd dd cb 00 46 . . . F
1497 jr z,l0808h ;07c1 28 45 ( E
1498 ld a,'R' ;07c3 3e 52 > R
1499 bit 4,(ix+000h) ;07c5 dd cb 00 66 . . . f
1500 jr nz,l07cdh ;07c9 20 02 .
1501 ld a,' ' ;07cb 3e 20 >
1502 l07cdh:
1503 call outchar ;07cd cd 5d 02 . ] .
1504 call outbl ;07d0 cd 9f 02 . . .
1505 ld l,(ix+002h) ;07d3 dd 6e 02 . n .
1506 ld h,(ix+003h) ;07d6 dd 66 03 . f .
1507 call out.hl.@ ;07d9 cd a4 01 . . .
1508 call outbl2 ;07dc cd 9c 02 . . .
1509 ld a,':' ;07df 3e 3a > :
1510 call outchar ;07e1 cd 5d 02 . ] .
1511 ld l,(ix+004h) ;07e4 dd 6e 04 . n .
1512 ld h,(ix+005h) ;07e7 dd 66 05 . f .
1513 call out_hl ;07ea cd 13 02 . . .
1514 ld l,(ix+006h) ;07ed dd 6e 06 . n .
1515 ld h,(ix+007h) ;07f0 dd 66 07 . f .
1516 ld a,h ;07f3 7c |
1517 or l ;07f4 b5 .
1518 jr z,l0805h ;07f5 28 0e ( .
1519 call outbl4 ;07f7 cd 99 02 . . .
1520 ld a,'I' ;07fa 3e 49 > I
1521 call outchar ;07fc cd 5d 02 . ] .
1522 call outbl2 ;07ff cd 9c 02 . . .
1523 call pstr ;0802 cd 88 02 . . .
1524 l0805h:
1525 call crlf ;0805 cd a3 02 . . .
1526 l0808h:
1527 ld de,BP_SIZE ;0808 11 08 00 . . .
1528 add ix,de ;080b dd 19 . .
1529 djnz l07bdh ;080d 10 ae . .
1530 ret ;080f c9 .
1531
1532 ; Add break points to list
1533 ; A = 1 Permanent (B command)
1534 ; A = 2 Temporary (G command)
1535
1536 bp_enter:
1537 ld b,a ;0810 47 G
1538 call skipbl ;0811 cd bf 02 . . .
1539 ret z ;0814 c8 .
1540 cp 'R' ;0815 fe 52 . R
1541 jr nz,l081ch ;0817 20 03 .
1542 inc de ;0819 13 .
1543 set 4,b ;081a cb e0 . .
1544 l081ch:
1545 push bc ;081c c5 .
1546 call expr ;081d cd be 03 . . .
1547 jp c,ERROR ;0820 da 07 01 . . .
1548 pop bc ;0823 c1 .
1549 bit 0,b ;0824 cb 40 . @
1550 push bc ;0826 c5 .
1551 push de ;0827 d5 .
1552 push hl ;0828 e5 .
1553 call nz,bp_clr ;0829 c4 93 07 . . .
1554 pop hl ;082c e1 .
1555 call bp_get_freeslot ;082d cd 54 08 . T .
1556 pop de ;0830 d1 .
1557 ld (ix+002h),l ;0831 dd 75 02 . u .
1558 ld (ix+003h),h ;0834 dd 74 03 . t .
1559 call bp_get_count ;0837 cd 6c 08 . l .
1560 ld (ix+004h),l ;083a dd 75 04 . u .
1561 ld (ix+005h),h ;083d dd 74 05 . t .
1562 call bp_get_condition ;0840 cd 7d 08 . } .
1563 ld (ix+006h),l ;0843 dd 75 06 . u .
1564 ld (ix+007h),h ;0846 dd 74 07 . t .
1565 call next_arg ;0849 cd ca 02 . . .
1566 pop af ;084c f1 .
1567 ld (ix+000h),a ;084d dd 77 00 . w .
1568 and 00fh ;0850 e6 0f . .
1569 jr bp_enter ;0852 18 bc . .
1570
1571 bp_get_freeslot:
1572 ld b,BP_CNT ;0854 06 0c . .
1573 ld ix,bp_tab ;0856 dd 21 b8 0a . ! . .
1574 l085ah:
1575 ld a,(ix+000h) ;085a dd 7e 00 . ~ .
1576 and 00fh ;085d e6 0f . .
1577 ret z ;085f c8 .
1578 push bc ;0860 c5 .
1579 ld bc,BP_SIZE ;0861 01 08 00 . . .
1580 add ix,bc ;0864 dd 09 . .
1581 pop bc ;0866 c1 .
1582 djnz l085ah ;0867 10 f1 . .
1583 jp ERROR ;0869 c3 07 01 . . .
1584
1585 bp_get_count:
1586 call skipbl ;086c cd bf 02 . . .
1587 ld hl,1 ;086f 21 01 00 ! . .
1588 cp ':' ;0872 fe 3a . :
1589 ret nz ;0874 c0 .
1590 inc de ;0875 13 .
1591 call expr ;0876 cd be 03 . . .
1592 jp c,ERROR ;0879 da 07 01 . . .
1593 ret ;087c c9 .
1594
1595 bp_get_condition:
1596 call skipbl ;087d cd bf 02 . . .
1597 cp 'I' ;0880 fe 49 . I
1598 ld hl,0 ;0882 21 00 00 ! . .
1599 ret nz ;0885 c0 .
1600 inc de ;0886 13 .
1601 call skipbl ;0887 cd bf 02 . . .
1602 push de ;088a d5 .
1603 call expr ;088b cd be 03 . . .
1604 jp c,ERROR ;088e da 07 01 . . .
1605 ex de,hl ;0891 eb .
1606 pop de ;0892 d1 .
1607 push de ;0893 d5 .
1608 sbc hl,de ;0894 ed 52 . R
1609 ld b,h ;0896 44 D
1610 ld c,l ;0897 4d M
1611 ld hl,(expr_p1) ;0898 2a 18 0b * . .
1612 push hl ;089b e5 .
1613 add hl,bc ;089c 09 .
1614 ld de,expr_bufe ;089d 11 9c 0b . . .
1615 call cp_hl_de ;08a0 cd ee 02 . . .
1616 jp nc,ERROR ;08a3 d2 07 01 . . .
1617 pop hl ;08a6 e1 .
1618 ld (expr_p2),hl ;08a7 22 1a 0b " . .
1619 pop de ;08aa d1 .
1620 ex de,hl ;08ab eb .
1621 ldir ;08ac ed b0 . .
1622 xor a ;08ae af .
1623 ld (de),a ;08af 12 .
1624 inc de ;08b0 13 .
1625 ex de,hl ;08b1 eb .
1626 ld (expr_p1),hl ;08b2 22 18 0b " . .
1627 ld hl,(expr_p2) ;08b5 2a 1a 0b * . .
1628 ret ;08b8 c9 .
1629
1630 bpddtz:
1631 ld (reg.l),hl ;08b9 22 5a 00 " Z .
1632 pop hl ;08bc e1 .
1633 dec hl ;08bd 2b +
1634 ld (REG.PC),hl ;08be 22 60 00 " ` .
1635 ld (reg_sp),sp ;08c1 ed 73 5c 00 . s \ .
1636 ld sp,reg.l ;08c5 31 5a 00 1 Z .
1637 push de ;08c8 d5 .
1638 push bc ;08c9 c5 .
1639 push af ;08ca f5 .
1640 push ix ;08cb dd e5 . .
1641 push iy ;08cd fd e5 . .
1642 ld a,i ;08cf ed 57 . W
1643 call sub_0004h ;08d1 cd 04 00 . . .
1644 ld h,a ;08d4 67 g
1645 ld l,000h ;08d5 2e 00 . .
1646 push hl ;08d7 e5 .
1647 ld a,0f3h ;08d8 3e f3 > .
1648 jp po,l08dfh ;08da e2 df 08 . . .
1649 ld a,0fbh ;08dd 3e fb > .
1650 l08dfh:
1651 ld (reg.iff),a ;08df 32 5e 00 2 ^ .
1652 ex af,af' ;08e2 08 .
1653 push af ;08e3 f5 .
1654 exx ;08e4 d9 .
1655 push bc ;08e5 c5 .
1656 push de ;08e6 d5 .
1657 push hl ;08e7 e5 .
1658 call sub_097ah ;08e8 cd 7a 09 . z .
1659 ld a,(b_21e2_start) ;08eb 3a e2 21 : . !
1660 dec a ;08ee 3d =
1661 jr z,l090bh ;08ef 28 1a ( .
1662 call inchar ;08f1 cd 73 02 . s .
1663 jr c,l0902h ;08f4 38 0c 8 .
1664 call sub_0913h ;08f6 cd 13 09 . . .
1665 and a ;08f9 a7 .
1666 jp z,user_go ;08fa ca 25 0a . % .
1667 and 083h ;08fd e6 83 . .
1668 jp z,l2151h ;08ff ca 51 21 . Q !
1669 l0902h:
1670 call bp_clr_temporary ;0902 cd 54 07 . T .
1671 call prnt_cpustat ;0905 cd 30 06 . 0 .
1672 jp mainloop ;0908 c3 bd 00 . . .
1673
1674 l090bh:
1675 ld (b_21e2_start),a ;090b 32 e2 21 2 . !
1676 ld c,007h ;090e 0e 07 . .
1677 jp l0a41h ;0910 c3 41 0a . A .
1678
1679 sub_0913h:
1680 ld a,080h ;0913 3e 80 > .
1681 ex af,af' ;0915 08 .
1682 sub a ;0916 97 .
1683 ld (l0941h),a ;0917 32 41 09 2 A .
1684 ld b,BP_CNT ;091a 06 0c . .
1685 ld ix,bp_tab ;091c dd 21 b8 0a . ! . .
1686 l0920h:
1687 ld a,(ix+000h) ;0920 dd 7e 00 . ~ .
1688 and 007h ;0923 e6 07 . .
1689 jr z,l0938h ;0925 28 11 ( .
1690 ld e,(ix+002h) ;0927 dd 5e 02 . ^ .
1691 ld d,(ix+003h) ;092a dd 56 03 . V .
1692 ld hl,(REG.PC) ;092d 2a 60 00 * ` .
1693 call cp_hl_de ;0930 cd ee 02 . . .
1694 push bc ;0933 c5 .
1695 call z,sub_0942h ;0934 cc 42 09 . B .
1696 pop bc ;0937 c1 .
1697 l0938h:
1698 ld de,BP_SIZE ;0938 11 08 00 . . .
1699 add ix,de ;093b dd 19 . .
1700 djnz l0920h ;093d 10 e1 . .
1701 ex af,af' ;093f 08 .
1702 ret ;0940 c9 .
1703
1704 l0941h:
1705 db 0 ;0941 00 .
1706
1707 sub_0942h:
1708 ex af,af' ;0942 08 .
1709 res 7,a ;0943 cb bf . .
1710 ex af,af' ;0945 08 .
1711 ld e,(ix+006h) ;0946 dd 5e 06 . ^ .
1712 ld d,(ix+007h) ;0949 dd 56 07 . V .
1713 ld a,d ;094c 7a z
1714 or e ;094d b3 .
1715 ld hl,0ffffh ;094e 21 ff ff ! . .
1716 call nz,expr ;0951 c4 be 03 . . .
1717 ld a,h ;0954 7c |
1718 or l ;0955 b5 .
1719 jr z,l0969h ;0956 28 11 ( .
1720 ld e,(ix+004h) ;0958 dd 5e 04 . ^ .
1721 ld d,(ix+005h) ;095b dd 56 05 . V .
1722 dec de ;095e 1b .
1723 ld a,d ;095f 7a z
1724 or e ;0960 b3 .
1725 jr z,l0974h ;0961 28 11 ( .
1726 ld (ix+004h),e ;0963 dd 73 04 . s .
1727 ld (ix+005h),d ;0966 dd 72 05 . r .
1728 l0969h:
1729 bit 4,(ix+000h) ;0969 dd cb 00 66 . . . f
1730 ret z ;096d c8 .
1731 ld a,001h ;096e 3e 01 > .
1732 ld (l0941h),a ;0970 32 41 09 2 A .
1733 ret ;0973 c9 .
1734 l0974h:
1735 ex af,af' ;0974 08 .
1736 or (ix+000h) ;0975 dd b6 00 . . .
1737 ex af,af' ;0978 08 .
1738 ret ;0979 c9 .
1739
1740 sub_097ah:
1741 ld b,BP_CNT ;097a 06 0c . .
1742 ld ix,bp_tab ;097c dd 21 b8 0a . ! . .
1743 l0980h:
1744 bit 5,(ix+000h) ;0980 dd cb 00 6e . . . n
1745 res 5,(ix+000h) ;0984 dd cb 00 ae . . . .
1746 jr z,l099ah ;0988 28 10 ( .
1747 ld l,(ix+002h) ;098a dd 6e 02 . n .
1748 ld h,(ix+003h) ;098d dd 66 03 . f .
1749 ld a,(l0003h) ;0990 3a 03 00 : . .
1750 cp (hl) ;0993 be .
1751 jr nz,l099ah ;0994 20 04 .
1752 ld a,(ix+001h) ;0996 dd 7e 01 . ~ .
1753 ld (hl),a ;0999 77 w
1754 l099ah:
1755 res 3,(ix+000h) ;099a dd cb 00 9e . . . .
1756 ld de,BP_SIZE ;099e 11 08 00 . . .
1757 add ix,de ;09a1 dd 19 . .
1758 djnz l0980h ;09a3 10 db . .
1759 ret ;09a5 c9 .
1760
1761 sub_09a6h:
1762 ld b,BP_CNT ;09a6 06 0c . .
1763 ld ix,bp_tab ;09a8 dd 21 b8 0a . ! . .
1764 l09ach:
1765 ld a,(ix+000h) ;09ac dd 7e 00 . ~ .
1766 and 003h ;09af e6 03 . .
1767 jr z,l09c0h ;09b1 28 0d ( .
1768 ld e,(ix+002h) ;09b3 dd 5e 02 . ^ .
1769 ld d,(ix+003h) ;09b6 dd 56 03 . V .
1770 ld hl,(REG.PC) ;09b9 2a 60 00 * ` .
1771 call cp_hl_de ;09bc cd ee 02 . . .
1772 ret z ;09bf c8 .
1773 l09c0h:
1774 ld de,BP_SIZE ;09c0 11 08 00 . . .
1775 add ix,de ;09c3 dd 19 . .
1776 djnz l09ach ;09c5 10 e5 . .
1777 sub a ;09c7 97 .
1778 inc a ;09c8 3c <
1779 ret ;09c9 c9 .
1780
1781 sub_09cah:
1782 call bp_get_freeslot ;09ca cd 54 08 . T .
1783 ld (ix+004h),001h ;09cd dd 36 04 01 . 6 . .
1784 ld (ix+005h),000h ;09d1 dd 36 05 00 . 6 . .
1785 ld (ix+002h),l ;09d5 dd 75 02 . u .
1786 ld (ix+003h),h ;09d8 dd 74 03 . t .
1787 ld (ix+006h),000h ;09db dd 36 06 00 . 6 . .
1788 ld (ix+007h),000h ;09df dd 36 07 00 . 6 . .
1789 ld a,(b_21e2_start) ;09e3 3a e2 21 : . !
1790 and a ;09e6 a7 .
1791 ld a,008h ;09e7 3e 08 > .
1792 jr nz,l09edh ;09e9 20 02 .
1793 ld a,004h ;09eb 3e 04 > .
1794 l09edh:
1795 ld (ix+000h),a ;09ed dd 77 00 . w .
1796 ret ;09f0 c9 .
1797
1798 sub_09f1h:
1799 ld b,BP_CNT ;09f1 06 0c . .
1800 ld ix,bp_tab ;09f3 dd 21 b8 0a . ! . .
1801 l09f7h:
1802 ld a,(ix+000h) ;09f7 dd 7e 00 . ~ .
1803 and c ;09fa a1 .
1804 jr z,l0a1dh ;09fb 28 20 (
1805 set 5,(ix+000h) ;09fd dd cb 00 ee . . . .
1806 ld l,(ix+002h) ;0a01 dd 6e 02 . n .
1807 ld h,(ix+003h) ;0a04 dd 66 03 . f .
1808 ld a,(hl) ;0a07 7e ~
1809 ld (ix+001h),a ;0a08 dd 77 01 . w .
1810 ld a,(l0003h) ;0a0b 3a 03 00 : . .
1811 ld (hl),a ;0a0e 77 w
1812 and 038h ;0a0f e6 38 . 8
1813 ld h,000h ;0a11 26 00 & .
1814 ld l,a ;0a13 6f o
1815 ld (hl),0c3h ;0a14 36 c3 6 .
1816 inc hl ;0a16 23 #
1817 ld de,bpddtz ;0a17 11 b9 08 . . .
1818 ld (hl),e ;0a1a 73 s
1819 inc hl ;0a1b 23 #
1820 ld (hl),d ;0a1c 72 r
1821 l0a1dh:
1822 ld de,BP_SIZE ;0a1d 11 08 00 . . .
1823 add ix,de ;0a20 dd 19 . .
1824 djnz l09f7h ;0a22 10 d3 . .
1825 ret ;0a24 c9 .
1826
1827 user_go:
1828 sub a ;0a25 97 .
1829 ld (b_21e2_start),a ;0a26 32 e2 21 2 . !
1830 ld a,(l0941h) ;0a29 3a 41 09 : A .
1831 and a ;0a2c a7 .
1832 call nz,prnt_cpustat ;0a2d c4 30 06 . 0 .
1833 call sub_09a6h ;0a30 cd a6 09 . . .
1834 ld c,007h ;0a33 0e 07 . .
1835 jr nz,l0a41h ;0a35 20 0a .
1836 ld a,001h ;0a37 3e 01 > .
1837 ld (b_21e2_start),a ;0a39 32 e2 21 2 . !
1838 call sub_1ffeh ;0a3c cd fe 1f . . .
1839 ld c,008h ;0a3f 0e 08 . .
1840 l0a41h:
1841 call sub_09f1h ;0a41 cd f1 09 . . .
1842 ld sp,reg.l2 ;0a44 31 46 00 1 F .
1843 pop hl ;0a47 e1 .
1844 pop de ;0a48 d1 .
1845 pop bc ;0a49 c1 .
1846 pop af ;0a4a f1 .
1847 exx ;0a4b d9 .
1848 ex af,af' ;0a4c 08 .
1849 pop af ;0a4d f1 .
1850 ld i,a ;0a4e ed 47 . G
1851 pop iy ;0a50 fd e1 . .
1852 pop ix ;0a52 dd e1 . .
1853 pop af ;0a54 f1 .
1854 pop bc ;0a55 c1 .
1855 pop de ;0a56 d1 .
1856 pop hl ;0a57 e1 .
1857 ld sp,(reg_sp) ;0a58 ed 7b 5c 00 . { \ .
1858 jp reg.iff ;0a5c c3 5e 00 . ^ .
1859
1860 bp_clr_condition:
1861 ld a,(ix+000h) ;0a5f dd 7e 00 . ~ .
1862 and 003h ;0a62 e6 03 . .
1863 ret nz ;0a64 c0 .
1864 ld e,(ix+006h) ;0a65 dd 5e 06 . ^ .
1865 ld d,(ix+007h) ;0a68 dd 56 07 . V .
1866 ld a,d ;0a6b 7a z
1867 or e ;0a6c b3 .
1868 ret z ;0a6d c8 .
1869 push bc ;0a6e c5 .
1870 ld h,d ;0a6f 62 b
1871 ld l,e ;0a70 6b k
1872 sub a ;0a71 97 .
1873 ld (ix+006h),a ;0a72 dd 77 06 . w .
1874 ld (ix+007h),a ;0a75 dd 77 07 . w .
1875 ld bc,0ffffh ;0a78 01 ff ff . . .
1876 cpir ;0a7b ed b1 . .
1877 l0a7dh:
1878 push de ;0a7d d5 .
1879 ld de,(expr_p1) ;0a7e ed 5b 18 0b . [ . .
1880 call cp_hl_de ;0a82 cd ee 02 . . .
1881 pop de ;0a85 d1 .
1882 jr nc,l0a93h ;0a86 30 0b 0 .
1883 call sub_0a99h ;0a88 cd 99 0a . . .
1884 l0a8bh:
1885 ld a,(hl) ;0a8b 7e ~
1886 ldi ;0a8c ed a0 . .
1887 and a ;0a8e a7 .
1888 jr nz,l0a8bh ;0a8f 20 fa .
1889 jr l0a7dh ;0a91 18 ea . .
1890 l0a93h:
1891 ld (expr_p1),de ;0a93 ed 53 18 0b . S . .
1892 pop bc ;0a97 c1 .
1893 ret ;0a98 c9 .
1894
1895 sub_0a99h:
1896 ld iy,bp_tab ;0a99 fd 21 b8 0a . ! . .
1897 push de ;0a9d d5 .
1898 l0a9eh:
1899 ld e,(iy+006h) ;0a9e fd 5e 06 . ^ .
1900 ld d,(iy+007h) ;0aa1 fd 56 07 . V .
1901 call cp_hl_de ;0aa4 cd ee 02 . . .
1902 jr z,l0ab0h ;0aa7 28 07 ( .
1903 ld de,BP_SIZE ;0aa9 11 08 00 . . .
1904 add iy,de ;0aac fd 19 . .
1905 jr l0a9eh ;0aae 18 ee . .
1906 l0ab0h:
1907 pop de ;0ab0 d1 .
1908 ld (iy+006h),e ;0ab1 fd 73 06 . s .
1909 ld (iy+007h),d ;0ab4 fd 72 07 . r .
1910 ret ;0ab7 c9 .
1911
1912 bp_tab:
1913 rept BP_CNT
1914 rept BP_SIZE
1915 db 0
1916 endm
1917 endm
1918
1919 expr_p1:
1920 defw expr_buf ;0b18 1c 0b . .
1921 expr_p2:
1922 defw expr_buf ;0b1a 1c 0b . .
1923
1924 expr_buf:
1925 db 'DDT/Z',TAB
1926 db '[8101] 001',CR,LF,'$'
1927
1928 ds EXPR_BUF_SIZE - ($ - expr_buf)
1929 expr_bufe:
1930
1931 msg_Y:
1932 dc 'Yn' ;0b9c 59 ee Y n.
1933 reg_Y:
1934 rept YREG_CNT
1935 dw 0
1936 endm
1937
1938 cmd_Y:
1939 call get.decdigit ;0bb2 cd 1d 06 . . .
1940 jr c,l0bc3h ;0bb5 38 0c 8 .
1941 inc de ;0bb7 13 .
1942 push af ;0bb8 f5 .
1943 call assert_eol ;0bb9 cd d6 02 . . .
1944 pop af ;0bbc f1 .
1945 call sub_0bdch ;0bbd cd dc 0b . . .
1946 jp l0c15h ;0bc0 c3 15 0c . . .
1947 l0bc3h:
1948 call assert_eol ;0bc3 cd d6 02 . . .
1949 xor a ;0bc6 af .
1950 l0bc7h:
1951 push af ;0bc7 f5 .
1952 call sub_0bdch ;0bc8 cd dc 0b . . .
1953 call outbl4 ;0bcb cd 99 02 . . .
1954 pop af ;0bce f1 .
1955 inc a ;0bcf 3c <
1956 bit 0,a ;0bd0 cb 47 . G
1957 push af ;0bd2 f5 .
1958 call z,crlf ;0bd3 cc a3 02 . . .
1959 pop af ;0bd6 f1 .
1960 cp YREG_CNT ;0bd7 fe 0a . .
1961 jr c,l0bc7h ;0bd9 38 ec 8 .
1962 ret ;0bdb c9 .
1963
1964 sub_0bdch:
1965 ld c,a ;0bdc 4f O
1966 ld b,0 ;0bdd 06 00 . .
1967 add a,'0'+080h ;0bdf c6 b0 . .
1968 ld de,msg_Y+1 ;0be1 11 9d 0b . . .
1969 ld (de),a ;0be4 12 .
1970 dec de ;0be5 1b .
1971 ld hl,reg_Y ;0be6 21 9e 0b ! . .
1972 add hl,bc ;0be9 09 .
1973 add hl,bc ;0bea 09 .
1974 ex de,hl ;0beb eb .
1975 ld c,003h ;0bec 0e 03 . .
1976 jp l0c33h ;0bee c3 33 0c . 3 .
1977
1978 cmd_X:
1979 call skipbl ;0bf1 cd bf 02 . . .
1980 call sub_0caeh ;0bf4 cd ae 0c . . .
1981 jp nc,prnt_cpustat0 ;0bf7 d2 2d 06 . - .
1982 call assert_eol ;0bfa cd d6 02 . . .
1983 ld a,b ;0bfd 78 x
1984 cp 01eh ;0bfe fe 1e . .
1985 jr z,l0c5fh ;0c00 28 5d ( ]
1986 cp 01fh ;0c02 fe 1f . .
1987 jr z,l0c4fh ;0c04 28 49 ( I
1988 cp 01dh ;0c06 fe 1d . .
1989 jp z,ERROR ;0c08 ca 07 01 . . .
1990 ex de,hl ;0c0b eb .
1991 ld hl,b_0cc3_start ;0c0c 21 c3 0c ! . .
1992 call sub_033dh ;0c0f cd 3d 03 . = .
1993 l0c12h:
1994 call l0c33h ;0c12 cd 33 0c . 3 .
1995 l0c15h:
1996 call outbl ;0c15 cd 9f 02 . . .
1997 push de ;0c18 d5 .
1998 push bc ;0c19 c5 .
1999 call get_line ;0c1a cd 4e 01 . N .
2000 call skipbl ;0c1d cd bf 02 . . .
2001 jr z,l0c30h ;0c20 28 0e ( .
2002 call sub_0363h ;0c22 cd 63 03 . c .
2003 ld b,h ;0c25 44 D
2004 ld c,l ;0c26 4d M
2005 pop af ;0c27 f1 .
2006 pop hl ;0c28 e1 .
2007 ld (hl),c ;0c29 71 q
2008 bit 0,a ;0c2a cb 47 . G
2009 ret z ;0c2c c8 .
2010 inc hl ;0c2d 23 #
2011 ld (hl),b ;0c2e 70 p
2012 ret ;0c2f c9 .
2013 l0c30h:
2014 pop af ;0c30 f1 .
2015 pop hl ;0c31 e1 .
2016 ret ;0c32 c9 .
2017 l0c33h:
2018 ld b,c ;0c33 41 A
2019 call pstr ;0c34 cd 88 02 . . .
2020 ld a,'=' ;0c37 3e 3d > =
2021 call outchar ;0c39 cd 5d 02 . ] .
2022 ld a,(de) ;0c3c 1a .
2023 bit 0,b ;0c3d cb 40 . @
2024 jp z,out_hex ;0c3f ca 18 02 . . .
2025 ld l,a ;0c42 6f o
2026 inc de ;0c43 13 .
2027 ld a,(de) ;0c44 1a .
2028 dec de ;0c45 1b .
2029 ld h,a ;0c46 67 g
2030 bit 1,b ;0c47 cb 48 . H
2031 jp z,out_hl ;0c49 ca 13 02 . . .
2032 jp out.hl.@ ;0c4c c3 a4 01 . . .
2033
2034 l0c4fh:
2035 call prnt_f ;0c4f cd 6e 06 . n .
2036 ld a,0f3h ;0c52 3e f3 > .
2037 ld (reg.iff),a ;0c54 32 5e 00 2 ^ .
2038 scf ;0c57 37 7
2039 call sub_0c6ah ;0c58 cd 6a 0c . j .
2040 ld (reg.f),a ;0c5b 32 54 00 2 T .
2041 ret ;0c5e c9 .
2042 l0c5fh:
2043 call prnt_f2 ;0c5f cd 81 06 . . .
2044 and a ;0c62 a7 .
2045 call sub_0c6ah ;0c63 cd 6a 0c . j .
2046 ld (reg.f2),a ;0c66 32 4c 00 2 L .
2047 ret ;0c69 c9 .
2048 sub_0c6ah:
2049 ex af,af' ;0c6a 08 .
2050 ld b,000h ;0c6b 06 00 . .
2051 call outbl ;0c6d cd 9f 02 . . .
2052 call assert_eol ;0c70 cd d6 02 . . .
2053 call get_line ;0c73 cd 4e 01 . N .
2054 l0c76h:
2055 call skipbl ;0c76 cd bf 02 . . .
2056 ld a,b ;0c79 78 x
2057 ret z ;0c7a c8 .
2058 push bc ;0c7b c5 .
2059 ld hl,b_0ca4_start ;0c7c 21 a4 0c ! . .
2060 call lookupch ;0c7f cd f3 02 . . .
2061 jp nc,ERROR ;0c82 d2 07 01 . . .
2062 ld a,b ;0c85 78 x
2063 cp 008h ;0c86 fe 08 . .
2064 jr z,l0c97h ;0c88 28 0d ( .
2065 pop bc ;0c8a c1 .
2066 rlca ;0c8b 07 .
2067 rlca ;0c8c 07 .
2068 rlca ;0c8d 07 .
2069 add a,0c0h ;0c8e c6 c0 . .
2070 ld (l0c94h),a ;0c90 32 94 0c 2 . .
2071 defb 0cbh ;0c93 cb .
2072 l0c94h:
2073 defb 0c0h ;0c94 c0 .
2074 jr l0c76h ;0c95 18 df . .
2075 l0c97h:
2076 ex af,af' ;0c97 08 .
2077 jp nc,ERROR ;0c98 d2 07 01 . . .
2078 ex af,af' ;0c9b 08 .
2079 ld a,0fbh ;0c9c 3e fb > .
2080 ld (reg.iff),a ;0c9e 32 5e 00 2 ^ .
2081 pop bc ;0ca1 c1 .
2082 jr l0c76h ;0ca2 18 d2 . .
2083
2084 b_0ca4_start:
2085 db 'CNV H ZSE',0
2086
2087 sub_0caeh:
2088 call sub_0303h ;0cae cd 03 03 . . .
2089 ret nc ;0cb1 d0 .
2090 ld a,b ;0cb2 78 x
2091 add a,b ;0cb3 80 .
2092 add a,b ;0cb4 80 .
2093 ld hl,b_0cfa_start ;0cb5 21 fa 0c ! . .
2094 call add_hl_a ;0cb8 cd b9 02 . . .
2095 ld c,(hl) ;0cbb 4e N
2096 inc hl ;0cbc 23 #
2097 ld a,(hl) ;0cbd 7e ~
2098 inc hl ;0cbe 23 #
2099 ld h,(hl) ;0cbf 66 f
2100 ld l,a ;0cc0 6f o
2101 scf ;0cc1 37 7
2102 ret ;0cc2 c9 .
2103
2104 b_0cc3_start:
2105 DC 'BC'''
2106 DC 'DE'''
2107 DC 'HL'''
2108 DC 'BC'
2109 DC 'DE'
2110 DC 'HL'
2111 DC 'A'''
2112 DC 'B'''
2113 DC 'C'''
2114 DC 'D'''
2115 DC 'E'''
2116 DC 'H'''
2117 DC 'L'''
2118 DC 'A'
2119 DC 'B'
2120 DC 'C'
2121 DC 'D'
2122 DC 'E'
2123 DC 'H'
2124 DC 'L'
2125 DC 'IX'
2126 DC 'IY'
2127 DC 'SP'
2128 DC 'PC'
2129 DC 'X'
2130 DC 'Y'
2131 DC 'S'
2132 DC 'P'
2133 DC 'I'
2134 DC 'IP'
2135 DC 'F'''
2136 DC 'F'
2137 DB 0
2138
2139 b_0cfa_start:
2140 defb 003h ;0cfa 03 .
2141 defw reg.c2 ;0cfb 4a 00 J .
2142 defb 003h ;0cfd 03 .
2143 defw reg.e2 ;0cfe 48 00 H .
2144 defb 003h ;0d00 03 .
2145 defw reg.l2 ;0d01 46 00 F .
2146 defb 003h ;0d03 03 .
2147 defw reg.c ;0d04 56 00 V .
2148 defb 003h ;0d06 03 .
2149 defw reg.e ;0d07 58 00 X .
2150 defb 003h ;0d09 03 .
2151 defw reg.l ;0d0a 5a 00 Z .
2152 defb 000h ;0d0c 00 .
2153 defw reg.a2 ;0d0d 4d 00 M .
2154 defb 000h ;0d0f 00 .
2155 defw reg.b2 ;0d10 4b 00 K .
2156 defb 000h ;0d12 00 .
2157 defw reg.c2 ;0d13 4a 00 J .
2158 defb 000h ;0d15 00 .
2159 defw reg.d2 ;0d16 49 00 I .
2160 defb 000h ;0d18 00 .
2161 defw reg.e2 ;0d19 48 00 H .
2162 defb 000h ;0d1b 00 .
2163 defw reg.h2 ;0d1c 47 00 G .
2164 defb 000h ;0d1e 00 .
2165 defw reg.l2 ;0d1f 46 00 F .
2166 defb 000h ;0d21 00 .
2167 defw reg.a ;0d22 55 00 U .
2168 defb 000h ;0d24 00 .
2169 defw reg.b ;0d25 57 00 W .
2170 defb 000h ;0d27 00 .
2171 defw reg.c ;0d28 56 00 V .
2172 defb 000h ;0d2a 00 .
2173 defw reg.d ;0d2b 59 00 Y .
2174 defb 000h ;0d2d 00 .
2175 defw reg.e ;0d2e 58 00 X .
2176 defb 000h ;0d30 00 .
2177 defw reg.h ;0d31 5b 00 [ .
2178 defb 000h ;0d33 00 .
2179 defw reg.l ;0d34 5a 00 Z .
2180 defb 003h ;0d36 03 .
2181 defw reg.ix ;0d37 52 00 R .
2182 defb 003h ;0d39 03 .
2183 defw reg.iy ;0d3a 50 00 P .
2184 defb 003h ;0d3c 03 .
2185 defw reg_sp ;0d3d 5c 00 \ .
2186 defb 003h ;0d3f 03 .
2187 defw REG.PC ;0d40 60 00 ` .
2188 defb 003h ;0d42 03 .
2189 defw reg.ix ;0d43 52 00 R .
2190 defb 003h ;0d45 03 .
2191 defw reg.iy ;0d46 50 00 P .
2192 defb 003h ;0d48 03 .
2193 defw reg_sp ;0d49 5c 00 \ .
2194 defb 003h ;0d4b 03 .
2195 defw REG.PC ;0d4c 60 00 ` .
2196 defb 000h ;0d4e 00 .
2197 defw reg.i ;0d4f 4f 00 O .
2198 defb 003h ;0d51 03 .
2199 defw l004eh ;0d52 4e 00 N .
2200 defb 000h ;0d54 00 .
2201 defw reg.f2 ;0d55 4c 00 L .
2202 defb 000h ;0d57 00 .
2203 defw reg.f ;0d58 54 00 T .
2204
2205 cmd_S:
2206 ld hl,(last_S) ;0d5a 2a 90 0d * . .
2207 call get_lastarg_def ;0d5d cd 69 03 . i .
2208 l0d60h:
2209 ld (last_S),hl ;0d60 22 90 0d " . .
2210 call out.hl.@ ;0d63 cd a4 01 . . .
2211 call outbl ;0d66 cd 9f 02 . . .
2212 ld a,(hl) ;0d69 7e ~
2213 call out_hex ;0d6a cd 18 02 . . .
2214 call outbl2 ;0d6d cd 9c 02 . . .
2215 call get_line ;0d70 cd 4e 01 . N .
2216 call skipbl ;0d73 cd bf 02 . . .
2217 inc hl ;0d76 23 #
2218 jr z,l0d60h ;0d77 28 e7 ( .
2219 dec hl ;0d79 2b +
2220 inc de ;0d7a 13 .
2221 cp '.' ;0d7b fe 2e . .
2222 jp z,assert_eol ;0d7d ca d6 02 . . .
2223 cp '-' ;0d80 fe 2d . -
2224 jr nz,l0d8ah ;0d82 20 06 .
2225 ld a,(de) ;0d84 1a .
2226 or a ;0d85 b7 .
2227 dec hl ;0d86 2b +
2228 jr z,l0d60h ;0d87 28 d7 ( .
2229 inc hl ;0d89 23 #
2230 l0d8ah:
2231 dec de ;0d8a 1b .
2232 call sub_0ef8h ;0d8b cd f8 0e . . .
2233 jr l0d60h ;0d8e 18 d0 . .
2234
2235 last_S:
2236 defw TPA ;0d90 00 01 . .
2237 cmd_@:
2238 call assert_eol ;0d92 cd d6 02 . . .
2239 ld hl,msg_offset ;0d95 21 a0 0d ! . .
2240 ld de,offs.@ ;0d98 11 64 00 . d .
2241 ld c,001h ;0d9b 0e 01 . .
2242 jp l0c12h ;0d9d c3 12 0c . . .
2243
2244 msg_offset:
2245 dc '@' ;0da0 c0 .
2246
2247 last_I:
2248 defw 0 ;0da1 00 00 . .
2249 cmd_I:
2250 ld hl,cmd_I ;0da3 21 a3 0d ! . .
2251 ld (cmd_rpt),hl ;0da6 22 68 00 " h .
2252 ld hl,(last_I) ;0da9 2a a1 0d * . .
2253 call get_lastarg_def ;0dac cd 69 03 . i .
2254 ld (last_I),hl ;0daf 22 a1 0d " . .
2255 ld b,h ;0db2 44 D
2256 ld c,l ;0db3 4d M
2257 in a,(c) ;0db4 ed 78 . x
2258 push af ;0db6 f5 .
2259 call out_hex ;0db7 cd 18 02 . . .
2260 call outbl4 ;0dba cd 99 02 . . .
2261 pop af ;0dbd f1 .
2262 call out.bin.b ;0dbe cd c7 01 . . .
2263 jp crlf ;0dc1 c3 a3 02 . . .
2264
2265 last_O_addr:
2266 dw 0 ;0dc4 00 .
2267 last_O_val:
2268 db 0 ;0dc6 00 .
2269 cmd_O:
2270 ld hl,cmd_O ;0dc7 21 c7 0d ! . .
2271 ld (cmd_rpt),hl ;0dca 22 68 00 " h .
2272 ld hl,(last_O_val) ;0dcd 2a c6 0d * . .
2273 call get_arg_def ;0dd0 cd 6e 03 . n .
2274 ld a,l ;0dd3 7d }
2275 ld (last_O_val),a ;0dd4 32 c6 0d 2 . .
2276 push af ;0dd7 f5 .
2277 call next_arg ;0dd8 cd ca 02 . . .
2278 ld hl,(last_O_addr) ;0ddb 2a c4 0d * . .
2279 call get_lastarg_def ;0dde cd 69 03 . i .
2280 ld (last_O_addr),hl ;0de1 22 c4 0d " . .
2281 ld b,h ;0de4 44 D
2282 ld c,l ;0de5 4d M
2283 pop af ;0de6 f1 .
2284 out (c),a ;0de7 ed 79 . y
2285 ret ;0de9 c9 .
2286
2287 cmd_V:
2288 call sub_034eh ;0dea cd 4e 03 . N .
2289 l0dedh:
2290 push bc ;0ded c5 .
2291 ld a,(de) ;0dee 1a .
2292 ld b,(hl) ;0def 46 F
2293 cp b ;0df0 b8 .
2294 jr z,l0e10h ;0df1 28 1d ( .
2295 ld c,a ;0df3 4f O
2296 call out.hl.@ ;0df4 cd a4 01 . . .
2297 call outbl ;0df7 cd 9f 02 . . .
2298 ld a,b ;0dfa 78 x
2299 call out_hex ;0dfb cd 18 02 . . .
2300 call outbl2 ;0dfe cd 9c 02 . . .
2301 ld a,c ;0e01 79 y
2302 call out_hex ;0e02 cd 18 02 . . .
2303 call outbl ;0e05 cd 9f 02 . . .
2304 ex de,hl ;0e08 eb .
2305 call out.hl.@ ;0e09 cd a4 01 . . .
2306 ex de,hl ;0e0c eb .
2307 call crlf ;0e0d cd a3 02 . . .
2308 l0e10h:
2309 pop bc ;0e10 c1 .
2310 inc hl ;0e11 23 #
2311 inc de ;0e12 13 .
2312 dec bc ;0e13 0b .
2313 ld a,b ;0e14 78 x
2314 or c ;0e15 b1 .
2315 jr nz,l0dedh ;0e16 20 d5 .
2316 ret ;0e18 c9 .
2317
2318 cmd_M:
2319 ld a,(de) ;0e19 1a .
2320 cp 'V' ;0e1a fe 56 . V
2321 jr nz,l0e1fh ;0e1c 20 01 .
2322 inc de ;0e1e 13 .
2323 l0e1fh:
2324 push af ;0e1f f5 .
2325 call sub_034eh ;0e20 cd 4e 03 . N .
2326 push hl ;0e23 e5 .
2327 push de ;0e24 d5 .
2328 push bc ;0e25 c5 .
2329 call cp_hl_de ;0e26 cd ee 02 . . .
2330 jr nc,$+11 ;0e29 30 09 0 .
2331 add hl,bc ;0e2b 09 .
2332 ex de,hl ;0e2c eb .
2333 add hl,bc ;0e2d 09 .
2334 ex de,hl ;0e2e eb .
2335 dec hl ;0e2f 2b +
2336 dec de ;0e30 1b .
2337 lddr ;0e31 ed b8 . .
2338 ld bc,0b0edh ;0e33 01 ed b0 . . .
2339 pop bc ;0e36 c1 .
2340 pop de ;0e37 d1 .
2341 pop hl ;0e38 e1 .
2342 pop af ;0e39 f1 .
2343 jr z,l0dedh ;0e3a 28 b1 ( .
2344 ret ;0e3c c9 .
2345
2346 cmd_H:
2347 call expr ;0e3d cd be 03 . . .
2348 jp c,prnt_max_high0 ;0e40 da 6f 11 . o .
2349 call next_arg ;0e43 cd ca 02 . . .
2350 push hl ;0e46 e5 .
2351 call expr ;0e47 cd be 03 . . .
2352 push af ;0e4a f5 .
2353 call assert_eol ;0e4b cd d6 02 . . .
2354 pop af ;0e4e f1 .
2355 ex de,hl ;0e4f eb .
2356 pop hl ;0e50 e1 .
2357 jr c,l0e5eh ;0e51 38 0b 8 .
2358 push hl ;0e53 e5 .
2359 push de ;0e54 d5 .
2360 add hl,de ;0e55 19 .
2361 call l0e5eh ;0e56 cd 5e 0e . ^ .
2362 pop de ;0e59 d1 .
2363 pop hl ;0e5a e1 .
2364 and a ;0e5b a7 .
2365 sbc hl,de ;0e5c ed 52 . R
2366 l0e5eh:
2367 call out_hl ;0e5e cd 13 02 . . .
2368 call outbl2 ;0e61 cd 9c 02 . . .
2369 call out_hl_neg ;0e64 cd 0a 02 . . .
2370 call outbl4 ;0e67 cd 99 02 . . .
2371 call out.hl.dec ;0e6a cd e7 01 . . .
2372 call outbl2 ;0e6d cd 9c 02 . . .
2373 call out_hl_dec_neg ;0e70 cd e2 01 . . .
2374 call outbl4 ;0e73 cd 99 02 . . .
2375 call out.bin.w ;0e76 cd c2 01 . . .
2376 call outbl2 ;0e79 cd 9c 02 . . .
2377 ld a,l ;0e7c 7d }
2378 call out.ascii ;0e7d cd 34 02 . 4 .
2379 jp crlf ;0e80 c3 a3 02 . . .
2380
2381 cmd_Q_jopt:
2382 db -1 ;0e83 ff .
2383
2384 cmd_Q:
2385 ld a,(de) ;0e84 1a .
2386 sub 'J' ;0e85 d6 4a . J
2387 ld (cmd_Q_jopt),a ;0e87 32 83 0e 2 . .
2388 jr nz,l0e8dh ;0e8a 20 01 .
2389 inc de ;0e8c 13 .
2390 l0e8dh:
2391 call get_arg_range ;0e8d cd 7d 03 . } .
2392 push bc ;0e90 c5 .
2393 push hl ;0e91 e5 .
2394 call sub_0ee6h ;0e92 cd e6 0e . . .
2395 pop hl ;0e95 e1 .
2396 l0e96h:
2397 call sub_0ed7h ;0e96 cd d7 0e . . .
2398 jr nz,l0eb0h ;0e99 20 15 .
2399 push bc ;0e9b c5 .
2400 push hl ;0e9c e5 .
2401 ld a,(cmd_Q_jopt) ;0e9d 3a 83 0e : . .
2402 or a ;0ea0 b7 .
2403 jr nz,l0ea7h ;0ea1 20 04 .
2404 ld bc,-8 ;0ea3 01 f8 ff . . .
2405 add hl,bc ;0ea6 09 .
2406 l0ea7h:
2407 ld bc,16 ;0ea7 01 10 00 . . .
2408 and a ;0eaa a7 .
2409 call sub_0f58h ;0eab cd 58 0f . X .
2410 pop hl ;0eae e1 .
2411 pop bc ;0eaf c1 .
2412 l0eb0h:
2413 inc hl ;0eb0 23 #
2414 ex (sp),hl ;0eb1 e3 .
2415 dec hl ;0eb2 2b +
2416 ld a,h ;0eb3 7c |
2417 or l ;0eb4 b5 .
2418 ex (sp),hl ;0eb5 e3 .
2419 jr nz,l0e96h ;0eb6 20 de .
2420 pop bc ;0eb8 c1 .
2421 ret ;0eb9 c9 .
2422
2423 cmd_Z:
2424 call get_arg_range ;0eba cd 7d 03 . } .
2425 push bc ;0ebd c5 .
2426 push hl ;0ebe e5 .
2427 call sub_0ee6h ;0ebf cd e6 0e . . .
2428 ld a,b ;0ec2 78 x
2429 pop hl ;0ec3 e1 .
2430 pop bc ;0ec4 c1 .
2431 push hl ;0ec5 e5 .
2432 ex de,hl ;0ec6 eb .
2433 l0ec7h:
2434 ldi ;0ec7 ed a0 . .
2435 jp po,l0ed3h ;0ec9 e2 d3 0e . . .
2436 dec a ;0ecc 3d =
2437 jr nz,l0ec7h ;0ecd 20 f8 .
2438 pop hl ;0ecf e1 .
2439 ldir ;0ed0 ed b0 . .
2440 ret ;0ed2 c9 .
2441 l0ed3h:
2442 pop hl ;0ed3 e1 .
2443 ret ;0ed4 c9 .
2444
2445 last_D:
2446 dw TPA
2447
2448 sub_0ed7h:
2449 push hl ;0ed7 e5 d5 . .
2450 push de
2451 push bc ;0ed9 c5 .
2452 l0edah:
2453 ld a,(de) ;0eda 1a .
2454 cp (hl) ;0edb be .
2455 jr nz,l0ee2h ;0edc 20 04 .
2456 inc de ;0ede 13 .
2457 inc hl ;0edf 23 #
2458 djnz l0edah ;0ee0 10 f8 . .
2459 l0ee2h:
2460 pop bc ;0ee2 c1 .
2461 pop de ;0ee3 d1 .
2462 pop hl ;0ee4 e1 .
2463 ret ;0ee5 c9 .
2464
2465 sub_0ee6h:
2466 ld hl,conbuf+1 ;0ee6 21 6b 00 ! k .
2467 call sub_0ef7h ;0ee9 cd f7 0e . . .
2468 ld de,conbuf+1 ;0eec 11 6b 00 . k .
2469 and a ;0eef a7 .
2470 sbc hl,de ;0ef0 ed 52 . R
2471 ld b,l ;0ef2 45 E
2472 ret nz ;0ef3 c0 .
2473 jp ERROR ;0ef4 c3 07 01 . . .
2474
2475 sub_0ef7h:
2476 db 0e6h ;0ef7 e6 and 037h (clear carry)
2477 sub_0ef8h:
2478 scf ;0ef8 37 . 7
2479 l0ef9h:
2480 push af ;0ef9 f5 .
2481 call next_arg ;0efa cd ca 02 . . .
2482 cp 'W' ;0efd fe 57 . W
2483 jr nz,l0f0eh ;0eff 20 0d .
2484 inc de ;0f01 13 .
2485 push hl ;0f02 e5 .
2486 call sub_035dh ;0f03 cd 5d 03 . ] .
2487 ex de,hl ;0f06 eb .
2488 ex (sp),hl ;0f07 e3 .
2489 ld (hl),e ;0f08 73 s
2490 inc hl ;0f09 23 #
2491 ld a,d ;0f0a 7a z
2492 pop de ;0f0b d1 .
2493 jr l0f1ah ;0f0c 18 0c . .
2494 l0f0eh:
2495 cp '''' ;0f0e fe 27 . '
2496 jr z,l0f1eh ;0f10 28 0c ( .
2497 push hl ;0f12 e5 .
2498 call expr ;0f13 cd be 03 . . .
2499 ld a,l ;0f16 7d }
2500 pop hl ;0f17 e1 .
2501 jr c,l0f42h ;0f18 38 28 8 (
2502 l0f1ah:
2503 ld (hl),a ;0f1a 77 w
2504 inc hl ;0f1b 23 #
2505 jr l0f3ah ;0f1c 18 1c . .
2506 l0f1eh:
2507 inc de ;0f1e 13 .
2508 ld a,(de) ;0f1f 1a .
2509 cp '''' ;0f20 fe 27 . '
2510 jr z,l0f2bh ;0f22 28 07 ( .
2511 or a ;0f24 b7 .
2512 jr z,l0f42h ;0f25 28 1b ( .
2513 l0f27h:
2514 ld (hl),a ;0f27 77 w
2515 inc hl ;0f28 23 #
2516 jr l0f1eh ;0f29 18 f3 . .
2517 l0f2bh:
2518 inc de ;0f2b 13 .
2519 ld a,(de) ;0f2c 1a .
2520 cp '''' ;0f2d fe 27 . '
2521 jr z,l0f27h ;0f2f 28 f6 ( .
2522 cp '.' ;0f31 fe 2e . .
2523 jr nz,l0f3ah ;0f33 20 05 .
2524 inc de ;0f35 13 .
2525 dec hl ;0f36 2b +
2526 set 7,(hl) ;0f37 cb fe . .
2527 inc hl ;0f39 23 #
2528 l0f3ah:
2529 pop af ;0f3a f1 .
2530 jr nc,l0ef9h ;0f3b 30 bc 0 .
2531 ld (last_S),hl ;0f3d 22 90 0d " . .
2532 jr l0ef9h ;0f40 18 b7 . .
2533 l0f42h:
2534 pop af ;0f42 f1 .
2535 ret nc ;0f43 d0 .
2536 ld (last_S),hl ;0f44 22 90 0d " . .
2537 ret ;0f47 c9 .
2538
2539 cmd_D:
2540 ld hl,cmd_D ;0f48 21 48 0f ! H .
2541 ld (cmd_rpt),hl ;0f4b 22 68 00 " h .
2542 ld hl,(last_D) ;0f4e 2a d5 0e * . .
2543 ld bc,128 ;0f51 01 80 00 . . .
2544 call sub_0377h ;0f54 cd 77 03 . w .
2545 scf ;0f57 37 7
2546 sub_0f58h:
2547 push bc ;0f58 c5 .
2548 push de ;0f59 d5 .
2549 push hl ;0f5a e5 .
2550 ex af,af' ;0f5b 08 .
2551 l0f5ch:
2552 call out.hl.@ ;0f5c cd a4 01 . . .
2553 call z,outbl2 ;0f5f cc 9c 02 . . .
2554 call outbl ;0f62 cd 9f 02 . . .
2555 ld de,0 ;0f65 11 00 00 . . .
2556 l0f68h:
2557 ld a,(hl) ;0f68 7e ~
2558 inc hl ;0f69 23 #
2559 call out_hex ;0f6a cd 18 02 . . .
2560 call outbl ;0f6d cd 9f 02 . . .
2561 dec bc ;0f70 0b .
2562 inc e ;0f71 1c .
2563 ld a,e ;0f72 7b {
2564 cp 010h ;0f73 fe 10 . .
2565 jr z,l0f80h ;0f75 28 09 ( .
2566 and 003h ;0f77 e6 03 . .
2567 call z,outbl ;0f79 cc 9f 02 . . .
2568 ld a,b ;0f7c 78 x
2569 or c ;0f7d b1 .
2570 jr nz,l0f68h ;0f7e 20 e8 .
2571 l0f80h:
2572 call outbl ;0f80 cd 9f 02 . . .
2573 and a ;0f83 a7 .
2574 sbc hl,de ;0f84 ed 52 . R
2575 l0f86h:
2576 ld a,(hl) ;0f86 7e ~
2577 call sub_0fa3h ;0f87 cd a3 0f . . .
2578 call outchar ;0f8a cd 5d 02 . ] .
2579 inc hl ;0f8d 23 #
2580 dec e ;0f8e 1d .
2581 jr nz,l0f86h ;0f8f 20 f5 .
2582 ex af,af' ;0f91 08 .
2583 jr nc,l0f97h ;0f92 30 03 0 .
2584 ld (last_D),hl ;0f94 22 d5 0e " . .
2585 l0f97h:
2586 ex af,af' ;0f97 08 .
2587 call crlf ;0f98 cd a3 02 . . .
2588 ld a,b ;0f9b 78 x
2589 or c ;0f9c b1 .
2590 jr nz,l0f5ch ;0f9d 20 bd .
2591 pop hl ;0f9f e1 .
2592 pop de ;0fa0 d1 .
2593 pop bc ;0fa1 c1 .
2594 ret ;0fa2 c9 .
2595
2596 sub_0fa3h:
2597 and 07fh ;0fa3 e6 7f . \7f
2598 cp 07fh ;0fa5 fe 7f . \7f
2599 jr z,l0fach ;0fa7 28 03 ( .
2600 cp ' ' ;0fa9 fe 20 .
2601 ret nc ;0fab d0 .
2602 l0fach:
2603 ld a,'.' ;0fac 3e 2e > .
2604 ret ;0fae c9 .
2605
2606 cmd_F:
2607 push de ;0faf d5 .
2608 ld hl,DMA_BUF+1 ;0fb0 21 81 00 ! . .
2609 ld (hl),' ' ;0fb3 36 20 6
2610 inc hl ;0fb5 23 #
2611 l0fb6h:
2612 ld a,(de) ;0fb6 1a .
2613 ld (hl),a ;0fb7 77 w
2614 inc hl ;0fb8 23 #
2615 inc de ;0fb9 13 .
2616 and a ;0fba a7 .
2617 jr nz,l0fb6h ;0fbb 20 f9 .
2618 ld a,l ;0fbd 7d }
2619 sub DMA_BUF+2 ;0fbe d6 82 . .
2620 ld (DMA_BUF),a ;0fc0 32 80 00 2 . .
2621 pop hl ;0fc3 e1 .
2622 ld de,FCB ;0fc4 11 5c 00 . \ .
2623 call parse_filename ;0fc7 cd cd 0f . . .
2624 ld de,FCB2 ;0fca 11 6c 00 . l .
2625
2626 parse_filename:
2627 call sub_102ch ;0fcd cd 2c 10 . , .
2628 push de ;0fd0 d5 .
2629 push bc ;0fd1 c5 .
2630 ld b,(hl) ;0fd2 46 F
2631 inc hl ;0fd3 23 #
2632 ld a,(hl) ;0fd4 7e ~
2633 cp ':' ;0fd5 fe 3a . :
2634 jr nz,l0fe1h ;0fd7 20 08 .
2635 inc hl ;0fd9 23 #
2636 ld a,b ;0fda 78 x
2637 sub 040h ;0fdb d6 40 . @
2638 and 01fh ;0fdd e6 1f . .
2639 jr l0fe3h ;0fdf 18 02 . .
2640 l0fe1h:
2641 dec hl ;0fe1 2b +
2642 xor a ;0fe2 af .
2643 l0fe3h:
2644 ld (de),a ;0fe3 12 .
2645 inc de ;0fe4 13 .
2646 ld b,8 ;0fe5 06 08 . .
2647 call sub_0ff2h ;0fe7 cd f2 0f . . .
2648 ld b,3 ;0fea 06 03 . .
2649 call sub_0ff2h ;0fec cd f2 0f . . .
2650 pop bc ;0fef c1 .
2651 pop de ;0ff0 d1 .
2652 ret ;0ff1 c9 .
2653
2654 sub_0ff2h:
2655 call sub_1012h ;0ff2 cd 12 10 . . .
2656 jr z,l0ffeh ;0ff5 28 07 ( .
2657 inc hl ;0ff7 23 #
2658 ld (de),a ;0ff8 12 .
2659 inc de ;0ff9 13 .
2660 djnz sub_0ff2h ;0ffa 10 f6 . .
2661 jr l1003h ;0ffc 18 05 . .
2662 l0ffeh:
2663 ld a,c ;0ffe 79 y
2664 l0fffh:
2665 ld (de),a ;0fff 12 .
2666 inc de ;1000 13 .
2667 djnz l0fffh ;1001 10 fc . .
2668 l1003h:
2669 call sub_1012h ;1003 cd 12 10 . . .
2670 inc hl ;1006 23 #
2671 jr nz,l1003h ;1007 20 fa .
2672 cp '*' ;1009 fe 2a . *
2673 jr z,l1003h ;100b 28 f6 ( .
2674 cp '.' ;100d fe 2e . .
2675 ret z ;100f c8 .
2676 dec hl ;1010 2b +
2677 ret ;1011 c9 .
2678
2679 sub_1012h:
2680 ld a,(hl) ;1012 7e ~
2681 ld c,' ' ;1013 0e 20 .
2682 and 01fh ;1015 e6 1f . .
2683 ret z ;1017 c8 .
2684 ld a,(hl) ;1018 7e ~
2685 cp ' ' ;1019 fe 20 .
2686 ret z ;101b c8 .
2687 call sub_1043h ;101c cd 43 10 . C .
2688 ret z ;101f c8 .
2689 cp '/' ;1020 fe 2f . /
2690 ret z ;1022 c8 .
2691 cp '.' ;1023 fe 2e . .
2692 ret z ;1025 c8 .
2693 ld c,'?' ;1026 0e 3f . ?
2694 cp '*' ;1028 fe 2a . *
2695 ret ;102a c9 .
2696
2697 l102bh:
2698 inc hl ;102b 23 #
2699 sub_102ch:
2700 ld a,(hl) ;102c 7e ~
2701 cp '/' ;102d fe 2f . /
2702 jr z,l103bh ;102f 28 0a ( .
2703 call sub_1043h ;1031 cd 43 10 . C .
2704 jr z,l102bh ;1034 28 f5 ( .
2705 l1036h:
2706 cp ' ' ;1036 fe 20 .
2707 jr z,l102bh ;1038 28 f1 ( .
2708 ret ;103a c9 .
2709
2710 l103bh:
2711 ld a,(hl) ;103b 7e ~
2712 cp ' '+1 ;103c fe 21 . !
2713 jr c,l1036h ;103e 38 f6 8 .
2714 inc hl ;1040 23 #
2715 jr l103bh ;1041 18 f8 . .
2716
2717 sub_1043h:
2718 cp '=' ;1043 fe 3d . =
2719 ret z ;1045 c8 .
2720 cp '_' ;1046 fe 5f . _
2721 ret z ;1048 c8 .
2722 cp ',' ;1049 fe 2c . ,
2723 ret ;104b c9 .
2724
2725 fcb_clear_rc:
2726 xor a ;104c af .
2727 ld hl,FCB+12 ;104d 21 68 00 ! h .
2728 ld b,21 ;1050 06 15 . .
2729 l1052h:
2730 ld (hl),a ;1052 77 w
2731 inc hl ;1053 23 #
2732 djnz l1052h ;1054 10 fc . .
2733 ld de,DMA_BUF ;1056 11 80 00 . . .
2734 ld c,BDOS_SETDMA ;1059 0e 1a . .
2735 call ddtz_base ;105b cd 00 00 . . .
2736 ld de,FCB ;105e 11 5c 00 . \ .
2737 ret ;1061 c9 .
2738
2739 cmd_R:
2740 ld hl,0 ;1062 21 00 00 ! . .
2741 call get_lastarg_def ;1065 cd 69 03 . i .
2742 read_file:
2743 push hl ;1068 e5 .
2744 ld hl,0 ;1069 21 00 00 ! . .
2745 ld (high_load),hl ;106c 22 9c 11 " . .
2746 call fcb_clear_rc ;106f cd 4c 10 . L .
2747 ld c,BDOS_OPEN ;1072 0e 0f . .
2748 call ddtz_base ;1074 cd 00 00 . . .
2749 inc a ;1077 3c <
2750 jp z,ERROR ;1078 ca 07 01 . . .
2751 ld hl,FCB+9 ;107b 21 65 00 ! e .
2752 ld de,str_hex ;107e 11 a5 10 . . .
2753 ld b,3 ;1081 06 03 . .
2754 call strncmp ;1083 cd 67 11 . g .
2755 pop hl ;1086 e1 .
2756 jr z,read_hexfile ;1087 28 1f ( .
2757 ld de,TPA ;1089 11 00 01 . . .
2758 add hl,de ;108c 19 .
2759 push hl ;108d e5 .
2760 l108eh:
2761 call read_sector ;108e cd 21 11 . ! .
2762 pop hl ;1091 e1 .
2763 jp z,prnt_max_high ;1092 ca 72 11 . r .
2764 ld de,DMA_BUF ;1095 11 80 00 . . .
2765 ld b,080h ;1098 06 80 . .
2766 l109ah:
2767 ld a,(de) ;109a 1a .
2768 call cmdR_storebyte ;109b cd 36 11 . 6 .
2769 inc de ;109e 13 .
2770 inc hl ;109f 23 #
2771 djnz l109ah ;10a0 10 f8 . .
2772 push hl ;10a2 e5 .
2773 jr l108eh ;10a3 18 e9 . .
2774
2775 str_hex:
2776 db 'HEX' ;10a5 48 H E X
2777
2778 read_hexfile:
2779 push hl ;10a8 e5 .
2780 ld a,080h ;10a9 3e 80 > .
2781 ld (cmdR_rindex),a ;10ab 32 20 11 2 .
2782 l10aeh:
2783 call read_byte ;10ae cd 05 11 . . .
2784 jr z,rdhex_done ;10b1 28 31 ( 1
2785 cp ':' ;10b3 fe 3a . :
2786 jr nz,l10aeh ;10b5 20 f7 .
2787 ld c,0 ;10b7 0e 00 . .
2788 call read_hexchar ;10b9 cd e8 10 . . .
2789 ld b,a ;10bc 47 G
2790 call read_hexchar ;10bd cd e8 10 . . .
2791 ld h,a ;10c0 67 g
2792 call read_hexchar ;10c1 cd e8 10 . . .
2793 ld l,a ;10c4 6f o
2794 ld a,b ;10c5 78 x
2795 and a ;10c6 a7 .
2796 jr z,rdhex_done ;10c7 28 1b ( .
2797 call read_hexchar ;10c9 cd e8 10 . . .
2798 l10cch:
2799 call read_hexchar ;10cc cd e8 10 . . .
2800 pop de ;10cf d1 .
2801 push de ;10d0 d5 .
2802 push hl ;10d1 e5 .
2803 add hl,de ;10d2 19 .
2804 call cmdR_storebyte ;10d3 cd 36 11 . 6 .
2805 pop hl ;10d6 e1 .
2806 inc hl ;10d7 23 #
2807 djnz l10cch ;10d8 10 f2 . .
2808 call read_hexchar ;10da cd e8 10 . . .
2809 ld a,c ;10dd 79 y
2810 and a ;10de a7 .
2811 jp nz,ERROR ;10df c2 07 01 . . .
2812 jr l10aeh ;10e2 18 ca . .
2813 rdhex_done:
2814 pop hl ;10e4 e1 .
2815 jp prnt_max_high ;10e5 c3 72 11 . r .
2816
2817 read_hexchar:
2818 call read_hexdigit ;10e8 cd f9 10 . . .
2819 rlca ;10eb 07 .
2820 rlca ;10ec 07 .
2821 rlca ;10ed 07 .
2822 rlca ;10ee 07 .
2823 ld d,a ;10ef 57 W
2824 call read_hexdigit ;10f0 cd f9 10 . . .
2825 add a,d ;10f3 82 .
2826 ld d,a ;10f4 57 W
2827 add a,c ;10f5 81 .
2828 ld c,a ;10f6 4f O
2829 ld a,d ;10f7 7a z
2830 ret ;10f8 c9 .
2831
2832 read_hexdigit:
2833 call read_byte ;10f9 cd 05 11 . . .
2834 jr z,l1102h ;10fc 28 04 ( .
2835 call hex_digit ;10fe cd 12 06 . . .
2836 ret nc ;1101 d0 .
2837 l1102h:
2838 jp ERROR ;1102 c3 07 01 . . .
2839
2840 read_byte:
2841 ld a,(cmdR_rindex) ;1105 3a 20 11 : .
2842 cp 080h ;1108 fe 80 . .
2843 jr nz,l1111h ;110a 20 05 .
2844 call read_sector ;110c cd 21 11 . ! .
2845 ret z ;110f c8 .
2846 sub a ;1110 97 .
2847 l1111h:
2848 inc a ;1111 3c <
2849 ld (cmdR_rindex),a ;1112 32 20 11 2 .
2850 push hl ;1115 e5 .
2851 add a,07fh ;1116 c6 7f . \7f
2852 ld l,a ;1118 6f o
2853 ld h,000h ;1119 26 00 & .
2854 ld a,(hl) ;111b 7e ~
2855 pop hl ;111c e1 .
2856 cp 01ah ;111d fe 1a . .
2857 ret ;111f c9 .
2858
2859 cmdR_rindex:
2860 db 0 ;1120 00 .
2861
2862 read_sector:
2863 push hl ;1121 e5 .
2864 push de ;1122 d5 .
2865 push bc ;1123 c5 .
2866 ld de,FCB ;1124 11 5c 00 . \ .
2867 ld c,BDOS_READ ;1127 0e 14 . .
2868 call ddtz_base ;1129 cd 00 00 . . .
2869 dec a ;112c 3d =
2870 jr z,l1132h ;112d 28 03 ( .
2871 jp p,ERROR ;112f f2 07 01 . . .
2872 l1132h:
2873 pop bc ;1132 c1 .
2874 pop de ;1133 d1 .
2875 pop hl ;1134 e1 .
2876 ret ;1135 c9 .
2877
2878 cmdR_storebyte:
2879 push af ;1136 f5 .
2880 push de ;1137 d5 .
2881 ld de,TPA ;1138 11 00 01 . . .
2882 call cp_hl_de ;113b cd ee 02 . . .
2883 jp c,ERROR ;113e da 07 01 . . .
2884 ld de,(BDOS+1) ;1141 ed 5b 06 00 . [ . .
2885 call cp_hl_de ;1145 cd ee 02 . . .
2886 jp nc,ERROR ;1148 d2 07 01 . . .
2887 ld de,(high_load) ;114b ed 5b 9c 11 . [ . .
2888 call cp_hl_de ;114f cd ee 02 . . .
2889 jr c,l1157h ;1152 38 03 8 .
2890 ld (high_load),hl ;1154 22 9c 11 " . .
2891 l1157h:
2892 ld de,(max_load) ;1157 ed 5b 9e 11 . [ . .
2893 call cp_hl_de ;115b cd ee 02 . . .
2894 jr c,l1163h ;115e 38 03 8 .
2895 ld (max_load),hl ;1160 22 9e 11 " . .
2896 l1163h:
2897 pop de ;1163 d1 .
2898 pop af ;1164 f1 .
2899 ld (hl),a ;1165 77 w
2900 ret ;1166 c9 .
2901
2902 strncmp:
2903 ld a,(de) ;1167 1a .
2904 cp (hl) ;1168 be .
2905 inc de ;1169 13 .
2906 inc hl ;116a 23 #
2907 ret nz ;116b c0 .
2908 djnz strncmp ;116c 10 f9 . .
2909 ret ;116e c9 .
2910
2911 prnt_max_high0:
2912 call assert_eol ;116f cd d6 02 . . .
2913 prnt_max_high:
2914 ld hl,msg_high ;1172 21 8d 11 ! . .
2915 call pstr ;1175 cd 88 02 . . .
2916 ld hl,(high_load) ;1178 2a 9c 11 * . .
2917 call out_hl ;117b cd 13 02 . . .
2918 ld hl,msg_max ;117e 21 94 11 ! . .
2919 call pstr ;1181 cd 88 02 . . .
2920 ld hl,(max_load) ;1184 2a 9e 11 * . .
2921 call out_hl ;1187 cd 13 02 . . .
2922 jp crlf ;118a c3 a3 02 . . .
2923
2924 msg_high:
2925 DC 'High = '
2926 msg_max:
2927 DC ' Max = '
2928
2929 high_load:
2930 defw TPA ;119c 00 01 . .
2931 max_load:
2932 defw TPA ;119e 00 01 . .
2933
2934 cmd_W:
2935 call get_arg_range ;11a0 cd 7d 03 . } .
2936 call assert_eol ;11a3 cd d6 02 . . .
2937 push hl ;11a6 e5 .
2938 ld a,c ;11a7 79 y
2939 add a,07fh ;11a8 c6 7f . \7f
2940 jr nc,l11adh ;11aa 30 01 0 .
2941 inc b ;11ac 04 .
2942 l11adh:
2943 and 080h ;11ad e6 80 . .
2944 ld c,a ;11af 4f O
2945 push bc ;11b0 c5 .
2946 ld a,(FCB+1) ;11b1 3a 5d 00 : ] .
2947 cp ' ' ;11b4 fe 20 .
2948 jr z,error5 ;11b6 28 3b ( ;
2949 call fcb_clear_rc ;11b8 cd 4c 10 . L .
2950 push de ;11bb d5 .
2951 ld c,BDOS_DELETE ;11bc 0e 13 . .
2952 call ddtz_base ;11be cd 00 00 . . .
2953 pop de ;11c1 d1 .
2954 ld c,BDOS_CREATE ;11c2 0e 16 . .
2955 call ddtz_base ;11c4 cd 00 00 . . .
2956 inc a ;11c7 3c <
2957 jr z,error5 ;11c8 28 29 ( )
2958 pop bc ;11ca c1 .
2959 pop hl ;11cb e1 .
2960 l11cch:
2961 ld a,b ;11cc 78 x
2962 or c ;11cd b1 .
2963 jr z,close_file ;11ce 28 26 ( &
2964 push bc ;11d0 c5 .
2965 ld de,080h ;11d1 11 80 00 . . . DMA_BUF
2966 ld b,d ;11d4 42 B
2967 ld c,e ;11d5 4b K
2968 ldir ;11d6 ed b0 . .
2969 call write_sector ;11d8 cd e4 11 . . .
2970 ex (sp),hl ;11db e3 .
2971 ld bc,0ff80h ;11dc 01 80 ff . . .
2972 add hl,bc ;11df 09 .
2973 ex (sp),hl ;11e0 e3 .
2974 pop bc ;11e1 c1 .
2975 jr l11cch ;11e2 18 e8 . .
2976
2977 write_sector:
2978 push hl ;11e4 e5 .
2979 ld de,FCB ;11e5 11 5c 00 . \ .
2980 ld c,BDOS_WRITE ;11e8 0e 15 . .
2981 call ddtz_base ;11ea cd 00 00 . . .
2982 pop hl ;11ed e1 .
2983 and a ;11ee a7 .
2984 ret z ;11ef c8 .
2985 call close_file ;11f0 cd f6 11 . . .
2986 error5:
2987 jp ERROR ;11f3 c3 07 01 . . .
2988
2989 close_file:
2990 ld de,FCB ;11f6 11 5c 00 . \ .
2991 ld c,BDOS_CLOSE ;11f9 0e 10 . .
2992 jp ddtz_base ;11fb c3 00 00 . . .
2993
2994 cmd_A:
2995 ld hl,(last_A) ;11fe 2a 64 12 * d .
2996 call get_lastarg_def ;1201 cd 69 03 . i .
2997 push hl ;1204 e5 .
2998 pop iy ;1205 fd e1 . .
2999 ld hl,l1259h ;1207 21 59 12 ! Y .
3000 ld (CMD_ERR),hl ;120a 22 66 00 " f .
3001 ld (l1262h),sp ;120d ed 73 62 12 . s b .
3002 l1211h:
3003 push iy ;1211 fd e5 . .
3004 pop hl ;1213 e1 .
3005 ld (last_A),hl ;1214 22 64 12 " d .
3006 ld (l0062h),hl ;1217 22 62 00 " b .
3007 push hl ;121a e5 .
3008 call sub_192dh ;121b cd 2d 19 . - .
3009 pop iy ;121e fd e1 . .
3010 ld c,b ;1220 48 H
3011 ld de,(offs.@) ;1221 ed 5b 64 00 . [ d .
3012 ld a,d ;1225 7a z
3013 or e ;1226 b3 .
3014 ld b,011h ;1227 06 11 . .
3015 jr z,l122dh ;1229 28 02 ( .
3016 ld b,019h ;122b 06 19 . .
3017 l122dh:
3018 call outbl ;122d cd 9f 02 . . .
3019 ld a,(con_col) ;1230 3a 72 02 : r .
3020 cp b ;1233 b8 .
3021 jr c,l122dh ;1234 38 f7 8 .
3022 push bc ;1236 c5 .
3023 call get_line ;1237 cd 4e 01 . N .
3024 pop bc ;123a c1 .
3025 call skipbl ;123b cd bf 02 . . .
3026 cp '.' ;123e fe 2e . .
3027 ret z ;1240 c8 .
3028 cp '-' ;1241 fe 2d . -
3029 jr nz,l124bh ;1243 20 06 .
3030 ld iy,(cmd_A_prev) ;1245 fd 2a 66 12 . * f .
3031 jr l1211h ;1249 18 c6 . .
3032 l124bh:
3033 and a ;124b a7 .
3034 call nz,sub_1268h ;124c c4 68 12 . h .
3035 ld (cmd_A_prev),iy ;124f fd 22 66 12 . " f .
3036 ld b,0 ;1253 06 00 . .
3037 add iy,bc ;1255 fd 09 . .
3038 jr l1211h ;1257 18 b8 . .
3039 l1259h:
3040 call l0146h ;1259 cd 46 01 . F .
3041 ld sp,(l1262h) ;125c ed 7b 62 12 . { b .
3042 jr l1211h ;1260 18 af . .
3043
3044 l1262h:
3045 dw 0 ;1262 00 00 .
3046 last_A:
3047 dw TPA ;1264 00 01 .
3048 cmd_A_prev:
3049 dw TPA ;1266 00 01 . .
3050
3051 sub_1268h:
3052 call skipbl ;1268 cd bf 02 . . .
3053 ld hl,t_MNEMONICS ;126b 21 c6 1e ! . .
3054 call sub_030ah ;126e cd 0a 03 . . .
3055 jp nc,ERROR ;1271 d2 07 01 . . .
3056 call skipbl ;1274 cd bf 02 . . .
3057 push de ;1277 d5 .
3058 ld a,b ;1278 78 x
3059 add a,b ;1279 80 .
3060 add a,b ;127a 80 .
3061 ld hl,b_1289_start ;127b 21 89 12 ! . .
3062 call add_hl_a ;127e cd b9 02 . . .
3063 ld e,(hl) ;1281 5e ^
3064 inc hl ;1282 23 #
3065 ld d,(hl) ;1283 56 V
3066 inc hl ;1284 23 #
3067 ld b,(hl) ;1285 46 F
3068 ex de,hl ;1286 eb .
3069 pop de ;1287 d1 .
3070 jp (hl) ;1288 e9 .
3071
3072 b_1289_start:
3073 defw l1551h ;1289 51 15 Q .
3074 defb 088h ;128b 88 .
3075 defw l1571h ;128c 71 15 q .
3076 defb 080h ;128e 80 .
3077 defw l15a8h ;128f a8 15 . .
3078 defb 0a0h ;1291 a0 .
3079 defw l1609h ;1292 09 16 . .
3080 defb 040h ;1294 40 @
3081 defw l162dh ;1295 2d 16 - .
3082 defb 0c4h ;1297 c4 .
3083 defw l153bh ;1298 3b 15 ; .
3084 defb 03fh ;129a 3f ?
3085 defw l15a8h ;129b a8 15 . .
3086 defb 0b8h ;129d b8 .
3087 defw l1544h ;129e 44 15 D .
3088 defb 0a9h ;12a0 a9 .
3089 defw l1544h ;12a1 44 15 D .
3090 defb 0b9h ;12a3 b9 .
3091 defw l1544h ;12a4 44 15 D .
3092 defb 0a1h ;12a6 a1 .
3093 defw l1544h ;12a7 44 15 D .
3094 defb 0b1h ;12a9 b1 .
3095 defw l153bh ;12aa 3b 15 ; .
3096 defb 02fh ;12ac 2f /
3097 defw l153bh ;12ad 3b 15 ; .
3098 defb 027h ;12af 27 '
3099 defw l1798h ;12b0 98 17 . .
3100 defb 005h ;12b2 05 .
3101 defw l153bh ;12b3 3b 15 ; .
3102 defb 0f3h ;12b5 f3 .
3103 defw l1699h ;12b6 99 16 . .
3104 defb 010h ;12b8 10 .
3105 defw l153bh ;12b9 3b 15 ; .
3106 defb 0fbh ;12bb fb .
3107 defw l1749h ;12bc 49 17 I .
3108 defb 0e3h ;12be e3 .
3109 defw l153bh ;12bf 3b 15 ; .
3110 defb 0d9h ;12c1 d9 .
3111 defw l153bh ;12c2 3b 15 ; .
3112 defb 076h ;12c4 76 v
3113 defw l16b4h ;12c5 b4 16 . .
3114 defb 046h ;12c7 46 F
3115 defw l16edh ;12c8 ed 16 . .
3116 defb 040h ;12ca 40 @
3117 defw l1798h ;12cb 98 17 . .
3118 defb 004h ;12cd 04 .
3119 defw l1544h ;12ce 44 15 D .
3120 defb 0aah ;12d0 aa .
3121 defw l1544h ;12d1 44 15 D .
3122 defb 0bah ;12d3 ba .
3123 defw l1544h ;12d4 44 15 D .
3124 defb 0a2h ;12d6 a2 .
3125 defw l1544h ;12d7 44 15 D .
3126 defb 0b2h ;12d9 b2 .
3127 defw l1653h ;12da 53 16 S .
3128 defb 0c2h ;12dc c2 .
3129 defw l16a0h ;12dd a0 16 . .
3130 defb 020h ;12df 20
3131 defw l1352h ;12e0 52 13 R .
3132 defb 040h ;12e2 40 @
3133 defw l1544h ;12e3 44 15 D .
3134 defb 0a8h ;12e5 a8 .
3135 defw l1544h ;12e6 44 15 D .
3136 defb 0b8h ;12e8 b8 .
3137 defw l1544h ;12e9 44 15 D .
3138 defb 0a0h ;12eb a0 .
3139 defw l1544h ;12ec 44 15 D .
3140 defb 0b0h ;12ee b0 .
3141 defw l1544h ;12ef 44 15 D .
3142 defb 044h ;12f1 44 D
3143 defw l153bh ;12f2 3b 15 ; .
3144 defb 000h ;12f4 00 .
3145 defw l15a8h ;12f5 a8 15 . .
3146 defb 0b0h ;12f7 b0 .
3147 defw l1544h ;12f8 44 15 D .
3148 defb 0bbh ;12fa bb .
3149 defw l1544h ;12fb 44 15 D .
3150 defb 0b3h ;12fd b3 .
3151 defw l1721h ;12fe 21 17 ! .
3152 defb 041h ;1300 41 A
3153 defw l1544h ;1301 44 15 D .
3154 defb 0abh ;1303 ab .
3155 defw l1544h ;1304 44 15 D .
3156 defb 0a3h ;1306 a3 .
3157 defw l16d9h ;1307 d9 16 . .
3158 defb 0c1h ;1309 c1 .
3159 defw l16d9h ;130a d9 16 . .
3160 defb 0c5h ;130c c5 .
3161 defw l1609h ;130d 09 16 . .
3162 defb 080h ;130f 80 .
3163 defw l1645h ;1310 45 16 E .
3164 defb 0c0h ;1312 c0 .
3165 defw l1544h ;1313 44 15 D .
3166 defb 04dh ;1315 4d M
3167 defw l1544h ;1316 44 15 D .
3168 defb 045h ;1318 45 E
3169 defw l15d5h ;1319 d5 15 . .
3170 defb 010h ;131b 10 .
3171 defw l153bh ;131c 3b 15 ; .
3172 defb 017h ;131e 17 .
3173 defw l15d5h ;131f d5 15 . .
3174 defb 000h ;1321 00 .
3175 defw l153bh ;1322 3b 15 ; .
3176 defb 007h ;1324 07 .
3177 defw l1544h ;1325 44 15 D .
3178 defb 06fh ;1327 6f o
3179 defw l15d5h ;1328 d5 15 . .
3180 defb 018h ;132a 18 .
3181 defw l153bh ;132b 3b 15 ; .
3182 defb 01fh ;132d 1f .
3183 defw l15d5h ;132e d5 15 . .
3184 defb 008h ;1330 08 .
3185 defw l153bh ;1331 3b 15 ; .
3186 defb 00fh ;1333 0f .
3187 defw l1544h ;1334 44 15 D .
3188 defb 067h ;1336 67 g
3189 defw l16cah ;1337 ca 16 . .
3190 defb 0c7h ;1339 c7 .
3191 defw l1551h ;133a 51 15 Q .
3192 defb 098h ;133c 98 .
3193 defw l153bh ;133d 3b 15 ; .
3194 defb 037h ;133f 37 7
3195 defw l1609h ;1340 09 16 . .
3196 defb 0c0h ;1342 c0 .
3197 defw l15d5h ;1343 d5 15 . .
3198 defb 020h ;1345 20
3199 defw l15d5h ;1346 d5 15 . .
3200 defb 028h ;1348 28 (
3201 defw l15d5h ;1349 d5 15 . .
3202 defb 038h ;134b 38 8
3203 defw l15a8h ;134c a8 15 . .
3204 defb 090h ;134e 90 .
3205 defw l15a8h ;134f a8 15 . .
3206 defb 0a8h ;1351 a8 .
3207
3208 l1352h:
3209 call sub_182eh ;1352 cd 2e 18 . . .
3210 jr c,l13d4h ;1355 38 7d 8 }
3211 call sub_1855h ;1357 cd 55 18 . U .
3212 jp c,l1471h ;135a da 71 14 . q .
3213 call sub_181bh ;135d cd 1b 18 . . .
3214 jp c,l149ch ;1360 da 9c 14 . . .
3215 call sub_183dh ;1363 cd 3d 18 . = .
3216 jp c,l14f5h ;1366 da f5 14 . . .
3217 ld a,(de) ;1369 1a .
3218 cp 'I' ;136a fe 49 . I
3219 jp z,l1511h ;136c ca 11 15 . . .
3220 cp 'R' ;136f fe 52 . R
3221 jp z,l1519h ;1371 ca 19 15 . . .
3222 cp '(' ;1374 fe 28 . (
3223 jp nz,ERROR ;1376 c2 07 01 . . .
3224 inc de ;1379 13 .
3225 call sub_181bh ;137a cd 1b 18 . . .
3226 jp c,l1528h ;137d da 28 15 . ( .
3227 call test_expr ;1380 cd 09 18 . . .
3228 call test_paren_close ;1383 cd c5 18 . . .
3229 call assert_comma ;1386 cd be 18 . . .
3230 call sub_181bh ;1389 cd 1b 18 . . .
3231 jr c,l13c2h ;138c 38 34 8 4
3232 call sub_183dh ;138e cd 3d 18 . = .
3233 jr nc,l13aah ;1391 30 17 0 .
3234 ld b,022h ;1393 06 22 . "
3235 l1395h:
3236 call assert_eol ;1395 cd d6 02 . . .
3237 ld a,(prefix_ixiy) ;1398 3a cc 18 : . .
3238 l139bh:
3239 ld (iy+000h),a ;139b fd 77 00 . w .
3240 ld (iy+001h),b ;139e fd 70 01 . p .
3241 ld (iy+002h),l ;13a1 fd 75 02 . u .
3242 ld (iy+003h),h ;13a4 fd 74 03 . t .
3243 ld c,004h ;13a7 0e 04 . .
3244 ret ;13a9 c9 .
3245 l13aah:
3246 ld a,(de) ;13aa 1a .
3247 cp 'A' ;13ab fe 41 . A
3248 jp nz,ERROR ;13ad c2 07 01 . . .
3249 inc de ;13b0 13 .
3250 ld b,032h ;13b1 06 32 . 2
3251 l13b3h:
3252 call assert_eol ;13b3 cd d6 02 . . .
3253 ld (iy+000h),b ;13b6 fd 70 00 . p .
3254 ld (iy+001h),l ;13b9 fd 75 01 . u .
3255 ld (iy+002h),h ;13bc fd 74 02 . t .
3256 ld c,003h ;13bf 0e 03 . .
3257 ret ;13c1 c9 .
3258 l13c2h:
3259 cp 020h ;13c2 fe 20 .
3260 jr z,l13d0h ;13c4 28 0a ( .
3261 add a,043h ;13c6 c6 43 . C
3262 ld b,a ;13c8 47 G
3263 l13c9h:
3264 call assert_eol ;13c9 cd d6 02 . . .
3265 ld a,0edh ;13cc 3e ed > .
3266 jr l139bh ;13ce 18 cb . .
3267 l13d0h:
3268 ld b,022h ;13d0 06 22 . "
3269 jr l13b3h ;13d2 18 df . .
3270 l13d4h:
3271 ld b,a ;13d4 47 G
3272 call assert_comma ;13d5 cd be 18 . . .
3273 call sub_182eh ;13d8 cd 2e 18 . . .
3274 jr nc,l13f0h ;13db 30 13 0 .
3275 push af ;13dd f5 .
3276 ld a,b ;13de 78 x
3277 rlca ;13df 07 .
3278 rlca ;13e0 07 .
3279 rlca ;13e1 07 .
3280 ld b,a ;13e2 47 G
3281 pop af ;13e3 f1 .
3282 add a,b ;13e4 80 .
3283 add a,040h ;13e5 c6 40 . @
3284 cp 076h ;13e7 fe 76 . v
3285 jp z,ERROR ;13e9 ca 07 01 . . .
3286 l13ech:
3287 ld b,a ;13ec 47 G
3288 jp l153bh ;13ed c3 3b 15 . ; .
3289 l13f0h:
3290 call sub_1855h ;13f0 cd 55 18 . U .
3291 jr nc,l1413h ;13f3 30 1e 0 .
3292 ld a,b ;13f5 78 x
3293 rlca ;13f6 07 .
3294 rlca ;13f7 07 .
3295 rlca ;13f8 07 .
3296 add a,046h ;13f9 c6 46 . F
3297 cp 076h ;13fb fe 76 . v
3298 jp z,ERROR ;13fd ca 07 01 . . .
3299 l1400h:
3300 ld b,a ;1400 47 G
3301 call assert_eol ;1401 cd d6 02 . . .
3302 ld (iy+001h),b ;1404 fd 70 01 . p .
3303 ld (iy+002h),c ;1407 fd 71 02 . q .
3304 ld a,(prefix_ixiy) ;140a 3a cc 18 : . .
3305 ld (iy+000h),a ;140d fd 77 00 . w .
3306 ld c,003h ;1410 0e 03 . .
3307 ret ;1412 c9 .
3308 l1413h:
3309 ld a,(de) ;1413 1a .
3310 cp 'I' ;1414 fe 49 . I
3311 jr z,l1426h ;1416 28 0e ( .
3312 cp 'R' ;1418 fe 52 . R
3313 jr nz,l1432h ;141a 20 16 .
3314 ld a,b ;141c 78 x
3315 cp 007h ;141d fe 07 . .
3316 jp nz,ERROR ;141f c2 07 01 . . .
3317 ld b,05fh ;1422 06 5f . _
3318 jr l142eh ;1424 18 08 . .
3319 l1426h:
3320 ld a,b ;1426 78 x
3321 cp 007h ;1427 fe 07 . .
3322 jp nz,ERROR ;1429 c2 07 01 . . .
3323 ld b,057h ;142c 06 57 . W
3324 l142eh:
3325 inc de ;142e 13 .
3326 jp l1544h ;142f c3 44 15 . D .
3327 l1432h:
3328 cp '(' ;1432 fe 28 . (
3329 jr z,l144ch ;1434 28 16 ( .
3330 call sub_17ffh ;1436 cd ff 17 . . .
3331 ld a,b ;1439 78 x
3332 rlca ;143a 07 .
3333 rlca ;143b 07 .
3334 rlca ;143c 07 .
3335 add a,006h ;143d c6 06 . .
3336 l143fh:
3337 ld b,a ;143f 47 G
3338 l1440h:
3339 call assert_eol ;1440 cd d6 02 . . .
3340 ld (iy+000h),b ;1443 fd 70 00 . p .
3341 ld (iy+001h),l ;1446 fd 75 01 . u .
3342 ld c,002h ;1449 0e 02 . .
3343 ret ;144b c9 .
3344 l144ch:
3345 inc de ;144c 13 .
3346 ld a,b ;144d 78 x
3347 cp 007h ;144e fe 07 . .
3348 jp nz,ERROR ;1450 c2 07 01 . . .
3349 call sub_181bh ;1453 cd 1b 18 . . .
3350 jr nc,l1466h ;1456 30 0e 0 .
3351 cp 030h ;1458 fe 30 . 0
3352 jp nc,ERROR ;145a d2 07 01 . . .
3353 add a,00ah ;145d c6 0a . .
3354 ld b,a ;145f 47 G
3355 call test_paren_close ;1460 cd c5 18 . . .
3356 jp l153bh ;1463 c3 3b 15 . ; .
3357 l1466h:
3358 call test_expr ;1466 cd 09 18 . . .
3359 call test_paren_close ;1469 cd c5 18 . . .
3360 ld b,03ah ;146c 06 3a . :
3361 jp l13b3h ;146e c3 b3 13 . . .
3362 l1471h:
3363 call assert_comma ;1471 cd be 18 . . .
3364 call sub_182eh ;1474 cd 2e 18 . . .
3365 jr nc,l1483h ;1477 30 0a 0 .
3366 cp 006h ;1479 fe 06 . .
3367 jp z,ERROR ;147b ca 07 01 . . .
3368 add a,070h ;147e c6 70 . p
3369 jp l1400h ;1480 c3 00 14 . . .
3370 l1483h:
3371 call sub_17ffh ;1483 cd ff 17 . . .
3372 call assert_eol ;1486 cd d6 02 . . .
3373 ld a,(prefix_ixiy) ;1489 3a cc 18 : . .
3374 ld (iy+000h),a ;148c fd 77 00 . w .
3375 ld (iy+001h),036h ;148f fd 36 01 36 . 6 . 6
3376 ld (iy+002h),c ;1493 fd 71 02 . q .
3377 ld (iy+003h),l ;1496 fd 75 03 . u .
3378 ld c,004h ;1499 0e 04 . .
3379 ret ;149b c9 .
3380 l149ch:
3381 ld b,a ;149c 47 G
3382 call assert_comma ;149d cd be 18 . . .
3383 ld hl,t_HL.AF ;14a0 21 af 1f ! . .
3384 call sub_0318h ;14a3 cd 18 03 . . .
3385 jr c,l14c3h ;14a6 38 1b 8 .
3386 call sub_183dh ;14a8 cd 3d 18 . = .
3387 jr nc,l14cch ;14ab 30 1f 0 .
3388 ld a,b ;14ad 78 x
3389 cp 030h ;14ae fe 30 . 0
3390 jr nz,error6 ;14b0 20 73 s
3391 ld b,0f9h ;14b2 06 f9 . .
3392 l14b4h:
3393 call assert_eol ;14b4 cd d6 02 . . .
3394 ld a,(prefix_ixiy) ;14b7 3a cc 18 : . .
3395 ld (iy+000h),a ;14ba fd 77 00 . w .
3396 ld (iy+001h),b ;14bd fd 70 01 . p .
3397 ld c,002h ;14c0 0e 02 . .
3398 ret ;14c2 c9 .
3399 l14c3h:
3400 ld a,b ;14c3 78 x
3401 cp 030h ;14c4 fe 30 . 0
3402 jr nz,error6 ;14c6 20 5d ]
3403 ld b,0f9h ;14c8 06 f9 . .
3404 jr l153bh ;14ca 18 6f . o
3405 l14cch:
3406 ld a,(de) ;14cc 1a .
3407 cp '(' ;14cd fe 28 . (
3408 jr nz,l14e8h ;14cf 20 17 .
3409 inc de ;14d1 13 .
3410 call test_expr ;14d2 cd 09 18 . . .
3411 call test_paren_close ;14d5 cd c5 18 . . .
3412 ld a,b ;14d8 78 x
3413 cp 020h ;14d9 fe 20 .
3414 jr z,l14e3h ;14db 28 06 ( .
3415 add a,04bh ;14dd c6 4b . K
3416 ld b,a ;14df 47 G
3417 jp l13c9h ;14e0 c3 c9 13 . . .
3418 l14e3h:
3419 ld b,02ah ;14e3 06 2a . *
3420 jp l13b3h ;14e5 c3 b3 13 . . .
3421 l14e8h:
3422 call test_expr ;14e8 cd 09 18 . . .
3423 call assert_eol ;14eb cd d6 02 . . .
3424 ld a,001h ;14ee 3e 01 > .
3425 add a,b ;14f0 80 .
3426 ld b,a ;14f1 47 G
3427 jp l13b3h ;14f2 c3 b3 13 . . .
3428 l14f5h:
3429 call assert_comma ;14f5 cd be 18 . . .
3430 ld a,(de) ;14f8 1a .
3431 cp '(' ;14f9 fe 28 . (
3432 jr nz,l1509h ;14fb 20 0c .
3433 inc de ;14fd 13 .
3434 call test_expr ;14fe cd 09 18 . . .
3435 call test_paren_close ;1501 cd c5 18 . . .
3436 ld b,02ah ;1504 06 2a . *
3437 jp l1395h ;1506 c3 95 13 . . .
3438 l1509h:
3439 call test_expr ;1509 cd 09 18 . . .
3440 ld b,021h ;150c 06 21 . !
3441 jp l1395h ;150e c3 95 13 . . .
3442 l1511h:
3443 inc de ;1511 13 .
3444 call assert_comma ;1512 cd be 18 . . .
3445 ld b,047h ;1515 06 47 . G
3446 jr l151fh ;1517 18 06 . .
3447 l1519h:
3448 inc de ;1519 13 .
3449 call assert_comma ;151a cd be 18 . . .
3450 ld b,04fh ;151d 06 4f . O
3451 l151fh:
3452 ld a,(de) ;151f 1a .
3453 inc de ;1520 13 .
3454 cp 'A' ;1521 fe 41 . A
3455 jr z,l1544h ;1523 28 1f ( .
3456 error6:
3457 jp ERROR ;1525 c3 07 01 . . .
3458
3459 l1528h:
3460 cp 020h ;1528 fe 20 .
3461 jr nc,error6 ;152a 30 f9 0 .
3462 add a,002h ;152c c6 02 . .
3463 ld b,a ;152e 47 G
3464 call test_paren_close ;152f cd c5 18 . . .
3465 call assert_comma ;1532 cd be 18 . . .
3466 ld a,(de) ;1535 1a .
3467 cp 'A' ;1536 fe 41 . A
3468 jr nz,error6 ;1538 20 eb .
3469 inc de ;153a 13 .
3470 l153bh:
3471 call assert_eol ;153b cd d6 02 . . .
3472 ld (iy+000h),b ;153e fd 70 00 . p .
3473 ld c,001h ;1541 0e 01 . .
3474 ret ;1543 c9 .
3475
3476 l1544h:
3477 call assert_eol ;1544 cd d6 02 . . .
3478 ld (iy+000h),0edh ;1547 fd 36 00 ed . 6 . .
3479 ld (iy+001h),b ;154b fd 70 01 . p .
3480 ld c,002h ;154e 0e 02 . .
3481 ret ;1550 c9 .
3482
3483 l1551h:
3484 ld hl,t_HL.AF ;1551 21 af 1f ! . .
3485 call sub_0318h ;1554 cd 18 03 . . .
3486 jr nc,l15a8h ;1557 30 4f 0 O
3487 call assert_comma ;1559 cd be 18 . . .
3488 call sub_181bh ;155c cd 1b 18 . . .
3489 jp nc,ERROR ;155f d2 07 01 . . .
3490 push af ;1562 f5 .
3491 ld a,b ;1563 78 x
3492 cp 088h ;1564 fe 88 . .
3493 ld b,04ah ;1566 06 4a . J
3494 jr z,l156ch ;1568 28 02 ( .
3495 ld b,042h ;156a 06 42 . B
3496 l156ch:
3497 pop af ;156c f1 .
3498 add a,b ;156d 80 .
3499 l156eh:
3500 ld b,a ;156e 47 G
3501 jr l1544h ;156f 18 d3 . .
3502 l1571h:
3503 ld hl,t_HL.AF ;1571 21 af 1f ! . .
3504 call sub_0318h ;1574 cd 18 03 . . .
3505 jr c,l159ah ;1577 38 21 8 !
3506 call sub_183dh ;1579 cd 3d 18 . = .
3507 jr nc,l15a8h ;157c 30 2a 0 *
3508 call assert_comma ;157e cd be 18 . . .
3509 ld hl,t_BC.DE.IX.SP ;1581 21 bd 1f ! . .
3510 ld a,(prefix_ixiy) ;1584 3a cc 18 : . .
3511 cp 0fdh ;1587 fe fd . .
3512 jr nz,l158eh ;1589 20 03 .
3513 ld hl,t_BC.DE.IY.SP ;158b 21 b4 1f ! . .
3514 l158eh:
3515 call sub_1818h ;158e cd 18 18 . . .
3516 jp nc,ERROR ;1591 d2 07 01 . . .
3517 add a,009h ;1594 c6 09 . .
3518 l1596h:
3519 ld b,a ;1596 47 G
3520 jp l14b4h ;1597 c3 b4 14 . . .
3521 l159ah:
3522 call assert_comma ;159a cd be 18 . . .
3523 call sub_181bh ;159d cd 1b 18 . . .
3524 jp nc,ERROR ;15a0 d2 07 01 . . .
3525 add a,009h ;15a3 c6 09 . .
3526 jp l13ech ;15a5 c3 ec 13 . . .
3527 l15a8h:
3528 ld a,(de) ;15a8 1a .
3529 cp 'A' ;15a9 fe 41 . A
3530 jr nz,l15b8h ;15ab 20 0b .
3531 push de ;15ad d5 .
3532 inc de ;15ae 13 .
3533 call next_arg ;15af cd ca 02 . . .
3534 jr z,l15b7h ;15b2 28 03 ( .
3535 pop de ;15b4 d1 .
3536 jr l15b8h ;15b5 18 01 . .
3537 l15b7h:
3538 pop af ;15b7 f1 .
3539 l15b8h:
3540 call sub_182eh ;15b8 cd 2e 18 . . .
3541 jr c,l15cbh ;15bb 38 0e 8 .
3542 call sub_1855h ;15bd cd 55 18 . U .
3543 jr c,l15cfh ;15c0 38 0d 8 .
3544 call sub_17ffh ;15c2 cd ff 17 . . .
3545 ld a,b ;15c5 78 x
3546 add a,046h ;15c6 c6 46 . F
3547 jp l143fh ;15c8 c3 3f 14 . ? .
3548 l15cbh:
3549 add a,b ;15cb 80 .
3550 jp l13ech ;15cc c3 ec 13 . . .
3551 l15cfh:
3552 ld a,b ;15cf 78 x
3553 add a,006h ;15d0 c6 06 . .
3554 jp l1400h ;15d2 c3 00 14 . . .
3555 l15d5h:
3556 call sub_182eh ;15d5 cd 2e 18 . . .
3557 jr c,l15fah ;15d8 38 20 8
3558 call sub_1855h ;15da cd 55 18 . U .
3559 jp nc,ERROR ;15dd d2 07 01 . . .
3560 ld a,b ;15e0 78 x
3561 add a,006h ;15e1 c6 06 . .
3562 ld b,a ;15e3 47 G
3563 l15e4h:
3564 call assert_eol ;15e4 cd d6 02 . . .
3565 ld a,(prefix_ixiy) ;15e7 3a cc 18 : . .
3566 ld (iy+000h),a ;15ea fd 77 00 . w .
3567 ld (iy+001h),0cbh ;15ed fd 36 01 cb . 6 . .
3568 ld (iy+002h),c ;15f1 fd 71 02 . q .
3569 ld (iy+003h),b ;15f4 fd 70 03 . p .
3570 ld c,004h ;15f7 0e 04 . .
3571 ret ;15f9 c9 .
3572 l15fah:
3573 add a,b ;15fa 80 .
3574 l15fbh:
3575 ld b,a ;15fb 47 G
3576 call assert_eol ;15fc cd d6 02 . . .
3577 ld (iy+001h),b ;15ff fd 70 01 . p .
3578 ld (iy+000h),0cbh ;1602 fd 36 00 cb . 6 . .
3579 ld c,002h ;1606 0e 02 . .
3580 ret ;1608 c9 .
3581 l1609h:
3582 call sub_17d3h ;1609 cd d3 17 . . .
3583 call assert_comma ;160c cd be 18 . . .
3584 call sub_182eh ;160f cd 2e 18 . . .
3585 jr c,l1624h ;1612 38 10 8 .
3586 call sub_1855h ;1614 cd 55 18 . U .
3587 jp nc,ERROR ;1617 d2 07 01 . . .
3588 ld a,l ;161a 7d }
3589 rlca ;161b 07 .
3590 rlca ;161c 07 .
3591 rlca ;161d 07 .
3592 add a,006h ;161e c6 06 . .
3593 add a,b ;1620 80 .
3594 ld b,a ;1621 47 G
3595 jr l15e4h ;1622 18 c0 . .
3596 l1624h:
3597 add a,b ;1624 80 .
3598 ld b,a ;1625 47 G
3599 ld a,l ;1626 7d }
3600 rlca ;1627 07 .
3601 rlca ;1628 07 .
3602 rlca ;1629 07 .
3603 add a,b ;162a 80 .
3604 jr l15fbh ;162b 18 ce . .
3605 l162dh:
3606 push de ;162d d5 .
3607 call sub_18a5h ;162e cd a5 18 . . .
3608 jr nc,l163ch ;1631 30 09 0 .
3609 add a,b ;1633 80 .
3610 ld b,a ;1634 47 G
3611 call next_arg ;1635 cd ca 02 . . .
3612 jr z,l163eh ;1638 28 04 ( .
3613 pop de ;163a d1 .
3614 push de ;163b d5 .
3615 l163ch:
3616 ld b,0cdh ;163c 06 cd . .
3617 l163eh:
3618 pop af ;163e f1 .
3619 call test_expr ;163f cd 09 18 . . .
3620 jp l13b3h ;1642 c3 b3 13 . . .
3621 l1645h:
3622 call sub_18a5h ;1645 cd a5 18 . . .
3623 jr nc,l164eh ;1648 30 04 0 .
3624 add a,b ;164a 80 .
3625 ld b,a ;164b 47 G
3626 jr l1650h ;164c 18 02 . .
3627 l164eh:
3628 ld b,0c9h ;164e 06 c9 . .
3629 l1650h:
3630 jp l153bh ;1650 c3 3b 15 . ; .
3631 l1653h:
3632 push de ;1653 d5 .
3633 call sub_18a5h ;1654 cd a5 18 . . .
3634 jr c,l1666h ;1657 38 0d 8 .
3635 l1659h:
3636 pop de ;1659 d1 .
3637 ld hl,l168ch ;165a 21 8c 16 ! . .
3638 call sub_030ah ;165d cd 0a 03 . . .
3639 jr c,l1674h ;1660 38 12 8 .
3640 ld b,0c3h ;1662 06 c3 . .
3641 jr l166eh ;1664 18 08 . .
3642 l1666h:
3643 add a,b ;1666 80 .
3644 ld b,a ;1667 47 G
3645 call next_arg ;1668 cd ca 02 . . .
3646 jr nz,l1659h ;166b 20 ec .
3647 pop af ;166d f1 .
3648 l166eh:
3649 call test_expr ;166e cd 09 18 . . .
3650 jp l13b3h ;1671 c3 b3 13 . . .
3651 l1674h:
3652 call assert_eol ;1674 cd d6 02 . . .
3653 ld a,b ;1677 78 x
3654 and a ;1678 a7 .
3655 jr nz,l1680h ;1679 20 05 .
3656 ld b,0e9h ;167b 06 e9 . .
3657 jp l153bh ;167d c3 3b 15 . ; .
3658 l1680h:
3659 ld b,0ddh ;1680 06 dd . .
3660 dec a ;1682 3d =
3661 jr z,l1687h ;1683 28 02 ( .
3662 ld b,0fdh ;1685 06 fd . .
3663 l1687h:
3664 ld l,0e9h ;1687 2e e9 . .
3665 jp l1440h ;1689 c3 40 14 . @ .
3666
3667 l168ch:
3668 DC '(HL)'
3669 DC '(IX)'
3670 DC '(IY)'
3671 DB 0
3672
3673 l1699h:
3674 call next_arg ;1699 cd ca 02 . . .
3675 ld b,010h ;169c 06 10 . .
3676 jr l16aeh ;169e 18 0e . .
3677 l16a0h:
3678 call sub_18ach ;16a0 cd ac 18 . . .
3679 jr c,l16a9h ;16a3 38 04 8 .
3680 ld b,018h ;16a5 06 18 . .
3681 jr l16aeh ;16a7 18 05 . .
3682 l16a9h:
3683 add a,b ;16a9 80 .
3684 ld b,a ;16aa 47 G
3685 call assert_comma ;16ab cd be 18 . . .
3686 l16aeh:
3687 call sub_17dch ;16ae cd dc 17 . . .
3688 jp l1440h ;16b1 c3 40 14 . @ .
3689
3690 l16b4h:
3691 call sub_17ffh ;16b4 cd ff 17 . . .
3692 ld a,l ;16b7 7d }
3693 cp 003h ;16b8 fe 03 . .
3694 jr nc,error2 ;16ba 30 5c 0 \
3695 and a ;16bc a7 .
3696 jr z,l16c7h ;16bd 28 08 ( .
3697 ld b,056h ;16bf 06 56 . V
3698 cp 001h ;16c1 fe 01 . .
3699 jr z,l16c7h ;16c3 28 02 ( .
3700 ld b,05eh ;16c5 06 5e . ^
3701 l16c7h:
3702 jp l1544h ;16c7 c3 44 15 . D .
3703
3704 l16cah:
3705 call sub_17ffh ;16ca cd ff 17 . . .
3706 ld a,l ;16cd 7d }
3707 push af ;16ce f5 .
3708 add a,b ;16cf 80 .
3709 ld b,a ;16d0 47 G
3710 pop af ;16d1 f1 .
3711 and 0c7h ;16d2 e6 c7 . .
3712 jr nz,error2 ;16d4 20 42 B
3713 jp l153bh ;16d6 c3 3b 15 . ; .
3714
3715 l16d9h:
3716 call sub_183dh ;16d9 cd 3d 18 . = .
3717 jr c,l16e7h ;16dc 38 09 8 .
3718 call sub_1812h ;16de cd 12 18 . . .
3719 jr nc,error2 ;16e1 30 35 0 5
3720 add a,b ;16e3 80 .
3721 jp l13ech ;16e4 c3 ec 13 . . .
3722 l16e7h:
3723 ld a,b ;16e7 78 x
3724 add a,020h ;16e8 c6 20 .
3725 jp l1596h ;16ea c3 96 15 . . .
3726
3727 l16edh:
3728 call sub_182eh ;16ed cd 2e 18 . . .
3729 jr nc,error2 ;16f0 30 26 0 &
3730 cp 006h ;16f2 fe 06 . .
3731 jr z,error2 ;16f4 28 22 ( "
3732 rlca ;16f6 07 .
3733 rlca ;16f7 07 .
3734 rlca ;16f8 07 .
3735 add a,b ;16f9 80 .
3736 ld b,a ;16fa 47 G
3737 cp 078h ;16fb fe 78 . x
3738 jr nz,l170fh ;16fd 20 10 .
3739 call assert_comma ;16ff cd be 18 . . .
3740 call sub_171bh ;1702 cd 1b 17 . . .
3741 jr c,l1715h ;1705 38 0e 8 .
3742 call sub_17f3h ;1707 cd f3 17 . . .
3743 ld b,0dbh ;170a 06 db . .
3744 jp l1440h ;170c c3 40 14 . @ .
3745 l170fh:
3746 call assert_comma ;170f cd be 18 . . .
3747 call sub_171bh ;1712 cd 1b 17 . . .
3748 l1715h:
3749 jp c,l1544h ;1715 da 44 15 . D .
3750 error2:
3751 jp ERROR ;1718 c3 07 01 . . .
3752
3753 sub_171bh:
3754 ld hl,t__C_ ;171b 21 f4 1f ! . .
3755 jp sub_0318h ;171e c3 18 03 . . .
3756
3757 l1721h:
3758 call sub_171bh ;1721 cd 1b 17 . . .
3759 jr nc,l1739h ;1724 30 13 0 .
3760 call assert_comma ;1726 cd be 18 . . .
3761 call sub_182eh ;1729 cd 2e 18 . . .
3762 jr nc,error2 ;172c 30 ea 0 .
3763 cp 006h ;172e fe 06 . .
3764 jr z,error2 ;1730 28 e6 ( .
3765 rlca ;1732 07 .
3766 rlca ;1733 07 .
3767 rlca ;1734 07 .
3768 add a,b ;1735 80 .
3769 jp l156eh ;1736 c3 6e 15 . n .
3770
3771 l1739h:
3772 call sub_17f3h ;1739 cd f3 17 . . .
3773 call assert_comma ;173c cd be 18 . . .
3774 cp 'A' ;173f fe 41 . A
3775 jr nz,error2 ;1741 20 d5 .
3776 inc de ;1743 13 .
3777 ld b,0d3h ;1744 06 d3 . .
3778 jp l1440h ;1746 c3 40 14 . @ .
3779
3780 l1749h:
3781 ld hl,b_176d_start ;1749 21 6d 17 ! m .
3782 call sub_030ah ;174c cd 0a 03 . . .
3783 jp nc,ERROR ;174f d2 07 01 . . .
3784 ld c,b ;1752 48 H
3785 call assert_eol ;1753 cd d6 02 . . .
3786 ld b,000h ;1756 06 00 . .
3787 ld hl,l178eh ;1758 21 8e 17 ! . .
3788 add hl,bc ;175b 09 .
3789 add hl,bc ;175c 09 .
3790 ld a,(hl) ;175d 7e ~
3791 ld (iy+000h),a ;175e fd 77 00 . w .
3792 ld c,001h ;1761 0e 01 . .
3793 inc hl ;1763 23 #
3794 ld a,(hl) ;1764 7e ~
3795 and a ;1765 a7 .
3796 ret z ;1766 c8 .
3797 ld (iy+001h),a ;1767 fd 77 01 . w .
3798 ld c,002h ;176a 0e 02 . .
3799 ret ;176c c9 .
3800
3801 b_176d_start:
3802 DC 'AF,AF'''
3803 l1773h:
3804 DC 'DE,HL'
3805 DC '(SP),HL'
3806 DC '(SP),IX'
3807 DC '(SP),IY'
3808 db 0
3809 l178eh:
3810 db 008h,000h ;178e 08 .
3811 db 0ebh,000h ;1790 eb .
3812 db 0e3h,000h ;1792 e3 .
3813 db 0ddh,0e3h ;1794 dd .
3814 db 0fdh,0e3h ;1796 fd .
3815
3816 l1798h:
3817 call sub_183dh ;1798 cd 3d 18 . = .
3818 jr c,l17b3h ;179b 38 16 8 .
3819 call sub_181bh ;179d cd 1b 18 . . .
3820 jr c,l17bfh ;17a0 38 1d 8 .
3821 call sub_182eh ;17a2 cd 2e 18 . . .
3822 jr c,l17cch ;17a5 38 25 8 %
3823 call sub_1855h ;17a7 cd 55 18 . U .
3824 jp nc,ERROR ;17aa d2 07 01 . . .
3825 ld a,b ;17ad 78 x
3826 add a,030h ;17ae c6 30 . 0
3827 jp l1400h ;17b0 c3 00 14 . . .
3828 l17b3h:
3829 ld a,b ;17b3 78 x
3830 ld b,023h ;17b4 06 23 . #
3831 cp 004h ;17b6 fe 04 . .
3832 jr z,l17bch ;17b8 28 02 ( .
3833 ld b,02bh ;17ba 06 2b . +
3834 l17bch:
3835 jp l14b4h ;17bc c3 b4 14 . . .
3836 l17bfh:
3837 push af ;17bf f5 .
3838 ld a,b ;17c0 78 x
3839 ld b,003h ;17c1 06 03 . .
3840 cp 004h ;17c3 fe 04 . .
3841 jr z,l17c9h ;17c5 28 02 ( .
3842 ld b,00bh ;17c7 06 0b . .
3843 l17c9h:
3844 pop af ;17c9 f1 .
3845 jr l17cfh ;17ca 18 03 . .
3846 l17cch:
3847 rlca ;17cc 07 .
3848 rlca ;17cd 07 .
3849 rlca ;17ce 07 .
3850 l17cfh:
3851 add a,b ;17cf 80 .
3852 jp l13ech ;17d0 c3 ec 13 . . .
3853 sub_17d3h:
3854 call sub_17ffh ;17d3 cd ff 17 . . .
3855 ld a,l ;17d6 7d }
3856 cp 008h ;17d7 fe 08 . .
3857 jr nc,error3 ;17d9 30 34 0 4
3858 ret ;17db c9 .
3859 sub_17dch:
3860 call test_expr ;17dc cd 09 18 . . .
3861 push bc ;17df c5 .
3862 push iy ;17e0 fd e5 . .
3863 pop bc ;17e2 c1 .
3864 and a ;17e3 a7 .
3865 sbc hl,bc ;17e4 ed 42 . B
3866 dec hl ;17e6 2b +
3867 dec hl ;17e7 2b +
3868 pop bc ;17e8 c1 .
3869 call sub_1802h ;17e9 cd 02 18 . . .
3870 ld a,h ;17ec 7c |
3871 xor l ;17ed ad .
3872 bit 7,a ;17ee cb 7f . \7f
3873 jr nz,error3 ;17f0 20 1d .
3874 ret ;17f2 c9 .
3875
3876 sub_17f3h:
3877 ld a,(de) ;17f3 1a .
3878 cp '(' ;17f4 fe 28 . (
3879 jr nz,sub_17ffh ;17f6 20 07 .
3880 inc de ;17f8 13 .
3881 call sub_17ffh ;17f9 cd ff 17 . . .
3882 jp test_paren_close ;17fc c3 c5 18 . . .
3883
3884 sub_17ffh:
3885 call test_expr ;17ff cd 09 18 . . .
3886 sub_1802h:
3887 ld a,h ;1802 7c |
3888 and a ;1803 a7 .
3889 ret z ;1804 c8 .
3890 inc a ;1805 3c <
3891 ret z ;1806 c8 .
3892 jr error3 ;1807 18 06 . .
3893
3894 test_expr:
3895 push bc ;1809 c5 .
3896 call expr ;180a cd be 03 . . .
3897 pop bc ;180d c1 .
3898 ret nc ;180e d0 .
3899 error3:
3900 jp ERROR ;180f c3 07 01 . . .
3901
3902 sub_1812h:
3903 push hl ;1812 e5 .
3904 ld hl,t_BC.DE.HL.AF ;1813 21 ab 1f ! . .
3905 jr l181fh ;1816 18 07 . .
3906
3907 sub_1818h:
3908 push hl ;1818 e5 .
3909 jr l181fh ;1819 18 04 . .
3910
3911 sub_181bh:
3912 push hl ;181b e5 .
3913 ld hl,t_BC.DE.HL.SP ;181c 21 a2 1f ! . .
3914 l181fh:
3915 push bc ;181f c5 .
3916 call sub_030ah ;1820 cd 0a 03 . . .
3917 jr nc,l182bh ;1823 30 06 0 .
3918 ld a,b ;1825 78 x
3919 rlca ;1826 07 .
3920 rlca ;1827 07 .
3921 rlca ;1828 07 .
3922 rlca ;1829 07 .
3923 scf ;182a 37 7
3924 l182bh:
3925 pop bc ;182b c1 .
3926 pop hl ;182c e1 .
3927 ret ;182d c9 .
3928
3929 sub_182eh:
3930 call skipbl ;182e cd bf 02 . . .
3931 push bc ;1831 c5 .
3932 push hl ;1832 e5 .
3933 ld hl,t_BCDEHL_HL_A ;1833 21 96 1f ! . .
3934 call sub_030ah ;1836 cd 0a 03 . . .
3935 ld a,b ;1839 78 x
3936 pop hl ;183a e1 .
3937 pop bc ;183b c1 .
3938 ret ;183c c9 .
3939
3940 sub_183dh:
3941 push hl ;183d e5 .
3942 push bc ;183e c5 .
3943 ld hl,t_IX.IY ;183f 21 c8 1f ! . .
3944 call sub_030ah ;1842 cd 0a 03 . . .
3945 jr nc,l1852h ;1845 30 0b 0 .
3946 ld a,0ddh ;1847 3e dd > .
3947 dec b ;1849 05 .
3948 jr nz,l184eh ;184a 20 02 .
3949 ld a,0fdh ;184c 3e fd > .
3950 l184eh:
3951 ld (prefix_ixiy),a ;184e 32 cc 18 2 . .
3952 scf ;1851 37 7
3953 l1852h:
3954 pop bc ;1852 c1 .
3955 pop hl ;1853 e1 .
3956 ret ;1854 c9 .
3957 sub_1855h:
3958 push hl ;1855 e5 .
3959 push bc ;1856 c5 .
3960 ld a,(de) ;1857 1a .
3961 cp '(' ;1858 fe 28 . (
3962 jr nz,l18a1h ;185a 20 45 E
3963 push de ;185c d5 .
3964 inc de ;185d 13 .
3965 ld hl,t_IX.IY ;185e 21 c8 1f ! . .
3966 call sub_030ah ;1861 cd 0a 03 . . .
3967 jr nc,l18a0h ;1864 30 3a 0 :
3968 pop af ;1866 f1 .
3969 ld a,0ddh ;1867 3e dd > .
3970 dec b ;1869 05 .
3971 jr nz,l186eh ;186a 20 02 .
3972 ld a,0fdh ;186c 3e fd > .
3973 l186eh:
3974 ld (prefix_ixiy),a ;186e 32 cc 18 2 . .
3975 ld a,(de) ;1871 1a .
3976 cp '+' ;1872 fe 2b . +
3977 jr z,l1882h ;1874 28 0c ( .
3978 cp ')' ;1876 fe 29 . )
3979 ld hl,0 ;1878 21 00 00 ! . .
3980 jr z,l189ah ;187b 28 1d ( .
3981 cp '-' ;187d fe 2d . -
3982 jp nz,ERROR ;187f c2 07 01 . . .
3983 l1882h:
3984 push af ;1882 f5 .
3985 inc de ;1883 13 .
3986 call sub_17ffh ;1884 cd ff 17 . . .
3987 pop af ;1887 f1 .
3988 cp '+' ;1888 fe 2b . +
3989 jr z,l1894h ;188a 28 08 ( .
3990 ld b,h ;188c 44 D
3991 ld c,l ;188d 4d M
3992 ld hl,0 ;188e 21 00 00 ! . .
3993 and a ;1891 a7 .
3994 sbc hl,bc ;1892 ed 42 . B
3995 l1894h:
3996 ld a,(de) ;1894 1a .
3997 cp ')' ;1895 fe 29 . )
3998 jp nz,ERROR ;1897 c2 07 01 . . .
3999 l189ah:
4000 inc de ;189a 13 .
4001 pop bc ;189b c1 .
4002 ld c,l ;189c 4d M
4003 pop hl ;189d e1 .
4004 scf ;189e 37 7
4005 ret ;189f c9 .
4006 l18a0h:
4007 pop de ;18a0 d1 .
4008 l18a1h:
4009 pop bc ;18a1 c1 .
4010 pop hl ;18a2 e1 .
4011 and a ;18a3 a7 .
4012 ret ;18a4 c9 .
4013
4014 sub_18a5h:
4015 ld hl,t_tstfl_ZCPS ;18a5 21 dc 1f ! . .
4016 ld c,007h ;18a8 0e 07 . .
4017 jr l18b1h ;18aa 18 05 . .
4018
4019 sub_18ach:
4020 ld hl,t_tstfl_ZC ;18ac 21 cd 1f ! . .
4021 ld c,003h ;18af 0e 03 . .
4022 l18b1h:
4023 push bc ;18b1 c5 .
4024 call sub_030ah ;18b2 cd 0a 03 . . .
4025 ld a,b ;18b5 78 x
4026 pop bc ;18b6 c1 .
4027 ret nc ;18b7 d0 .
4028 and c ;18b8 a1 .
4029 rlca ;18b9 07 .
4030 rlca ;18ba 07 .
4031 rlca ;18bb 07 .
4032 scf ;18bc 37 7
4033 ret ;18bd c9 .
4034
4035 assert_comma:
4036 call next_arg ;18be cd ca 02 . . .
4037 ret z ;18c1 c8 .
4038 l18c2h:
4039 jp ERROR ;18c2 c3 07 01 . . .
4040
4041 test_paren_close:
4042 ld a,(de) ;18c5 1a .
4043 cp ')' ;18c6 fe 29 . )
4044 jr nz,l18c2h ;18c8 20 f8 .
4045 inc de ;18ca 13 .
4046 ret ;18cb c9 .
4047
4048 prefix_ixiy:
4049 db 0 ;18cc 00 .
4050
4051 cmd_L:
4052 ld hl,cmd_L ;18cd 21 cd 18 ! . .
4053 ld (cmd_rpt),hl ;18d0 22 68 00 " h .
4054 call expr ;18d3 cd be 03 . . .
4055 jr nc,l18dbh ;18d6 30 03 0 .
4056 ld hl,(last_L) ;18d8 2a f9 1f * . .
4057 l18dbh:
4058 push hl ;18db e5 .
4059 pop iy ;18dc fd e1 . .
4060 call next_arg ;18de cd ca 02 . . .
4061 call sub_039ah ;18e1 cd 9a 03 . . .
4062 jr nc,l1905h ;18e4 30 1f 0 .
4063 call assert_eol ;18e6 cd d6 02 . . .
4064 ld b,010h ;18e9 06 10 . .
4065 l18ebh:
4066 push bc ;18eb c5 .
4067 push iy ;18ec fd e5 . .
4068 pop hl ;18ee e1 .
4069 push hl ;18ef e5 .
4070 call sub_192dh ;18f0 cd 2d 19 . - .
4071 call crlf ;18f3 cd a3 02 . . .
4072 pop iy ;18f6 fd e1 . .
4073 ld c,b ;18f8 48 H
4074 ld b,0 ;18f9 06 00 . .
4075 add iy,bc ;18fb fd 09 . .
4076 ld (last_L),iy ;18fd fd 22 f9 1f . " . .
4077 pop bc ;1901 c1 .
4078 djnz l18ebh ;1902 10 e7 . .
4079 ret ;1904 c9 .
4080 l1905h:
4081 call assert_eol ;1905 cd d6 02 . . .
4082 ld h,b ;1908 60 `
4083 ld l,c ;1909 69 i
4084 ld a,b ;190a 78 x
4085 or c ;190b b1 .
4086 jr nz,l190fh ;190c 20 01 .
4087 dec hl ;190e 2b +
4088 l190fh:
4089 push hl ;190f e5 .
4090 push iy ;1910 fd e5 . .
4091 pop hl ;1912 e1 .
4092 push hl ;1913 e5 .
4093 call sub_192dh ;1914 cd 2d 19 . - .
4094 call crlf ;1917 cd a3 02 . . .
4095 pop iy ;191a fd e1 . .
4096 ld e,b ;191c 58 X
4097 ld d,000h ;191d 16 00 . .
4098 add iy,de ;191f fd 19 . .
4099 ld (last_L),iy ;1921 fd 22 f9 1f . " . .
4100 pop hl ;1925 e1 .
4101 and a ;1926 a7 .
4102 sbc hl,de ;1927 ed 52 . R
4103 ret z ;1929 c8 .
4104 ret c ;192a d8 .
4105 jr l190fh ;192b 18 e2 . .
4106
4107 sub_192dh:
4108 call out.hl.@ ;192d cd a4 01 . . .
4109 call z,outbl ;1930 cc 9f 02 . . .
4110 call outbl ;1933 cd 9f 02 . . .
4111 sub a ;1936 97 .
4112 ld (con_col),a ;1937 32 72 02 2 r .
4113 call sub_1965h ;193a cd 65 19 . e .
4114 and a ;193d a7 .
4115 ret z ;193e c8 .
4116
4117 l193fh:
4118 call outbl ;193f cd 9f 02 . . .
4119 ld a,(con_col) ;1942 3a 72 02 : r .
4120 cp 16 ;1945 fe 10 . .
4121 jr c,l193fh ;1947 38 f6 8 .
4122
4123 prnt_offset:
4124 ld de,(offs.@) ;1949 ed 5b 64 00 . [ d .
4125 ld a,d ;194d 7a z
4126 or e ;194e b3 .
4127 ret z ;194f c8 .
4128 ld a,'(' ;1950 3e 28 > (
4129 call outchar ;1952 cd 5d 02 . ] .
4130 ld a,'@' ;1955 3e 40 > @
4131 call outchar ;1957 cd 5d 02 . ] .
4132 and a ;195a a7 .
4133 sbc hl,de ;195b ed 52 . R
4134 call out_hl ;195d cd 13 02 . . .
4135 ld a,')' ;1960 3e 29 > )
4136 jp outchar ;1962 c3 5d 02 . ] .
4137
4138 sub_1965h:
4139 sub a ;1965 97 .
4140 ld (l1ffdh),a ;1966 32 fd 1f 2 . .
4141 call disas_get_instrlen ;1969 cd 8c 19 . . .
4142 jr nc,l197fh ;196c 30 11 0 .
4143 push bc ;196e c5 .
4144 call prnt_mnemonic ;196f cd b9 1e . . .
4145 ex de,hl ;1972 eb .
4146 call sub_19c1h ;1973 cd c1 19 . . .
4147 pop bc ;1976 c1 .
4148 ld a,(l1ffdh) ;1977 3a fd 1f : . .
4149 ld hl,(l1ffbh) ;197a 2a fb 1f * . .
4150 scf ;197d 37 7
4151 ret ;197e c9 .
4152
4153 l197fh:
4154 ld hl,msg_undef_opcode ;197f 21 89 19 ! . .
4155 call pstr ;1982 cd 88 02 . . .
4156 ld b,001h ;1985 06 01 . .
4157 sub a ;1987 97 .
4158 ret ;1988 c9 .
4159
4160 msg_undef_opcode:
4161 DC '???'
4162
4163 disas_get_instrlen:
4164 sub a ;198c 97 .
4165 ld (isprefix_ixiy),a ;198d 32 f8 1f 2 . .
4166 ld a,(iy+000h) ;1990 fd 7e 00 . ~ .
4167 cp 0edh ;1993 fe ed . .
4168 jp z,disas_pfx.ED ;1995 ca 19 1a . . .
4169 cp 0ddh ;1998 fe dd . .
4170 jr z,l19abh ;199a 28 0f ( .
4171 cp 0fdh ;199c fe fd . .
4172 jr z,l19afh ;199e 28 0f ( .
4173 sub_19a0h:
4174 ld a,(iy+000h) ;19a0 fd 7e 00 . ~ .
4175 cp 0cbh ;19a3 fe cb . .
4176 jp z,disas_pfx.CB ;19a5 ca 36 1a . 6 .
4177 jp disas_nopfx ;19a8 c3 4d 1a . M .
4178 l19abh:
4179 ld a,1 ;19ab 3e 01 > .
4180 jr l19b1h ;19ad 18 02 . .
4181 l19afh:
4182 ld a,2 ;19af 3e 02 > .
4183 l19b1h:
4184 ld (isprefix_ixiy),a ;19b1 32 f8 1f 2 . .
4185 call disas_pfx.DDFD ;19b4 cd c2 19 . . .
4186 ret nc ;19b7 d0 .
4187 push bc ;19b8 c5 .
4188 call sub_19a0h ;19b9 cd a0 19 . . .
4189 pop af ;19bc f1 .
4190 add a,b ;19bd 80 .
4191 ld b,a ;19be 47 G
4192 scf ;19bf 37 7
4193 ret ;19c0 c9 .
4194
4195 sub_19c1h:
4196 jp (hl) ;19c1 e9 .
4197
4198 disas_pfx.DDFD:
4199 inc iy ;19c2 fd 23 . #
4200 ld hl,b_19ef_start ;19c4 21 ef 19 ! . .
4201 call test_DDFD ;19c7 cd 8c 1a . . .
4202 ld b,002h ;19ca 06 02 . .
4203 ret c ;19cc d8 .
4204 ld hl,l1a0ah ;19cd 21 0a 1a ! . .
4205 call test_DDFD ;19d0 cd 8c 1a . . .
4206 ld b,001h ;19d3 06 01 . .
4207 ret c ;19d5 d8 .
4208 ld a,(iy+000h) ;19d6 fd 7e 00 . ~ .
4209 cp 0cbh ;19d9 fe cb . .
4210 jr nz,l19edh ;19db 20 10 .
4211 ld a,(iy+002h) ;19dd fd 7e 02 . ~ .
4212 cp 036h ;19e0 fe 36 . 6
4213 ret z ;19e2 c8 .
4214 and 007h ;19e3 e6 07 . .
4215 cp 006h ;19e5 fe 06 . .
4216 jr nz,l19edh ;19e7 20 04 .
4217 ld b,002h ;19e9 06 02 . .
4218 scf ;19eb 37 7
4219 ret ;19ec c9 .
4220 l19edh:
4221 and a ;19ed a7 .
4222 ret ;19ee c9 .
4223
4224 ; DD/FD 3 byte (ix+d)/(iy+d)
4225 b_19ef_start:
4226 defb 034h ;19ef 34 4
4227 defb 035h ;19f0 35 5
4228 defb 036h ;19f1 36 6
4229 defb 046h ;19f2 46 F
4230 defb 04eh ;19f3 4e N
4231 defb 056h ;19f4 56 V
4232 defb 05eh ;19f5 5e ^
4233 defb 066h ;19f6 66 f
4234 defb 06eh ;19f7 6e n
4235 defb 070h ;19f8 70 p
4236 defb 071h ;19f9 71 q
4237 defb 072h ;19fa 72 r
4238 defb 073h ;19fb 73 s
4239 defb 074h ;19fc 74 t
4240 defb 075h ;19fd 75 u
4241 defb 077h ;19ff 77 w
4242 defb 07eh ;1a00 7e ~
4243 defb 086h ;1a01 86 .
4244 defb 08eh ;1a02 8e .
4245 defb 096h ;1a03 96 .
4246 defb 09eh ;1a04 9e .
4247 defb 0a6h ;1a05 a6 .
4248 defb 0aeh ;1a06 ae .
4249 defb 0b6h ;1a07 b6 .
4250 defb 0beh ;1a08 be .
4251 defb 0 ;1a09 00 .
4252
4253 ; DD/FD 2 byte
4254 l1a0ah:
4255 defb 009h ;1a0a 09 .
4256 defb 019h ;1a0b 19 .
4257 defb 021h ;1a0c 21 !
4258 defb 022h ;1a0d 22 "
4259 defb 023h ;1a0e 23 #
4260 defb 029h ;1a0f 29 )
4261 defb 02ah ;1a10 2a *
4262 defb 02bh ;1a11 2b +
4263 defb 039h ;1a12 39 9
4264 defb 0e1h ;1a13 e1 .
4265 defb 0e3h ;1a14 e3 .
4266 defb 0e5h ;1a15 e5 .
4267 defb 0e9h ;1a16 e9 .
4268 defb 0f9h ;1a17 f9 .
4269 defb 0 ;1a18 00 .
4270
4271 disas_pfx.ED:
4272 inc iy ;1a19 fd 23 . #
4273 ld hl,b_1bc9_start ;1a1b 21 c9 1b ! . .
4274 call sub_1a72h ;1a1e cd 72 1a . r .
4275 ld b,2 ;1a21 06 02 . .
4276 ret c ;1a23 d8 .
4277 ld hl,b_1bf4_start ;1a24 21 f4 1b ! . .
4278 call lookup_opc ;1a27 cd 97 1a . . .
4279 ld b,2 ;1a2a 06 02 . .
4280 ret c ;1a2c d8 .
4281 ld hl,b_1c40_start ;1a2d 21 40 1c ! @ .
4282 call lookup_opc ;1a30 cd 97 1a . . .
4283 ld b,4 ;1a33 06 04 . .
4284 ret ;1a35 c9 .
4285
4286 disas_pfx.CB:
4287 push iy ;1a36 fd e5 . .
4288 inc iy ;1a38 fd 23 . #
4289 ld a,(isprefix_ixiy) ;1a3a 3a f8 1f : . .
4290 and a ;1a3d a7 .
4291 jr z,l1a42h ;1a3e 28 02 ( .
4292 inc iy ;1a40 fd 23 . #
4293 l1a42h:
4294 ld hl,b_1c55_start ;1a42 21 55 1c ! U .
4295 call lookup_opc ;1a45 cd 97 1a . . .
4296 pop iy ;1a48 fd e1 . .
4297 ld b,2 ;1a4a 06 02 . .
4298 ret ;1a4c c9 .
4299
4300 disas_nopfx:
4301 ld hl,b_1b54_start ;1a4d 21 54 1b ! T .
4302 call lookup_opc ;1a50 cd 97 1a . . .
4303 ld b,2 ;1a53 06 02 . .
4304 ret c ;1a55 d8 .
4305 ld hl,b_1ab6_start ;1a56 21 b6 1a ! . .
4306 call sub_1a72h ;1a59 cd 72 1a . r .
4307 ld b,1 ;1a5c 06 01 . .
4308 ret c ;1a5e d8 .
4309 ld hl,b_1ad1_start ;1a5f 21 d1 1a ! . .
4310 call lookup_opc ;1a62 cd 97 1a . . .
4311 ld b,1 ;1a65 06 01 . .
4312 ret c ;1a67 d8 .
4313 ld hl,b_1b9b_start ;1a68 21 9b 1b ! . .
4314 call lookup_opc ;1a6b cd 97 1a . . .
4315 ret nc ;1a6e d0 .
4316 ld b,3 ;1a6f 06 03 . .
4317 ret ;1a71 c9 .
4318
4319 sub_1a72h:
4320 ld a,(hl) ;1a72 7e ~
4321 cp 0ffh ;1a73 fe ff . .
4322 ret z ;1a75 c8 .
4323 cp (iy+000h) ;1a76 fd be 00 . . .
4324 jr z,l1a7fh ;1a79 28 04 ( .
4325 inc hl ;1a7b 23 #
4326 inc hl ;1a7c 23 #
4327 jr sub_1a72h ;1a7d 18 f3 . .
4328 l1a7fh:
4329 inc hl ;1a7f 23 #
4330 ld c,(hl) ;1a80 4e N
4331 ld hl,t_MNEMONICS ;1a81 21 c6 1e ! . .
4332 ld b,0 ;1a84 06 00 . .
4333 add hl,bc ;1a86 09 .
4334 ld de,l1c97h ;1a87 11 97 1c . . .
4335 scf ;1a8a 37 7
4336 ret ;1a8b c9 .
4337
4338 test_DDFD:
4339 ld a,(hl) ;1a8c 7e ~
4340 and a ;1a8d a7 .
4341 ret z ;1a8e c8 .
4342 inc hl ;1a8f 23 #
4343 cp (iy+000h) ;1a90 fd be 00 . . .
4344 jr nz,test_DDFD ;1a93 20 f7 .
4345 scf ;1a95 37 7
4346 ret ;1a96 c9 .
4347
4348 lookup_opc:
4349 ld a,(iy+000h) ;1a97 fd 7e 00 . ~ .
4350 and (hl) ;1a9a a6 .
4351 inc hl ;1a9b 23 #
4352 cp (hl) ;1a9c be .
4353 jr z,l1aa8h ;1a9d 28 09 ( .
4354 inc hl ;1a9f 23 #
4355 inc hl ;1aa0 23 #
4356 inc hl ;1aa1 23 #
4357 inc hl ;1aa2 23 #
4358 ld a,(hl) ;1aa3 7e ~
4359 and a ;1aa4 a7 .
4360 jr nz,lookup_opc ;1aa5 20 f0 .
4361 ret ;1aa7 c9 .
4362 l1aa8h:
4363 inc hl ;1aa8 23 #
4364 ld c,(hl) ;1aa9 4e N
4365 inc hl ;1aaa 23 #
4366 ld e,(hl) ;1aab 5e ^
4367 inc hl ;1aac 23 #
4368 ld d,(hl) ;1aad 56 V
4369 ld hl,t_MNEMONICS ;1aae 21 c6 1e ! . .
4370 ld b,000h ;1ab1 06 00 . .
4371 add hl,bc ;1ab3 09 .
4372 scf ;1ab4 37 7
4373 ret ;1ab5 c9 .
4374
4375 ; 1 byte opcodes (no parameters)
4376 b_1ab6_start:
4377 defb 076h ;1ab6 76 v
4378 defb 039h ;1ab7 39 9
4379 defb 0d9h ;1ab8 d9 .
4380 defb 036h ;1ab9 36 6
4381 defb 0f3h ;1aba f3 .
4382 defb 02ch ;1abb 2c ,
4383 defb 0fbh ;1abc fb .
4384 defb 032h ;1abd 32 2
4385 defb 000h ;1abe 00 .
4386 defb 069h ;1abf 69 i
4387 defb 007h ;1ac0 07 .
4388 defb 09eh ;1ac1 9e .
4389 defb 00fh ;1ac2 0f .
4390 defb 0adh ;1ac3 ad .
4391 defb 017h ;1ac4 17 .
4392 defb 098h ;1ac5 98 .
4393 defb 01fh ;1ac6 1f .
4394 defb 0a7h ;1ac7 a7 .
4395 defb 027h ;1ac8 27 '
4396 defb 026h ;1ac9 26 &
4397 defb 02fh ;1aca 2f /
4398 defb 023h ;1acb 23 #
4399 defb 037h ;1acc 37 7
4400 defb 0bah ;1acd ba .
4401 defb 03fh ;1ace 3f ?
4402 defb 010h ;1acf 10 .
4403 defb 0ffh ;1ad0 ff .
4404
4405 ; 1 byte opcodes
4406 b_1ad1_start:
4407 defb 0c0h ;1ad1 c0 .
4408 defb 040h ;1ad2 40 @
4409 defb 056h ;1ad3 56 V
4410 defw l1c88h ;1ad4 88 1c . .
4411
4412 defb 0f8h ;1ad6 f8 .
4413 defb 080h ;1ad7 80 .
4414 defb 003h ;1ad8 03 .
4415 defw l1c91h ;1ad9 91 1c . .
4416
4417 defb 0f8h ;1adb f8 .
4418 defb 088h ;1adc 88 .
4419 defb 000h ;1add 00 .
4420 defw l1c91h ;1ade 91 1c . .
4421
4422 defb 0f8h ;1ae0 f8 .
4423 defb 090h ;1ae1 90 .
4424 defb 0c9h ;1ae2 c9 .
4425 defw l1e30h ;1ae3 30 1e 0 .
4426
4427 defb 0f8h ;1ae5 f8 .
4428 defb 098h ;1ae6 98 .
4429 defb 0b7h ;1ae7 b7 .
4430 defw l1c91h ;1ae8 91 1c . .
4431
4432 defb 0f8h ;1aea f8 .
4433 defb 0a0h ;1aeb a0 .
4434 defb 006h ;1aec 06 .
4435 defw l1e30h ;1aed 30 1e 0 .
4436
4437 defb 0f8h ;1aef f8 .
4438 defb 0a8h ;1af0 a8 .
4439 defb 0cch ;1af1 cc .
4440 defw l1e30h ;1af2 30 1e 0 .
4441
4442 defb 0f8h ;1af4 f8 .
4443 defb 0b0h ;1af5 b0 .
4444 defb 06ch ;1af6 6c l
4445 defw l1e30h ;1af7 30 1e 0 .
4446
4447 defb 0f8h ;1af9 f8 .
4448 defb 0b8h ;1afa b8 .
4449 defb 013h ;1afb 13 .
4450 defw l1e30h ;1afc 30 1e 0 .
4451
4452 defb 0c7h ;1afe c7 .
4453 defb 0c0h ;1aff c0 .
4454 defb 08bh ;1b00 8b .
4455 defw l1e9dh ;1b01 9d 1e . .
4456
4457 defb 0c7h ;1b03 c7 .
4458 defb 0c7h ;1b04 c7 .
4459 defb 0b4h ;1b05 b4 .
4460 defw l1c98h ;1b06 98 1c . .
4461
4462 defb 0ffh ;1b08 ff .
4463 defb 0c9h ;1b09 c9 .
4464 defb 08bh ;1b0a 8b .
4465 defw l1c97h ;1b0b 97 1c . .
4466
4467 defb 0cfh ;1b0d cf .
4468 defb 0c1h ;1b0e c1 .
4469 defb 081h ;1b0f 81 .
4470 defw l1e86h ;1b10 86 1e . .
4471
4472 defb 0cfh ;1b12 cf .
4473 defb 0c5h ;1b13 c5 .
4474 defb 084h ;1b14 84 .
4475 defw l1e86h ;1b15 86 1e . .
4476
4477 defb 0ffh ;1b17 ff .
4478 defb 0e3h ;1b18 e3 .
4479 defb 034h ;1b19 34 4
4480 defw l1ca0h ;1b1a a0 1c . .
4481
4482 defb 0ffh ;1b1c ff .
4483 defb 0e9h ;1b1d e9 .
4484 defb 052h ;1b1e 52 R
4485 defw l1caeh ;1b1f ae 1c . .
4486
4487 defb 0ffh ;1b21 ff .
4488 defb 0ebh ;1b22 eb .
4489 defb 034h ;1b23 34 4
4490 defw l1cbbh ;1b24 bb 1c . .
4491
4492 defb 0ffh ;1b26 ff .
4493 defb 0f9h ;1b27 f9 .
4494 defb 056h ;1b28 56 V
4495 defw l1cc1h ;1b29 c1 1c . .
4496
4497 defb 0cfh ;1b2b cf .
4498 defb 003h ;1b2c 03 .
4499 defb 041h ;1b2d 41 A
4500 defw l1e8bh ;1b2e 8b 1e . .
4501
4502 defb 0cfh ;1b30 cf .
4503 defb 00bh ;1b31 0b .
4504 defb 029h ;1b32 29 )
4505 defw l1e8bh ;1b33 8b 1e . .
4506
4507 defb 0c7h ;1b35 c7 .
4508 defb 004h ;1b36 04 .
4509 defb 041h ;1b37 41 A
4510 defw l1e28h ;1b38 28 1e ( .
4511
4512 defb 0c7h ;1b3a c7 .
4513 defb 005h ;1b3b 05 .
4514 defb 029h ;1b3c 29 )
4515 defw l1e28h ;1b3d 28 1e ( .
4516
4517 defb 0ffh ;1b3f ff .
4518 defb 008h ;1b40 08 .
4519 defb 034h ;1b41 34 4
4520 defw l1ccdh ;1b42 cd 1c . .
4521
4522 defb 0cfh ;1b44 cf .
4523 defb 009h ;1b45 09 .
4524 defb 003h ;1b46 03 .
4525 defw l1cd3h ;1b47 d3 1c . .
4526
4527 defb 0efh ;1b49 ef .
4528 defb 002h ;1b4a 02 .
4529 defb 056h ;1b4b 56 V
4530 defw l1cdch ;1b4c dc 1c . .
4531
4532 defb 0efh ;1b4e ef .
4533 defb 00ah ;1b4f 0a .
4534 defb 056h ;1b50 56 V
4535 defw l1ce5h ;1b51 e5 1c . .
4536
4537 defb 000h ;1b53 00 .
4538
4539 ; 2 byte opdodes
4540 b_1b54_start:
4541 defb 0c7h ;1b54 c7 .
4542 defb 006h ;1b55 06 .
4543 defb 056h ;1b56 56 V
4544 defw l1cfah ;1b57 fa 1c . .
4545
4546 defb 0ffh ;1b59 ff .
4547 defb 0c6h ;1b5a c6 .
4548 defb 003h ;1b5b 03 .
4549 defw l1cf5h ;1b5c f5 1c . .
4550
4551 defb 0ffh ;1b5e ff .
4552 defb 0ceh ;1b5f ce .
4553 defb 000h ;1b60 00 .
4554 defw l1cf5h ;1b61 f5 1c . .
4555
4556 defb 0ffh ;1b63 ff .
4557 defb 0d6h ;1b64 d6 .
4558 defb 0c9h ;1b65 c9 .
4559 defw l1d09h ;1b66 09 1d . .
4560
4561 defb 0ffh ;1b68 ff .
4562 defb 0deh ;1b69 de .
4563 defb 0b7h ;1b6a b7 .
4564 defw l1cf5h ;1b6b f5 1c . .
4565
4566 defb 0ffh ;1b6d ff .
4567 defb 0e6h ;1b6e e6 .
4568 defb 006h ;1b6f 06 .
4569 defw l1d09h ;1b70 09 1d . .
4570
4571 defb 0ffh ;1b72 ff .
4572 defb 0eeh ;1b73 ee .
4573 defb 0cch ;1b74 cc .
4574 defw l1d09h ;1b75 09 1d . .
4575
4576 defb 0ffh ;1b77 ff .
4577 defb 0f6h ;1b78 f6 .
4578 defb 06ch ;1b79 6c l
4579 defw l1d09h ;1b7a 09 1d . .
4580
4581 defb 0ffh ;1b7c ff .
4582 defb 0feh ;1b7d fe .
4583 defb 013h ;1b7e 13 .
4584 defw l1d09h ;1b7f 09 1d . .
4585
4586 defb 0ffh ;1b81 ff .
4587 defb 010h ;1b82 10 .
4588 defb 02eh ;1b83 2e .
4589 defw l1d1ah ;1b84 1a 1d . .
4590
4591 defb 0ffh ;1b86 ff .
4592 defb 018h ;1b87 18 .
4593 defb 054h ;1b88 54 T
4594 defw l1d1ah ;1b89 1a 1d . .
4595
4596 defb 0e7h ;1b8b e7 .
4597 defb 020h ;1b8c 20
4598 defb 054h ;1b8d 54 T
4599 defw l1d0fh ;1b8e 0f 1d . .
4600
4601 defb 0ffh ;1b90 ff .
4602 defb 0d3h ;1b91 d3 .
4603 defb 076h ;1b92 76 v
4604 defw l1d37h ;1b93 37 1d 7 .
4605
4606 defb 0ffh ;1b95 ff .
4607 defb 0dbh ;1b96 db .
4608 defb 03fh ;1b97 3f ?
4609 defw l1d29h ;1b98 29 1d ) .
4610
4611 defb 000h ;1b9a 00 .
4612
4613 ; 3 byte opcodes
4614 b_1b9b_start:
4615 defb 0c7h ;1b9b c7 .
4616 defb 0c2h ;1b9c c2 .
4617 defb 052h ;1b9d 52 R
4618 defw l1d42h ;1b9e 42 1d B .
4619
4620 defb 0c7h ;1ba0 c7 .
4621 defb 0c4h ;1ba1 c4 .
4622 defb 00ch ;1ba2 0c .
4623 defw l1d42h ;1ba3 42 1d B .
4624
4625 defb 0cfh ;1ba5 cf .
4626 defb 001h ;1ba6 01 .
4627 defb 056h ;1ba7 56 V
4628 defw l1d5ah ;1ba8 5a 1d Z .
4629
4630 defb 0ffh ;1baa ff .
4631 defb 0c3h ;1bab c3 .
4632 defb 052h ;1bac 52 R
4633 defw l1d48h ;1bad 48 1d H .
4634
4635 defb 0ffh ;1baf ff .
4636 defb 0cdh ;1bb0 cd .
4637 defb 00ch ;1bb1 0c .
4638 defw l1d48h ;1bb2 48 1d H .
4639
4640 defb 0ffh ;1bb4 ff .
4641 defb 022h ;1bb5 22 "
4642 defb 056h ;1bb6 56 V
4643 defw l1d62h ;1bb7 62 1d b .
4644
4645 defb 0ffh ;1bb9 ff .
4646 defb 02ah ;1bba 2a *
4647 defb 056h ;1bbb 56 V
4648 defw l1d6bh ;1bbc 6b 1d k .
4649
4650 defb 0ffh ;1bbe ff .
4651 defb 032h ;1bbf 32 2
4652 defb 056h ;1bc0 56 V
4653 defw l1d74h ;1bc1 74 1d t .
4654
4655 defb 0ffh ;1bc3 ff .
4656 defb 03ah ;1bc4 3a :
4657 defb 056h ;1bc5 56 V
4658 defw l1d7fh ;1bc6 7f 1d \7f .
4659
4660 defb 000h ;1bc8 00 .
4661
4662 ; prefix ED + 1 byte opcode
4663 b_1bc9_start:
4664 defb 044h ;1bc9 44 D
4665 defb 066h ;1bca 66 f
4666 defb 045h ;1bcb 45 E
4667 defb 092h ;1bcc 92 .
4668 defb 04dh ;1bcd 4d M
4669 defb 08eh ;1bce 8e .
4670 defb 067h ;1bcf 67 g
4671 defb 0b1h ;1bd0 b1 .
4672 defb 06fh ;1bd1 6f o
4673 defb 0a2h ;1bd2 a2 .
4674 defb 0a0h ;1bd3 a0 .
4675 defb 05fh ;1bd4 5f _
4676 defb 0a1h ;1bd5 a1 .
4677 defb 01ch ;1bd6 1c .
4678 defb 0a2h ;1bd7 a2 .
4679 defb 04bh ;1bd8 4b K
4680 defb 0a3h ;1bd9 a3 .
4681 defb 07dh ;1bda 7d }
4682 defb 0a8h ;1bdb a8 .
4683 defb 058h ;1bdc 58 X
4684 defb 0a9h ;1bdd a9 .
4685 defb 015h ;1bde 15 .
4686 defb 0aah ;1bdf aa .
4687 defb 044h ;1be0 44 D
4688 defb 0abh ;1be1 ab .
4689 defb 079h ;1be2 79 y
4690 defb 0b0h ;1be3 b0 .
4691 defb 062h ;1be4 62 b
4692 defb 0b1h ;1be5 b1 .
4693 defb 01fh ;1be6 1f .
4694 defb 0b2h ;1be7 b2 .
4695 defb 04eh ;1be8 4e N
4696 defb 0b3h ;1be9 b3 .
4697 defb 072h ;1bea 72 r
4698 defb 0b8h ;1beb b8 .
4699 defb 05bh ;1bec 5b [
4700 defb 0b9h ;1bed b9 .
4701 defb 018h ;1bee 18 .
4702 defb 0bah ;1bef ba .
4703 defb 047h ;1bf0 47 G
4704 defb 0bbh ;1bf1 bb .
4705 defb 06eh ;1bf2 6e n
4706 defb 0ffh ;1bf3 ff .
4707
4708 b_1bf4_start:
4709 defb 0e7h ;1bf4 e7 .
4710 defb 040h ;1bf5 40 @
4711 defb 03fh ;1bf6 3f ?
4712 defw l1db3h ;1bf7 b3 1d . .
4713
4714 defb 0f7h ;1bf9 f7 .
4715 defb 060h ;1bfa 60 `
4716 defb 03fh ;1bfb 3f ?
4717 defw l1db3h ;1bfc b3 1d . .
4718
4719 defb 0ffh ;1bfe ff .
4720 defb 078h ;1bff 78 x
4721 defb 03fh ;1c00 3f ?
4722 defw l1db3h ;1c01 b3 1d . .
4723
4724 defb 0e7h ;1c03 e7 .
4725 defb 041h ;1c04 41 A
4726 defb 076h ;1c05 76 v
4727 defw l1dbfh ;1c06 bf 1d . .
4728
4729 defb 0f7h ;1c08 f7 .
4730 defb 061h ;1c09 61 a
4731 defb 076h ;1c0a 76 v
4732 defw l1dbfh ;1c0b bf 1d . .
4733
4734 defb 0ffh ;1c0d ff .
4735 defb 079h ;1c0e 79 y
4736 defb 076h ;1c0f 76 v
4737 defw l1dbfh ;1c10 bf 1d . .
4738
4739 defb 0cfh ;1c12 cf .
4740 defb 042h ;1c13 42 B
4741 defb 0b7h ;1c14 b7 .
4742 defw l1dcah ;1c15 ca 1d . .
4743
4744 defb 0cfh ;1c17 cf .
4745 defb 04ah ;1c18 4a J
4746 defb 000h ;1c19 00 .
4747 defw l1dcah ;1c1a ca 1d . .
4748
4749 defb 0ffh ;1c1c ff .
4750 defb 046h ;1c1d 46 F
4751 defb 03dh ;1c1e 3d =
4752 defw l1d85h ;1c1f 85 1d . .
4753
4754 defb 0ffh ;1c21 ff .
4755 defb 056h ;1c22 56 V
4756 defb 03dh ;1c23 3d =
4757 defw l1d89h ;1c24 89 1d . .
4758
4759 defb 0ffh ;1c26 ff .
4760 defb 05eh ;1c27 5e ^
4761 defb 03dh ;1c28 3d =
4762 defw l1d8dh ;1c29 8d 1d . .
4763
4764 defb 0ffh ;1c2b ff .
4765 defb 047h ;1c2c 47 G
4766 defb 056h ;1c2d 56 V
4767 defw l1d92h ;1c2e 92 1d . .
4768
4769 defb 0ffh ;1c30 ff .
4770 defb 057h ;1c31 57 W
4771 defb 056h ;1c32 56 V
4772 defw l1d97h ;1c33 97 1d . .
4773
4774 defb 0ffh ;1c35 ff .
4775 defb 04fh ;1c36 4f O
4776 defb 056h ;1c37 56 V
4777 defw l1d9ch ;1c38 9c 1d . .
4778
4779 defb 0ffh ;1c3a ff .
4780 defb 05fh ;1c3b 5f _
4781 defb 056h ;1c3c 56 V
4782 defw l1da1h ;1c3d a1 1d . .
4783
4784 defb 000h ;1c3f 00 .
4785
4786 b_1c40_start:
4787 defb 0efh ;1c40 ef .
4788 defb 043h ;1c41 43 C
4789 defb 056h ;1c42 56 V
4790 defw l1dd3h ;1c43 d3 1d . .
4791
4792 defb 0ffh ;1c45 ff .
4793 defb 073h ;1c46 73 s
4794 defb 056h ;1c47 56 V
4795 defw l1dd3h ;1c48 d3 1d . .
4796
4797 defb 0efh ;1c4a ef .
4798 defb 04bh ;1c4b 4b K
4799 defb 056h ;1c4c 56 V
4800 defw l1ddch ;1c4d dc 1d . .
4801
4802 defb 0ffh ;1c4f ff .
4803 defb 07bh ;1c50 7b {
4804 defb 056h ;1c51 56 V
4805 defw l1ddch ;1c52 dc 1d . .
4806
4807 defb 000h ;1c54 00 .
4808
4809 ; DD/FD CB
4810 b_1c55_start:
4811 defb 0f8h ;1c55 f8 .
4812 defb 000h ;1c56 00 .
4813 defb 09bh ;1c57 9b .
4814 defw l1e03h ;1c58 03 1e . .
4815
4816 defb 0f8h ;1c5a f8 .
4817 defb 008h ;1c5b 08 .
4818 defb 0aah ;1c5c aa .
4819 defw l1e03h ;1c5d 03 1e . .
4820
4821 defb 0f8h ;1c5f f8 .
4822 defb 010h ;1c60 10 .
4823 defb 096h ;1c61 96 .
4824 defw l1e03h ;1c62 03 1e . .
4825
4826 defb 0f8h ;1c64 f8 .
4827 defb 018h ;1c65 18 .
4828 defb 0a5h ;1c66 a5 .
4829 defw l1e03h ;1c67 03 1e . .
4830
4831 defb 0f8h ;1c69 f8 .
4832 defb 020h ;1c6a 20
4833 defb 0c0h ;1c6b c0 .
4834 defw l1e03h ;1c6c 03 1e . .
4835
4836 defb 0f8h ;1c6e f8 .
4837 defb 028h ;1c6f 28 (
4838 defb 0c3h ;1c70 c3 .
4839 defw l1e03h ;1c71 03 1e . .
4840
4841 defb 0f8h ;1c73 f8 .
4842 defb 038h ;1c74 38 8
4843 defb 0c6h ;1c75 c6 .
4844 defw l1e03h ;1c76 03 1e . .
4845
4846 defb 0c0h ;1c78 c0 .
4847 defb 040h ;1c79 40 @
4848 defb 009h ;1c7a 09 .
4849 defw l1de4h ;1c7b e4 1d . .
4850
4851 defb 0c0h ;1c7d c0 .
4852 defb 080h ;1c7e 80 .
4853 defb 088h ;1c7f 88 .
4854 defw l1de4h ;1c80 e4 1d . .
4855
4856 defb 0c0h ;1c82 c0 .
4857 defb 0c0h ;1c83 c0 .
4858 defb 0bdh ;1c84 bd .
4859 defw l1de4h ;1c85 e4 1d . .
4860
4861 defb 000h ;1c87 00 .
4862
4863 l1c88h:
4864 call l1e28h ;1c88 cd 28 1e . ( .
4865 call prnt_char_comma ;1c8b cd b4 1e . . .
4866 jp l1e30h ;1c8e c3 30 1e . 0 .
4867 l1c91h:
4868 call prnt_A_comma ;1c91 cd b1 1e . . .
4869 jp l1e30h ;1c94 c3 30 1e . 0 .
4870 l1c97h:
4871 ret ;1c97 c9 .
4872 l1c98h:
4873 ld a,(iy+000h) ;1c98 fd 7e 00 . ~ .
4874 and 038h ;1c9b e6 38 . 8
4875 jp out_hex ;1c9d c3 18 02 . . .
4876 l1ca0h:
4877 ld hl,b_1ca9_start ;1ca0 21 a9 1c ! . .
4878 call pstr ;1ca3 cd 88 02 . . .
4879 jp l1e7eh ;1ca6 c3 7e 1e . ~ .
4880
4881 b_1ca9_start:
4882 DC '(SP),'
4883 l1caeh:
4884 ld a,'(' ;1cae 3e 28 > (
4885 call outchar ;1cb0 cd 5d 02 . ] .
4886 call l1e7eh ;1cb3 cd 7e 1e . ~ .
4887 ld a,')' ;1cb6 3e 29 > )
4888 jp outchar ;1cb8 c3 5d 02 . ] .
4889 l1cbbh:
4890 ld hl,l1773h ;1cbb 21 73 17 ! s .
4891 jp pstr ;1cbe c3 88 02 . . .
4892 l1cc1h:
4893 ld hl,b_1cca_start ;1cc1 21 ca 1c ! . .
4894 call pstr ;1cc4 cd 88 02 . . .
4895 jp l1e7eh ;1cc7 c3 7e 1e . ~ .
4896
4897 b_1cca_start:
4898 DC 'SP,'
4899 l1ccdh:
4900 ld hl,b_176d_start ;1ccd 21 6d 17 ! m .
4901 jp pstr ;1cd0 c3 88 02 . . .
4902 l1cd3h:
4903 call l1e7eh ;1cd3 cd 7e 1e . ~ .
4904 call prnt_char_comma ;1cd6 cd b4 1e . . .
4905 jp l1e8bh ;1cd9 c3 8b 1e . . .
4906 l1cdch:
4907 call sub_1ce8h ;1cdc cd e8 1c . . .
4908 call prnt_char_comma ;1cdf cd b4 1e . . .
4909 jp prnt_char_A ;1ce2 c3 3d 1d . = .
4910
4911 l1ce5h:
4912 call prnt_A_comma ;1ce5 cd b1 1e . . .
4913 sub_1ce8h:
4914 ld a,'(' ;1ce8 3e 28 > (
4915 call outchar ;1cea cd 5d 02 . ] .
4916 call l1e8bh ;1ced cd 8b 1e . . .
4917 ld a,')' ;1cf0 3e 29 > )
4918 jp outchar ;1cf2 c3 5d 02 . ] .
4919 l1cf5h:
4920 call prnt_A_comma ;1cf5 cd b1 1e . . .
4921 jr l1d09h ;1cf8 18 0f . .
4922 l1cfah:
4923 call l1e28h ;1cfa cd 28 1e . ( .
4924 call prnt_char_comma ;1cfd cd b4 1e . . .
4925 ld a,(isprefix_ixiy) ;1d00 3a f8 1f : . .
4926 and a ;1d03 a7 .
4927 ld a,(iy+002h) ;1d04 fd 7e 02 . ~ .
4928 jr nz,l1d0ch ;1d07 20 03 .
4929 l1d09h:
4930 ld a,(iy+001h) ;1d09 fd 7e 01 . ~ .
4931 l1d0ch:
4932 jp out_hex ;1d0c c3 18 02 . . .
4933 l1d0fh:
4934 ld a,(iy+000h) ;1d0f fd 7e 00 . ~ .
4935 and 018h ;1d12 e6 18 . .
4936 call sub_1ea0h ;1d14 cd a0 1e . . .
4937 call prnt_char_comma ;1d17 cd b4 1e . . .
4938 l1d1ah:
4939 ld c,(iy+001h) ;1d1a fd 4e 01 . N .
4940 ld a,c ;1d1d 79 y
4941 rla ;1d1e 17 .
4942 sbc a,a ;1d1f 9f .
4943 ld b,a ;1d20 47 G
4944 push iy ;1d21 fd e5 . .
4945 pop hl ;1d23 e1 .
4946 add hl,bc ;1d24 09 .
4947 inc hl ;1d25 23 #
4948 inc hl ;1d26 23 #
4949 jr l1d4eh ;1d27 18 25 . %
4950 l1d29h:
4951 call prnt_A_comma ;1d29 cd b1 1e . . .
4952 sub_1d2ch:
4953 ld a,'(' ;1d2c 3e 28 > (
4954 call outchar ;1d2e cd 5d 02 . ] .
4955 ld a,(iy+001h) ;1d31 fd 7e 01 . ~ .
4956 jp l1e6bh ;1d34 c3 6b 1e . k .
4957 l1d37h:
4958 call sub_1d2ch ;1d37 cd 2c 1d . , .
4959 call prnt_char_comma ;1d3a cd b4 1e . . .
4960 prnt_char_A:
4961 ld a,'A' ;1d3d 3e 41 > A
4962 jp outchar ;1d3f c3 5d 02 . ] .
4963
4964 l1d42h:
4965 call l1e9dh ;1d42 cd 9d 1e . . .
4966 call prnt_char_comma ;1d45 cd b4 1e . . .
4967 l1d48h:
4968 ld l,(iy+001h) ;1d48 fd 6e 01 . n .
4969 ld h,(iy+002h) ;1d4b fd 66 02 . f .
4970 l1d4eh:
4971 ld a,002h ;1d4e 3e 02 > .
4972 sub_1d50h:
4973 ld (l1ffdh),a ;1d50 32 fd 1f 2 . .
4974 ld (l1ffbh),hl ;1d53 22 fb 1f " . .
4975 call out_hl ;1d56 cd 13 02 . . .
4976 ret ;1d59 c9 .
4977 l1d5ah:
4978 call l1e8bh ;1d5a cd 8b 1e . . .
4979 call prnt_char_comma ;1d5d cd b4 1e . . .
4980 jr l1d48h ;1d60 18 e6 . .
4981 l1d62h:
4982 call sub_1e13h ;1d62 cd 13 1e . . .
4983 call prnt_char_comma ;1d65 cd b4 1e . . .
4984 jp l1e7eh ;1d68 c3 7e 1e . ~ .
4985 l1d6bh:
4986 call l1e7eh ;1d6b cd 7e 1e . ~ .
4987 call prnt_char_comma ;1d6e cd b4 1e . . .
4988 jp sub_1e13h ;1d71 c3 13 1e . . .
4989 l1d74h:
4990 call sub_1e13h ;1d74 cd 13 1e . . .
4991 call prnt_char_comma ;1d77 cd b4 1e . . .
4992 ld a,'A' ;1d7a 3e 41 > A
4993 jp outchar ;1d7c c3 5d 02 . ] .
4994 l1d7fh:
4995 call prnt_A_comma ;1d7f cd b1 1e . . .
4996 jp sub_1e13h ;1d82 c3 13 1e . . .
4997 l1d85h:
4998 ld a,'0' ;1d85 3e 30 > 0
4999 jr l1d8fh ;1d87 18 06 . .
5000 l1d89h:
5001 ld a,'1' ;1d89 3e 31 > 1
5002 jr l1d8fh ;1d8b 18 02 . .
5003 l1d8dh:
5004 ld a,'2' ;1d8d 3e 32 > 2
5005 l1d8fh:
5006 jp outchar ;1d8f c3 5d 02 . ] .
5007 l1d92h:
5008 ld hl,b_1da7_start ;1d92 21 a7 1d ! . .
5009 jr l1da4h ;1d95 18 0d . .
5010 l1d97h:
5011 ld hl,l1daah ;1d97 21 aa 1d ! . .
5012 jr l1da4h ;1d9a 18 08 . .
5013 l1d9ch:
5014 ld hl,l1dadh ;1d9c 21 ad 1d ! . .
5015 jr l1da4h ;1d9f 18 03 . .
5016 l1da1h:
5017 ld hl,l1db0h ;1da1 21 b0 1d ! . .
5018 l1da4h:
5019 jp pstr ;1da4 c3 88 02 . . .
5020
5021 b_1da7_start:
5022 DC 'I,A'
5023 l1daah:
5024 DC 'A,I'
5025 l1dadh:
5026 DC 'R,A'
5027 l1db0h:
5028 DC 'A,R'
5029
5030 l1db3h:
5031 call l1e28h ;1db3 cd 28 1e . ( .
5032 call prnt_char_comma ;1db6 cd b4 1e . . .
5033 ld hl,t__C_ ;1db9 21 f4 1f ! . .
5034 jp pstr ;1dbc c3 88 02 . . .
5035 l1dbfh:
5036 ld hl,t__C_ ;1dbf 21 f4 1f ! . .
5037 call pstr ;1dc2 cd 88 02 . . .
5038 call prnt_char_comma ;1dc5 cd b4 1e . . .
5039 jr l1e28h ;1dc8 18 5e . ^
5040 l1dcah:
5041 call l1e7eh ;1dca cd 7e 1e . ~ .
5042 call prnt_char_comma ;1dcd cd b4 1e . . .
5043 jp l1e8bh ;1dd0 c3 8b 1e . . .
5044 l1dd3h:
5045 call sub_1e13h ;1dd3 cd 13 1e . . .
5046 call prnt_char_comma ;1dd6 cd b4 1e . . .
5047 jp l1e8bh ;1dd9 c3 8b 1e . . .
5048 l1ddch:
5049 call l1e8bh ;1ddc cd 8b 1e . . .
5050 call prnt_char_comma ;1ddf cd b4 1e . . .
5051 jr sub_1e13h ;1de2 18 2f . /
5052 l1de4h:
5053 ld a,(isprefix_ixiy) ;1de4 3a f8 1f : . .
5054 and a ;1de7 a7 .
5055 jr nz,l1defh ;1de8 20 05 .
5056 ld a,(iy+001h) ;1dea fd 7e 01 . ~ .
5057 jr l1df2h ;1ded 18 03 . .
5058 l1defh:
5059 ld a,(iy+002h) ;1def fd 7e 02 . ~ .
5060 l1df2h:
5061 push af ;1df2 f5 .
5062 rra ;1df3 1f .
5063 rra ;1df4 1f .
5064 rra ;1df5 1f .
5065 and 007h ;1df6 e6 07 . .
5066 add a,'0' ;1df8 c6 30 . 0
5067 call outchar ;1dfa cd 5d 02 . ] .
5068 call prnt_char_comma ;1dfd cd b4 1e . . .
5069 pop af ;1e00 f1 .
5070 jr l1e33h ;1e01 18 30 . 0
5071 l1e03h:
5072 ld a,(isprefix_ixiy) ;1e03 3a f8 1f : . .
5073 and a ;1e06 a7 .
5074 jr nz,l1e0eh ;1e07 20 05 .
5075 ld a,(iy+001h) ;1e09 fd 7e 01 . ~ .
5076 jr l1e11h ;1e0c 18 03 . .
5077 l1e0eh:
5078 ld a,(iy+002h) ;1e0e fd 7e 02 . ~ .
5079 l1e11h:
5080 jr l1e33h ;1e11 18 20 .
5081 sub_1e13h:
5082 ld a,'(' ;1e13 3e 28 > (
5083 call outchar ;1e15 cd 5d 02 . ] .
5084 ld l,(iy+001h) ;1e18 fd 6e 01 . n .
5085 ld h,(iy+002h) ;1e1b fd 66 02 . f .
5086 ld a,001h ;1e1e 3e 01 > .
5087 call sub_1d50h ;1e20 cd 50 1d . P .
5088 ld a,')' ;1e23 3e 29 > )
5089 jp outchar ;1e25 c3 5d 02 . ] .
5090 l1e28h:
5091 ld a,(iy+000h) ;1e28 fd 7e 00 . ~ .
5092 rra ;1e2b 1f .
5093 rra ;1e2c 1f .
5094 rra ;1e2d 1f .
5095 jr l1e33h ;1e2e 18 03 . .
5096 l1e30h:
5097 ld a,(iy+000h) ;1e30 fd 7e 00 . ~ .
5098 l1e33h:
5099 and 007h ;1e33 e6 07 . .
5100 cp 006h ;1e35 fe 06 . .
5101 jr nz,l1e73h ;1e37 20 3a :
5102 ld a,(isprefix_ixiy) ;1e39 3a f8 1f : . .
5103 and a ;1e3c a7 .
5104 ld a,006h ;1e3d 3e 06 > .
5105 jr z,l1e73h ;1e3f 28 32 ( 2
5106 ld hl,b_1e78_start ;1e41 21 78 1e ! x .
5107 ld a,(isprefix_ixiy) ;1e44 3a f8 1f : . .
5108 dec a ;1e47 3d =
5109 jr z,l1e4dh ;1e48 28 03 ( .
5110 ld hl,l1e7bh ;1e4a 21 7b 1e ! { .
5111 l1e4dh:
5112 call pstr ;1e4d cd 88 02 . . .
5113 ld a,(iy+001h) ;1e50 fd 7e 01 . ~ .
5114 and a ;1e53 a7 .
5115 jp m,l1e61h ;1e54 fa 61 1e . a .
5116 ld a,'+' ;1e57 3e 2b > +
5117 call outchar ;1e59 cd 5d 02 . ] .
5118 ld a,(iy+001h) ;1e5c fd 7e 01 . ~ .
5119 jr l1e6bh ;1e5f 18 0a . .
5120 l1e61h:
5121 ld a,'-' ;1e61 3e 2d > -
5122 call outchar ;1e63 cd 5d 02 . ] .
5123 ld a,(iy+001h) ;1e66 fd 7e 01 . ~ .
5124 neg ;1e69 ed 44 . D
5125 l1e6bh:
5126 call out_hex ;1e6b cd 18 02 . . .
5127 ld a,')' ;1e6e 3e 29 > )
5128 jp outchar ;1e70 c3 5d 02 . ] .
5129 l1e73h:
5130 ld hl,t_BCDEHL_HL_A ;1e73 21 96 1f ! . .
5131 jr l1eaah ;1e76 18 32 . 2
5132
5133 b_1e78_start:
5134 DC '(IX'
5135 l1e7bh:
5136 DC '(IY'
5137 l1e7eh:
5138 ld a,(isprefix_ixiy) ;1e7e 3a f8 1f : . .
5139 ld hl,t_HL.IX.IY ;1e81 21 c6 1f ! . .
5140 jr l1eaah ;1e84 18 24 . $
5141 l1e86h:
5142 ld hl,t_BC.DE.HL.AF ;1e86 21 ab 1f ! . .
5143 jr l1e8eh ;1e89 18 03 . .
5144 l1e8bh:
5145 ld hl,t_BC.DE.HL.SP ;1e8b 21 a2 1f ! . .
5146 l1e8eh:
5147 ld a,(iy+000h) ;1e8e fd 7e 00 . ~ .
5148 rra ;1e91 1f .
5149 rra ;1e92 1f .
5150 rra ;1e93 1f .
5151 rra ;1e94 1f .
5152 and 003h ;1e95 e6 03 . .
5153 cp 002h ;1e97 fe 02 . .
5154 jr z,l1e7eh ;1e99 28 e3 ( .
5155 jr l1eaah ;1e9b 18 0d . .
5156 l1e9dh:
5157 ld a,(iy+000h) ;1e9d fd 7e 00 . ~ .
5158 sub_1ea0h:
5159 rra ;1ea0 1f .
5160 rra ;1ea1 1f .
5161 rra ;1ea2 1f .
5162 and 007h ;1ea3 e6 07 . .
5163 ld hl,t_tstfl_ZCPS ;1ea5 21 dc 1f ! . .
5164 jr l1eaah ;1ea8 18 00 . .
5165 l1eaah:
5166 ld b,a ;1eaa 47 G
5167 call sub_033dh ;1eab cd 3d 03 . = .
5168 jp pstr ;1eae c3 88 02 . . .
5169
5170 prnt_A_comma:
5171 call prnt_char_A ;1eb1 cd 3d 1d . = .
5172 prnt_char_comma:
5173 ld a,',' ;1eb4 3e 2c > ,
5174 jp outchar ;1eb6 c3 5d 02 . ] .
5175
5176 prnt_mnemonic:
5177 call pstr ;1eb9 cd 88 02 . . .
5178 l1ebch:
5179 call outbl ;1ebc cd 9f 02 . . .
5180 inc c ;1ebf 0c .
5181 ld a,c ;1ec0 79 y
5182 cp 5 ;1ec1 fe 05 . .
5183 jr nz,l1ebch ;1ec3 20 f7 .
5184 ret ;1ec5 c9 .
5185
5186 t_MNEMONICS:
5187 DC 'ADC'
5188 DC 'ADD'
5189 DC 'AND'
5190 DC 'BIT'
5191 DC 'CALL'
5192 DC 'CCF'
5193 DC 'CP'
5194 DC 'CPD'
5195 DC 'CPDR'
5196 DC 'CPI'
5197 DC 'CPIR'
5198 DC 'CPL'
5199 DC 'DAA'
5200 DC 'DEC'
5201 DC 'DI'
5202 DC 'DJNZ'
5203 DC 'EI'
5204 DC 'EX'
5205 DC 'EXX'
5206 DC 'HALT'
5207 DC 'IM'
5208 DC 'IN'
5209 DC 'INC'
5210 DC 'IND'
5211 DC 'INDR'
5212 DC 'INI'
5213 DC 'INIR'
5214 DC 'JP'
5215 DC 'JR'
5216 DC 'LD'
5217 DC 'LDD'
5218 DC 'LDDR'
5219 DC 'LDI'
5220 DC 'LDIR'
5221 DC 'NEG'
5222 DC 'NOP'
5223 DC 'OR'
5224 DC 'OTDR'
5225 DC 'OTIR'
5226 DC 'OUT'
5227 DC 'OUTD'
5228 DC 'OUTI'
5229 DC 'POP'
5230 DC 'PUSH'
5231 DC 'RES'
5232 DC 'RET'
5233 DC 'RETI'
5234 DC 'RETN'
5235 DC 'RL'
5236 DC 'RLA'
5237 DC 'RLC'
5238 DC 'RLCA'
5239 DC 'RLD'
5240 DC 'RR'
5241 DC 'RRA'
5242 DC 'RRC'
5243 DC 'RRCA'
5244 DC 'RRD'
5245 DC 'RST'
5246 DC 'SBC'
5247 DC 'SCF'
5248 DC 'SET'
5249 DC 'SLA'
5250 DC 'SRA'
5251 DC 'SRL'
5252 DC 'SUB'
5253 DC 'XOR'
5254 if 0
5255 DC 'IN0'
5256 DC 'MLT'
5257 DC 'OTDM'
5258 DC 'OTDMR'
5259 DC 'OTIM'
5260 DC 'OTIMR'
5261 DC 'OUT0'
5262 DC 'SLP'
5263 DC 'TST'
5264 DC 'TSTIO'
5265 endif
5266 DB 0
5267
5268 t_BCDEHL_HL_A:
5269 DC 'B'
5270 DC 'C'
5271 DC 'D'
5272 DC 'E'
5273 DC 'H'
5274 DC 'L'
5275 DC '(HL)'
5276 DC 'A'
5277 DB 0
5278 t_BC.DE.HL.SP:
5279 DC 'BC'
5280 DC 'DE'
5281 DC 'HL'
5282 DC 'SP'
5283 DB 0
5284 t_BC.DE.HL.AF:
5285 DC 'BC'
5286 DC 'DE'
5287 t_HL.AF:
5288 DC 'HL'
5289 DC 'AF'
5290 DB 0
5291 t_BC.DE.IY.SP:
5292 DC 'BC'
5293 DC 'DE'
5294 DC 'IY'
5295 DC 'SP'
5296 DB 0
5297 t_BC.DE.IX.SP:
5298 DC 'BC'
5299 DC 'DE'
5300 DC 'IX'
5301 DC 'SP'
5302 DB 0
5303 t_HL.IX.IY:
5304 DC 'HL'
5305 t_IX.IY:
5306 DC 'IX'
5307 DC 'IY'
5308 DB 0
5309 t_tstfl_ZC:
5310 DC 'NZ'
5311 DC 'Z'
5312 DC 'NC'
5313 DC 'C'
5314 DC 'NE'
5315 DC 'EQ'
5316 DC 'GE'
5317 DC 'LT'
5318 DB 0
5319 t_tstfl_ZCPS:
5320 DC 'NZ'
5321 DC 'Z'
5322 DC 'NC'
5323 DC 'C'
5324 DC 'PO'
5325 DC 'PE'
5326 DC 'P'
5327 DC 'M'
5328 DC 'NE'
5329 DC 'EQ'
5330 DC 'GE'
5331 DC 'LT'
5332 DC 'NV'
5333 DC 'V'
5334 DB 0
5335 t__C_:
5336 DC '(C)'
5337 DB 0
5338
5339 isprefix_ixiy:
5340 db 0 ;1ff8 00 .
5341 last_L:
5342 dw TPA ;1ff9 00 01 .
5343 l1ffbh:
5344 dw 0 ;1ffb 00 00 .
5345 l1ffdh:
5346 db 0 ;1ffd 00 .
5347
5348 sub_1ffeh:
5349 ld hl,(REG.PC) ;1ffe 2a 60 00 * ` .
5350 ld a,h ;2001 7c |
5351 or l ;2002 b5 .
5352 jr z,l2037h ;2003 28 32 ( 2
5353 ld de,BDOS ;2005 11 05 00 . . .
5354 and a ;2008 a7 .
5355 sbc hl,de ;2009 ed 52 . R
5356 ld hl,l20edh ;200b 21 ed 20 ! .
5357 jr z,l2031h ;200e 28 21 ( !
5358 ld iy,(REG.PC) ;2010 fd 2a 60 00 . * ` .
5359 call disas_get_instrlen ;2014 cd 8c 19 . . .
5360 jp nc,ERROR ;2017 d2 07 01 . . .
5361 ld c,b ;201a 48 H
5362 ld b,000h ;201b 06 00 . .
5363 ld hl,(REG.PC) ;201d 2a 60 00 * ` .
5364 add hl,bc ;2020 09 .
5365 call sub_09cah ;2021 cd ca 09 . . .
5366 ld iy,(REG.PC) ;2024 fd 2a 60 00 . * ` .
5367 ld hl,b_2039_start ;2028 21 39 20 ! 9
5368 call lookup_opc ;202b cd 97 1a . . .
5369 ccf ;202e 3f ?
5370 ret c ;202f d8 .
5371 ex de,hl ;2030 eb .
5372 l2031h:
5373 call CALL_HL ;2031 cd 0f 01 . . .
5374 call c,sub_09cah ;2034 dc ca 09 . . .
5375 l2037h:
5376 scf ;2037 37 7
5377 ret ;2038 c9 .
5378
5379 b_2039_start:
5380 defb 0ffh ;2039 ff .
5381 defb 0ddh ;203a dd .
5382 defb 000h ;203b 00 .
5383 defw l20a7h ;203c a7 20 .
5384
5385 defb 0ffh ;203e ff .
5386 defb 0fdh ;203f fd .
5387 defb 000h ;2040 00 .
5388 defw l20ach ;2041 ac 20 .
5389
5390 defb 0ffh ;2043 ff .
5391 defb 0edh ;2044 ed .
5392 defb 000h ;2045 00 .
5393 defw l20b8h ;2046 b8 20 .
5394
5395 b_2048_start:
5396 defb 0ffh ;2048 ff .
5397 defb 0cdh ;2049 cd .
5398 defb 000h ;204a 00 .
5399 defw l2080h ;204b 80 20 .
5400
5401 defb 0ffh ;204d ff .
5402 defb 0c3h ;204e c3 .
5403 defb 000h ;204f 00 .
5404 defw l208bh ;2050 8b 20 .
5405
5406 defb 0ffh ;2052 ff .
5407 defb 0e9h ;2053 e9 .
5408 defb 000h ;2054 00 .
5409 defw l20a2h ;2055 a2 20 .
5410
5411 defb 0ffh ;2057 ff .
5412 defb 0c9h ;2058 c9 .
5413 defb 000h ;2059 00 .
5414 defw l20dch ;205a dc 20 .
5415
5416 defb 0ffh ;205c ff .
5417 defb 0cfh ;205d cf .
5418 defb 000h ;205e 00 .
5419 defw l2115h ;205f 15 21 . !
5420
5421 defb 0c7h ;2061 c7 .
5422 defb 0c7h ;2062 c7 .
5423 defb 000h ;2063 00 .
5424 defw l20f9h ;2064 f9 20 .
5425
5426 defb 0c7h ;2066 c7 .
5427 defb 0c4h ;2067 c4 .
5428 defb 000h ;2068 00 .
5429 defw l2080h ;2069 80 20 .
5430
5431 defb 0f7h ;206b f7 .
5432 defb 010h ;206c 10 .
5433 defb 000h ;206d 00 .
5434 defw l2093h ;206e 93 20 .
5435
5436 defb 0e7h ;2070 e7 .
5437 defb 020h ;2071 20
5438 defb 000h ;2072 00 .
5439 defw l2093h ;2073 93 20 .
5440
5441 defb 0c7h ;2075 c7 .
5442 defb 0c2h ;2076 c2 .
5443 defb 000h ;2077 00 .
5444 defw l208bh ;2078 8b 20 .
5445
5446 defb 0c7h ;207a c7 .
5447 defb 0c0h ;207b c0 .
5448 defb 000h ;207c 00 .
5449 defw l20c5h ;207d c5 20 .
5450
5451 defb 000h ;207f 00 .
5452
5453 l2080h:
5454 ld a,(b_21e2_start) ;2080 3a e2 21 : . !
5455 and a ;2083 a7 .
5456 jr nz,l208bh ;2084 20 05 .
5457 ld a,(trace_call_flag) ;2086 3a e3 21 : . !
5458 and a ;2089 a7 .
5459 ret nz ;208a c0 .
5460 l208bh:
5461 ld l,(iy+001h) ;208b fd 6e 01 . n .
5462 ld h,(iy+002h) ;208e fd 66 02 . f .
5463 scf ;2091 37 7
5464 ret ;2092 c9 .
5465 l2093h:
5466 ld c,(iy+001h) ;2093 fd 4e 01 . N .
5467 ld a,c ;2096 79 y
5468 rla ;2097 17 .
5469 sbc a,a ;2098 9f .
5470 ld b,a ;2099 47 G
5471 ld hl,(REG.PC) ;209a 2a 60 00 * ` .
5472 add hl,bc ;209d 09 .
5473 inc hl ;209e 23 #
5474 inc hl ;209f 23 #
5475 scf ;20a0 37 7
5476 ret ;20a1 c9 .
5477 l20a2h:
5478 ld hl,(reg.l) ;20a2 2a 5a 00 * Z .
5479 scf ;20a5 37 7
5480 ret ;20a6 c9 .
5481 l20a7h:
5482 ld hl,(reg.ix) ;20a7 2a 52 00 * R .
5483 jr l20afh ;20aa 18 03 . .
5484 l20ach:
5485 ld hl,(reg.iy) ;20ac 2a 50 00 * P .
5486 l20afh:
5487 ld a,(iy+001h) ;20af fd 7e 01 . ~ .
5488 cp 0e9h ;20b2 fe e9 . .
5489 scf ;20b4 37 7
5490 ret z ;20b5 c8 .
5491 and a ;20b6 a7 .
5492 ret ;20b7 c9 .
5493 l20b8h:
5494 ld a,(iy+001h) ;20b8 fd 7e 01 . ~ .
5495 cp 04dh ;20bb fe 4d . M
5496 jr z,l20dch ;20bd 28 1d ( .
5497 cp 045h ;20bf fe 45 . E
5498 jr z,l20dch ;20c1 28 19 ( .
5499 and a ;20c3 a7 .
5500 ret ;20c4 c9 .
5501 l20c5h:
5502 ld a,(iy+000h) ;20c5 fd 7e 00 . ~ .
5503 ld (l20d7h),a ;20c8 32 d7 20 2 .
5504 ld hl,(reg.f) ;20cb 2a 54 00 * T .
5505 push hl ;20ce e5 .
5506 pop af ;20cf f1 .
5507 call l20d7h ;20d0 cd d7 20 . .
5508 scf ;20d3 37 7
5509 jr c,l20dch ;20d4 38 06 8 .
5510 ret ;20d6 c9 .
5511 l20d7h:
5512 nop ;20d7 00 .
5513 and a ;20d8 a7 .
5514 pop hl ;20d9 e1 .
5515 inc hl ;20da 23 #
5516 jp (hl) ;20db e9 .
5517
5518 l20dch:
5519 ld a,(b_21e2_start) ;20dc 3a e2 21 : . !
5520 and a ;20df a7 .
5521 jr nz,l20edh ;20e0 20 0b .
5522 ld a,(trace_call_flag) ;20e2 3a e3 21 : . !
5523 and a ;20e5 a7 .
5524 jr z,l20edh ;20e6 28 05 ( .
5525 call l20edh ;20e8 cd ed 20 . .
5526 pop hl ;20eb e1 .
5527 ret ;20ec c9 .
5528 l20edh:
5529 ld hl,(reg_sp) ;20ed 2a 5c 00 * \ .
5530 ld e,(hl) ;20f0 5e ^
5531 inc hl ;20f1 23 #
5532 ld d,(hl) ;20f2 56 V
5533 ex de,hl ;20f3 eb .
5534 call sub_09cah ;20f4 cd ca 09 . . .
5535 and a ;20f7 a7 .
5536 ret ;20f8 c9 .
5537
5538 l20f9h:
5539 ld a,(l0003h) ;20f9 3a 03 00 : . .
5540 cp (iy+000h) ;20fc fd be 00 . . .
5541 ret z ;20ff c8 .
5542 ld a,(iy+000h) ;2100 fd 7e 00 . ~ .
5543 and 038h ;2103 e6 38 . 8
5544 ld l,a ;2105 6f o
5545 ld h,000h ;2106 26 00 & .
5546 ld a,(b_21e2_start) ;2108 3a e2 21 : . !
5547 and a ;210b a7 .
5548 jr nz,l2113h ;210c 20 05 .
5549 ld a,(trace_call_flag) ;210e 3a e3 21 : . !
5550 and a ;2111 a7 .
5551 ret nz ;2112 c0 .
5552 l2113h:
5553 scf ;2113 37 7
5554 ret ;2114 c9 .
5555 l2115h:
5556 and a ;2115 a7 .
5557 ret ;2116 c9 .
5558 cmd_C:
5559 ld hl,cmd_C ;2117 21 17 21 ! . !
5560 ld a,001h ;211a 3e 01 > .
5561 jr l2122h ;211c 18 04 . .
5562 cmd_T:
5563 xor a ;211e af .
5564 ld hl,cmd_T ;211f 21 1e 21 ! . !
5565 l2122h:
5566 ld (cmd_rpt),hl ;2122 22 68 00 " h .
5567 ld (trace_call_flag),a ;2125 32 e3 21 2 . !
5568 ld a,(de) ;2128 1a .
5569 sub 'N' ;2129 d6 4e . N
5570 jr nz,l212eh ;212b 20 01 .
5571 inc de ;212d 13 .
5572 l212eh:
5573 ld (trace_N_flag),a ;212e 32 e7 21 2 . !
5574 ld a,(de) ;2131 1a .
5575 sub 'J' ;2132 d6 4a . J
5576 jr nz,l2137h ;2134 20 01 .
5577 inc de ;2136 13 .
5578 l2137h:
5579 ld (trace_J_flag),a ;2137 32 e8 21 2 . !
5580 call sub_21a6h ;213a cd a6 21 . . !
5581 jr z,l2145h ;213d 28 06 ( .
5582 ld hl,1 ;213f 21 01 00 ! . .
5583 call get_lastarg_def ;2142 cd 69 03 . i .
5584 l2145h:
5585 ld (trace_count),hl ;2145 22 e5 21 " . !
5586 sub a ;2148 97 .
5587 ld (l0941h),a ;2149 32 41 09 2 A .
5588 l214ch:
5589 call sub_1ffeh ;214c cd fe 1f . . .
5590 jr l21a3h ;214f 18 52 . R
5591
5592 l2151h:
5593 call bp_clr_temporary ;2151 cd 54 07 . T .
5594 ld a,(trace_J_flag) ;2154 3a e8 21 : . !
5595 and a ;2157 a7 .
5596 jr nz,l216bh ;2158 20 11 .
5597 ld iy,(REG.PC) ;215a fd 2a 60 00 . * ` .
5598 call sub_21c8h ;215e cd c8 21 . . !
5599 jr z,l216bh ;2161 28 08 ( .
5600 ld hl,b_2048_start ;2163 21 48 20 ! H
5601 call lookup_opc ;2166 cd 97 1a . . .
5602 jr nc,l214ch ;2169 30 e1 0 .
5603 l216bh:
5604 ld a,(trace_UW_flag) ;216b 3a e4 21 : . !
5605 and a ;216e a7 .
5606 jr z,l2188h ;216f 28 17 ( .
5607 ld de,(trace_count) ;2171 ed 5b e5 21 . [ . !
5608 call expr ;2175 cd be 03 . . .
5609 ld a,h ;2178 7c |
5610 or l ;2179 b5 .
5611 add a,0ffh ;217a c6 ff . .
5612 sbc a,a ;217c 9f .
5613 ld hl,trace_UW_flag ;217d 21 e4 21 ! . !
5614 xor (hl) ;2180 ae .
5615 bit 1,a ;2181 cb 4f . O
5616 jr z,l2193h ;2183 28 0e ( .
5617 l2185h:
5618 jp l0902h ;2185 c3 02 09 . . .
5619 l2188h:
5620 ld hl,(trace_count) ;2188 2a e5 21 * . !
5621 dec hl ;218b 2b +
5622 ld (trace_count),hl ;218c 22 e5 21 " . !
5623 ld a,h ;218f 7c |
5624 or l ;2190 b5 .
5625 jr z,l2185h ;2191 28 f2 ( .
5626 l2193h:
5627 call sub_1ffeh ;2193 cd fe 1f . . .
5628 jr nc,l2185h ;2196 30 ed 0 .
5629 ld a,(trace_N_flag) ;2198 3a e7 21 : . !
5630 ld b,a ;219b 47 G
5631 ld a,(l0941h) ;219c 3a 41 09 : A .
5632 or b ;219f b0 .
5633 ld (l0941h),a ;21a0 32 41 09 2 A .
5634 l21a3h:
5635 jp user_go ;21a3 c3 25 0a . % .
5636
5637 sub_21a6h:
5638 call skipbl ;21a6 cd bf 02 . . .
5639 xor a ;21a9 af .
5640 ld (trace_UW_flag),a ;21aa 32 e4 21 2 . !
5641 ld a,(de) ;21ad 1a .
5642 cp 'U' ;21ae fe 55 . U
5643 jr z,l21b5h ;21b0 28 03 ( .
5644 cp 'W' ;21b2 fe 57 . W
5645 ret nz ;21b4 c0 .
5646 l21b5h:
5647 inc de ;21b5 13 .
5648 push af ;21b6 f5 .
5649 push de ;21b7 d5 .
5650 call expr ;21b8 cd be 03 . . .
5651 jp c,ERROR ;21bb da 07 01 . . .
5652 call assert_eol ;21be cd d6 02 . . .
5653 pop hl ;21c1 e1 .
5654 pop af ;21c2 f1 .
5655 ld (trace_UW_flag),a ;21c3 32 e4 21 2 . !
5656 sub a ;21c6 97 .
5657 ret ;21c7 c9 .
5658
5659 sub_21c8h:
5660 ld a,(iy+000h) ;21c8 fd 7e 00 . ~ .
5661 cp 0edh ;21cb fe ed . .
5662 jr z,l21dah ;21cd 28 0b ( .
5663 and 0dfh ;21cf e6 df . .
5664 cp 0ddh ;21d1 fe dd . .
5665 ret nz ;21d3 c0 .
5666 ld a,(iy+001h) ;21d4 fd 7e 01 . ~ .
5667 cp 0e9h ;21d7 fe e9 . .
5668 ret ;21d9 c9 .
5669 l21dah:
5670 ld a,(iy+001h) ;21da fd 7e 01 . ~ .
5671 and 0f7h ;21dd e6 f7 . .
5672 cp 045h ;21df fe 45 . E
5673 ret ;21e1 c9 .
5674
5675 b_21e2_start:
5676 db 0 ;21e2 00 .
5677 trace_call_flag:
5678 db 0 ;1=call, 0=trace 21e3 00 .
5679 trace_UW_flag:
5680 db 0 ;0 or 'U' or 'W' 21e4 00 .
5681 trace_count:
5682 dw 0 ;21e5 00 00 .
5683 trace_N_flag:
5684 db 0 ;0 if 'N' 21e7 00 .
5685 trace_J_flag:
5686 db 0 ;0 if 'J' 21e8 00 .
5687
5688 ddtz_size equ $-ddtz_base
5689 ddtz_end:
5690
5691 ;-------------------------------------------------------------------------------
5692
5693 end