]> cloudbase.mooo.com Git - z180-stamp.git/blob - z180/ddtz.180
Merge tag 'fatfs-0.10b'
[z180-stamp.git] / z180 / ddtz.180
1 page 255
2 .z80
3
4 external $ci, $co, $cists
5
6 global ddtz,bpent
7 global $stack
8
9
10 include config.inc
11 include z180reg.inc
12 include z180.lib
13
14 BS equ 08h
15 TAB equ 09h
16 CR equ 0dh
17 LF equ 0ah
18 DEL equ 7fh
19 CNTRX equ 'X'-'@'
20
21 TPA equ 100h
22 TOPRAM equ 0f000h
23
24
25 MEMDUMP_CNT equ 16 ;mem dump bytes per line
26 BP_CNT equ 12 ;number of breakbpoints
27
28
29 ;--------------------------------------------------
30 ;
31
32 ; copy code to common memory and execute it there
33 comst macro
34 call ?excom
35 ds 1
36 ?lcs defl $
37 endm
38
39 ; mark end of common code snippet
40 comend macro
41 ?lce defl $
42 ?lclen defl ?lce-?lcs
43 org ?lcs-1
44 db ?lclen
45 org ?lce
46 ifndef ?lcmax
47 ?lcmax defl 0
48 endif
49 if ?lclen gt ?lcmax
50 ?lcmax defl ?lclen
51 endif
52 endm
53
54 ; repeat execution of last common code snippet
55 comrep macro
56 call ?exclst
57 endm
58
59
60
61 cseg
62
63 ;----------------------------------------------------------
64
65 MSG:
66 DB 'DDT/Z - HD64180 (ROM)'
67 DB CR,LF,0
68
69 HLPMSG:
70 DB 'DDT/Z180 (ROM) Commands:',CR,LF
71 DB '> @ examine/substitute the displacement register @',CR,LF
72 DB '> A [address] Assemble',CR,LF
73 DB '> B[X] display [or clear] all Breakpoints',CR,LF
74 DB ' B breakp [:count] [breakp..] set Breakpoints',CR,LF
75 DB ' BX address [address..] clear Breakpoints',CR,LF
76 DB '>>C[N][J] [count] trace over Calls [No list] [Jumps only]',CR,LF
77 DB ' C[N][J] W|U expression trace over Calls While|Until ...',CR,LF
78 DB '>>D [startadr] [endadr] Display memory in hex and ascii',CR,LF
79 DB '> G [startadr] [;breakp..] Go [to start] [temporary breakpoints]',CR,LF
80 DB '> H [expression [expression]] compute expressions / show High/max load adr.',CR,LF
81 DB '>>I [port] Input a byte from port',CR,LF
82 DB '>>L [startadr] [endadr] List disassembled code',CR,LF
83 DB '> M[V] startadr endadr destadr Move memory [and verify]',CR,LF
84 DB '>>O [byte] [port] Output a byte to port',CR,LF
85 DB '> Q[J] startadr endadr bytes Qery memory for byte string [Justified]',CR,LF
86 DB '> R [displacement] Read intel hex from console [add displacemt]',CR,LF
87 DB '> S address Substitute memory',CR,LF
88 DB '>>T[N][J] [count] Trace [No list] [Jumps only] [count steps]',CR,LF
89 DB ' T[N][J] W|U expression Trace While|Until expression',CR,LF
90 DB '> V startadr endadr destadr Verify (compare) two memory areas',CR,LF
91 DB '> X[register] eXamine [and substitute] registers',CR,LF
92 DB '> Y[0..9] eXamine [and substitute] Y variables',CR,LF
93 DB '> Z startadr endadr bytes Zap (fill) memory with a byte string',CR,LF
94 DB 0
95
96 ddtz:
97 ld sp,$stack
98 ld a,(wstrtflg) ;check warm start flag
99 or a
100 jr nz,ddtz_w
101
102 exx
103 ld hl,sysramc
104 ld de,topcodbeg
105 ld bc,topcodend-topcodbeg
106 ldir
107
108 ld hl,vartab
109 ld de,ddtram
110 ld bc,vartabe-vartab
111 ldir
112 exx
113
114 ld a,e
115 ld (ubbr),a
116
117 ddtz_w:
118 ld hl,MSG ;073c
119 call PSTR ;073f
120 call ddtei ;0742
121
122 ; DDTZ main loop
123
124 DDTZML:
125 ld sp,$stack ;0761
126 ld hl,l07eah ;0764
127 ld (CMD_ERR),hl ;0767
128 ld hl,(REG.PC) ;076a
129 ld (OFFS.pc),hl ;076d
130 call sub_0e68h ;0770
131 ld hl,(CMD_RPT) ;0773
132 ld de,DDTZML ;0776
133 call CP.HL.DE ;0779
134 ld a,'>' ;077c
135 call OUTCHAR ;077e
136 call nz,OUTCHAR ;0781
137 call z,OUTBL ;0784
138 call INLINE ;0787
139 call SKIPBL ;078a
140 jr z,exe_hl ;078d
141 ld hl,DDTZML ;078f
142 ld (CMD_RPT),hl ;0792
143 inc de ;0795
144 sub '?' ;0796
145 jr c,ERROR ;0798
146 cp 'Z'+1-'?' ;079a
147 jr nc,ERROR ;079c
148 add a,a ;079e
149 ld hl,CMDTAB ;079f
150 call ADD_HL_A ;07a2
151 ld a,(hl) ;07a5
152 inc hl ;07a6
153 ld h,(hl) ;07a7
154 ld l,a ;07a8
155 jr exe_hl ;07a9
156 ERROR:
157 ld hl,(CMD_ERR) ;07ab
158 exe_hl:
159 call CALL.HL ;07ae
160 jr DDTZML ;07b1
161
162 CALL.HL:
163 jp (hl) ;07b3
164
165
166 CMDTAB:
167 defw CMD.?
168 defw CMD.@ ;07b4
169 defw CMD.A ;07b6
170 defw CMD.B ;07b8
171 defw CMD.C ;07ba
172 defw CMD.D ;07bc
173 defw ERROR ;07be
174 defw ERROR ;07c0
175 defw CMD.G ;07c2
176 defw CMD.H ;07c4
177 defw CMD.I ;07c6
178 defw ERROR ;07c8
179 defw ERROR ;07ca
180 defw CMD.L ;07cc
181 defw CMD.M ;07ce
182 defw ERROR ;07d0
183 defw CMD.O ;07d2
184 defw ERROR ;07d4
185 defw CMD.Q ;07d6
186 defw CMD.R ;07d8
187 defw CMD.S ;07da
188 defw CMD.T ;07dc
189 defw ERROR ;07de
190 defw CMD.V ;07e0
191 defw ERROR ;07e2
192 defw CMD.X ;07e4
193 defw CMD.Y ;07e6
194 defw CMD.Z ;07e8
195 l07eah:
196 ld a,'?' ;07ea
197 call OUTCHAR ;07ec
198 jp CRLF ;07ef
199
200 CMD.?:
201 call assert_eol
202 ld hl,HLPMSG
203 call PSTR
204 ret
205
206 DELC:
207 ld a,b ;07f2
208 or a ;07f3
209 ret z ;07f4
210 ld a,BS ;07f5
211 call $co ;07f7
212 ld a,' ' ;07fa
213 call $co ;07fc
214 ld a,BS ;07ff
215 call $co ;0801
216 dec hl ;0804
217 dec b ;0805
218 inc c ;0806
219 ld a,(hl) ;0807
220 cp ' ' ;0808
221 ret nc ;080a
222 ld a,BS ;080b
223 call $co ;080d
224 ld a,' ' ;0810
225 call $co ;0812
226 ld a,BS ;0815
227 call $co ;0817
228 ret ;081a
229 DELL:
230 ld a,b ;081b
231 or a ;081c
232 ret z ;081d
233 call DELC ;081e
234 jr DELL ;0821
235
236 INLINE:
237 push hl ;0823
238 ld hl,CI.BUF ;0824
239 ld c,(hl) ;0827
240 inc hl ;0828
241 ld b,000h ;0829
242 inc hl ;082b
243 inlnxtch:
244 ld a,c ;082c
245 or a ;082d
246 jr z,inl_e ;082e
247 call $ci ;0830
248 cp CR ;0833
249 jr z,inl_e ;0835
250 cp LF ;0837
251 jr z,inl_e ;0839
252 cp BS ;083b
253 jr nz,l0844h ;083d
254 call DELC ;083f
255 jr inlnxtch ;0842
256 l0844h:
257 cp DEL ;0844
258 jr nz,l084dh ;0846
259 call DELC ;0848
260 jr inlnxtch ;084b
261 l084dh:
262 cp CNTRX ;084d
263 jr nz,l0856h ;084f
264 call DELL ;0851
265 jr inlnxtch ;0854
266 l0856h:
267 cp TAB ;0856
268 jr nz,l085ch ;0858
269 ld a,' ' ;085a
270 l085ch:
271 ld (hl),a ;085c
272 cp ' ' ;085d
273 jr nc,l0869h ;085f
274 ld a,'^' ;0861
275 call $co ;0863
276 ld a,(hl) ;0866
277 add a,'@' ;0867
278 l0869h:
279 call $co ;0869
280 inc hl ;086c
281 inc b ;086d
282 dec c ;086e
283 jr inlnxtch ;086f
284
285 inl_e:
286 ld hl,ci.buf+1 ;0871
287 ld (hl),b ;0874
288 call CRLF ;0875
289 ld de,ci.buf+1 ;0878
290 ld a,(de) ;087b
291 ld b,a ;087c
292 ld c,000h ;087d
293 inc b ;087f
294 l0880h:
295 inc de ;0880
296 dec b ;0881
297 jr z,l08b2h ;0882
298 ld a,(de) ;0884
299 bit 0,c ;0885
300 call z,UPCASE ;0887
301 ld (de),a ;088a
302 cp '''' ;088b
303 jr nz,l0880h ;088d
304 push de ;088f
305 dec de ;0890
306 ld a,(de) ;0891
307 cp '''' ;0892
308 jr z,l08aeh ;0894
309 dec de ;0896
310 ld a,(de) ;0897
311 cp '^' ;0898
312 jr z,l08a2h ;089a
313 dec de ;089c
314 ld a,(de) ;089d
315 cp '^' ;089e
316 jr nz,l08aeh ;08a0
317 l08a2h:
318 inc de ;08a2
319 push bc ;08a3
320 call sub_0a0eh ;08a4
321 pop bc ;08a7
322 dec de ;08a8
323 ld a,(de) ;08a9
324 cp '''' ;08aa
325 jr z,l08afh ;08ac
326 l08aeh:
327 inc c ;08ae
328 l08afh:
329 pop de ;08af
330 jr l0880h ;08b0
331 l08b2h:
332 xor a ;08b2
333 ld (de),a ;08b3
334 ld de,ci.buf+2 ;08b4
335 pop hl ;08b7
336 ret ;08b8
337
338 UPCASE:
339 cp 'a' ;08b9
340 ret c ;08bb
341 cp 'z'+1 ;08bc
342 ret nc ;08be
343 and 05fh ;08bf
344 ret ;08c1
345
346 out.hl.@:
347 call out.hl ;08c2
348 push de ;08c5
349 push hl ;08c6
350 ld de,(offs.@) ;08c7
351 ld a,d ;08cb
352 or e ;08cc
353 jr z,l08ddh ;08cd
354 call OUTBL ;08cf
355 ld a,'@' ;08d2
356 call OUTCHAR ;08d4
357 and a ;08d7
358 sbc hl,de ;08d8
359 call out.hl ;08da
360 l08ddh:
361 pop hl ;08dd
362 pop de ;08de
363 ret ;08df
364
365 out.bin.w:
366 ld a,h ;08e0
367 call out.bin.b ;08e1
368 ld a,l ;08e4
369 out.bin.b:
370 ld b,008h ;08e5
371 l08e7h:
372 add a,a ;08e7
373 push af ;08e8
374 ld a,0 ;08e9
375 adc a,a ;08eb
376 call out.digit ;08ec
377 pop af ;08ef
378 djnz l08e7h ;08f0
379 ld a,'"' ;08f2
380 jp OUTCHAR ;08f4
381
382 sub_08f7h:
383 ld a,'-' ;08f7
384 call OUTCHAR ;08f9
385 dec hl ;08fc
386 jp cpl.hl ;08fd
387
388 out.hl.decm:
389 push hl ;0900
390 call sub_08f7h ;0901
391 db 3eh ;0904 ld a,0E5h
392 out.hl.dec:
393 push hl
394 ld b,6 ;0906
395 call sub_0917h ;0908
396 pop hl ;090b
397 ld a,'.' ;090c
398 call OUTCHAR ;090e
399 l0911h:
400 call OUTBL ;0911
401 djnz l0911h ;0914
402 ret ;0916
403
404
405 sub_0917h:
406 dec b ;0917
407 push de ;0918
408 ld de,10 ;0919
409 call DIV_HL_DE ;091c
410 ld a,h ;091f
411 or l ;0920
412 call nz,sub_0917h ;0921
413 ld a,e ;0924
414 pop de ;0925
415 jr out.digit ;0926
416
417 sub_0928h:
418 push hl ;0928
419 call sub_08f7h ;0929
420 call out.hl ;092c
421 pop hl ;092f
422 ret ;0930
423 out.hl:
424 ld a,h ;0931
425 call out.hex ;0932
426 ld a,l ;0935
427 out.hex:
428 push af ;0936
429 rra ;0937
430 rra ;0938
431 rra ;0939
432 rra ;093a
433 call out.digit ;093b
434 pop af ;093e
435 out.digit:
436 and 00fh ;093f
437 cp 10 ;0941
438 jr c,l0947h ;0943
439 add a,007h ;0945
440 l0947h:
441 add a,'0' ;0947
442 jr OUTCHAR ;0949
443 l094bh:
444 ld a,'-' ;094b
445 call OUTCHAR ;094d
446 ld a,040h ;0950
447 out.ascii:
448 ex af,af' ;0952
449 call outquote ;0953
450 ex af,af' ;0956
451 push af ;0957
452 res 7,a ;0958
453 cp ' ' ;095a
454 jr nc,l0960h ;095c
455 sub 0c0h ;095e
456 l0960h:
457 call OUTCHAR ;0960
458 push af ;0963
459 cp '''' ;0964
460 call z,OUTCHAR ;0966
461 pop af ;0969
462 ex af,af' ;096a
463 call outquote ;096b
464 pop af ;096e
465 or a ;096f
466 ld a,'.' ;0970
467 call m,OUTCHAR ;0972
468 ex af,af' ;0975
469 jr c,l094bh ;0976
470 ret ;0978
471
472 outquote:
473 ld a,'''' ;0979
474 OUTCHAR:
475 push hl ;097b
476 push af ;097c
477 and 07fh ;097d
478 call $co ;097f
479 ld hl,CON.COL ;0982
480 inc (hl) ;0985
481 pop af ;0986
482 pop hl ;0987
483 ret ;0988
484
485 inchar:
486 call $cists ;0989
487 and a ;098c
488 ret z ;098d
489 call $ci ;098e
490 scf ;0991
491 ret ;0992
492
493 PSTR:
494 ld c,000h ;0993
495 l0995h:
496 ld a,(hl) ;0995
497 and a ;0996
498 ret z ;0997
499 call OUTCHAR ;0998
500 inc c ;099b
501 inc hl ;099c
502 and a ;099d
503 ret m ;099e
504 jr l0995h ;099f
505
506 outbl6:
507 call outbl2 ;09a1
508 outbl4:
509 call outbl2 ;09a4
510 outbl2:
511 call OUTBL ;09a7
512 OUTBL:
513 ld a,' ' ;09aa
514 jr OUTCHAR ;09ac
515 CRLF:
516 call inchar ;09ae
517 ld a,CR ;09b1
518 call OUTCHAR ;09b3
519 ld a,LF ;09b6
520 call OUTCHAR ;09b8
521 ld a,000h ;09bb
522 ld (CON.COL),a ;09bd
523 jp c,DDTZML ;09c0
524 ret ;09c3
525
526 ADD_HL_A:
527 add a,l ;09c4
528 ld l,a ;09c5
529 ret nc ;09c6
530 inc h ;09c7
531 ret ;09c8
532
533 SKIPBL0:
534 inc de ;09c9
535 SKIPBL:
536 ld a,(de) ;09ca
537 cp ' ' ;09cb
538 jr z,SKIPBL0 ;09cd
539 cp 009h ;09cf
540 jr z,SKIPBL0 ;09d1
541 or a ;09d3
542 ret ;09d4
543
544 skip_to_nextarg:
545 call SKIPBL ;09d5
546 cp ',' ;09d8
547 ret nz ;09da
548 inc de ;09db
549 call SKIPBL ;09dc
550 cp a ;09df
551 ret ;09e0
552
553 assert_eol:
554 call SKIPBL ;09e1
555 ret z ;09e4
556 l09e5h:
557 jp ERROR ;09e5
558
559 chk.sp:
560 push hl ;09e8
561 push de ;09e9
562 ld hl,0 ;09ea
563 add hl,sp ;09ed
564 ld de,$stack-50 ;09ee
565 call CP.HL.DE ;09f1
566 pop de ;09f4
567 pop hl ;09f5
568 jr c,l09e5h ;09f6
569 ret ;09f8
570
571 CP.HL.DE:
572 and a ;09f9
573 sbc hl,de ;09fa
574 add hl,de ;09fc
575 ret ;09fd
576
577 lookupch:
578 ld b,000h ;09fe
579 l0a00h:
580 ld a,(hl) ;0a00
581 and a ;0a01
582 ret z ;0a02
583 ld a,(de) ;0a03
584 cp (hl) ;0a04
585 jr z,l0a0bh ;0a05
586 inc hl ;0a07
587 inc b ;0a08
588 jr l0a00h ;0a09
589 l0a0bh:
590 scf ;0a0b
591 inc de ;0a0c
592 ret ;0a0d
593
594 sub_0a0eh:
595 ld hl,b_0x132A_start ;0a0e
596 ld b,07fh ;0a11
597 jr l0a17h ;0a13
598
599 sub_0a15h:
600 ld b,0ffh ;0a15
601 l0a17h:
602 inc b ;0a17
603 ld a,(hl) ;0a18
604 and a ;0a19
605 ret z ;0a1a
606 call l0a27 ;0a1b
607 jr nc,l0a17h ;0a1e
608 res 7,b ;0a20
609 ret ;0a22
610
611 sub_0a23h:
612 push bc ;0a23
613 res 7,b ;0a24
614 db 3eh ;0a26 ld a,0c5h
615 l0a27:
616 push bc ;0a27
617 push de ;0a28
618 l0a29h:
619 ld a,(de) ;0a29
620 xor (hl) ;0a2a
621 and 07fh ;0a2b
622 jr nz,l0a41h ;0a2d
623 bit 7,(hl) ;0a2f
624 inc hl ;0a31
625 inc de ;0a32
626 jr z,l0a29h ;0a33
627 scf ;0a35
628 bit 7,b ;0a36
629 call z,sub_0d20h ;0a38
630 jr nc,l0a44h ;0a3b
631 pop af ;0a3d
632 scf ;0a3e
633 pop bc ;0a3f
634 ret ;0a40
635
636 l0a41h:
637 call sub_0a50h ;0a41
638 l0a44h:
639 pop de ;0a44
640 and a ;0a45
641 pop bc ;0a46
642 ret ;0a47
643
644 sub_0a48h:
645 inc b ;0a48
646 l0a49h:
647 dec b ;0a49
648 ret z ;0a4a
649 call sub_0a50h ;0a4b
650 jr l0a49h ;0a4e
651 sub_0a50h:
652 ld a,(hl) ;0a50
653 and a ;0a51
654 ret z ;0a52
655 l0a53h:
656 ld a,(hl) ;0a53
657 inc hl ;0a54
658 and a ;0a55
659 ret m ;0a56
660 jr l0a53h ;0a57
661
662 get_arg3:
663 call get_arg_range ;0a59
664 push hl ;0a5c
665 push bc ;0a5d
666 call skip_to_nextarg ;0a5e
667 call get_arg ;0a61
668 ex de,hl ;0a64
669 pop bc ;0a65
670 pop hl ;0a66
671 ret ;0a67
672
673 sub_0a68h:
674 call EXPR ;0a68
675 jr c,error0 ;0a6b
676 ret ;0a6d
677
678 get_arg:
679 call sub_0a68h ;0a6e
680 l0a71h:
681 jp assert_eol ;0a71
682
683 get_lastarg_def:
684 call get_arg_def ;0a74
685 jr l0a71h ;0a77
686
687 get_arg_def:
688 push hl ;0a79
689 call EXPR ;0a7a
690 jr c,l0a80h ;0a7d
691 ex (sp),hl ;0a7f
692 l0a80h:
693 pop hl ;0a80
694 ret ;0a81
695
696 sub_0a82h:
697 call sub_0a87h ;0a82
698 jr l0a71h ;0a85
699
700 sub_0a87h:
701 db 0e6h ;0a87 and 037h (clear carry)
702 get_arg_range:
703 scf
704 ex af,af' ;0a89
705 push bc ;0a8a
706 push hl ;0a8b
707 call EXPR ;0a8c
708 jr nc,l0a97h ;0a8f
709 ex af,af' ;0a91
710 jr c,error0 ;0a92
711 ex af,af' ;0a94
712 pop hl ;0a95
713
714 defb 03eh ;0a96
715 l0a97h:
716 pop af ;0a97
717 call sub_0aa5h ;0a98
718 jr nc,l0aa3h ;0a9b
719 ex af,af' ;0a9d
720 pop bc ;0a9e
721 ret nc ;0a9f
722 error0:
723 jp ERROR ;0aa0
724
725 l0aa3h:
726 pop af ;0aa3
727 ret ;0aa4
728
729 sub_0aa5h:
730 call skip_to_nextarg ;0aa5
731 cp 'S' ;0aa8
732 jr nz,l0aadh ;0aaa
733 inc de ;0aac
734 l0aadh:
735 push hl ;0aad
736 push af ;0aae
737 call EXPR ;0aaf
738 jr c,l0ac3h ;0ab2
739 ld b,h ;0ab4
740 ld c,l ;0ab5
741 pop af ;0ab6
742 pop hl ;0ab7
743 jr z,l0ac1h ;0ab8
744 ld a,c ;0aba
745 sub l ;0abb
746 ld c,a ;0abc
747 ld a,b ;0abd
748 sbc a,h ;0abe
749 ld b,a ;0abf
750 inc bc ;0ac0
751 l0ac1h:
752 and a ;0ac1
753 ret ;0ac2
754
755 l0ac3h:
756 pop af ;0ac3
757 pop hl ;0ac4
758 jr z,error0 ;0ac5
759 scf ;0ac7
760 ret ;0ac8
761
762 EXPR:
763 call SKIPBL ;0ac9
764 EXPR1:
765 call do_subexpr ;0acc
766 ret c ;0acf
767 call do_rel_op ;0ad0
768 ret nc ;0ad3
769 push bc ;0ad4
770 push hl ;0ad5
771 call do_subexpr ;0ad6
772 jr c,error0 ;0ad9
773 ex de,hl ;0adb
774 ex (sp),hl ;0adc
775 and a ;0add
776 sbc hl,de ;0ade
777 ld hl,0ffffh ;0ae0
778 pop de ;0ae3
779 ret ;0ae4
780
781 do_op_eq:
782 jr z,l0af8h ;0ae5
783 jr l0af7h ;0ae7
784 do_op_ne:
785 jr nz,l0af8h ;0ae9
786 jr l0af7h ;0aeb
787 do_op_le:
788 jr z,l0af8h ;0aed
789 do_op_lt:
790 jr c,l0af8h ;0aef
791 jr l0af7h ;0af1
792 do_op_gt:
793 jr z,l0af7h ;0af3
794 do_op_ge:
795 jr nc,l0af8h ;0af5
796 l0af7h:
797 inc hl ;0af7
798 l0af8h:
799 and a ;0af8
800 ret ;0af9
801
802 do_rel_op:
803 push hl ;0afa
804 ld hl,tab_eq_le_ge ;0afb
805 call lookupch ;0afe
806 jr nc,l0b28h ;0b01
807 ld a,b ;0b03
808 or a ;0b04
809 jr z,l0b1ch ;0b05
810 ld a,(de) ;0b07
811 cp '=' ;0b08
812 jr nz,l0b11h ;0b0a
813 inc de ;0b0c
814 inc b ;0b0d
815 inc b ;0b0e
816 jr l0b1ch ;0b0f
817
818 l0b11h:
819 bit 0,b ;0b11
820 jr z,l0b1ch ;0b13
821 cp '>' ;0b15
822 jr nz,l0b1ch ;0b17
823 inc de ;0b19
824 ld b,005h ;0b1a
825 l0b1ch:
826 ld hl,tab_func_eqlege ;0b1c
827 ld a,b ;0b1f
828 add a,a ;0b20
829 call ADD_HL_A ;0b21
830 ld c,(hl) ;0b24
831 inc hl ;0b25
832 ld b,(hl) ;0b26
833 scf ;0b27
834 l0b28h:
835 pop hl ;0b28
836 ret ;0b29
837
838 tab_eq_le_ge:
839 db '=<>',0
840
841 tab_func_eqlege:
842 defw do_op_eq ;0b2e
843 defw do_op_lt ;0b30
844 defw do_op_gt ;0b32
845 defw do_op_le ;0b34
846 defw do_op_ge ;0b36
847 defw do_op_ne ;0b38
848
849 do_subexpr:
850 call do_factor ;0b3a
851 ret c ;0b3d
852 l0b3eh:
853 call do_binary_op ;0b3e
854 push hl ;0b41
855 push bc ;0b42
856 call do_factor ;0b43
857 pop bc ;0b46
858 ex de,hl ;0b47
859 ex (sp),hl ;0b48
860 jr nc,l0b52h ;0b49
861 pop de ;0b4b
862 ld a,b ;0b4c
863 or c ;0b4d
864 ret z ;0b4e
865 jp ERROR ;0b4f
866
867 l0b52h:
868 ld a,b ;0b52
869 or c ;0b53
870 push bc ;0b54
871 ret nz ;0b55
872 pop bc ;0b56
873 do_op_add:
874 add hl,de ;0b57
875 l0b58h:
876 pop de ;0b58
877 jr l0b3eh ;0b59
878
879 do_op_sub:
880 and a ;0b5b
881 sbc hl,de ;0b5c
882 jr l0b58h ;0b5e
883
884 do_op_mlt:
885 push bc ;0b60
886 ld b,h
887 ld c,e
888 ld h,e
889 ld e,l
890 mlt bc
891 mlt de
892 mlt hl
893 ld a,h
894 add a,c
895 add a,e
896 ld h,a
897 pop bc ;0b72
898 jr l0b58h ;0b73
899
900 do_op_div:
901 call DIV_HL_DE ;0b75
902 jr l0b58h ;0b78
903
904 do_op_mod:
905 call DIV_HL_DE ;0b7a
906 ex de,hl ;0b7d
907 jr l0b58h ;0b7e
908
909 DIV_HL_DE:
910 push bc ;0b80
911 ex de,hl ;0b81
912 ld b,h ;0b82
913 ld c,l ;0b83
914 ld hl,0 ;0b84
915 ld a,16 ;0b87
916 l0b89h:
917 push af ;0b89
918 add hl,hl ;0b8a
919 ex de,hl ;0b8b
920 xor a ;0b8c
921 add hl,hl ;0b8d
922 ex de,hl ;0b8e
923 adc a,l ;0b8f
924 sub c ;0b90
925 ld l,a ;0b91
926 ld a,h ;0b92
927 sbc a,b ;0b93
928 ld h,a ;0b94
929 inc de ;0b95
930 jr nc,l0b9ah ;0b96
931 add hl,bc ;0b98
932 dec de ;0b99
933 l0b9ah:
934 pop af ;0b9a
935 dec a ;0b9b
936 jr nz,l0b89h ;0b9c
937 ex de,hl ;0b9e
938 pop bc ;0b9f
939 ret ;0ba0
940
941 do_op_and:
942 ld a,h ;0ba1
943 and d ;0ba2
944 ld h,a ;0ba3
945 ld a,l ;0ba4
946 and e ;0ba5
947 ld l,a ;0ba6
948 jr l0b58h ;0ba7
949
950 do_op_or:
951 ld a,h ;0ba9
952 or d ;0baa
953 ld h,a ;0bab
954 ld a,l ;0bac
955 or e ;0bad
956 ld l,a ;0bae
957 jr l0b58h ;0baf
958
959 do_op_xor:
960 ld a,h ;0bb1
961 xor d ;0bb2
962 ld h,a ;0bb3
963 ld a,l ;0bb4
964 xor e ;0bb5
965 ld l,a ;0bb6
966 jr l0b58h ;0bb7
967
968 do_binary_op:
969 push hl ;0bb9
970 ld hl,tab_op_a ;0bba
971 call lookupch ;0bbd
972 ld a,b ;0bc0
973 ld hl,tab_func_opa ;0bc1
974 add a,a ;0bc4
975 call ADD_HL_A ;0bc5
976 ld c,(hl) ;0bc8
977 inc hl ;0bc9
978 ld b,(hl) ;0bca
979 pop hl ;0bcb
980 ret ;0bcc
981
982 tab_op_a:
983 DB '+-*/%&!#',0
984 tab_func_opa:
985 defw do_op_add ;0bd6
986 defw do_op_sub ;0bd8
987 defw do_op_mlt ;0bda
988 defw do_op_div ;0bdc
989 defw do_op_mod ;0bde
990 defw do_op_and ;0be0
991 defw do_op_or ;0be2
992 defw do_op_xor ;0be4
993 defw 0 ;0be6
994
995 fact_factor:
996 call do_factor ;0be8
997 ret nc ;0beb
998 jp ERROR ;0bec
999
1000 do_factor:
1001 call chk.sp ;0bef
1002 call get.number ;0bf2
1003 ret nc ;0bf5
1004 inc de ;0bf6
1005 ld hl,TOPRAM ;0bf7
1006 cp 'T' ;0bfa
1007 ret z ;0bfc
1008 ld hl,(HILOD) ;0bfd
1009 cp 'H' ;0c00
1010 ret z ;0c02
1011 ld hl,(MAXLOD) ;0c03
1012 cp 'M' ;0c06
1013 ret z ;0c08
1014 ld hl,TPA ;0c09
1015 cp 'L' ;0c0c
1016 ret z ;0c0e
1017 ld hl,(offs.@) ;0c0f
1018 cp '@' ;0c12
1019 ret z ;0c14
1020 ld hl,(OFFS.pc) ;0c15
1021 cp '$' ;0c18
1022 ret z ;0c1a
1023 cp '-' ;0c1b
1024 jr z,fact_factneg ;0c1d
1025 cp '~' ;0c1f
1026 jr z,fact_factinv ;0c21
1027 cp '+' ;0c23
1028 jr z,fact_factor ;0c25
1029 cp '^' ;0c27
1030 jr z,fact_reg.CPU ;0c29
1031 cp 'Y' ;0c2b
1032 jr z,fact_reg.Y ;0c2d
1033 cp '(' ;0c2f
1034 jr z,fact_mem ;0c31
1035 cp '[' ;0c33
1036 jp z,EXPR_BRCKT ;0c35 [ expression ]
1037 cp '''' ;0c38
1038 jr z,fact_factstring ;0c3a
1039 dec de ;0c3c
1040 scf ;0c3d
1041 ret ;0c3e
1042
1043 fact_reg.Y:
1044 call get.decdigit ;0c3f
1045 jp c,ERROR ;0c42
1046 inc de ;0c45
1047 add a,a ;0c46
1048 ld hl,reg.Y ;0c47
1049 call ADD_HL_A ;0c4a
1050 ld a,(hl) ;0c4d
1051 inc hl ;0c4e
1052 ld h,(hl) ;0c4f
1053 ld l,a ;0c50
1054 and a ;0c51
1055 ret ;0c52
1056 fact_factstring:
1057 ld hl,0 ;0c53
1058 l0c56h:
1059 ld a,(de) ;0c56
1060 cp '''' ;0c57
1061 jr z,l0c62h ;0c59
1062 and a ;0c5b
1063 ret z ;0c5c
1064 l0c5dh:
1065 ld h,l ;0c5d
1066 ld l,a ;0c5e
1067 inc de ;0c5f
1068 jr l0c56h ;0c60
1069
1070 l0c62h:
1071 inc de ;0c62
1072 ld a,(de) ;0c63
1073 cp '''' ;0c64
1074 jr z,l0c5dh ;0c66
1075 sub '.' ;0c68
1076 or a ;0c6a
1077 ret nz ;0c6b
1078 inc de ;0c6c
1079 set 7,l ;0c6d
1080 ret ;0c6f
1081
1082 fact_reg.CPU:
1083 call sub_1315h ;0c70
1084 jr nc,l0cbbh ;0c73
1085 ld a,(hl) ;0c75
1086 inc hl ;0c76
1087 ld h,(hl) ;0c77
1088 ld l,a ;0c78
1089 and a ;0c79
1090 bit 0,c ;0c7a
1091 ret nz ;0c7c
1092 ld h,000h ;0c7d
1093 ret ;0c7f
1094
1095 fact_factneg:
1096 call fact_factor ;0c80
1097 dec hl ;0c83
1098 cpl.hl:
1099 ld a,h ;0c84
1100 cpl ;0c85
1101 ld h,a ;0c86
1102 ld a,l ;0c87
1103 cpl ;0c88
1104 ld l,a ;0c89
1105 ret ;0c8a
1106 fact_factinv:
1107 call fact_factor ;0c8b
1108 jr cpl.hl ;0c8e
1109
1110 fact_mem:
1111 call EXPR1 ;0c90
1112 jr c,l0cbbh ;0c93
1113 ld a,(de) ;0c95
1114 cp ')' ;0c96
1115 jr nz,l0cbbh ;0c98
1116 inc de ;0c9a
1117 comst
1118 ld a,(hl) ;0c9f
1119 inc hl ;
1120 ld h,(hl) ;
1121 comend
1122 ld l,a ;0ca7
1123 ld a,(de) ;0ca8
1124 inc de ;0ca9
1125 cp '.' ;0caa
1126 ret z ;0cac
1127 dec de ;0cad
1128 xor a ;0cae
1129 ld h,a ;0caf
1130 ret ;0cb0
1131
1132 EXPR_BRCKT:
1133 call EXPR1 ;0cb1
1134 jr c,l0cbbh ;0cb4
1135 ld a,(de) ;0cb6
1136 cp ']' ;0cb7
1137 inc de ;0cb9
1138 ret z ;0cba
1139 l0cbbh:
1140 jp ERROR ;0cbb
1141
1142 get.number:
1143 call get.hexdigit ;0cbe
1144 ret c ;0cc1
1145 push de ;0cc2
1146 l0cc3h:
1147 inc de ;0cc3
1148 call get.hexdigit ;0cc4
1149 jr nc,l0cc3h ;0cc7
1150 pop de ;0cc9
1151 cp '.' ;0cca
1152 jr z,l0d04h ;0ccc
1153 cp '"' ;0cce
1154 jr z,l0ce9h ;0cd0
1155 ld hl,0 ;0cd2
1156 l0cd5h:
1157 call get.hexdigit ;0cd5
1158 jr c,l0ce4h ;0cd8
1159 add hl,hl ;0cda
1160 add hl,hl ;0cdb
1161 add hl,hl ;0cdc
1162 add hl,hl ;0cdd
1163 call ADD_HL_A ;0cde
1164 inc de ;0ce1
1165 jr l0cd5h ;0ce2
1166 l0ce4h:
1167 xor 'H' ;0ce4
1168 ret nz ;0ce6
1169 inc de ;0ce7
1170 ret ;0ce8
1171
1172 l0ce9h:
1173 ld hl,0 ;0ce9
1174 l0cech:
1175 call get.decdigit ;0cec
1176 l0cefh:
1177 inc de ;0cef
1178 jr c,l0cf8h ;0cf0
1179 add hl,hl ;0cf2
1180 call ADD_HL_A ;0cf3
1181 jr l0cech ;0cf6
1182 l0cf8h:
1183 cp '"' ;0cf8
1184 jp nz,ERROR ;0cfa
1185 call get.decdigit ;0cfd
1186 jr nc,l0cefh ;0d00
1187 or a ;0d02
1188 ret ;0d03
1189 l0d04h:
1190 ld hl,0 ;0d04
1191 l0d07h:
1192 call get.decdigit ;0d07
1193 inc de ;0d0a
1194 jr c,l0d1ah ;0d0b
1195 push bc ;0d0d
1196 add hl,hl ;0d0e hl *= 10
1197 ld b,h ;0d0f
1198 ld c,l ;0d10
1199 add hl,hl ;0d11
1200 add hl,hl ;0d12
1201 add hl,bc ;0d13
1202 pop bc ;0d14
1203 call ADD_HL_A ;0d15
1204 jr l0d07h ;0d18
1205 l0d1ah:
1206 cp '.' ;0d1a
1207 ret z ;0d1c
1208 jp ERROR ;0d1d
1209
1210 sub_0d20h:
1211 ld a,(de) ;0d20
1212 cp 05bh ;0d21
1213 jr l0d28h ;0d23
1214
1215 get.hexdigit:
1216 ld a,(de) ;0d25
1217 sub_0d26h:
1218 cp 'F'+1 ;0d26
1219 l0d28h:
1220 ccf ;0d28
1221 ret c ;0d29
1222 cp 'A' ;0d2a
1223 jr c,l0d32h ;0d2c
1224 sub 'A'-10 ;0d2e
1225 ret ;0d30
1226
1227 get.decdigit:
1228 ld a,(de) ;0d31
1229 l0d32h:
1230 cp '9'+1 ;0d32
1231 jr l0d39h ;0d34
1232 get.bindigit:
1233 ld a,(de) ;0d36
1234 cp '1'+1 ;0d37
1235 l0d39h:
1236 ccf ;0d39
1237 ret c ;0d3a
1238 cp '0' ;0d3b
1239 ret c ;0d3d
1240 sub '0' ;0d3e
1241 ret ;0d40
1242
1243 l0d41h:
1244 call assert_eol ;0d41
1245
1246 prnt_cpustat:
1247 call prnt_f ;0d44
1248 call outbl2 ;0d47
1249 ld hl,b_0x0DFD_start ;0d4a
1250 ld de,b_0x0E1D_start ;0d4d
1251 ld b,006h ;0d50
1252 l0d52h:
1253 call prnt_regs ;0d52
1254 djnz l0d52h ;0d55
1255 push hl ;0d57
1256 push de ;0d58
1257 ld iy,(REG.PC) ;0d59
1258 call sub_1f77h ;0d5d
1259 exx ;0d60
1260 ex af,af' ;0d61
1261 call CRLF ;0d62
1262 call prnt_f2 ;0d65
1263 call outbl2 ;0d68
1264 pop de ;0d6b
1265 pop hl ;0d6c
1266 ld b,007h ;0d6d
1267 l0d6fh:
1268 call prnt_regs ;0d6f
1269 djnz l0d6fh ;0d72
1270 exx ;0d74
1271 ex af,af' ;0d75
1272 and a ;0d76
1273 jr z,l0d7fh ;0d77
1274 call outbl6 ;0d79
1275 call sub_1f5bh ;0d7c
1276 l0d7fh:
1277 jp crlf ;0d7f
1278
1279 prnt_f:
1280 ld a,(reg.f) ;0d82
1281 call prnt_flags ;0d85
1282 ld a,(reg.iff) ;0d88
1283 cp 0f3h ;0d8b
1284 jp z,outbl ;0d8d
1285 ld a,'E' ;0d90
1286 jp outchar ;0d92
1287
1288 prnt_f2:
1289 ld a,(reg.f2) ;0d95
1290 call prnt_flags ;0d98
1291 jp outbl ;0d9b
1292
1293 prnt_flags:
1294 ld b,a ;0d9e
1295 ld a,'S' ;0d9f
1296 call sub_0dbeh ;0da1
1297 ld a,'Z' ;0da4
1298 call sub_0dbeh ;0da6
1299 rl b ;0da9
1300 ld a,'H' ;0dab
1301 call sub_0dbeh ;0dad
1302 rl b ;0db0
1303 ld a,'V' ;0db2
1304 call sub_0dbeh ;0db4
1305 ld a,'N' ;0db7
1306 call sub_0dbeh ;0db9
1307 ld a,'C' ;0dbc
1308 sub_0dbeh:
1309 rl b ;0dbe
1310 jp c,OUTCHAR ;0dc0
1311 jp OUTBL ;0dc3
1312
1313 prnt_regs:
1314 push bc ;0dc6
1315 push de ;0dc7
1316 call PSTR ;0dc8
1317 ld a,'=' ;0dcb
1318 call OUTCHAR ;0dcd
1319 ex (sp),hl ;0dd0
1320 ld e,(hl) ;0dd1
1321 inc hl ;0dd2
1322 ld d,(hl) ;0dd3
1323 inc hl ;0dd4
1324 ld a,(hl) ;0dd5
1325 inc hl ;0dd6
1326 push hl ;0dd7
1327 and a ;0dd8
1328 jr z,l0df2h ;0dd9
1329 push af ;0ddb
1330 ld a,(de) ;0ddc
1331 ld l,a ;0ddd
1332 inc de ;0dde
1333 ld a,(de) ;0ddf
1334 ld h,a ;0de0
1335 pop af ;0de1
1336 dec a ;0de2
1337 jr z,l0dedh ;0de3
1338 call out.hl.@ ;0de5
1339 call z,outbl6 ;0de8
1340 jr l0df6h ;0deb
1341 l0dedh:
1342 call out.hl ;0ded
1343 jr l0df6h ;0df0
1344 l0df2h:
1345 ld a,(de) ;0df2
1346 call out.hex ;0df3
1347 l0df6h:
1348 call OUTBL ;0df6
1349 pop de ;0df9
1350 pop hl ;0dfa
1351 pop bc ;0dfb
1352 ret ;0dfc
1353
1354 b_0x0DFD_start:
1355 DC 'A '
1356 DC 'BC '
1357 DC 'DE '
1358 DC 'HL '
1359 DC 'SP'
1360 DC 'PC'
1361 DC 'A'''
1362 DC 'BC'''
1363 DC 'DE'''
1364 DC 'HL'''
1365 DC 'IX'
1366 DC 'IY'
1367 DC 'I'
1368 DB 0
1369
1370 b_0x0E1D_start:
1371 defw reg.a ;0e1d
1372 defb 000h ;0e1f
1373 defw reg.c ;0e20
1374 defb 001h ;0e22
1375 defw reg.e ;0e23
1376 defb 001h ;0e25
1377 defw reg.l ;0e26
1378 defb 001h ;0e28
1379 defw reg.sp ;0e29
1380 defb 001h ;0e2b
1381 defw reg.pc ;0e2c
1382 defb 002h ;0e2e
1383 defw reg.a2 ;0e2f
1384 defb 000h ;0e31
1385 defw reg.c2 ;0e32
1386 defb 001h ;0e34
1387 defw reg.e2 ;0e35
1388 defb 001h ;0e37
1389 defw reg.l2 ;0e38
1390 defb 001h ;0e3a
1391 defw reg.ix ;0e3b
1392 defb 001h ;0e3d
1393 defw reg.iy ;0e3e
1394 defb 001h ;0e40
1395 defw reg.i ;0e41
1396 dw 0 ;0e43
1397
1398 CMD.G:
1399 sub a ;0e45
1400 ld (TCFLG),a ;0e46
1401 ld (XA747),a ;0e49
1402 call EXPR ;0e4c
1403 jr c,l0e54h ;0e4f
1404 ld (REG.PC),hl ;0e51
1405 l0e54h:
1406 call SKIPBL ;0e54
1407 jp z,l1183h ;0e57
1408 cp ';' ;0e5a
1409 jp nz,ERROR ;0e5c
1410 inc de ;0e5f
1411 ld a,002h ;0e60
1412 call sub_0f24h ;0e62
1413 jp l1183h ;0e65
1414
1415 sub_0e68h:
1416 ld b,BP_CNT ;0e68
1417 ld ix,bp_tab ;0e6a
1418 l0e6eh:
1419 ld a,(ix+000h) ;0e6e
1420 and 0f1h ;0e71
1421 ld (ix+000h),a ;0e73
1422 call sub_11c5h ;0e76
1423 ld de,BP_SIZE ;0e79
1424 add ix,de ;0e7c
1425 djnz l0e6eh ;0e7e
1426 ret ;0e80
1427
1428 CMD.B:
1429 call SKIPBL ;0e81
1430 jr z,l0ecbh ;0e84
1431 inc de ;0e86
1432 cp 'X' ;0e87
1433 jr z,l0e91h ;0e89
1434 dec de ;0e8b
1435 ld a,001h ;0e8c
1436 jp sub_0f24h ;0e8e
1437 l0e91h:
1438 call SKIPBL ;0e91
1439 jr z,l0ea6h ;0e94
1440 l0e96h:
1441 call EXPR ;0e96
1442 jp c,assert_eol ;0e99
1443 push de ;0e9c
1444 call sub_0ea7h ;0e9d
1445 pop de ;0ea0
1446 call skip_to_nextarg ;0ea1
1447 jr l0e96h ;0ea4
1448 l0ea6h:
1449 scf ;0ea6
1450 sub_0ea7h:
1451 ld b,BP_CNT ;0ea7
1452 ld ix,bp_tab ;0ea9
1453 l0eadh:
1454 push af ;0ead
1455 jr c,l0ebbh ;0eae
1456 ld e,(ix+002h) ;0eb0
1457 ld d,(ix+003h) ;0eb3
1458 call CP.HL.DE ;0eb6
1459 jr nz,l0ec2h ;0eb9
1460 l0ebbh:
1461 ld (ix+000h),000h ;0ebb
1462 call sub_11c5h ;0ebf
1463 l0ec2h:
1464 ld de,BP_SIZE ;0ec2
1465 add ix,de ;0ec5
1466 pop af ;0ec7
1467 djnz l0eadh ;0ec8
1468 ret ;0eca
1469 l0ecbh:
1470 ld b,BP_CNT ;0ecb
1471 ld ix,bp_tab ;0ecd
1472 l0ed1h:
1473 bit 0,(ix+000h) ;0ed1
1474 jr z,l0f1ch ;0ed5
1475 ld a,'R' ;0ed7
1476 bit 4,(ix+000h) ;0ed9
1477 jr nz,l0ee1h ;0edd
1478 ld a,' ' ;0edf
1479 l0ee1h:
1480 call OUTCHAR ;0ee1
1481 call OUTBL ;0ee4
1482 ld l,(ix+002h) ;0ee7
1483 ld h,(ix+003h) ;0eea
1484 call out.hl.@ ;0eed
1485 call outbl2 ;0ef0
1486 ld a,':' ;0ef3
1487 call OUTCHAR ;0ef5
1488 ld l,(ix+004h) ;0ef8
1489 ld h,(ix+005h) ;0efb
1490 call out.hl ;0efe
1491 ld l,(ix+006h) ;0f01
1492 ld h,(ix+007h) ;0f04
1493 ld a,h ;0f07
1494 or l ;0f08
1495 jr z,l0f19h ;0f09
1496 call outbl4 ;0f0b
1497 ld a,'I' ;0f0e
1498 call OUTCHAR ;0f10
1499 call outbl2 ;0f13
1500 call PSTR ;0f16
1501 l0f19h:
1502 call CRLF ;0f19
1503 l0f1ch:
1504 ld de,BP_SIZE ;0f1c
1505 add ix,de ;0f1f
1506 djnz l0ed1h ;0f21
1507 ret ;0f23
1508
1509 sub_0f24h:
1510 ld b,a ;0f24
1511 call SKIPBL ;0f25
1512 ret z ;0f28
1513 cp 'R' ;0f29
1514 jr nz,l0f30h ;0f2b
1515 inc de ;0f2d
1516 set 4,b ;0f2e
1517 l0f30h:
1518 push bc ;0f30
1519 call EXPR ;0f31
1520 jp c,ERROR ;0f34
1521 pop bc ;0f37
1522 bit 0,b ;0f38
1523 push bc ;0f3a
1524 push de ;0f3b
1525 push hl ;0f3c
1526 call nz,sub_0ea7h ;0f3d
1527 pop hl ;0f40
1528 call sub_0f68h ;0f41
1529 pop de ;0f44
1530 ld (ix+002h),l ;0f45
1531 ld (ix+003h),h ;0f48
1532 call sub_0f80h ;0f4b
1533 ld (ix+004h),l ;0f4e
1534 ld (ix+005h),h ;0f51
1535 call sub_0f91h ;0f54
1536 ld (ix+006h),l ;0f57
1537 ld (ix+007h),h ;0f5a
1538 call skip_to_nextarg ;0f5d
1539 pop af ;0f60
1540 ld (ix+000h),a ;0f61
1541 and 00fh ;0f64
1542 jr sub_0f24h ;0f66
1543 sub_0f68h:
1544 ld b,BP_CNT ;0f68
1545 ld ix,bp_tab ;0f6a
1546 l0f6eh:
1547 ld a,(ix+000h) ;0f6e
1548 and 00fh ;0f71
1549 ret z ;0f73
1550 push bc ;0f74
1551 ld bc,BP_SIZE ;0f75
1552 add ix,bc ;0f78
1553 pop bc ;0f7a
1554 djnz l0f6eh ;0f7b
1555 jp ERROR ;0f7d
1556
1557 sub_0f80h:
1558 call SKIPBL ;0f80
1559 ld hl,1 ;0f83
1560 cp 03ah ;0f86
1561 ret nz ;0f88
1562 inc de ;0f89
1563 call EXPR ;0f8a
1564 jp c,ERROR ;0f8d
1565 ret ;0f90
1566 sub_0f91h:
1567 call SKIPBL ;0f91
1568 cp 049h ;0f94
1569 ld hl,0 ;0f96
1570 ret nz ;0f99
1571 inc de ;0f9a
1572 call SKIPBL ;0f9b
1573 push de ;0f9e
1574 call EXPR ;0f9f
1575 jp c,ERROR ;0fa2
1576 ex de,hl ;0fa5
1577 pop de ;0fa6
1578 push de ;0fa7
1579 sbc hl,de ;0fa8
1580 ld b,h ;0faa
1581 ld c,l ;0fab
1582 ld hl,(sexp1) ;0fac
1583 push hl ;0faf
1584 add hl,bc ;0fb0
1585 ld de,sexpbufe ;0fb1
1586 call CP.HL.DE ;0fb4
1587 jp nc,ERROR ;0fb7
1588 pop hl ;0fba
1589 ld (sexp2),hl ;0fbb
1590 pop de ;0fbe
1591 ex de,hl ;0fbf
1592 ldir ;0fc0
1593 xor a ;0fc2
1594 ld (de),a ;0fc3
1595 inc de ;0fc4
1596 ex de,hl ;0fc5
1597 ld (sexp1),hl ;0fc6
1598 ld hl,(sexp2) ;0fc9
1599 ret ;0fcc
1600
1601 bpddtz:
1602 if ROMSYS
1603 ld h,ROMEN ;0fcd
1604 jr z,l0fd2h ;0fcf
1605 inc h ;0fd1
1606 l0fd2h:
1607 push hl ;0fd2 save rom enable stat
1608 endif
1609 push bc ;0fd3
1610 push de ;0fd4
1611 push ix ;0fd5
1612 push iy ;0fd7
1613 ld a,i ;0fd9
1614 ld h,a ;0fdb
1615 ld l,000h ;0fdc
1616 push hl ;0fde
1617 ld a,0f3h ;0fdf DI
1618 jp po,l0fe6h ;0fe1
1619 ld a,0fbh ;0fe4 EI
1620 l0fe6h:
1621 ld (reg.iff),a ;0fe6
1622 ld hl,ivtab ;0fe9
1623 ld a,h ;0fec
1624 ld i,a ;0fed
1625 call ddtei ;0fef
1626 ex af,af' ;0ff2
1627 push af ;0ff3
1628 exx ;0ff4
1629 push bc ;0ff5
1630 push de ;0ff6
1631 push hl ;0ff7
1632 call bp.unset ;0ff8
1633 in0 a,(itc) ;0ffb
1634 jp p,l1017h ;0ffe
1635 res TRAP,a ;1001
1636 out0 (itc),a ;1003
1637 bit UFO,a ;1006
1638 jr z,l1011h ;1008
1639 ld hl,(REG.PC) ;100a
1640 dec hl ;100d
1641 ld (REG.PC),hl ;100e
1642 l1011h:
1643 ld hl,MSG_trap ;1011
1644 call PSTR ;1014
1645 l1017h:
1646 ld a,(XBFE8) ;1017
1647 dec a ;101a
1648 jr z,l1051h ;101b
1649 call inchar ;101d
1650 jr c,l102eh ;1020
1651 call sub_1059h ;1022
1652 and a ;1025
1653 jp z,l1183h ;1026
1654 and 083h ;1029
1655 jp z,l284ah ;102b
1656 l102eh:
1657 call sub_0e68h ;102e
1658 call prnt_cpustat ;1031
1659 jp DDTZML ;1034
1660
1661 MSG_trap:
1662 DB CR,LF,'Undefined opcode trap'
1663 DB CR,LF,0
1664
1665 l1051h:
1666 ld (XBFE8),a ;1051
1667 ld c,007h ;1054
1668 jp l119fh ;1056
1669 sub_1059h:
1670 ld a,080h ;1059
1671 ex af,af' ;105b
1672 sub a ;105c
1673 ld (XA747),a ;105d
1674 ld b,BP_CNT ;1060
1675 ld ix,bp_tab ;1062
1676 l1066h:
1677 ld a,(ix+000h) ;1066
1678 and 007h ;1069
1679 jr z,l107eh ;106b
1680 ld e,(ix+002h) ;106d
1681 ld d,(ix+003h) ;1070
1682 ld hl,(REG.PC) ;1073
1683 call CP.HL.DE ;1076
1684 push bc ;1079
1685 call z,sub_1087h ;107a
1686 pop bc ;107d
1687 l107eh:
1688 ld de,BP_SIZE ;107e
1689 add ix,de ;1081
1690 djnz l1066h ;1083
1691 ex af,af' ;1085
1692 ret ;1086
1693 sub_1087h:
1694 ex af,af' ;1087
1695 res 7,a ;1088
1696 ex af,af' ;108a
1697 ld e,(ix+006h) ;108b
1698 ld d,(ix+007h) ;108e
1699 ld a,d ;1091
1700 or e ;1092
1701 ld hl,0ffffh ;1093
1702 call nz,EXPR ;1096
1703 ld a,h ;1099
1704 or l ;109a
1705 jr z,l10aeh ;109b
1706 ld e,(ix+004h) ;109d
1707 ld d,(ix+005h) ;10a0
1708 dec de ;10a3
1709 ld a,d ;10a4
1710 or e ;10a5
1711 jr z,l10b9h ;10a6
1712 ld (ix+004h),e ;10a8
1713 ld (ix+005h),d ;10ab
1714 l10aeh:
1715 bit 4,(ix+000h) ;10ae
1716 ret z ;10b2
1717 ld a,001h ;10b3
1718 ld (XA747),a ;10b5
1719 ret ;10b8
1720 l10b9h:
1721 ex af,af' ;10b9
1722 or (ix+000h) ;10ba
1723 ex af,af' ;10bd
1724 ret
1725
1726 bp.unset:
1727 ld b,BP_CNT ;10bf
1728 ld ix,bp_tab ;10c1
1729 l10c5h:
1730 bit 5,(ix+000h) ;10c5
1731 res 5,(ix+000h) ;10c9
1732 jr z,l10e7h ;10cd
1733 ld l,(ix+002h) ;10cf
1734 ld h,(ix+003h) ;10d2
1735 ld a,(ddtrst) ;10d5
1736 comst ;10e2
1737 cp (hl) ;10dc
1738 comend
1739 jr nz,l10e7h ;10dd
1740 ld a,(ix+001h) ;10df
1741 comst ;10e2
1742 ld (hl),a ;10e6
1743 comend
1744 l10e7h:
1745 res 3,(ix+000h) ;10e7
1746 ld de,BP_SIZE ;10eb
1747 add ix,de ;10ee
1748 djnz l10c5h ;10f0
1749 ret ;10f2
1750 sub_10f3h:
1751 ld b,BP_CNT ;10f3
1752 ld ix,bp_tab ;10f5
1753 l10f9h:
1754 ld a,(ix+000h) ;10f9
1755 and 003h ;10fc
1756 jr z,l110dh ;10fe
1757 ld e,(ix+002h) ;1100
1758 ld d,(ix+003h) ;1103
1759 ld hl,(REG.PC) ;1106
1760 call CP.HL.DE ;1109
1761 ret z ;110c
1762 l110dh:
1763 ld de,BP_SIZE ;110d
1764 add ix,de ;1110
1765 djnz l10f9h ;1112
1766 sub a ;1114
1767 inc a ;1115
1768 ret ;1116
1769 sub_1117h:
1770 call sub_0f68h ;1117
1771 ld (ix+004h),001h ;111a
1772 ld (ix+005h),000h ;111e
1773 ld (ix+002h),l ;1122
1774 ld (ix+003h),h ;1125
1775 ld (ix+006h),000h ;1128
1776 ld (ix+007h),000h ;112c
1777 ld a,(XBFE8) ;1130
1778 and a ;1133
1779 ld a,008h ;1134
1780 jr nz,l113ah ;1136
1781 ld a,004h ;1138
1782 l113ah:
1783 ld (ix+000h),a ;113a
1784 ret ;113d
1785
1786 bp.set:
1787 ld b,BP_CNT ;113e
1788 ld ix,bp_tab ;1140
1789 l1144h:
1790 ld a,(ix+000h) ;1144
1791 and c ;1147
1792 jr z,l117bh ;1148
1793 set 5,(ix+000h) ;114a
1794 ld l,(ix+002h) ;114e
1795 ld h,(ix+003h) ;1151
1796
1797 if 0
1798
1799 comst ;1154
1800 ld a,(hl) ;1158
1801 comend
1802 ld (ix+001h),a ;1159
1803 ld a,(ddtrst) ;115c
1804 comst ;115f
1805 ld (hl),a ;1163
1806 comend
1807 and 038h ;1164
1808 ld h,000h ;1166
1809 ld l,a ;1168
1810 ld a,0c3h ;1169
1811 comrep ;116b
1812 inc hl ;116e
1813 ld de,bpent ;116f
1814 ld a,e ;1172
1815 comrep ;1173
1816 inc hl ;1176
1817 ld a,d ;1177
1818 comrep ;1178
1819
1820 else
1821
1822 ld a,(ddtrst) ;115c
1823 comst ;115f
1824 ld e,(hl) ;1158
1825 ld (hl),a ;1163
1826 comend
1827 ld (ix+001h),e ;1159
1828 and 038h ;1164
1829 ld h,0 ;1166
1830 ld l,a ;1168
1831 ld de,bpent ;116f
1832 comst ;
1833 ld (hl),0c3h ;1169
1834 inc hl ;116e
1835 ld (hl),e ;1172
1836 inc hl ;1176
1837 ld (hl),d ;1177
1838 comend
1839
1840 endif
1841
1842 l117bh:
1843 ld de,BP_SIZE ;117b
1844 add ix,de ;117e
1845 djnz l1144h ;1180
1846 ret
1847 ;1182
1848 l1183h:
1849 sub a ;1183
1850 ld (XBFE8),a ;1184
1851 ld a,(XA747) ;1187
1852 and a ;118a
1853 call nz,prnt_cpustat ;118b
1854 call sub_10f3h ;118e
1855 ld c,007h ;1191
1856 jr nz,l119fh ;1193
1857 ld a,001h ;1195
1858 ld (XBFE8),a ;1197
1859 call sub_26e7h ;119a
1860 ld c,008h ;119d
1861 l119fh:
1862 call bp.set ;119f
1863 ld sp,$stack ;11a2 set/restore user cpu state
1864 pop hl ;11a5
1865 pop de ;11a6
1866 pop bc ;11a7
1867 pop af ;11a8
1868 exx ;11a9
1869 ex af,af' ;11aa
1870 pop af ;11ab
1871 ld i,a ;11ac
1872 pop iy ;11ae
1873 pop ix ;11b0
1874 pop de ;11b2
1875 pop bc ;11b3
1876 if ROMSYS
1877 pop hl ;11b4
1878 ld a,l ;11b5
1879 and M_MWI ;11b6
1880 ld l,a ;11b8
1881 di ;11b9
1882 in0 a,(dcntl) ;11ba
1883 and ~M_MWI ;11bd
1884 or l ;11bf
1885 ld l,a ;11c0
1886 ld a,h ;11c1
1887 else
1888 pop hl
1889 di
1890 endif
1891 jp $go ;11c2 common ram, switch banks and go to user prog
1892
1893 sub_11c5h:
1894 ld a,(ix+000h) ;11c5
1895 and 003h ;11c8
1896 ret nz ;11ca
1897 ld e,(ix+006h) ;11cb
1898 ld d,(ix+007h) ;11ce
1899 ld a,d ;11d1
1900 or e ;11d2
1901 ret z ;11d3
1902 push bc ;11d4
1903 ld h,d ;11d5
1904 ld l,e ;11d6
1905 sub a ;11d7
1906 ld (ix+006h),a ;11d8
1907 ld (ix+007h),a ;11db
1908 ld bc,0ffffh ;11de
1909 cpir ;11e1
1910 l11e3h:
1911 push de ;11e3
1912 ld de,(sexp1) ;11e4
1913 call CP.HL.DE ;11e8
1914 pop de ;11eb
1915 jr nc,l11f9h ;11ec
1916 call sub_11ffh ;11ee
1917 l11f1h:
1918 ld a,(hl) ;11f1
1919 ldi ;11f2
1920 and a ;11f4
1921 jr nz,l11f1h ;11f5
1922 jr l11e3h ;11f7
1923 l11f9h:
1924 ld (sexp1),de ;11f9
1925 pop bc ;11fd
1926 ret ;11fe
1927 sub_11ffh:
1928 ld iy,bp_tab ;11ff
1929 push de ;1203
1930 l1204h:
1931 ld e,(iy+006h) ;1204
1932 ld d,(iy+007h) ;1207
1933 call CP.HL.DE ;120a
1934 jr z,l1216h ;120d
1935 ld de,BP_SIZE ;120f
1936 add iy,de ;1212
1937 jr l1204h ;1214
1938 l1216h:
1939 pop de ;1216
1940 ld (iy+006h),e ;1217
1941 ld (iy+007h),d ;121a
1942 ret ;121d
1943
1944 CMD.Y:
1945 call get.decdigit ;121e
1946 jr c,l122fh ;1221
1947 inc de ;1223
1948 push af ;1224
1949 call assert_eol ;1225
1950 pop af ;1228
1951 call sub_1248h ;1229
1952 jp l127ch ;122c
1953 l122fh:
1954 call assert_eol ;122f
1955 xor a ;1232
1956 l1233h:
1957 push af ;1233
1958 call sub_1248h ;1234
1959 call outbl4 ;1237
1960 pop af ;123a
1961 inc a ;123b
1962 bit 0,a ;123c
1963 push af ;123e
1964 call z,CRLF ;123f
1965 pop af ;1242
1966 cp LF ;1243
1967 jr c,l1233h ;1245
1968 ret ;1247
1969
1970 sub_1248h:
1971 ld c,a ;1248
1972 ld b,0 ;1249
1973 add a,'0'+080h ;124b
1974 ld de,msg.Y+1 ;124d
1975 ld (de),a ;1250
1976 dec de ;1251
1977 ld hl,reg.Y ;1252
1978 add hl,bc ;1255
1979 add hl,bc ;1256
1980 ex de,hl ;1257
1981 ld c,003h ;1258
1982 jp l129ah ;125a
1983
1984 CMD.X:
1985 call SKIPBL ;125d
1986 call sub_1315h ;1260
1987 jp nc,l0d41h ;1263
1988 call assert_eol ;1266
1989 ld a,b ;1269
1990 cp 01fh ;126a
1991 jr z,l12c6h ;126c
1992 cp 020h ;126e
1993 jr z,l12b6h ;1270
1994 ex de,hl ;1272
1995 ld hl,b_0x132A_start ;1273
1996 call sub_0a48h ;1276
1997 l1279h:
1998 call l129ah ;1279
1999 l127ch:
2000 call OUTBL ;127c
2001 push de ;127f
2002 push bc ;1280
2003 call INLINE ;1281
2004 call SKIPBL ;1284
2005 jr z,l1297h ;1287
2006 call get_arg ;1289
2007 ld b,h ;128c
2008 ld c,l ;128d
2009 pop af ;128e
2010 pop hl ;128f
2011 ld (hl),c ;1290
2012 bit 0,a ;1291
2013 ret z ;1293
2014 inc hl ;1294
2015 ld (hl),b ;1295
2016 ret ;1296
2017 l1297h:
2018 pop af ;1297
2019 pop hl ;1298
2020 ret ;1299
2021 l129ah:
2022 ld b,c ;129a
2023 call PSTR ;129b
2024 ld a,'=' ;129e
2025 call OUTCHAR ;12a0
2026 ld a,(de) ;12a3
2027 bit 0,b ;12a4
2028 jp z,out.hex ;12a6
2029 ld l,a ;12a9
2030 inc de ;12aa
2031 ld a,(de) ;12ab
2032 dec de ;12ac
2033 ld h,a ;12ad
2034 bit 1,b ;12ae
2035 jp z,out.hl ;12b0
2036 jp out.hl.@ ;12b3
2037
2038 l12b6h:
2039 call prnt_f ;12b6
2040 ld a,0f3h ;12b9
2041 ld (reg.iff),a ;12bb
2042 scf ;12be
2043 call sub_12d1h ;12bf
2044 ld (reg.f),a ;12c2
2045 ret ;12c5
2046
2047 l12c6h:
2048 call prnt_f2 ;12c6
2049 and a ;12c9
2050 call sub_12d1h ;12ca
2051 ld (reg.f2),a ;12cd
2052 ret ;12d0
2053
2054 sub_12d1h:
2055 ex af,af' ;12d1
2056 ld b,000h ;12d2
2057 call outbl ;12d4
2058 call assert_eol ;12d7
2059 call inline ;12da
2060 l12ddh:
2061 call skipbl ;12dd
2062 ld a,b ;12e0
2063 ret z ;12e1
2064 push bc ;12e2
2065 ld hl,tab_pr_flags ;12e3
2066 call lookupch ;12e6
2067 jp nc,error ;12e9
2068 ld a,b ;12ec
2069 cp 008h ;12ed
2070 jr z,l12feh ;12ef
2071 inc b ;12f1
2072 ld a,001h ;12f2
2073 jr l12f7h ;12f4
2074 l12f6h:
2075 rlca ;12f6
2076 l12f7h:
2077 djnz l12f6h ;12f7
2078 pop bc ;12f9
2079 or b ;12fa
2080 ld b,a ;12fb
2081 jr l12ddh ;12fc
2082 l12feh:
2083 ex af,af' ;12fe
2084 jp nc,ERROR ;12ff
2085 ex af,af' ;1302
2086 ld a,0FBh ;1303
2087 ld (reg.iff),a ;1305
2088 pop bc ;1308
2089 jr l12ddh ;1309
2090
2091 tab_pr_flags:
2092 db 'CNV H ZSE'
2093 db 0
2094
2095 sub_1315h:
2096 call sub_0a0eh ;1315
2097 ret nc ;1318
2098 ld a,b ;1319
2099 add a,b ;131a
2100 add a,b ;131b
2101 ld hl,b_0x136C_start ;131c
2102 call ADD_HL_A ;131f
2103 ld c,(hl) ;1322
2104 inc hl ;1323
2105 ld a,(hl) ;1324
2106 inc hl ;1325
2107 ld h,(hl) ;1326
2108 ld l,a ;1327
2109 scf ;1328
2110 ret ;1329
2111
2112 b_0x132A_start:
2113 DC 'CBAR'
2114 DC 'BBR'
2115 DC 'BC'''
2116 DC 'DE'''
2117 DC 'HL'''
2118 DC 'BC'
2119 DC 'DE'
2120 DC 'HL'
2121 DC 'A'''
2122 DC 'B'''
2123 DC 'C'''
2124 DC 'D'''
2125 DC 'E'''
2126 DC 'H'''
2127 DC 'L'''
2128 DC 'A'
2129 DC 'B'
2130 DC 'C'
2131 DC 'D'
2132 DC 'E'
2133 DC 'H'
2134 DC 'L'
2135 DC 'IX'
2136 DC 'IY'
2137 DC 'SP'
2138 DC 'PC'
2139 DC 'X'
2140 DC 'Y'
2141 DC 'S'
2142 DC 'P'
2143 DC 'I'
2144 DC 'F'''
2145 DC 'F'
2146 if ROMSYS
2147 DC 'ROMSEL'
2148 endif
2149 DB 0
2150 b_0x136C_start:
2151 defb 000h ;136c
2152 defw ucbar ;136d
2153 defb 000h ;136f
2154 defw ubbr ;1370
2155 defb 003h ;1372
2156 defw reg.c2 ;1373
2157 defb 003h ;1375
2158 defw reg.e2 ;1376
2159 defb 003h ;1378
2160 defw reg.l2 ;1379
2161 defb 003h ;137b
2162 defw reg.c ;137c
2163 defb 003h ;137e
2164 defw reg.e ;137f
2165 defb 003h ;1381
2166 defw reg.l ;1382
2167 defb 000h ;1384
2168 defw reg.a2 ;1385
2169 defb 000h ;1387
2170 defw reg.b2 ;1388
2171 defb 000h ;138a
2172 defw reg.c2 ;138b
2173 defb 000h ;138d
2174 defw reg.d2 ;138e
2175 defb 000h ;1390
2176 defw reg.e2 ;1391
2177 defb 000h ;1393
2178 defw reg.h2 ;1394
2179 defb 000h ;1396
2180 defw reg.l2 ;1397
2181 defb 000h ;1399
2182 defw reg.a ;139a
2183 defb 000h ;139c
2184 defw reg.b ;139d
2185 defb 000h ;139f
2186 defw reg.c ;13a0
2187 defb 000h ;13a2
2188 defw reg.d ;13a3
2189 defb 000h ;13a5
2190 defw reg.e ;13a6
2191 defb 000h ;13a8
2192 defw reg.h ;13a9
2193 defb 000h ;13ab
2194 defw reg.l ;13ac
2195 defb 003h ;13ae
2196 defw reg.ix ;13af
2197 defb 003h ;13b1
2198 defw reg.iy ;13b2
2199 defb 003h ;13b4
2200 defw reg.sp ;13b5
2201 defb 003h ;13b7
2202 defw reg.pc ;13b8
2203 defb 003h ;13ba
2204 defw reg.ix ;13bb
2205 defb 003h ;13bd
2206 defw reg.iy ;13be
2207 defb 003h ;13c0
2208 defw reg.sp ;13c1
2209 defb 003h ;13c3
2210 defw reg.pc ;13c4
2211 defb 000h ;13c6
2212 defw reg.i ;13c7
2213 defb 000h ;13c9
2214 defw reg.f2 ;13ca
2215 defb 000h ;13cc
2216 defw reg.f ;13cd
2217 if ROMSYS
2218 defb 000h ;13cf
2219 defw uromen ;13d0
2220 endif
2221 CMD.S:
2222 ld hl,(lst.S) ;13d2
2223 call get_lastarg_def ;13d5
2224 l13d8h:
2225 ld (lst.S),hl ;13d8
2226 call out.hl.@ ;13db
2227 call OUTBL ;13de
2228 comst ;13e1
2229 ld a,(hl) ;13e5
2230 comend
2231 call out.hex ;13e6
2232 call outbl2 ;13e9
2233 call INLINE ;13ec
2234 call SKIPBL ;13ef
2235 inc hl ;13f2
2236 jr z,l13d8h ;13f3
2237 dec hl ;13f5
2238 inc de ;13f6
2239 cp '.' ;13f7
2240 jp z,assert_eol ;13f9
2241 cp '-' ;13fc
2242 jr nz,l1406h ;13fe
2243 ld a,(de) ;1400
2244 or a ;1401
2245 dec hl ;1402
2246 jr z,l13d8h ;1403
2247 inc hl ;1405
2248 l1406h:
2249 dec de ;1406
2250 call get_bytes_m ;1407
2251 jr l13d8h ;140a
2252
2253 CMD.@:
2254 call assert_eol ;140c
2255 ld hl,MSG_at ;140f
2256 ld de,offs.@ ;1412
2257 ld c,001h ;1415
2258 jp l1279h ;1417
2259 MSG_at:
2260 dc '@'
2261
2262 CMD.I:
2263 ld hl,CMD.I ;141b
2264 ld (CMD_RPT),hl ;141e
2265 ld hl,(lst.IP) ;1421
2266 call get_lastarg_def ;1424
2267 ld (lst.IP),hl ;1427
2268 ld b,h ;142a
2269 ld c,l ;142b
2270 ld a,b ;142c
2271 or a ;142d
2272 jr nz,l1442h ;142e
2273 ld a,c ;1430
2274 ld hl,ucbar ;1431
2275 cp cbar ;1434
2276 jr z,l143fh ;1436
2277 ld hl,ubbr ;1438
2278 cp bbr ;143b
2279 jr nz,l1442h ;143d
2280 l143fh:
2281 ld a,(hl) ;143f
2282 jr l1444h ;1440
2283 l1442h:
2284 in a,(c) ;1442
2285 l1444h:
2286 push af ;1444
2287 call out.hex ;1445
2288 call outbl4 ;1448
2289 pop af ;144b
2290 call out.bin.b ;144c
2291 jp CRLF ;144f
2292 CMD.O:
2293 ld hl,CMD.O ;1452
2294 ld (CMD_RPT),hl ;1455
2295 ld hl,(lst.OD) ;1458
2296 call get_arg_def ;145b
2297 ld a,l ;145e
2298 ld (lst.OD),a ;145f
2299 push af ;1462
2300 call skip_to_nextarg ;1463
2301 ld hl,(lst.OP) ;1466
2302 call get_lastarg_def ;1469
2303 ld (lst.OP),hl ;146c
2304 ld b,h ;146f
2305 ld c,l ;1470
2306 ld a,b ;1471
2307 or a ;1472
2308 jr nz,l1489h ;1473
2309 ld a,c ;1475
2310 ld hl,ucbar ;1476
2311 cp cbar ;1479
2312 jr z,l148dh ;147b
2313 ld hl,ubbr ;147d
2314 cp bbr ;1480
2315 jr z,l148dh ;1482
2316 cp cbr ;1484
2317 jp z,ERROR ;1486
2318 l1489h:
2319 pop af ;1489
2320 out (c),a ;148a
2321 ret ;148c
2322 l148dh:
2323 pop af ;148d
2324 ld (hl),a ;148e
2325 ret ;148f
2326
2327 CMD.V:
2328 call get_arg3 ;1490 get from, size, to
2329 cmp_mem:
2330 push bc ;1493
2331 comst ;1494
2332 ld a,(de) ;1498
2333 ld b,(hl) ;1499
2334 comend
2335 cp b ;149a
2336 jr z,l14bah ;149b
2337 ld c,a ;149d
2338 call out.hl.@ ;149e
2339 call OUTBL ;14a1
2340 ld a,b ;14a4
2341 call out.hex ;14a5
2342 call outbl2 ;14a8
2343 ld a,c ;14ab
2344 call out.hex ;14ac
2345 call OUTBL ;14af
2346 ex de,hl ;14b2
2347 call out.hl.@ ;14b3
2348 ex de,hl ;14b6
2349 call CRLF ;14b7
2350 l14bah:
2351 pop bc ;14ba
2352 inc hl ;14bb
2353 inc de ;14bc
2354 dec bc ;14bd
2355 ld a,b ;14be
2356 or c ;14bf
2357 jr nz,cmp_mem ;14c0
2358 ret ;14c2
2359
2360 CMD.M:
2361 ld a,(de) ;14c3
2362 cp 'V' ;14c4
2363 jr nz,bm_nv ;14c6
2364 inc de ;14c8
2365 bm_nv:
2366 push af ;14c9 save 'V' flag
2367 call get_arg3 ;14ca
2368 push hl ;14cd
2369 push de ;14ce
2370 push bc ;14cf
2371 call CP.HL.DE ;14d0
2372 jr nc,bm_mvdown ;14d3
2373 add hl,bc ;14d5
2374 ex de,hl ;14d6
2375 add hl,bc ;14d7
2376 ex de,hl ;14d8
2377 dec hl ;14d9
2378 dec de ;14da
2379 comst ;14db
2380 lddr ;14df
2381 comend
2382 jr bm_done ;14e1
2383 bm_mvdown:
2384 comst ;14e3
2385 ldir ;14e7
2386 comend
2387 bm_done:
2388 pop bc ;14e9
2389 pop de ;14ea
2390 pop hl ;14eb
2391 pop af ;14ec
2392 jr z,cmp_mem ;14ed validate?
2393 ret ;14ef
2394 CMD.H:
2395 call EXPR ;14f0
2396 jp c,l173ch ;14f3
2397 call skip_to_nextarg ;14f6
2398 push hl ;14f9
2399 call EXPR ;14fa
2400 push af ;14fd
2401 call assert_eol ;14fe
2402 pop af ;1501
2403 ex de,hl ;1502
2404 pop hl ;1503
2405 jr c,l1511h ;1504
2406 push hl ;1506
2407 push de ;1507
2408 add hl,de ;1508
2409 call l1511h ;1509
2410 pop de ;150c
2411 pop hl ;150d
2412 and a ;150e
2413 sbc hl,de ;150f
2414 l1511h:
2415 call out.hl ;1511 val
2416 call outbl2 ;1514
2417 call sub_0928h ;1517 -val
2418 call outbl4 ;151a
2419 call out.hl.dec ;151d dec
2420 call outbl2 ;1520
2421 call out.hl.decm ;1523 -dec
2422 call outbl4 ;1526
2423 call out.bin.w ;1529 bin
2424 call outbl2 ;152c
2425 ld a,l ;152f
2426 call out.ascii ;1530
2427 jp CRLF ;1533
2428
2429 CMD.Q:
2430 ld a,(de) ;1536
2431 sub 'J' ;1537
2432 ld (lst.Qj),a ;1539
2433 jr nz,l153fh ;153c
2434 inc de ;153e
2435 l153fh:
2436 call get_arg_range ;153f
2437 push bc ;1542
2438 push hl ;1543
2439 call sub_15a7h ;1544
2440 pop hl ;1547
2441 l1548h:
2442 call sub_1594h ;1548
2443 jr nz,l1562h ;154b
2444 push bc ;154d
2445 push hl ;154e
2446 ld a,(lst.Qj) ;154f
2447 or a ;1552
2448 jr nz,l1559h ;1553
2449 ld bc,-8 ;1555
2450 add hl,bc ;1558
2451 l1559h:
2452 ld bc,MEMDUMP_CNT ;1559
2453 and a ;155c
2454 call memdump ;155d
2455 pop hl ;1560
2456 pop bc ;1561
2457 l1562h:
2458 inc hl ;1562
2459 ex (sp),hl ;1563
2460 dec hl ;1564
2461 ld a,h ;1565
2462 or l ;1566
2463 ex (sp),hl ;1567
2464 jr nz,l1548h ;1568
2465 pop bc ;156a
2466 ret ;156b
2467
2468 CMD.Z:
2469 call get_arg_range ;156c
2470 push bc ;156f
2471 push hl ;1570
2472 call sub_15a7h ;1571
2473 ld a,b ;1574
2474 pop hl ;1575
2475 pop bc ;1576
2476 push hl ;1577
2477 ex de,hl ;1578
2478 l1579h:
2479 push af ;1579
2480 ld a,(hl) ;157a
2481 comst ;157b
2482 ld (de),a ;157f
2483 comend
2484 pop af ;1580
2485 inc de ;1581
2486 cpi ;1582
2487 jp po,l1592h ;1584
2488 dec a ;1587
2489 jr nz,l1579h ;1588
2490 pop hl ;158a
2491 comst ;158b
2492 ldir ;158f
2493 comend
2494 ret ;1591
2495 l1592h:
2496 pop hl ;1592
2497 ret ;1593
2498
2499 sub_1594h:
2500 push hl ;1594
2501 push de ;1595
2502 push bc ;1596
2503 l1597h:
2504 ld a,(de) ;1597
2505 comst ;1598
2506 cp (hl) ;159c
2507 comend
2508 jr nz,l15a3h ;159d
2509 inc de ;159f
2510 inc hl ;15a0
2511 djnz l1597h ;15a1
2512 l15a3h:
2513 pop bc ;15a3
2514 pop de ;15a4
2515 pop hl ;15a5
2516 ret ;15a6
2517
2518 sub_15a7h:
2519 ld hl,ci.buf+1 ;15a7
2520 call get_bytes ;15aa
2521 ld de,ci.buf+1 ;15ad
2522 and a ;15b0
2523 sbc hl,de ;15b1
2524 ld b,l ;15b3
2525 ret nz ;15b4
2526 jp ERROR ;15b5
2527
2528 get_bytes:
2529 db 0e6h ;15b8 and 037h (clear carry, skip next opc)
2530 get_bytes_m:
2531 scf
2532 l15bah:
2533 push af ;15ba
2534 call skip_to_nextarg ;15bb
2535 cp 'W' ;15be
2536 jr nz,l15d9h ;15c0
2537 inc de ;15c2
2538 push hl ;15c3
2539 call sub_0a68h ;15c4
2540 ex de,hl ;15c7
2541 pop bc ;15c8
2542 pop af ;15c9
2543 push af ;15ca
2544 push bc ;15cb
2545 ex (sp),hl ;15cc
2546 jr nc,l15d3h ;15cd
2547 comst ;15cf
2548 l15d3h:
2549 ld (hl),e ;15d3
2550 comend
2551 inc hl ;15d4
2552 ld c,d ;15d5
2553 pop de ;15d6
2554 jr l15e5h ;15d7
2555 l15d9h:
2556 cp '''' ;15d9
2557 jr z,l15f1h ;15db
2558 push hl ;15dd
2559 call EXPR ;15de
2560 ld c,l ;15e1
2561 pop hl ;15e2
2562 jr c,l1626h ;15e3
2563 l15e5h:
2564 pop af ;15e5
2565 push af ;15e6
2566 jr nc,l15edh ;15e7
2567 comst ;15e9
2568 l15edh:
2569 ld (hl),c ;15ed
2570 comend
2571 inc hl ;15ee
2572 jr l161eh ;15ef
2573 l15f1h:
2574 inc de ;15f1
2575 ld a,(de) ;15f2
2576 cp '''' ;15f3
2577 jr z,l1607h ;15f5
2578 or a ;15f7
2579 jr z,l1626h ;15f8
2580 l15fah:
2581 ld c,a ;15fa
2582 pop af ;15fb
2583 push af ;15fc
2584 jr nc,l1603h ;15fd
2585 comst ;15ff
2586 l1603h:
2587 ld (hl),c ;1603
2588 comend
2589 inc hl ;1604
2590 jr l15f1h ;1605
2591 l1607h:
2592 inc de ;1607
2593 ld a,(de) ;1608
2594 cp '''' ;1609
2595 jr z,l15fah ;160b
2596 cp '.' ;160d
2597 jr nz,l161eh ;160f
2598 inc de ;1611
2599 dec hl ;1612
2600 pop af ;1613
2601 push af ;1614
2602 jr nc,l161bh ;1615
2603 comst ;1617
2604 l161bh:
2605 set 7,(hl) ;161b
2606 comend
2607 inc hl ;161d
2608 l161eh:
2609 pop af ;161e
2610 jr nc,l15bah ;161f
2611 ld (lst.S),hl ;1621
2612 jr l15bah ;1624
2613
2614 l1626h:
2615 pop af ;1626
2616 ret nc ;1627
2617 ld (lst.S),hl ;1628
2618 ret ;162b
2619
2620 CMD.D:
2621 ld hl,CMD.D ;162c
2622 ld (CMD_RPT),hl ;162f
2623 ld hl,(lst.D) ;1632
2624 ld bc,00080h ;1635
2625 call sub_0a82h ;1638
2626 scf ;163b
2627 memdump:
2628 push bc ;163c
2629 push de ;163d
2630 push hl ;163e
2631 ex af,af' ;163f
2632 l1640h:
2633 call out.hl.@ ;1640
2634 call z,outbl2 ;1643
2635 call OUTBL ;1646
2636 ld de,0 ;1649
2637 l164ch:
2638 comst ;164c
2639 ld a,(hl) ;1650
2640 comend
2641 inc hl ;1651
2642 call out.hex ;1652
2643 call OUTBL ;1655
2644 dec bc ;1658
2645 inc e ;1659
2646 ld a,e ;165a
2647 cp 010h ;165b
2648 jr z,l1668h ;165d
2649 and 003h ;165f
2650 call z,OUTBL ;1661
2651 ld a,b ;1664
2652 or c ;1665
2653 jr nz,l164ch ;1666
2654 l1668h:
2655 call OUTBL ;1668
2656 and a ;166b
2657 sbc hl,de ;166c
2658 l166eh:
2659 comst ;166e
2660 ld a,(hl) ;1672
2661 comend
2662 call sub_168fh ;1673
2663 call OUTCHAR ;1676
2664 inc hl ;1679
2665 dec e ;167a
2666 jr nz,l166eh ;167b
2667 ex af,af' ;167d
2668 jr nc,l1683h ;167e
2669 ld (lst.D),hl ;1680
2670 l1683h:
2671 ex af,af' ;1683
2672 call CRLF ;1684
2673 ld a,b ;1687
2674 or c ;1688
2675 jr nz,l1640h ;1689
2676 pop hl ;168b
2677 pop de ;168c
2678 pop bc ;168d
2679 ret ;168e
2680 sub_168fh:
2681 and 07fh ;168f
2682 cp 07fh ;1691
2683 jr z,l1698h ;1693
2684 cp 020h ;1695
2685 ret nc ;1697
2686 l1698h:
2687 ld a,02eh ;1698
2688 ret ;169a
2689
2690 ; Read Intel Hex File from console.
2691
2692 CMD.R:
2693 ld hl,0 ;169b
2694 call get_lastarg_def ;169e
2695 push hl ;16a1
2696 ld hl,0 ;16a2
2697 ld (HILOD),hl ;16a5
2698 w_recstart:
2699 call i.getchar ;16a8
2700 jr z,l16deh ;16ab
2701 cp ':' ;16ad
2702 jr nz,w_recstart ;16af
2703 ld c,0 ;16b1 init checksum
2704 call i.gethexbyte ;16b3 record len
2705 ld b,a ;16b6
2706 call i.gethexbyte ;16b7 address high
2707 ld h,a ;16ba
2708 call i.gethexbyte ;16bb address low
2709 ld l,a ;16be
2710 call i.gethexbyte ;16bf record type (ignored)
2711 ld a,b ;16c2
2712 and a ;16c3 record len == 0?
2713 jr z,l16deh ;16c4
2714 l16c6h:
2715 call i.gethexbyte ;16c6
2716 pop de ;16c9
2717 push de ;16ca
2718 push hl ;16cb
2719 add hl,de ;16cc
2720 call i.storebyte ;16cd
2721 pop hl ;16d0
2722 inc hl ;16d1
2723 djnz l16c6h ;16d2
2724 call i.gethexbyte ;16d4
2725 ld a,c ;16d7
2726 and a ;16d8
2727 jp nz,ERROR ;16d9 exit if checksum error
2728 jr w_recstart ;16dc next record
2729 l16deh:
2730 pop hl ;16de
2731 call i.gethexbyte ;16df
2732 jp l173fh ;16e2
2733
2734 i.gethexbyte:
2735 call sub_16f6h ;16e5
2736 rlca ;16e8
2737 rlca ;16e9
2738 rlca ;16ea
2739 rlca ;16eb
2740 ld d,a ;16ec
2741 call sub_16f6h ;16ed
2742 add a,d ;16f0
2743 ld d,a ;16f1
2744 add a,c ;16f2
2745 ld c,a ;16f3
2746 ld a,d ;16f4
2747 ret ;16f5
2748
2749 sub_16f6h:
2750 call i.getchar ;16f6
2751 jr z,l16ffh ;16f9
2752 call sub_0d26h ;16fb
2753 ret nc ;16fe
2754 l16ffh:
2755 jp ERROR ;16ff
2756
2757 i.getchar:
2758 call $ci ;1702
2759 cp 01ah ;1705
2760 ret ;1707
2761
2762 i.storebyte:
2763 push af ;1708
2764 push de ;1709
2765 ld de,TPA ;170a
2766 call CP.HL.DE ;170d
2767 jp c,ERROR ;1710
2768 ld de,$stcka ;1713
2769 call CP.HL.DE ;1716
2770 jp nc,ERROR ;1719
2771 ld de,(HILOD) ;171c
2772 call CP.HL.DE ;1720
2773 jr c,l1728h ;1723
2774 ld (HILOD),hl ;1725
2775 l1728h:
2776 ld de,(MAXLOD) ;1728
2777 call CP.HL.DE ;172c
2778 jr c,l1734h ;172f
2779 ld (MAXLOD),hl ;1731
2780 l1734h:
2781 pop de ;1734
2782 pop af ;1735
2783 comst ;1736
2784 ld (hl),a ;173a
2785 comend
2786 ret ;173b
2787
2788 l173ch:
2789 call assert_eol ;173c
2790 l173fh:
2791 ld hl,MSG_high ;173f
2792 call PSTR ;1742
2793 ld hl,(HILOD) ;1745
2794 call out.hl ;1748
2795 ld hl,MSG_max ;174b
2796 call PSTR ;174e
2797 ld hl,(MAXLOD) ;1751
2798 call out.hl ;1754
2799 jp CRLF ;1757
2800
2801 MSG_high:
2802 DC 'High = '
2803 MSG_max:
2804 DC ' Max = '
2805
2806 CMD.A:
2807 ld hl,(lst.A) ;1769
2808 call get_lastarg_def ;176c
2809 push hl ;176f
2810 pop iy ;1770
2811 ld hl,l17c4h ;1772
2812 ld (CMD_ERR),hl ;1775
2813 ld (XB068),sp ;1778
2814 l177ch:
2815 push iy ;177c
2816 pop hl ;177e
2817 ld (lst.A),hl ;177f
2818 ld (OFFS.pc),hl ;1782
2819 push hl ;1785
2820 call sub_1f3fh ;1786
2821 pop iy ;1789
2822 ld c,b ;178b
2823 ld de,(offs.@) ;178c
2824 ld a,d ;1790
2825 or e ;1791
2826 ld b,011h ;1792
2827 jr z,l1798h ;1794
2828 ld b,019h ;1796
2829 l1798h:
2830 call OUTBL ;1798
2831 ld a,(CON.COL) ;179b
2832 cp b ;179e
2833 jr c,l1798h ;179f
2834 push bc ;17a1
2835 call INLINE ;17a2
2836 pop bc ;17a5
2837 call SKIPBL ;17a6
2838 cp '.' ;17a9
2839 ret z ;17ab
2840 cp '-' ;17ac
2841 jr nz,l17b6h ;17ae
2842 ld iy,(XB06C) ;17b0
2843 jr l177ch ;17b4
2844 l17b6h:
2845 and a ;17b6
2846 call nz,sub_17cdh ;17b7
2847 ld (XB06C),iy ;17ba
2848 ld b,0 ;17be
2849 add iy,bc ;17c0
2850 jr l177ch ;17c2
2851 l17c4h:
2852 call l07eah ;17c4
2853 ld sp,(XB068) ;17c7
2854 jr l177ch ;17cb
2855
2856 sub_17cdh:
2857 call SKIPBL ;17cd
2858 ld hl,t_MNEMONICS ;17d0
2859 call sub_0a15h ;17d3
2860 jp nc,ERROR ;17d6
2861 call SKIPBL ;17d9
2862 push de ;17dc
2863 ld a,b ;17dd
2864 add a,b ;17de
2865 add a,b ;17df
2866 ld hl,b_0x17EE_start ;17e0
2867 call ADD_HL_A ;17e3
2868 ld e,(hl) ;17e6
2869 inc hl ;17e7
2870 ld d,(hl) ;17e8
2871 inc hl ;17e9
2872 ld b,(hl) ;17ea
2873 ex de,hl ;17eb
2874 pop de ;17ec
2875 jp (hl) ;17ed
2876
2877 b_0x17EE_start:
2878 defw l1b54h ;17ee
2879
2880 b_0x17F0_start:
2881 defb 088h ;17f0
2882
2883 b_0x17F1_start:
2884 defw l1b74h ;17f1
2885
2886 b_0x17F3_start:
2887 defb 080h ;17f3
2888
2889 b_0x17F4_start:
2890 defw l1babh ;17f4
2891
2892 b_0x17F6_start:
2893 defb 0a0h ;17f6
2894
2895 b_0x17F7_start:
2896 defw l1c14h ;17f7
2897
2898 b_0x17F9_start:
2899 defb 040h ;17f9
2900
2901 b_0x17FA_start:
2902 defw l1c38h ;17fa
2903
2904 b_0x17FC_start:
2905 defb 0c4h ;17fc
2906
2907 b_0x17FD_start:
2908 defw l1b36h ;17fd
2909
2910 b_0x17FF_start:
2911 defb 03fh ;17ff
2912
2913 b_0x1800_start:
2914 defw l1babh ;1800
2915
2916 b_0x1802_start:
2917 defb 0b8h ;1802
2918
2919 b_0x1803_start:
2920 defw gen.opc.ED2 ;1803
2921
2922 b_0x1805_start:
2923 defb 0a9h ;1805
2924
2925 b_0x1806_start:
2926 defw gen.opc.ED2 ;1806
2927
2928 b_0x1808_start:
2929 defb 0b9h ;1808
2930
2931 b_0x1809_start:
2932 defw gen.opc.ED2 ;1809
2933
2934 b_0x180B_start:
2935 defb 0a1h ;180b
2936
2937 b_0x180C_start:
2938 defw gen.opc.ED2 ;180c
2939
2940 b_0x180E_start:
2941 defb 0b1h ;180e
2942
2943 b_0x180F_start:
2944 defw l1b36h ;180f
2945
2946 b_0x1811_start:
2947 defb 02fh ;1811
2948
2949 b_0x1812_start:
2950 defw l1b36h ;1812
2951
2952 b_0x1814_start:
2953 defb 027h ;1814
2954
2955 b_0x1815_start:
2956 defw l1dabh ;1815
2957
2958 b_0x1817_start:
2959 defb 005h ;1817
2960
2961 b_0x1818_start:
2962 defw l1b36h ;1818
2963
2964 b_0x181A_start:
2965 defb 0f3h ;181a
2966
2967 b_0x181B_start:
2968 defw l1ca4h ;181b
2969
2970 b_0x181D_start:
2971 defb 010h ;181d
2972
2973 b_0x181E_start:
2974 defw l1b36h ;181e
2975
2976 b_0x1820_start:
2977 defb 0fbh ;1820
2978
2979 b_0x1821_start:
2980 defw l1d54h ;1821
2981
2982 b_0x1823_start:
2983 defb 0e3h ;1823
2984
2985 b_0x1824_start:
2986 defw l1b36h ;1824
2987
2988 b_0x1826_start:
2989 defb 0d9h ;1826
2990
2991 b_0x1827_start:
2992 defw l1b36h ;1827
2993
2994 b_0x1829_start:
2995 defb 076h ;1829
2996
2997 b_0x182A_start:
2998 defw l1cbfh ;182a
2999
3000 b_0x182C_start:
3001 defb 046h ;182c
3002
3003 b_0x182D_start:
3004 defw l1cf8h ;182d
3005
3006 b_0x182F_start:
3007 defb 040h ;182f
3008
3009 b_0x1830_start:
3010 defw l1dabh ;1830
3011
3012 b_0x1832_start:
3013 defb 004h ;1832
3014
3015 b_0x1833_start:
3016 defw gen.opc.ED2 ;1833
3017
3018 b_0x1835_start:
3019 defb 0aah ;1835
3020
3021 b_0x1836_start:
3022 defw gen.opc.ED2 ;1836
3023
3024 b_0x1838_start:
3025 defb 0bah ;1838
3026
3027 b_0x1839_start:
3028 defw gen.opc.ED2 ;1839
3029
3030 b_0x183B_start:
3031 defb 0a2h ;183b
3032
3033 b_0x183C_start:
3034 defw gen.opc.ED2 ;183c
3035
3036 b_0x183E_start:
3037 defb 0b2h ;183e
3038
3039 b_0x183F_start:
3040 defw l1c5eh ;183f
3041
3042 b_0x1841_start:
3043 defb 0c2h ;1841
3044
3045 b_0x1842_start:
3046 defw l1cabh ;1842
3047
3048 b_0x1844_start:
3049 defb 020h ;1844
3050
3051 b_0x1845_start:
3052 defw l1934h ;1845
3053
3054 b_0x1847_start:
3055 defb 040h ;1847
3056
3057 b_0x1848_start:
3058 defw gen.opc.ED2 ;1848
3059
3060 b_0x184A_start:
3061 defb 0a8h ;184a
3062
3063 b_0x184B_start:
3064 defw gen.opc.ED2 ;184b
3065
3066 b_0x184D_start:
3067 defb 0b8h ;184d
3068
3069 b_0x184E_start:
3070 defw gen.opc.ED2 ;184e
3071
3072 b_0x1850_start:
3073 defb 0a0h ;1850
3074
3075 b_0x1851_start:
3076 defw gen.opc.ED2 ;1851
3077
3078 b_0x1853_start:
3079 defb 0b0h ;1853
3080
3081 b_0x1854_start:
3082 defw gen.opc.ED2 ;1854
3083
3084 b_0x1856_start:
3085 defb 044h ;1856
3086
3087 b_0x1857_start:
3088 defw l1b36h ;1857
3089
3090 b_0x1859_start:
3091 defb 000h ;1859
3092
3093 b_0x185A_start:
3094 defw l1babh ;185a
3095
3096 b_0x185C_start:
3097 defb 0b0h ;185c
3098
3099 b_0x185D_start:
3100 defw gen.opc.ED2 ;185d
3101
3102 b_0x185F_start:
3103 defb 0bbh ;185f
3104
3105 b_0x1860_start:
3106 defw gen.opc.ED2 ;1860
3107
3108 b_0x1862_start:
3109 defb 0b3h ;1862
3110
3111 b_0x1863_start:
3112 defw l1d2ch ;1863
3113
3114 b_0x1865_start:
3115 defb 041h ;1865
3116
3117 b_0x1866_start:
3118 defw gen.opc.ED2 ;1866
3119
3120 b_0x1868_start:
3121 defb 0abh ;1868
3122
3123 b_0x1869_start:
3124 defw gen.opc.ED2 ;1869
3125
3126 b_0x186B_start:
3127 defb 0a3h ;186b
3128
3129 b_0x186C_start:
3130 defw l1ce4h ;186c
3131
3132 b_0x186E_start:
3133 defb 0c1h ;186e
3134
3135 b_0x186F_start:
3136 defw l1ce4h ;186f
3137
3138 b_0x1871_start:
3139 defb 0c5h ;1871
3140
3141 b_0x1872_start:
3142 defw l1c14h ;1872
3143
3144 b_0x1874_start:
3145 defb 080h ;1874
3146
3147 b_0x1875_start:
3148 defw l1c50h ;1875
3149
3150 b_0x1877_start:
3151 defb 0c0h ;1877
3152
3153 b_0x1878_start:
3154 defw gen.opc.ED2 ;1878
3155
3156 b_0x187A_start:
3157 defb 04dh ;187a
3158
3159 b_0x187B_start:
3160 defw gen.opc.ED2 ;187b
3161
3162 b_0x187D_start:
3163 defb 045h ;187d
3164
3165 b_0x187E_start:
3166 defw l1bd8h ;187e
3167
3168 b_0x1880_start:
3169 defb 010h ;1880
3170
3171 b_0x1881_start:
3172 defw l1b36h ;1881
3173
3174 b_0x1883_start:
3175 defb 017h ;1883
3176
3177 b_0x1884_start:
3178 defw l1bd8h ;1884
3179
3180 b_0x1886_start:
3181 defb 000h ;1886
3182
3183 b_0x1887_start:
3184 defw l1b36h ;1887
3185
3186 b_0x1889_start:
3187 defb 007h ;1889
3188
3189 b_0x188A_start:
3190 defw gen.opc.ED2 ;188a
3191
3192 b_0x188C_start:
3193 defb 06fh ;188c
3194
3195 b_0x188D_start:
3196 defw l1bd8h ;188d
3197
3198 b_0x188F_start:
3199 defb 018h ;188f
3200
3201 b_0x1890_start:
3202 defw l1b36h ;1890
3203
3204 b_0x1892_start:
3205 defb 01fh ;1892
3206
3207 b_0x1893_start:
3208 defw l1bd8h ;1893
3209
3210 b_0x1895_start:
3211 defb 008h ;1895
3212
3213 b_0x1896_start:
3214 defw l1b36h ;1896
3215
3216 b_0x1898_start:
3217 defb 00fh ;1898
3218
3219 b_0x1899_start:
3220 defw gen.opc.ED2 ;1899
3221
3222 b_0x189B_start:
3223 defb 067h ;189b
3224
3225 b_0x189C_start:
3226 defw l1cd5h ;189c
3227
3228 b_0x189E_start:
3229 defb 0c7h ;189e
3230
3231 b_0x189F_start:
3232 defw l1b54h ;189f
3233
3234 b_0x18A1_start:
3235 defb 098h ;18a1
3236
3237 b_0x18A2_start:
3238 defw l1b36h ;18a2
3239
3240 b_0x18A4_start:
3241 defb 037h ;18a4
3242
3243 b_0x18A5_start:
3244 defw l1c14h ;18a5
3245
3246 b_0x18A7_start:
3247 defb 0c0h ;18a7
3248
3249 b_0x18A8_start:
3250 defw l1bd8h ;18a8
3251
3252 b_0x18AA_start:
3253 defb 020h ;18aa
3254
3255 b_0x18AB_start:
3256 defw l1bd8h ;18ab
3257
3258 b_0x18AD_start:
3259 defb 028h ;18ad
3260
3261 b_0x18AE_start:
3262 defw l1bd8h ;18ae
3263
3264 b_0x18B0_start:
3265 defb 038h ;18b0
3266
3267 b_0x18B1_start:
3268 defw l1babh ;18b1
3269
3270 b_0x18B3_start:
3271 defb 090h ;18b3
3272
3273 b_0x18B4_start:
3274 defw l1babh ;18b4
3275
3276 b_0x18B6_start:
3277 defb 0a8h ;18b6
3278
3279 b_0x18B7_start:
3280 defw A.IN0 ;18b7
3281
3282 b_0x18B9_start:
3283 defb 000h ;18b9
3284
3285 b_0x18BA_start:
3286 defw A.MLT ;18ba
3287
3288 b_0x18BC_start:
3289 defb 04ch ;18bc
3290 ld b,e ;18bd
3291 dec de ;18be
3292
3293 b_0x18BF_start:
3294 defb 08bh ;18bf
3295
3296 b_0x18C0_start:
3297 defw gen.opc.ED2 ;18c0
3298
3299 b_0x18C2_start:
3300 defb 09bh ;18c2
3301
3302 b_0x18C3_start:
3303 defw gen.opc.ED2 ;18c3
3304
3305 b_0x18C5_start:
3306 defb 083h ;18c5
3307
3308 b_0x18C6_start:
3309 defw gen.opc.ED2 ;18c6
3310
3311 b_0x18C8_start:
3312 defb 093h ;18c8
3313
3314 b_0x18C9_start:
3315 defw l18fdh ;18c9
3316
3317 b_0x18CB_start:
3318 defb 001h ;18cb
3319
3320 b_0x18CC_start:
3321 defw gen.opc.ED2 ;18cc
3322
3323 b_0x18CE_start:
3324 defb 076h ;18ce
3325
3326 b_0x18CF_start:
3327 defw l191dh ;18cf
3328
3329 b_0x18D1_start:
3330 defb 004h ;18d1
3331
3332 b_0x18D2_start:
3333 defw l192ch ;18d2
3334
3335 b_0x18D4_start:
3336 defb 074h ;18d4
3337 A.IN0:
3338 call sub_1e41h ;18d5
3339 jr nc,l1931h ;18d8
3340 cp 006h ;18da
3341 jr z,l1931h ;18dc
3342 rlca ;18de
3343 rlca ;18df
3344 rlca ;18e0
3345 add a,b ;18e1
3346 ld b,a ;18e2
3347 call sub_1ed1h ;18e3
3348 call sub_1e06h ;18e6
3349 l18e9h:
3350 call assert_eol ;18e9
3351 comst ;18ec
3352 ld (iy+000h),0edh ;18f0
3353 ld (iy+001h),b ;18f4
3354 ld (iy+002h),l ;18f7
3355 comend
3356 ld c,003h ;18fa
3357 ret ;18fc
3358 l18fdh:
3359 call sub_1e06h ;18fd
3360 call sub_1ed1h ;1900
3361 call sub_1e41h ;1903
3362 jr nc,l1931h ;1906
3363 cp 006h ;1908
3364 jr z,l1931h ;190a
3365 rlca ;190c
3366 rlca ;190d
3367 rlca ;190e
3368 add a,b ;190f
3369 ld b,a ;1910
3370 jr l18e9h ;1911
3371 A.MLT:
3372 call sub_1e2eh ;1913
3373 jr nc,l1931h ;1916
3374 add a,b ;1918
3375 ld b,a ;1919
3376 jp gen.opc.ED2 ;191a
3377 l191dh:
3378 call sub_1e41h ;191d
3379 jr nc,l192ah ;1920
3380 rlca ;1922
3381 rlca ;1923
3382 rlca ;1924
3383 add a,b ;1925
3384 ld b,a ;1926
3385 jp gen.opc.ED2 ;1927
3386 l192ah:
3387 ld b,064h ;192a
3388 l192ch:
3389 call sub_1e12h ;192c
3390 jr l18e9h ;192f
3391 l1931h:
3392 jp ERROR ;1931
3393 l1934h:
3394 call sub_1e41h ;1934
3395 jp c,l19bfh ;1937
3396 call sub_1e68h ;193a
3397 jp c,l1a64h ;193d
3398 call sub_1e2eh ;1940
3399 jp c,l1a93h ;1943
3400 call sub_1e50h ;1946
3401 jp c,l1af0h ;1949
3402 ld a,(de) ;194c
3403 cp 049h ;194d
3404 jp z,l1b0ch ;194f
3405 cp 052h ;1952
3406 jp z,l1b14h ;1954
3407 cp 028h ;1957
3408 jp nz,ERROR ;1959
3409 inc de ;195c
3410 call sub_1e2eh ;195d
3411 jp c,l1b23h ;1960
3412 call tst_EXPR ;1963
3413 call sub_1ed8h ;1966
3414 call sub_1ed1h ;1969
3415 call sub_1e2eh ;196c
3416 jr c,l19adh ;196f
3417 call sub_1e50h ;1971
3418 jr nc,l1991h ;1974
3419 ld b,022h ;1976
3420 l1978h:
3421 call assert_eol ;1978
3422 ld a,(pfx.IXY) ;197b
3423 l197eh:
3424 comst ;197e
3425 ld (iy+000h),a ;1982
3426 ld (iy+001h),b ;1985
3427 ld (iy+002h),l ;1988
3428 ld (iy+003h),h ;198b
3429 comend
3430 ld c,004h ;198e
3431 ret ;1990
3432 l1991h:
3433 ld a,(de) ;1991
3434 cp 041h ;1992
3435 jp nz,ERROR ;1994
3436 inc de ;1997
3437 ld b,032h ;1998
3438 l199ah:
3439 call assert_eol ;199a
3440 comst ;199d
3441 ld (iy+000h),b ;19a1
3442 ld (iy+001h),l ;19a4
3443 ld (iy+002h),h ;19a7
3444 comend
3445 ld c,003h ;19aa
3446 ret ;19ac
3447 l19adh:
3448 cp 020h ;19ad
3449 jr z,l19bbh ;19af
3450 add a,043h ;19b1
3451 ld b,a ;19b3
3452 l19b4h:
3453 call assert_eol ;19b4
3454 ld a,0edh ;19b7
3455 jr l197eh ;19b9
3456 l19bbh:
3457 ld b,022h ;19bb
3458 jr l199ah ;19bd
3459 l19bfh:
3460 ld b,a ;19bf
3461 call sub_1ed1h ;19c0
3462 call sub_1e41h ;19c3
3463 jr nc,l19dbh ;19c6
3464 push af ;19c8
3465 ld a,b ;19c9
3466 rlca ;19ca
3467 rlca ;19cb
3468 rlca ;19cc
3469 ld b,a ;19cd
3470 pop af ;19ce
3471 add a,b ;19cf
3472 add a,040h ;19d0
3473 cp 076h ;19d2
3474 jp z,ERROR ;19d4
3475 l19d7h:
3476 ld b,a ;19d7
3477 jp l1b36h ;19d8
3478 l19dbh:
3479 call sub_1e68h ;19db
3480 jr nc,l1a02h ;19de
3481 ld a,b ;19e0
3482 rlca ;19e1
3483 rlca ;19e2
3484 rlca ;19e3
3485 add a,046h ;19e4
3486 cp 076h ;19e6
3487 jp z,ERROR ;19e8
3488 l19ebh:
3489 ld b,a ;19eb
3490 call assert_eol ;19ec
3491 ld a,(pfx.IXY) ;19ef
3492 comst ;19f2
3493 ld (iy+000h),a ;19f6
3494 ld (iy+001h),b ;19f9
3495 ld (iy+002h),c ;19fc
3496 comend
3497 ld c,003h ;19ff
3498 ret ;1a01
3499 l1a02h:
3500 ld a,(de) ;1a02
3501 cp 'I' ;1a03
3502 jr z,l1a15h ;1a05
3503 cp 'R' ;1a07
3504 jr nz,l1a21h ;1a09
3505 ld a,b ;1a0b
3506 cp 007h ;1a0c
3507 jp nz,ERROR ;1a0e
3508 ld b,05fh ;1a11
3509 jr l1a1dh ;1a13
3510 l1a15h:
3511 ld a,b ;1a15
3512 cp 007h ;1a16
3513 jp nz,ERROR ;1a18
3514 ld b,057h ;1a1b
3515 l1a1dh:
3516 inc de ;1a1d
3517 jp gen.opc.ED2 ;1a1e
3518 l1a21h:
3519 cp '(' ;1a21
3520 jr z,l1a3fh ;1a23
3521 call sub_1e12h ;1a25
3522 ld a,b ;1a28 ld r,nn
3523 rlca ;1a29
3524 rlca ;1a2a
3525 rlca ;1a2b
3526 add a,006h ;1a2c
3527 l1a2eh:
3528 ld b,a ;1a2e
3529 l1a2fh:
3530 call assert_eol ;1a2f
3531 comst ;1a32
3532 ld (iy+000h),b ;1a36
3533 ld (iy+001h),l ;1a39
3534 comend
3535 ld c,002h ;1a3c
3536 ret ;1a3e
3537 l1a3fh:
3538 inc de ;1a3f
3539 ld a,b ;1a40
3540 cp 007h ;1a41
3541 jp nz,ERROR ;1a43
3542 call sub_1e2eh ;1a46
3543 jr nc,l1a59h ;1a49
3544 cp 030h ;1a4b
3545 jp nc,ERROR ;1a4d
3546 add a,00ah ;1a50
3547 ld b,a ;1a52
3548 call sub_1ed8h ;1a53
3549 jp l1b36h ;1a56
3550 l1a59h:
3551 call tst_EXPR ;1a59
3552 call sub_1ed8h ;1a5c
3553 ld b,03ah ;1a5f
3554 jp l199ah ;1a61
3555 l1a64h:
3556 call sub_1ed1h ;1a64
3557 call sub_1e41h ;1a67
3558 jr nc,l1a76h ;1a6a
3559 cp 006h ;1a6c
3560 jp z,ERROR ;1a6e
3561 add a,070h ;1a71
3562 jp l19ebh ;1a73
3563 l1a76h:
3564 call sub_1e12h ;1a76
3565 call assert_eol ;1a79
3566 ld a,(pfx.IXY) ;1a7c
3567 comst ;1a7f
3568 ld (iy+000h),a ;1a83 dd/fd
3569 ld (iy+001h),036h ;1a86
3570 ld (iy+002h),c ;1a8a displacement
3571 ld (iy+003h),l ;1a8d nn
3572 comend
3573 ld c,4 ;1a90
3574 ret ;1a92
3575 l1a93h:
3576 ld b,a ;1a93
3577 call sub_1ed1h ;1a94
3578 ld hl,t_HL.AF ;1a97
3579 call sub_0a23h ;1a9a
3580 jr c,l1abeh ;1a9d
3581 call sub_1e50h ;1a9f
3582 jr nc,l1ac7h ;1aa2
3583 ld a,b ;1aa4
3584 cp 030h ;1aa5
3585 jr nz,l1b20h ;1aa7
3586 ld b,0f9h ;1aa9
3587 l1aabh:
3588 call assert_eol ;1aab
3589 ld a,(pfx.IXY) ;1aae
3590 comst ;1ab1
3591 ld (iy+000h),a ;1ab5
3592 ld (iy+001h),b ;1ab8
3593 comend
3594 ld c,002h ;1abb
3595 ret ;1abd
3596 l1abeh:
3597 ld a,b ;1abe
3598 cp 030h ;1abf
3599 jr nz,l1b20h ;1ac1
3600 ld b,0f9h ;1ac3
3601 jr l1b36h ;1ac5
3602 l1ac7h:
3603 ld a,(de) ;1ac7
3604 cp 028h ;1ac8
3605 jr nz,l1ae3h ;1aca
3606 inc de ;1acc
3607 call tst_EXPR ;1acd
3608 call sub_1ed8h ;1ad0
3609 ld a,b ;1ad3
3610 cp 020h ;1ad4
3611 jr z,l1adeh ;1ad6
3612 add a,04bh ;1ad8
3613 ld b,a ;1ada
3614 jp l19b4h ;1adb
3615 l1adeh:
3616 ld b,02ah ;1ade
3617 jp l199ah ;1ae0
3618 l1ae3h:
3619 call tst_EXPR ;1ae3
3620 call assert_eol ;1ae6
3621 ld a,001h ;1ae9
3622 add a,b ;1aeb
3623 ld b,a ;1aec
3624 jp l199ah ;1aed
3625 l1af0h:
3626 call sub_1ed1h ;1af0
3627 ld a,(de) ;1af3
3628 cp 028h ;1af4
3629 jr nz,l1b04h ;1af6
3630 inc de ;1af8
3631 call tst_EXPR ;1af9
3632 call sub_1ed8h ;1afc
3633 ld b,02ah ;1aff
3634 jp l1978h ;1b01
3635 l1b04h:
3636 call tst_EXPR ;1b04
3637 ld b,021h ;1b07
3638 jp l1978h ;1b09
3639 l1b0ch:
3640 inc de ;1b0c
3641 call sub_1ed1h ;1b0d
3642 ld b,047h ;1b10
3643 jr l1b1ah ;1b12
3644 l1b14h:
3645 inc de ;1b14
3646 call sub_1ed1h ;1b15
3647 ld b,04fh ;1b18
3648 l1b1ah:
3649 ld a,(de) ;1b1a
3650 inc de ;1b1b
3651 cp 041h ;1b1c
3652 jr z,gen.opc.ED2 ;1b1e
3653 l1b20h:
3654 jp ERROR ;1b20
3655 l1b23h:
3656 cp 020h ;1b23
3657 jr nc,l1b20h ;1b25
3658 add a,002h ;1b27
3659 ld b,a ;1b29
3660 call sub_1ed8h ;1b2a
3661 call sub_1ed1h ;1b2d
3662 ld a,(de) ;1b30
3663 cp 041h ;1b31
3664 jr nz,l1b20h ;1b33
3665 inc de ;1b35
3666 l1b36h:
3667 call assert_eol ;1b36
3668 comst ;1b39
3669 ld (iy+000h),b ;1b3d
3670 comend
3671 ld c,001h ;1b40
3672 ret ;1b42
3673 gen.opc.ED2:
3674 call assert_eol ;1b43
3675 comst ;1b46
3676 ld (iy+000h),0edh ;1b4a
3677 ld (iy+001h),b ;1b4e
3678 comend
3679 ld c,002h ;1b51
3680 ret ;1b53
3681 l1b54h:
3682 ld hl,t_HL.AF ;1b54
3683 call sub_0a23h ;1b57
3684 jr nc,l1babh ;1b5a
3685 call sub_1ed1h ;1b5c
3686 call sub_1e2eh ;1b5f
3687 jp nc,ERROR ;1b62
3688 push af ;1b65
3689 ld a,b ;1b66
3690 cp 088h ;1b67
3691 ld b,04ah ;1b69
3692 jr z,l1b6fh ;1b6b
3693 ld b,042h ;1b6d
3694 l1b6fh:
3695 pop af ;1b6f
3696 add a,b ;1b70
3697 l1b71h:
3698 ld b,a ;1b71
3699 jr gen.opc.ED2 ;1b72
3700 l1b74h:
3701 ld hl,t_HL.AF ;1b74
3702 call sub_0a23h ;1b77
3703 jr c,l1b9dh ;1b7a
3704 call sub_1e50h ;1b7c
3705 jr nc,l1babh ;1b7f
3706 call sub_1ed1h ;1b81
3707 ld hl,t_BC.DE.IX.SP ;1b84
3708 ld a,(pfx.IXY) ;1b87
3709 cp 0fdh ;1b8a
3710 jr nz,l1b91h ;1b8c
3711 ld hl,t_BC.DE.IY.SP ;1b8e
3712 l1b91h:
3713 call sub_1e2bh ;1b91
3714 jp nc,ERROR ;1b94
3715 add a,009h ;1b97
3716 l1b99h:
3717 ld b,a ;1b99
3718 jp l1aabh ;1b9a
3719 l1b9dh:
3720 call sub_1ed1h ;1b9d
3721 call sub_1e2eh ;1ba0
3722 jp nc,ERROR ;1ba3
3723 add a,009h ;1ba6
3724 jp l19d7h ;1ba8
3725 l1babh:
3726 ld a,(de) ;1bab
3727 cp 041h ;1bac
3728 jr nz,l1bbbh ;1bae
3729 push de ;1bb0
3730 inc de ;1bb1
3731 call skip_to_nextarg ;1bb2
3732 jr z,l1bbah ;1bb5
3733 pop de ;1bb7
3734 jr l1bbbh ;1bb8
3735 l1bbah:
3736 pop af ;1bba
3737 l1bbbh:
3738 call sub_1e41h ;1bbb
3739 jr c,l1bceh ;1bbe
3740 call sub_1e68h ;1bc0
3741 jr c,l1bd2h ;1bc3
3742 call sub_1e12h ;1bc5
3743 ld a,b ;1bc8
3744 add a,046h ;1bc9
3745 jp l1a2eh ;1bcb
3746 l1bceh:
3747 add a,b ;1bce
3748 jp l19d7h ;1bcf
3749 l1bd2h:
3750 ld a,b ;1bd2
3751 add a,006h ;1bd3
3752 jp l19ebh ;1bd5
3753 l1bd8h:
3754 call sub_1e41h ;1bd8
3755 jr c,l1c01h ;1bdb
3756 call sub_1e68h ;1bdd
3757 jp nc,ERROR ;1be0
3758 ld a,b ;1be3
3759 add a,006h ;1be4
3760 ld b,a ;1be6
3761 l1be7h:
3762 call assert_eol ;1be7
3763 ld a,(pfx.IXY) ;1bea
3764 comst ;1bed
3765 ld (iy+000h),a ;1bf1
3766 ld (iy+001h),0cbh ;1bf4
3767 ld (iy+002h),c ;1bf8
3768 ld (iy+003h),b ;1bfb
3769 comend
3770 ld c,004h ;1bfe
3771 ret ;1c00
3772 l1c01h:
3773 add a,b ;1c01
3774 l1c02h:
3775 ld b,a ;1c02
3776 call assert_eol ;1c03
3777 comst ;1c06
3778 ld (iy+000h),0cbh ;1c0a
3779 ld (iy+001h),b ;1c0e
3780 comend
3781 ld c,002h ;1c11
3782 ret ;1c13
3783 l1c14h:
3784 call sub_1de6h ;1c14
3785 call sub_1ed1h ;1c17
3786 call sub_1e41h ;1c1a
3787 jr c,l1c2fh ;1c1d
3788 call sub_1e68h ;1c1f
3789 jp nc,ERROR ;1c22
3790 ld a,l ;1c25
3791 rlca ;1c26
3792 rlca ;1c27
3793 rlca ;1c28
3794 add a,006h ;1c29
3795 add a,b ;1c2b
3796 ld b,a ;1c2c
3797 jr l1be7h ;1c2d
3798 l1c2fh:
3799 add a,b ;1c2f
3800 ld b,a ;1c30
3801 ld a,l ;1c31
3802 rlca ;1c32
3803 rlca ;1c33
3804 rlca ;1c34
3805 add a,b ;1c35
3806 jr l1c02h ;1c36
3807 l1c38h:
3808 push de ;1c38
3809 call sub_1eb8h ;1c39
3810 jr nc,l1c47h ;1c3c
3811 add a,b ;1c3e
3812 ld b,a ;1c3f
3813 call skip_to_nextarg ;1c40
3814 jr z,l1c49h ;1c43
3815 pop de ;1c45
3816 push de ;1c46
3817 l1c47h:
3818 ld b,0cdh ;1c47
3819 l1c49h:
3820 pop af ;1c49
3821 call tst_EXPR ;1c4a
3822 jp l199ah ;1c4d
3823 l1c50h:
3824 call sub_1eb8h ;1c50
3825 jr nc,l1c59h ;1c53
3826 add a,b ;1c55
3827 ld b,a ;1c56
3828 jr l1c5bh ;1c57
3829 l1c59h:
3830 ld b,0c9h ;1c59
3831 l1c5bh:
3832 jp l1b36h ;1c5b
3833 l1c5eh:
3834 push de ;1c5e
3835 call sub_1eb8h ;1c5f
3836 jr c,l1c71h ;1c62
3837 l1c64h:
3838 pop de ;1c64
3839 ld hl,b_0x1C97_start ;1c65
3840 call sub_0a15h ;1c68
3841 jr c,l1c7fh ;1c6b
3842 ld b,0c3h ;1c6d
3843 jr l1c79h ;1c6f
3844 l1c71h:
3845 add a,b ;1c71
3846 ld b,a ;1c72
3847 call skip_to_nextarg ;1c73
3848 jr nz,l1c64h ;1c76
3849 pop af ;1c78
3850 l1c79h:
3851 call tst_EXPR ;1c79
3852 jp l199ah ;1c7c
3853 l1c7fh:
3854 call assert_eol ;1c7f
3855 ld a,b ;1c82
3856 and a ;1c83
3857 jr nz,l1c8bh ;1c84
3858 ld b,0e9h ;1c86
3859 jp l1b36h ;1c88
3860 l1c8bh:
3861 ld b,0ddh ;1c8b
3862 dec a ;1c8d
3863 jr z,l1c92h ;1c8e
3864 ld b,0fdh ;1c90
3865 l1c92h:
3866 ld l,0e9h ;1c92
3867 jp l1a2fh ;1c94
3868
3869 b_0x1C97_start:
3870 DC '(HL)'
3871 DC '(IX)'
3872 DC '(IY)'
3873 DB 0
3874
3875 l1ca4h:
3876 call skip_to_nextarg ;1ca4
3877 ld b,010h ;1ca7
3878 jr l1cb9h ;1ca9
3879 l1cabh:
3880 call sub_1ebfh ;1cab
3881 jr c,l1cb4h ;1cae
3882 ld b,018h ;1cb0
3883 jr l1cb9h ;1cb2
3884 l1cb4h:
3885 add a,b ;1cb4
3886 ld b,a ;1cb5
3887 call sub_1ed1h ;1cb6
3888 l1cb9h:
3889 call sub_1defh ;1cb9
3890 jp l1a2fh ;1cbc
3891 l1cbfh:
3892 call sub_1e12h ;1cbf
3893 ld a,l ;1cc2
3894 cp 003h ;1cc3
3895 jr nc,l1d23h ;1cc5
3896 and a ;1cc7
3897 jr z,l1cd2h ;1cc8
3898 ld b,056h ;1cca
3899 cp 001h ;1ccc
3900 jr z,l1cd2h ;1cce
3901 ld b,05eh ;1cd0
3902 l1cd2h:
3903 jp gen.opc.ED2 ;1cd2
3904 l1cd5h:
3905 call sub_1e12h ;1cd5
3906 ld a,l ;1cd8
3907 push af ;1cd9
3908 add a,b ;1cda
3909 ld b,a ;1cdb
3910 pop af ;1cdc
3911 and 0c7h ;1cdd
3912 jr nz,l1d23h ;1cdf
3913 jp l1b36h ;1ce1
3914 l1ce4h:
3915 call sub_1e50h ;1ce4
3916 jr c,l1cf2h ;1ce7
3917 call sub_1e25h ;1ce9
3918 jr nc,l1d23h ;1cec
3919 add a,b ;1cee
3920 jp l19d7h ;1cef
3921 l1cf2h:
3922 ld a,b ;1cf2
3923 add a,020h ;1cf3
3924 jp l1b99h ;1cf5
3925 l1cf8h:
3926 call sub_1e41h ;1cf8
3927 jr nc,l1d23h ;1cfb
3928 cp 006h ;1cfd
3929 jr z,l1d23h ;1cff
3930 rlca ;1d01
3931 rlca ;1d02
3932 rlca ;1d03
3933 add a,b ;1d04
3934 ld b,a ;1d05
3935 cp 078h ;1d06
3936 jr nz,l1d1ah ;1d08
3937 call sub_1ed1h ;1d0a
3938 call sub_1d26h ;1d0d
3939 jr c,l1d20h ;1d10
3940 call sub_1e06h ;1d12
3941 ld b,0dbh ;1d15
3942 jp l1a2fh ;1d17
3943 l1d1ah:
3944 call sub_1ed1h ;1d1a
3945 call sub_1d26h ;1d1d
3946 l1d20h:
3947 jp c,gen.opc.ED2 ;1d20
3948 l1d23h:
3949 jp ERROR ;1d23
3950 sub_1d26h:
3951 ld hl,t__C_ ;1d26
3952 jp sub_0a23h ;1d29
3953 l1d2ch:
3954 call sub_1d26h ;1d2c
3955 jr nc,l1d44h ;1d2f
3956 call sub_1ed1h ;1d31
3957 call sub_1e41h ;1d34
3958 jr nc,l1d23h ;1d37
3959 cp 006h ;1d39
3960 jr z,l1d23h ;1d3b
3961 rlca ;1d3d
3962 rlca ;1d3e
3963 rlca ;1d3f
3964 add a,b ;1d40
3965 jp l1b71h ;1d41
3966 l1d44h:
3967 call sub_1e06h ;1d44
3968 call sub_1ed1h ;1d47
3969 cp 041h ;1d4a
3970 jr nz,l1d23h ;1d4c
3971 inc de ;1d4e
3972 ld b,0d3h ;1d4f
3973 jp l1a2fh ;1d51
3974 l1d54h:
3975 ld hl,b_0x1D80_start ;1d54
3976 call sub_0a15h ;1d57
3977 jp nc,ERROR ;1d5a
3978 ld c,b ;1d5d
3979 call assert_eol ;1d5e
3980 ld b,000h ;1d61
3981 ld hl,b_0x1DA1_start ;1d63
3982 add hl,bc ;1d66
3983 add hl,bc ;1d67
3984 ld a,(hl) ;1d68
3985 comst ;1d69
3986 ld (iy+000h),a ;1d6d
3987 comend
3988 ld c,001h ;1d70
3989 inc hl ;1d72
3990 ld a,(hl) ;1d73
3991 and a ;1d74
3992 ret z ;1d75
3993 comst ;1d76
3994 ld (iy+001h),a ;1d7a
3995 comend
3996 ld c,002h ;1d7d
3997 ret ;1d7f
3998
3999 b_0x1D80_start:
4000 DC 'AF,AF'''
4001 l1d86h:
4002 DC 'DE,HL'
4003 DC '(SP),HL'
4004 DC '(SP),IX'
4005 DC '(SP),IY'
4006 db 000h ;1da0
4007
4008 b_0x1DA1_start:
4009 db 008h ;1da1
4010 db 000h ;1da2
4011 db 0ebh ;1da3
4012 db 000h ;1da4
4013 db 0e3h ;1da5
4014 db 000h ;1da6
4015 db 0ddh ;1da7
4016 db 0e3h ;1da8
4017 db 0fdh ;1da9
4018 db 0e3h ;1daa
4019 l1dabh:
4020 call sub_1e50h ;1dab
4021 jr c,l1dc6h ;1dae
4022 call sub_1e2eh ;1db0
4023 jr c,l1dd2h ;1db3
4024 call sub_1e41h ;1db5
4025 jr c,l1ddfh ;1db8
4026 call sub_1e68h ;1dba
4027 jp nc,ERROR ;1dbd
4028 ld a,b ;1dc0
4029 add a,030h ;1dc1
4030 jp l19ebh ;1dc3
4031 l1dc6h:
4032 ld a,b ;1dc6
4033 ld b,023h ;1dc7
4034 cp 004h ;1dc9
4035 jr z,l1dcfh ;1dcb
4036 ld b,02bh ;1dcd
4037 l1dcfh:
4038 jp l1aabh ;1dcf
4039 l1dd2h:
4040 push af ;1dd2
4041 ld a,b ;1dd3
4042 ld b,003h ;1dd4
4043 cp 004h ;1dd6
4044 jr z,l1ddch ;1dd8
4045 ld b,00bh ;1dda
4046 l1ddch:
4047 pop af ;1ddc
4048 jr l1de2h ;1ddd
4049 l1ddfh:
4050 rlca ;1ddf
4051 rlca ;1de0
4052 rlca ;1de1
4053 l1de2h:
4054 add a,b ;1de2
4055 jp l19d7h ;1de3
4056 sub_1de6h:
4057 call sub_1e12h ;1de6
4058 ld a,l ;1de9
4059 cp 008h ;1dea
4060 jr nc,error1 ;1dec
4061 ret ;1dee
4062 sub_1defh:
4063 call tst_EXPR ;1def
4064 push bc ;1df2
4065 push iy ;1df3
4066 pop bc ;1df5
4067 and a ;1df6
4068 sbc hl,bc ;1df7
4069 dec hl ;1df9
4070 dec hl ;1dfa
4071 pop bc ;1dfb
4072 call sub_1e15h ;1dfc
4073 ld a,h ;1dff
4074 xor l ;1e00
4075 bit 7,a ;1e01
4076 jr nz,error1 ;1e03
4077 ret ;1e05
4078 sub_1e06h:
4079 ld a,(de) ;1e06
4080 cp 028h ;1e07
4081 jr nz,sub_1e12h ;1e09
4082 inc de ;1e0b
4083 call sub_1e12h ;1e0c
4084 jp sub_1ed8h ;1e0f
4085
4086 sub_1e12h:
4087 call tst_EXPR ;1e12
4088 sub_1e15h:
4089 ld a,h ;1e15
4090 and a ;1e16
4091 ret z ;1e17
4092 inc a ;1e18
4093 ret z ;1e19
4094 jr error1 ;1e1a
4095
4096 tst_EXPR:
4097 push bc ;1e1c
4098 call EXPR ;1e1d
4099 pop bc ;1e20
4100 ret nc ;1e21
4101 error1:
4102 jp ERROR ;1e22
4103 sub_1e25h:
4104 push hl ;1e25
4105 ld hl,t_BC.DE.HL.AF ;1e26
4106 jr l1e32h ;1e29
4107 sub_1e2bh:
4108 push hl ;1e2b
4109 jr l1e32h ;1e2c
4110 sub_1e2eh:
4111 push hl ;1e2e
4112 ld hl,t_BC.DE.HL.SP ;1e2f
4113 l1e32h:
4114 push bc ;1e32
4115 call sub_0a15h ;1e33
4116 jr nc,l1e3eh ;1e36
4117 ld a,b ;1e38
4118 rlca ;1e39
4119 rlca ;1e3a
4120 rlca ;1e3b
4121 rlca ;1e3c
4122 scf ;1e3d
4123 l1e3eh:
4124 pop bc ;1e3e
4125 pop hl ;1e3f
4126 ret ;1e40
4127 sub_1e41h:
4128 call SKIPBL ;1e41
4129 push bc ;1e44
4130 push hl ;1e45
4131 ld hl,t_BCDEHL_HL_A ;1e46
4132 call sub_0a15h ;1e49
4133 ld a,b ;1e4c
4134 pop hl ;1e4d
4135 pop bc ;1e4e
4136 ret ;1e4f
4137 sub_1e50h:
4138 push hl ;1e50
4139 push bc ;1e51
4140 ld hl,t_IX.IY ;1e52
4141 call sub_0a15h ;1e55
4142 jr nc,l1e65h ;1e58
4143 ld a,0ddh ;1e5a
4144 dec b ;1e5c
4145 jr nz,l1e61h ;1e5d
4146 ld a,0fdh ;1e5f
4147 l1e61h:
4148 ld (pfx.IXY),a ;1e61
4149 scf ;1e64
4150 l1e65h:
4151 pop bc ;1e65
4152 pop hl ;1e66
4153 ret ;1e67
4154 sub_1e68h:
4155 push hl ;1e68
4156 push bc ;1e69
4157 ld a,(de) ;1e6a
4158 cp '(' ;1e6b
4159 jr nz,l1eb4h ;1e6d
4160 push de ;1e6f
4161 inc de ;1e70
4162 ld hl,t_IX.IY ;1e71
4163 call sub_0a15h ;1e74
4164 jr nc,l1eb3h ;1e77
4165 pop af ;1e79
4166 ld a,0ddh ;1e7a
4167 dec b ;1e7c
4168 jr nz,l1e81h ;1e7d
4169 ld a,0fdh ;1e7f
4170 l1e81h:
4171 ld (pfx.IXY),a ;1e81
4172 ld a,(de) ;1e84
4173 cp '+' ;1e85
4174 jr z,l1e95h ;1e87
4175 cp ')' ;1e89
4176 ld hl,0 ;1e8b
4177 jr z,l1eadh ;1e8e
4178 cp '-' ;1e90
4179 jp nz,ERROR ;1e92
4180 l1e95h:
4181 push af ;1e95
4182 inc de ;1e96
4183 call sub_1e12h ;1e97 get displacement
4184 pop af ;1e9a
4185 cp '+' ;1e9b
4186 jr z,l1ea7h ;1e9d
4187 ld b,h ;1e9f
4188 ld c,l ;1ea0
4189 ld hl,0 ;1ea1
4190 and a ;1ea4
4191 sbc hl,bc ;1ea5
4192 l1ea7h:
4193 ld a,(de) ;1ea7
4194 cp ')' ;1ea8
4195 jp nz,ERROR ;1eaa
4196 l1eadh:
4197 inc de ;1ead
4198 pop bc ;1eae
4199 ld c,l ;1eaf
4200 pop hl ;1eb0
4201 scf ;1eb1
4202 ret ;1eb2
4203 l1eb3h:
4204 pop de ;1eb3
4205 l1eb4h:
4206 pop bc ;1eb4
4207 pop hl ;1eb5
4208 and a ;1eb6
4209 ret ;1eb7
4210 sub_1eb8h:
4211 ld hl,t_tstfl_ZCPS ;1eb8
4212 ld c,007h ;1ebb
4213 jr l1ec4h ;1ebd
4214 sub_1ebfh:
4215 ld hl,t_tstfl_ZC ;1ebf
4216 ld c,003h ;1ec2
4217 l1ec4h:
4218 push bc ;1ec4
4219 call sub_0a15h ;1ec5
4220 ld a,b ;1ec8
4221 pop bc ;1ec9
4222 ret nc ;1eca
4223 and c ;1ecb
4224 rlca ;1ecc
4225 rlca ;1ecd
4226 rlca ;1ece
4227 scf ;1ecf
4228 ret ;1ed0
4229 sub_1ed1h:
4230 call skip_to_nextarg ;1ed1
4231 ret z ;1ed4
4232 l1ed5h:
4233 jp ERROR ;1ed5
4234 sub_1ed8h:
4235 ld a,(de) ;1ed8
4236 cp 029h ;1ed9
4237 jr nz,l1ed5h ;1edb
4238 inc de ;1edd
4239 ret ;1ede
4240 CMD.L:
4241 ld hl,CMD.L ;1edf
4242 ld (CMD_RPT),hl ;1ee2
4243 call EXPR ;1ee5
4244 jr nc,l1eedh ;1ee8
4245 ld hl,(lst.L) ;1eea
4246 l1eedh:
4247 push hl ;1eed
4248 pop iy ;1eee
4249 call skip_to_nextarg ;1ef0
4250 call sub_0aa5h ;1ef3
4251 jr nc,l1f17h ;1ef6
4252 call assert_eol ;1ef8
4253 ld b,010h ;1efb
4254 l1efdh:
4255 push bc ;1efd
4256 push iy ;1efe
4257 pop hl ;1f00
4258 push hl ;1f01
4259 call sub_1f3fh ;1f02
4260 call CRLF ;1f05
4261 pop iy ;1f08
4262 ld c,b ;1f0a
4263 ld b,000h ;1f0b
4264 add iy,bc ;1f0d
4265 ld (lst.L),iy ;1f0f
4266 pop bc ;1f13
4267 djnz l1efdh ;1f14
4268 ret ;1f16
4269 l1f17h:
4270 call assert_eol ;1f17
4271 ld h,b ;1f1a
4272 ld l,c ;1f1b
4273 ld a,b ;1f1c
4274 or c ;1f1d
4275 jr nz,l1f21h ;1f1e
4276 dec hl ;1f20
4277 l1f21h:
4278 push hl ;1f21
4279 push iy ;1f22
4280 pop hl ;1f24
4281 push hl ;1f25
4282 call sub_1f3fh ;1f26
4283 call CRLF ;1f29
4284 pop iy ;1f2c
4285 ld e,b ;1f2e
4286 ld d,000h ;1f2f
4287 add iy,de ;1f31
4288 ld (lst.L),iy ;1f33
4289 pop hl ;1f37
4290 and a ;1f38
4291 sbc hl,de ;1f39
4292 ret z ;1f3b
4293 ret c ;1f3c
4294 jr l1f21h ;1f3d
4295 sub_1f3fh:
4296 call out.hl.@ ;1f3f
4297 call z,OUTBL ;1f42
4298 call OUTBL ;1f45
4299 sub a ;1f48
4300 ld (CON.COL),a ;1f49
4301 call sub_1f77h ;1f4c
4302 and a ;1f4f
4303 ret z ;1f50
4304 l1f51h:
4305 call OUTBL ;1f51
4306 ld a,(CON.COL) ;1f54
4307 cp 010h ;1f57
4308 jr c,l1f51h ;1f59
4309 sub_1f5bh:
4310 ld de,(offs.@) ;1f5b
4311 ld a,d ;1f5f
4312 or e ;1f60
4313 ret z ;1f61
4314 ld a,'(' ;1f62
4315 call OUTCHAR ;1f64
4316 ld a,'@' ;1f67
4317 call OUTCHAR ;1f69
4318 and a ;1f6c
4319 sbc hl,de ;1f6d
4320 call out.hl ;1f6f
4321 ld a,')' ;1f72
4322 jp OUTCHAR ;1f74
4323 sub_1f77h:
4324 sub a ;1f77
4325 ld (XBE03),a ;1f78
4326 call sub_1f9eh ;1f7b
4327 jr nc,l1f91h ;1f7e
4328 push bc ;1f80
4329 call sub_2581h ;1f81
4330 ex de,hl ;1f84
4331 call sub_1fdbh ;1f85
4332 pop bc ;1f88
4333 ld a,(XBE03) ;1f89
4334 ld hl,(XBE01) ;1f8c
4335 scf ;1f8f
4336 ret ;1f90
4337 l1f91h:
4338 ld hl,b_0x1F9B_start ;1f91
4339 call PSTR ;1f94
4340 ld b,001h ;1f97
4341 sub a ;1f99
4342 ret ;1f9a
4343
4344 b_0x1F9B_start:
4345 DC '???'
4346
4347 sub_1f9eh:
4348 sub a ;1f9e
4349 ld (is.pfx.IXY),a ;1f9f
4350 comst ;1fa2
4351 ld a,(iy+000h) ;1fa6
4352 comend
4353 cp 0edh ;1fa9
4354 jp z,disas_pfx.ED ;1fab
4355 cp 0ddh ;1fae
4356 jr z,l1fc5h ;1fb0
4357 cp 0fdh ;1fb2
4358 jr z,l1fc9h ;1fb4
4359 sub_1fb6h:
4360 comst ;1fb6
4361 ld a,(iy+000h) ;1fba
4362 comend
4363 cp 0cbh ;1fbd
4364 jp z,l2061h ;1fbf
4365 jp l2078h ;1fc2
4366 l1fc5h:
4367 ld a,001h ;1fc5
4368 jr l1fcbh ;1fc7
4369 l1fc9h:
4370 ld a,002h ;1fc9
4371 l1fcbh:
4372 ld (is.pfx.IXY),a ;1fcb
4373 call sub_1fdch ;1fce
4374 ret nc ;1fd1
4375 push bc ;1fd2
4376 call sub_1fb6h ;1fd3
4377 pop af ;1fd6
4378 add a,b ;1fd7
4379 ld b,a ;1fd8
4380 scf ;1fd9
4381 ret ;1fda
4382
4383 sub_1fdbh:
4384 jp (hl) ;1fdb
4385
4386 sub_1fdch:
4387 inc iy ;1fdc
4388 ld hl,b_0x2011_start ;1fde
4389 call sub_20bbh ;1fe1
4390 ld b,002h ;1fe4
4391 ret c ;1fe6
4392 ld hl,l202ch ;1fe7
4393 call sub_20bbh ;1fea
4394 ld b,001h ;1fed
4395 ret c ;1fef
4396 comst ;1ff0
4397 ld a,(iy+000h) ;1ff4
4398 comend
4399 cp 0cbh ;1ff7
4400 jr nz,l200fh ;1ff9
4401 comst ;1ffb
4402 ld a,(iy+002h) ;1fff
4403 comend
4404 cp 036h ;2002
4405 ret z ;2004
4406 and 007h ;2005
4407 cp 006h ;2007
4408 jr nz,l200fh ;2009
4409 ld b,002h ;200b
4410 scf ;200d
4411 ret ;200e
4412 l200fh:
4413 and a ;200f
4414 ret ;2010
4415
4416 b_0x2011_start:
4417 db 034h ;2011
4418 db 035h ;2012
4419 db 036h ;2013
4420 db 046h ;2014
4421 db 04eh ;2015
4422 db 056h ;2016
4423 db 05eh ;2017
4424 db 066h ;2018
4425 db 06eh ;2019
4426 db 070h ;201a
4427 db 071h ;201b
4428 db 072h ;201c
4429 db 073h ;201d
4430 db 074h ;201e
4431 db 075h ;201f
4432 db 076h ;2020
4433 db 077h ;2021
4434 db 07eh ;2022
4435 db 086h ;2023
4436 db 08eh ;2024
4437 db 096h ;2025
4438 db 09eh ;2026
4439 db 0a6h ;2027
4440 db 0aeh ;2028
4441 db 0b6h ;2029
4442 db 0beh ;202a
4443 db 000h ;202b
4444 l202ch:
4445 db 009h ;202c
4446 db 019h ;202d
4447 db 021h ;202e
4448 db 022h ;202f
4449 db 023h ;2030
4450 db 029h ;2031
4451 db 02ah ;2032
4452 db 02bh ;2033
4453 db 039h ;2034
4454 db 0e1h ;2035
4455 db 0e3h ;2036
4456 db 0e5h ;2037
4457 db 0e9h ;2038
4458 db 0f9h ;2039
4459 db 000h ;203a
4460
4461 disas_pfx.ED:
4462 inc iy ;203b
4463 ld hl,b_0x2200_start ;203d
4464 call sub_209dh ;2040
4465 ld b,002h ;2043
4466 ret c ;2045
4467 ld hl,l2235h ;2046
4468 call lookup_opc ;2049
4469 ld b,002h ;204c
4470 ret c ;204e
4471 ld hl,l228bh ;204f
4472 call lookup_opc ;2052
4473 ld b,003h ;2055
4474 ret c ;2057
4475 ld hl,l22b4h ;2058
4476 call lookup_opc ;205b
4477 ld b,004h ;205e
4478 ret ;2060
4479 l2061h:
4480 push iy ;2061
4481 inc iy ;2063
4482 ld a,(is.pfx.IXY) ;2065
4483 and a ;2068
4484 jr z,l206dh ;2069
4485 inc iy ;206b
4486 l206dh:
4487 ld hl,l22c9h ;206d
4488 call lookup_opc ;2070
4489 pop iy ;2073
4490 ld b,002h ;2075
4491 ret ;2077
4492 l2078h:
4493 ld hl,b_0x218B_start ;2078
4494 call lookup_opc ;207b
4495 ld b,002h ;207e
4496 ret c ;2080
4497 ld hl,b_0x20ED_start ;2081
4498 call sub_209dh ;2084
4499 ld b,001h ;2087
4500 ret c ;2089
4501 ld hl,b_0x2108_start ;208a
4502 call lookup_opc ;208d
4503 ld b,001h ;2090
4504 ret c ;2092
4505 ld hl,b_0x21D2_start ;2093
4506 call lookup_opc ;2096
4507 ret nc ;2099
4508 ld b,003h ;209a
4509 ret ;209c
4510
4511 sub_209dh:
4512 ld a,(hl) ;209d
4513 cp 0ffh ;209e
4514 ret z ;20a0
4515 comst ;20a1
4516 cp (iy+000h) ;20a5
4517 comend
4518 jr z,l20aeh ;20a8
4519 inc hl ;20aa
4520 inc hl ;20ab
4521 jr sub_209dh ;20ac
4522 l20aeh:
4523 inc hl ;20ae
4524 ld c,(hl) ;20af
4525 ld hl,t_MNEMONICS ;20b0
4526 ld b,000h ;20b3
4527 add hl,bc ;20b5
4528 ld de,l230bh ;20b6
4529 scf ;20b9
4530 ret ;20ba
4531 sub_20bbh:
4532 ld a,(hl) ;20bb
4533 and a ;20bc
4534 ret z ;20bd
4535 inc hl ;20be
4536 comst ;20bf
4537 cp (iy+000h) ;20c3
4538 comend
4539 jr nz,sub_20bbh ;20c6
4540 scf ;20c8
4541 ret ;20c9
4542
4543 lookup_opc:
4544 comst ;20ca
4545 ld a,(iy+000h) ;20ce
4546 comend
4547 and (hl) ;20d1
4548 inc hl ;20d2
4549 cp (hl) ;20d3
4550 jr z,l20dfh ;20d4
4551 inc hl ;20d6
4552 inc hl ;20d7
4553 inc hl ;20d8
4554 inc hl ;20d9
4555 ld a,(hl) ;20da
4556 and a ;20db
4557 jr nz,lookup_opc ;20dc
4558 ret ;20de
4559 l20dfh:
4560 inc hl ;20df
4561 ld c,(hl) ;20e0
4562 inc hl ;20e1
4563 ld e,(hl) ;20e2
4564 inc hl ;20e3
4565 ld d,(hl) ;20e4
4566 ld hl,t_MNEMONICS ;20e5
4567 ld b,000h ;20e8
4568 add hl,bc ;20ea
4569 scf ;20eb
4570 ret ;20ec
4571
4572 b_0x20ED_start: ; 1 byte opcodes (no parameters)
4573 db 076h ;20ed halt
4574 db 039h ;20ee
4575 db 0d9h ;20ef exx
4576 db 036h ;20f0
4577 db 0f3h ;20f1 di
4578 db 02ch ;20f2
4579 db 0fbh ;20f3 ei
4580 db 032h ;20f4
4581 db 000h ;20f5 nop
4582 db 069h ;20f6
4583 db 007h ;20f7 rlca
4584 db 09eh ;20f8
4585 db 00fh ;20f9 rrca
4586 db 0adh ;20fa
4587 db 017h ;20fb rla
4588 db 098h ;20fc
4589 db 01fh ;20fd rra
4590 db 0a7h ;20fe
4591 db 027h ;20ff daa
4592 db 026h ;2100
4593 db 02fh ;2101 cpl
4594 db 023h ;2102
4595 db 037h ;2103 scf
4596 db 0bah ;2104
4597 db 03fh ;2105 ccf
4598 db 010h ;2106
4599 db 0ffh ;2107 EOT
4600
4601 b_0x2108_start: ; 1 byte opcodes
4602 defb 0c0h ;2108 ld r,r
4603 defb 040h ;2109
4604 defb 056h ;210a
4605 defw l22fch ;210b
4606
4607 defb 0f8h ;210d add a,r
4608 defb 080h ;210e
4609 defb 003h ;210f
4610 defw l2305h ;2110
4611
4612 defb 0f8h ;2112 adc a,r
4613 defb 088h ;2113
4614 defb 000h ;2114
4615 defw l2305h ;2115
4616
4617 defb 0f8h ;2117
4618 defb 090h ;2118
4619 defb 0c9h ;2119
4620 defw l24ebh ;211a
4621
4622 defb 0f8h ;211c
4623 defb 098h ;211d
4624 defb 0b7h ;211e
4625 defw l2305h ;211f
4626
4627 defb 0f8h ;2121
4628 defb 0a0h ;2122
4629 defb 006h ;2123
4630 defw l24ebh ;2124
4631
4632 defb 0f8h ;2126
4633 defb 0a8h ;2127
4634 defb 0cch ;2128
4635 defw l24ebh ;2129
4636
4637 defb 0f8h ;212b
4638 defb 0b0h ;212c
4639 defb 06ch ;212d
4640 defw l24ebh ;212e
4641
4642 defb 0f8h ;2130
4643 defb 0b8h ;2131
4644 defb 013h ;2132
4645 defw l24ebh ;2133
4646
4647 defb 0c7h ;2135
4648 defb 0c0h ;2136 ret cc
4649 defb 08bh ;2137
4650 defw l2561h ;2138
4651
4652 defb 0c7h ;213a rst
4653 defb 0c7h ;213b
4654 defb 0b4h ;213c
4655 defw l231eh ;213d
4656
4657 defb 0ffh ;213f ret
4658 defb 0c9h ;2140
4659 defb 08bh ;2141
4660 defw l230bh ;2142
4661
4662 defb 0cfh ;2144 pop rr
4663 defb 0c1h ;2145
4664 defb 081h ;2146
4665 defw l2546h ;2147
4666
4667 defb 0cfh ;2149 push rr
4668 defb 0c5h ;214a
4669 defb 084h ;214b
4670 defw l2546h ;214c
4671
4672 defb 0ffh ;214e ex (sp),hl
4673 defb 0e3h ;214f
4674 defb 034h ;2150
4675 defw l232ah ;2151
4676
4677 defb 0ffh ;2153 jp (hl)
4678 defb 0e9h ;2154
4679 defb 052h ;2155
4680 defw l2338h ;2156
4681
4682 defb 0ffh ;2158 ex de,hl
4683 defb 0ebh ;2159
4684 defb 034h ;215a
4685 defw l2345h ;215b
4686
4687 defb 0ffh ;215d ld sp,hl
4688 defb 0f9h ;215e
4689 defb 056h ;215f
4690 defw l234bh ;2160
4691
4692 defb 0cfh ;2162 inc rr
4693 defb 003h ;2163
4694 defb 041h ;2164
4695 defw l254bh ;2165
4696
4697 defb 0cfh ;2167 dec rr
4698 defb 00bh ;2168
4699 defb 029h ;2169
4700 defw l254bh ;216a
4701
4702 defb 0c7h ;216c inc r
4703 defb 004h ;216d
4704 defb 041h ;216e
4705 defw l24dfh ;216f
4706
4707 defb 0c7h ;2171 dec r
4708 defb 005h ;2172
4709 defb 029h ;2173
4710 defw l24dfh ;2174
4711
4712 defb 0ffh ;2176 ex af,af'
4713 defb 008h ;2177
4714 defb 034h ;2178
4715 defw l2357h ;2179
4716
4717 defb 0cfh ;217b add hl,rr
4718 defb 009h ;217c
4719 defb 003h ;217d
4720 defw l235dh ;217e
4721
4722 defb 0efh ;2180 ld (rr),a ;rr=bc,de
4723 defb 002h ;2181
4724 defb 056h ;2182
4725 defw l2366h ;2183
4726
4727 defb 0efh ;2185 ld a,(rr) ;rr=bc,de
4728 defb 00ah ;2186
4729 defb 056h ;2187
4730 defw l236fh ;2188
4731
4732 defb 000h ;218a EOT
4733
4734 b_0x218B_start: ; 2 byte opdodes
4735 defb 0c7h ;218b ld r,nn
4736 defb 006h ;218c
4737 defb 056h ;218d
4738 defw l2384h ;218e
4739
4740 defb 0ffh ;2190 add a,nn
4741 defb 0c6h ;2191
4742 defb 003h ;2192
4743 defw l237fh ;2193
4744
4745 defb 0ffh ;2195 adc a,nn
4746 defb 0ceh ;2196
4747 defb 000h ;2197
4748 defw l237fh ;2198
4749
4750 defb 0ffh ;219a sub a,nn
4751 defb 0d6h ;219b
4752 defb 0c9h ;219c
4753 defw l2397h ;219d
4754
4755 defb 0ffh ;219f
4756 defb 0deh ;21a0
4757 defb 0b7h ;21a1
4758 defw l237fh ;21a2
4759
4760 defb 0ffh ;21a4 and a,nn
4761 defb 0e6h ;21a5
4762 defb 006h ;21a6
4763 defw l2397h ;21a7
4764
4765 defb 0ffh ;21a9
4766 defb 0eeh ;21aa
4767 defb 0cch ;21ab
4768 defw l2397h ;21ac
4769
4770 defb 0ffh ;21ae
4771 defb 0f6h ;21af
4772 defb 06ch ;21b0
4773 defw l2397h ;21b1
4774
4775 defb 0ffh ;21b3 cp a,nn
4776 defb 0feh ;21b4
4777 defb 013h ;21b5
4778 defw l2397h ;21b6
4779
4780 defb 0ffh ;21b8 djnz
4781 defb 010h ;21b9
4782 defb 02eh ;21ba
4783 defw l23b0h ;21bb
4784
4785 defb 0ffh ;21bd jr
4786 defb 018h ;21be
4787 defb 054h ;21bf
4788 defw l23b0h ;21c0
4789
4790 defb 0e7h ;21c2 jr,cc
4791 defb 020h ;21c3
4792 defb 054h ;21c4
4793 defw l23a1h ;21c5
4794
4795 defb 0ffh ;21c7
4796 defb 0d3h ;21c8 out (nn),a
4797 defb 076h ;21c9
4798 defw l23d5h ;21ca
4799
4800 defb 0ffh ;21cc in a,(nn)
4801 defb 0dbh ;21cd
4802 defb 03fh ;21ce
4803 defw l23c3h ;21cf
4804
4805 defb 000h ;21d1 EOT
4806
4807 b_0x21D2_start: ; 3 byte opcodes
4808 defb 0c7h ;21d2
4809 defb 0c2h ;21d3
4810 defb 052h ;21d4
4811 defw l23e0h ;21d5
4812
4813 defb 0c7h ;21d7
4814 defb 0c4h ;21d8
4815 defb 00ch ;21d9
4816 defw l23e0h ;21da
4817
4818 defb 0cfh ;21dc
4819 defb 001h ;21dd
4820 defb 056h ;21de
4821 defw l23fch ;21df
4822
4823 defb 0ffh ;21e1
4824 defb 0c3h ;21e2
4825 defb 052h ;21e3
4826 defw l23e6h ;21e4
4827
4828 defb 0ffh ;21e6
4829 defb 0cdh ;21e7
4830 defb 00ch ;21e8
4831 defw l23e6h ;21e9
4832
4833 defb 0ffh ;21eb
4834 defb 022h ;21ec
4835 defb 056h ;21ed
4836 defw l2404h ;21ee
4837
4838 defb 0ffh ;21f0
4839 defb 02ah ;21f1
4840 defb 056h ;21f2
4841 defw l240dh ;21f3
4842
4843 defb 0ffh ;21f5
4844 defb 032h ;21f6
4845 defb 056h ;21f7
4846 defw l2416h ;21f8
4847
4848 defb 0ffh ;21fa
4849 defb 03ah ;21fb
4850 defb 056h ;21fc
4851 defw l2421h ;21fd
4852
4853 defb 000h ;21ff
4854
4855 b_0x2200_start: ; prefix ED + 1 byte opcode
4856 defb 044h ;2200 neg
4857 defb 066h ;2201
4858 defb 045h ;2202 retn
4859 defb 092h ;2203
4860 defb 04dh ;2204 reti
4861 defb 08eh ;2205
4862 defb 067h ;2206 rrd
4863 defb 0b1h ;2207
4864 defb 06fh ;2208 rld
4865 defb 0a2h ;2209
4866 defb 0a0h ;220a ldi
4867 defb 05fh ;220b
4868 defb 0a1h ;220c
4869 defb 01ch ;220d
4870 defb 0a2h ;220e
4871 defb 04bh ;220f
4872 defb 0a3h ;2210
4873 defb 07dh ;2211
4874 defb 0a8h ;2212 ldd
4875 defb 058h ;2213
4876 defb 0a9h ;2214
4877 defb 015h ;2215
4878 defb 0aah ;2216
4879 defb 044h ;2217
4880 defb 0abh ;2218
4881 defb 079h ;2219
4882 defb 0b0h ;221a ldir
4883 defb 062h ;221b
4884 defb 0b1h ;221c
4885 defb 01fh ;221d
4886 defb 0b2h ;221e
4887 defb 04eh ;221f
4888 defb 0b3h ;2220
4889 defb 072h ;2221
4890 defb 0b8h ;2222 lddr
4891 defb 05bh ;2223
4892 defb 0b9h ;2224
4893 defb 018h ;2225
4894 defb 0bah ;2226
4895 defb 047h ;2227
4896 defb 0bbh ;2228
4897 defb 06eh ;2229
4898 defb 08bh ;222a otdm
4899 defb 0d5h ;222b
4900 defb 09bh ;222c otdmr
4901 defb 0d9h ;222d
4902 defb 083h ;222e otim
4903 defb 0deh ;222f
4904 defb 093h ;2230 otimr
4905 defb 0e2h ;2231
4906 defb 076h ;2232 slp
4907 defb 0ebh ;2233
4908 defb 0ffh ;2234 EOT
4909
4910 l2235h:
4911 defb 0e7h ;2235 in r,(c) ;r=bcde
4912 defb 040h ;2236
4913 defb 03fh ;2237
4914 defw l2455h ;2238
4915
4916 defb 0f7h ;223a in r,(c) ;r=hl
4917 defb 060h ;223b
4918 defb 03fh ;223c
4919 defw l2455h ;223d
4920
4921 defb 0ffh ;223f in r,(c) ;r=a
4922 defb 078h ;2240
4923 defb 03fh ;2241
4924 defw l2455h ;2242
4925
4926 defb 0e7h ;2244
4927 defb 041h ;2245
4928 defb 076h ;2246
4929 defw l2461h ;2247
4930
4931 defb 0f7h ;2249
4932 defb 061h ;224a
4933 defb 076h ;224b
4934 defw l2461h ;224c
4935
4936 defb 0ffh ;224e out (c),r ;r=a
4937 defb 079h ;224f
4938 defb 076h ;2250
4939 defw l2461h ;2251
4940
4941 defb 0cfh ;2253 sbc hl,rr
4942 defb 042h ;2254
4943 defb 0b7h ;2255
4944 defw l246dh ;2256
4945
4946 defb 0cfh ;2258 adc hl,rr
4947 defb 04ah ;2259
4948 defb 000h ;225a
4949 defw l246dh ;225b
4950
4951 defb 0ffh ;225d im 0
4952 defb 046h ;225e
4953 defb 03dh ;225f
4954 defw l2427h ;2260
4955
4956 defb 0ffh ;2262 im 1
4957 defb 056h ;2263
4958 defb 03dh ;2264
4959 defw l242bh ;2265
4960
4961 defb 0ffh ;2267 im 2
4962 defb 05eh ;2268
4963 defb 03dh ;2269
4964 defw l242fh ;226a
4965
4966 defb 0ffh ;226c ld i,a
4967 defb 047h ;226d
4968 defb 056h ;226e
4969 defw l2434h ;226f
4970
4971 defb 0ffh ;2271
4972 defb 057h ;2272
4973 defb 056h ;2273
4974 defw l2439h ;2274
4975
4976 defb 0ffh ;2276
4977 defb 04fh ;2277
4978 defb 056h ;2278
4979 defw l243eh ;2279
4980
4981 defb 0ffh ;227b
4982 defb 05fh ;227c
4983 defb 056h ;227d
4984 defw l2443h ;227e
4985
4986 defb 0cfh ;2280 mlt rr
4987 defb 04ch ;2281
4988 defb 0d2h ;2282
4989 defw l254bh ;2283
4990
4991 defb 0c7h ;2285 tst r
4992 defb 004h ;2286
4993 defb 0eeh ;2287
4994 defw l24dfh ;2288
4995
4996 defb 000h ;228a
4997
4998 l228bh:
4999 defb 0e7h ;228b
5000 defb 000h ;228c
5001 defb 0cfh ;228d
5002
5003 b_0x228E_start:
5004 defw l230ch ;228e
5005
5006 b_0x2290_start:
5007 defb 0f7h ;2290
5008 defb 020h ;2291
5009 defb 0cfh ;2292
5010
5011 b_0x2293_start:
5012 defw l230ch ;2293
5013
5014 b_0x2295_start:
5015 defb 0ffh ;2295
5016 defb 038h ;2296
5017 defb 0cfh ;2297
5018
5019 b_0x2298_start:
5020 defw l230ch ;2298
5021
5022 b_0x229A_start:
5023 defb 0e7h ;229a
5024 defb 001h ;229b
5025 defb 0e7h ;229c
5026
5027 b_0x229D_start:
5028 defw l2315h ;229d
5029
5030 b_0x229F_start:
5031 defb 0f7h ;229f
5032 defb 021h ;22a0
5033 defb 0e7h ;22a1
5034
5035 b_0x22A2_start:
5036 defw l2315h ;22a2
5037
5038 b_0x22A4_start:
5039 defb 0ffh ;22a4
5040 defb 039h ;22a5
5041 defb 0e7h ;22a6
5042
5043 b_0x22A7_start:
5044 defw l2315h ;22a7
5045
5046 b_0x22A9_start:
5047 defb 0ffh ;22a9
5048 defb 064h ;22aa
5049 defb 0eeh ;22ab
5050
5051 b_0x22AC_start:
5052 defw l2397h ;22ac
5053
5054 b_0x22AE_start:
5055 defb 0ffh ;22ae
5056 defb 074h ;22af
5057 defb 0f1h ;22b0
5058
5059 b_0x22B1_start:
5060 defw l2397h ;22b1
5061
5062 b_0x22B3_start:
5063 defb 000h ;22b3
5064 l22b4h:
5065 defb 0efh ;22b4
5066 defb 043h ;22b5
5067 defb 056h ;22b6
5068
5069 b_0x22B7_start:
5070 defw l2476h ;22b7
5071
5072 b_0x22B9_start:
5073 defb 0ffh ;22b9
5074 defb 073h ;22ba
5075 defb 056h ;22bb
5076
5077 b_0x22BC_start:
5078 defw l2476h ;22bc
5079
5080 b_0x22BE_start:
5081 defb 0efh ;22be
5082 defb 04bh ;22bf
5083 defb 056h ;22c0
5084
5085 b_0x22C1_start:
5086 defw l247fh ;22c1
5087
5088 b_0x22C3_start:
5089 defb 0ffh ;22c3
5090 defb 07bh ;22c4
5091 defb 056h ;22c5
5092
5093 b_0x22C6_start:
5094 defw l247fh ;22c6
5095
5096 b_0x22C8_start:
5097 defb 000h ;22c8
5098 l22c9h:
5099 defb 0f8h ;22c9
5100 defb 000h ;22ca
5101 defb 09bh ;22cb
5102
5103 b_0x22CC_start:
5104 defw l24aeh ;22cc
5105
5106 b_0x22CE_start:
5107 defb 0f8h ;22ce
5108 defb 008h ;22cf
5109 defb 0aah ;22d0
5110
5111 b_0x22D1_start:
5112 defw l24aeh ;22d1
5113
5114 b_0x22D3_start:
5115 defb 0f8h ;22d3
5116 defb 010h ;22d4
5117 defb 096h ;22d5
5118
5119 b_0x22D6_start:
5120 defw l24aeh ;22d6
5121
5122 b_0x22D8_start:
5123 defb 0f8h ;22d8
5124 defb 018h ;22d9
5125 defb 0a5h ;22da
5126
5127 b_0x22DB_start:
5128 defw l24aeh ;22db
5129
5130 b_0x22DD_start:
5131 defb 0f8h ;22dd
5132 defb 020h ;22de
5133 defb 0c0h ;22df
5134
5135 b_0x22E0_start:
5136 defw l24aeh ;22e0
5137
5138 b_0x22E2_start:
5139 defb 0f8h ;22e2
5140 defb 028h ;22e3
5141 defb 0c3h ;22e4
5142
5143 b_0x22E5_start:
5144 defw l24aeh ;22e5
5145
5146 b_0x22E7_start:
5147 defb 0f8h ;22e7
5148 defb 038h ;22e8
5149 defb 0c6h ;22e9
5150
5151 b_0x22EA_start:
5152 defw l24aeh ;22ea
5153
5154 b_0x22EC_start:
5155 defb 0c0h ;22ec
5156 defb 040h ;22ed
5157 defb 009h ;22ee
5158
5159 b_0x22EF_start:
5160 defw l2487h ;22ef
5161
5162 b_0x22F1_start:
5163 defb 0c0h ;22f1
5164 defb 080h ;22f2
5165 defb 088h ;22f3
5166
5167 b_0x22F4_start:
5168 defw l2487h ;22f4
5169
5170 b_0x22F6_start:
5171 defb 0c0h ;22f6
5172 defb 0c0h ;22f7
5173 defb 0bdh ;22f8
5174
5175 b_0x22F9_start:
5176 defw l2487h ;22f9
5177
5178 b_0x22FB_start:
5179 defb 000h ;22fb
5180 l22fch:
5181 call l24dfh ;22fc
5182 call sub_257ch ;22ff
5183 jp l24ebh ;2302
5184 l2305h:
5185 call sub_2579h ;2305
5186 jp l24ebh ;2308
5187 l230bh:
5188 ret ;230b
5189 l230ch:
5190 call l24dfh ;230c
5191 call sub_257ch ;230f
5192 jp l23c6h ;2312
5193 l2315h:
5194 call l23c6h ;2315
5195 call sub_257ch ;2318
5196 jp l24dfh ;231b
5197 l231eh:
5198 comst ;231e
5199 ld a,(iy+000h) ;2322
5200 comend
5201 and 038h ;2325
5202 jp out.hex ;2327
5203 l232ah:
5204 ld hl,b_0x2333_start ;232a
5205 call PSTR ;232d
5206 jp l253eh ;2330
5207
5208 b_0x2333_start:
5209 DC '(SP),'
5210
5211 l2338h:
5212 ld a,'(' ;2338
5213 call OUTCHAR ;233a
5214 call l253eh ;233d
5215 ld a,')' ;2340
5216 jp OUTCHAR ;2342
5217 l2345h:
5218 ld hl,l1d86h ;2345
5219 jp PSTR ;2348
5220 l234bh:
5221 ld hl,b_0x2354_start ;234b
5222 call PSTR ;234e
5223 jp l253eh ;2351
5224
5225 b_0x2354_start:
5226 DC 'SP,'
5227
5228 l2357h:
5229 ld hl,b_0x1D80_start ;2357
5230 jp PSTR ;235a
5231 l235dh:
5232 call l253eh ;235d
5233 call sub_257ch ;2360
5234 jp l254bh ;2363
5235 l2366h:
5236 call sub_2372h ;2366
5237 call sub_257ch ;2369
5238 jp l23dbh ;236c
5239 l236fh:
5240 call sub_2579h ;236f
5241 sub_2372h:
5242 ld a,'(' ;2372
5243 call OUTCHAR ;2374
5244 call l254bh ;2377
5245 ld a,')' ;237a
5246 jp OUTCHAR ;237c
5247 l237fh:
5248 call sub_2579h ;237f
5249 jr l2397h ;2382
5250 l2384h:
5251 call l24dfh ;2384
5252 call sub_257ch ;2387
5253 ld a,(is.pfx.IXY) ;238a
5254 and a ;238d
5255 comst ;238e
5256 ld a,(iy+002h) ;2392
5257 comend
5258 jr nz,l239eh ;2395
5259 l2397h:
5260 comst ;2397
5261 ld a,(iy+001h) ;239b
5262 comend
5263 l239eh:
5264 jp out.hex ;239e
5265 l23a1h:
5266 comst ;23a1
5267 ld a,(iy+000h) ;23a5
5268 comend
5269 and 018h ;23a8
5270 call sub_2568h ;23aa
5271 call sub_257ch ;23ad
5272 l23b0h:
5273 comst ;23b0
5274 ld c,(iy+001h) ;23b4
5275 comend
5276 ld a,c ;23b7
5277 rla ;23b8
5278 sbc a,a ;23b9
5279 ld b,a ;23ba
5280 push iy ;23bb
5281 pop hl ;23bd
5282 add hl,bc ;23be
5283 inc hl ;23bf
5284 inc hl ;23c0
5285 jr l23f0h ;23c1
5286 l23c3h:
5287 call sub_2579h ;23c3
5288 l23c6h:
5289 ld a,028h ;23c6
5290 call OUTCHAR ;23c8
5291 comst ;23cb
5292 ld a,(iy+001h) ;23cf
5293 comend
5294 jp l252bh ;23d2
5295 l23d5h:
5296 call l23c6h ;23d5
5297 call sub_257ch ;23d8
5298 l23dbh:
5299 ld a,041h ;23db
5300 jp OUTCHAR ;23dd
5301 l23e0h:
5302 call l2561h ;23e0
5303 call sub_257ch ;23e3
5304 l23e6h:
5305 comst ;23e6
5306 ld l,(iy+001h) ;23ea
5307 ld h,(iy+002h) ;23ed
5308 comend
5309 l23f0h:
5310 ld a,002h ;23f0
5311 sub_23f2h:
5312 ld (XBE03),a ;23f2
5313 ld (XBE01),hl ;23f5
5314 call out.hl ;23f8
5315 ret ;23fb
5316 l23fch:
5317 call l254bh ;23fc
5318 call sub_257ch ;23ff
5319 jr l23e6h ;2402
5320 l2404h:
5321 call sub_24c6h ;2404
5322 call sub_257ch ;2407
5323 jp l253eh ;240a
5324 l240dh:
5325 call l253eh ;240d
5326 call sub_257ch ;2410
5327 jp sub_24c6h ;2413
5328 l2416h:
5329 call sub_24c6h ;2416
5330 call sub_257ch ;2419
5331 ld a,041h ;241c
5332 jp OUTCHAR ;241e
5333 l2421h:
5334 call sub_2579h ;2421
5335 jp sub_24c6h ;2424
5336 l2427h:
5337 ld a,030h ;2427
5338 jr l2431h ;2429
5339 l242bh:
5340 ld a,031h ;242b
5341 jr l2431h ;242d
5342 l242fh:
5343 ld a,032h ;242f
5344 l2431h:
5345 jp OUTCHAR ;2431
5346 l2434h:
5347 ld hl,b_0x2449_start ;2434
5348 jr l2446h ;2437
5349 l2439h:
5350 ld hl,l244ch ;2439
5351 jr l2446h ;243c
5352 l243eh:
5353 ld hl,l244fh ;243e
5354 jr l2446h ;2441
5355 l2443h:
5356 ld hl,l2452h ;2443
5357 l2446h:
5358 jp PSTR ;2446
5359
5360 b_0x2449_start:
5361 DC 'I,A'
5362 l244ch:
5363 DC 'A,I'
5364 l244fh:
5365 DC 'R,A'
5366 l2452h:
5367 DC 'A,R'
5368
5369 l2455h:
5370 call l24dfh ;2455
5371 call sub_257ch ;2458
5372 ld hl,t__C_ ;245b
5373 jp PSTR ;245e
5374 l2461h:
5375 ld hl,t__C_ ;2461
5376 call PSTR ;2464
5377 call sub_257ch ;2467
5378 jp l24dfh ;246a
5379 l246dh:
5380 call l253eh ;246d
5381 call sub_257ch ;2470
5382 jp l254bh ;2473
5383 l2476h:
5384 call sub_24c6h ;2476
5385 call sub_257ch ;2479
5386 jp l254bh ;247c
5387 l247fh:
5388 call l254bh ;247f
5389 call sub_257ch ;2482
5390 jr sub_24c6h ;2485
5391 l2487h:
5392 ld a,(is.pfx.IXY) ;2487
5393 and a ;248a
5394 jr nz,l2496h ;248b
5395 comst ;248d
5396 ld a,(iy+001h) ;2491
5397 comend
5398 jr l249dh ;2494
5399 l2496h:
5400 comst ;2496
5401 ld a,(iy+002h) ;249a
5402 comend
5403 l249dh:
5404 push af ;249d
5405 rra ;249e
5406 rra ;249f
5407 rra ;24a0
5408 and 007h ;24a1
5409 add a,'0' ;24a3
5410 call OUTCHAR ;24a5
5411 call sub_257ch ;24a8
5412 pop af ;24ab
5413 jr l24f2h ;24ac
5414 l24aeh:
5415 ld a,(is.pfx.IXY) ;24ae
5416 and a ;24b1
5417 jr nz,l24bdh ;24b2
5418 comst ;24b4
5419 ld a,(iy+001h) ;24b8
5420 comend
5421 jr l24c4h ;24bb
5422 l24bdh:
5423 comst ;24bd
5424 ld a,(iy+002h) ;24c1
5425 comend
5426 l24c4h:
5427 jr l24f2h ;24c4
5428 sub_24c6h:
5429 ld a,'(' ;24c6
5430 call OUTCHAR ;24c8
5431 comst ;24cb
5432 ld l,(iy+001h) ;24cf
5433 ld h,(iy+002h) ;24d2
5434 comend
5435 ld a,001h ;24d5
5436 call sub_23f2h ;24d7
5437 ld a,')' ;24da
5438 jp OUTCHAR ;24dc
5439 l24dfh:
5440 comst ;24df
5441 ld a,(iy+000h) ;24e3
5442 comend
5443 rra ;24e6
5444 rra ;24e7
5445 rra ;24e8
5446 jr l24f2h ;24e9
5447 l24ebh:
5448 comst ;24eb
5449 ld a,(iy+000h) ;24ef
5450 comend
5451 l24f2h:
5452 and 007h ;24f2
5453 cp 006h ;24f4
5454 jr nz,l2533h ;24f6
5455 ld a,(is.pfx.IXY) ;24f8
5456 and a ;24fb
5457 ld a,006h ;24fc
5458 jr z,l2533h ;24fe
5459 ld hl,b_0x2538_start ;2500
5460 ld a,(is.pfx.IXY) ;2503
5461 dec a ;2506
5462 jr z,l250ch ;2507
5463 ld hl,b_0x253B_start ;2509
5464 l250ch:
5465 call PSTR ;250c
5466 comst ;250f
5467 ld a,(iy+001h) ;2513
5468 comend
5469 and a ;2516
5470 push af ;2517
5471 jp m,l2523h ;2518
5472 ld a,'+' ;251b
5473 call OUTCHAR ;251d
5474 pop af ;2520
5475 jr l252bh ;2521
5476 l2523h:
5477 ld a,'-' ;2523
5478 call OUTCHAR ;2525
5479 pop af ;2528
5480 neg ;2529
5481 l252bh:
5482 call out.hex ;252b
5483 ld a,')' ;252e
5484 jp OUTCHAR ;2530
5485 l2533h:
5486 ld hl,t_BCDEHL_HL_A ;2533
5487 jr l2572h ;2536
5488
5489 b_0x2538_start:
5490 DC '(IX'
5491 b_0x253B_start:
5492 DC '(IY'
5493
5494 l253eh:
5495 ld a,(is.pfx.IXY) ;253e
5496 ld hl,t_HL.IX.IY ;2541
5497 jr l2572h ;2544
5498 l2546h:
5499 ld hl,t_BC.DE.HL.AF ;2546
5500 jr l254eh ;2549
5501 l254bh:
5502 ld hl,t_BC.DE.HL.SP ;254b
5503 l254eh:
5504 comst ;254e
5505 ld a,(iy+000h) ;2552
5506 comend
5507 rra ;2555
5508 rra ;2556
5509 rra ;2557
5510 rra ;2558
5511 and 003h ;2559
5512 cp 002h ;255b
5513 jr z,l253eh ;255d
5514 jr l2572h ;255f
5515 l2561h:
5516 comst ;2561
5517 ld a,(iy+000h) ;2565
5518 comend
5519 sub_2568h:
5520 rra ;2568
5521 rra ;2569
5522 rra ;256a
5523 and 007h ;256b
5524 ld hl,t_tstfl_ZCPS ;256d
5525 jr l2572h ;2570
5526 l2572h:
5527 ld b,a ;2572
5528 call sub_0a48h ;2573
5529 jp PSTR ;2576
5530 sub_2579h:
5531 call l23dbh ;2579
5532 sub_257ch:
5533 ld a,',' ;257c
5534 jp OUTCHAR ;257e
5535 sub_2581h:
5536 call PSTR ;2581
5537 l2584h:
5538 call OUTBL ;2584
5539 inc c ;2587
5540 ld a,c ;2588
5541 cp 006h ;2589
5542 jr nz,l2584h ;258b
5543 ret ;258d
5544
5545 t_MNEMONICS:
5546 DC 'ADC'
5547 DC 'ADD'
5548 DC 'AND'
5549 DC 'BIT'
5550 DC 'CALL'
5551 DC 'CCF'
5552 DC 'CP'
5553 DC 'CPD'
5554 DC 'CPDR'
5555 DC 'CPI'
5556 DC 'CPIR'
5557 DC 'CPL'
5558 DC 'DAA'
5559 DC 'DEC'
5560 DC 'DI'
5561 DC 'DJNZ'
5562 DC 'EI'
5563 DC 'EX'
5564 DC 'EXX'
5565 DC 'HALT'
5566 DC 'IM'
5567 DC 'IN'
5568 DC 'INC'
5569 DC 'IND'
5570 DC 'INDR'
5571 DC 'INI'
5572 DC 'INIR'
5573 DC 'JP'
5574 DC 'JR'
5575 DC 'LD'
5576 DC 'LDD'
5577 DC 'LDDR'
5578 DC 'LDI'
5579 DC 'LDIR'
5580 DC 'NEG'
5581 DC 'NOP'
5582 DC 'OR'
5583 DC 'OTDR'
5584 DC 'OTIR'
5585 DC 'OUT'
5586 DC 'OUTD'
5587 DC 'OUTI'
5588 DC 'POP'
5589 DC 'PUSH'
5590 DC 'RES'
5591 DC 'RET'
5592 DC 'RETI'
5593 DC 'RETN'
5594 DC 'RL'
5595 DC 'RLA'
5596 DC 'RLC'
5597 DC 'RLCA'
5598 DC 'RLD'
5599 DC 'RR'
5600 DC 'RRA'
5601 DC 'RRC'
5602 DC 'RRCA'
5603 DC 'RRD'
5604 DC 'RST'
5605 DC 'SBC'
5606 DC 'SCF'
5607 DC 'SET'
5608 DC 'SLA'
5609 DC 'SRA'
5610 DC 'SRL'
5611 DC 'SUB'
5612 DC 'XOR'
5613 DC 'IN0'
5614 DC 'MLT'
5615 DC 'OTDM'
5616 DC 'OTDMR'
5617 DC 'OTIM'
5618 DC 'OTIMR'
5619 DC 'OUT0'
5620 DC 'SLP'
5621 DC 'TST'
5622 DC 'TSTIO'
5623 DB 0
5624
5625 t_BCDEHL_HL_A:
5626 DC 'B'
5627 DC 'C'
5628 DC 'D'
5629 DC 'E'
5630 DC 'H'
5631 DC 'L'
5632 DC '(HL)'
5633 DC 'A'
5634 DB 0
5635 t_BC.DE.HL.SP:
5636 DC 'BC'
5637 DC 'DE'
5638 DC 'HL'
5639 DC 'SP'
5640 DB 0
5641 t_BC.DE.HL.AF:
5642 DC 'BC'
5643 DC 'DE'
5644 t_HL.AF:
5645 DC 'HL'
5646 DC 'AF'
5647 DB 0
5648 t_BC.DE.IY.SP:
5649 DC 'BC'
5650 DC 'DE'
5651 DC 'IY'
5652 DC 'SP'
5653 DB 0
5654 t_BC.DE.IX.SP:
5655 DC 'BC'
5656 DC 'DE'
5657 DC 'IX'
5658 DC 'SP'
5659 DB 0
5660 t_HL.IX.IY:
5661 DC 'HL'
5662 t_IX.IY:
5663 DC 'IX'
5664 DC 'IY'
5665 DB 0
5666 t_tstfl_ZC:
5667 DC 'NZ'
5668 DC 'Z'
5669 DC 'NC'
5670 DC 'C'
5671 DC 'NE'
5672 DC 'EQ'
5673 DC 'GE'
5674 DC 'LT'
5675 DB 0
5676 t_tstfl_ZCPS:
5677 DC 'NZ'
5678 DC 'Z'
5679 DC 'NC'
5680 DC 'C'
5681 DC 'PO'
5682 DC 'PE'
5683 DC 'P'
5684 DC 'M'
5685 DC 'NE'
5686 DC 'EQ'
5687 DC 'GE'
5688 DC 'LT'
5689 DC 'NV'
5690 DC 'V'
5691 DB 0
5692 t__C_:
5693 DC '(C)'
5694 DB 0
5695
5696 sub_26e7h:
5697 ld hl,(REG.PC) ;26e7
5698 ld a,h ;26ea
5699 or l ;26eb
5700 jr z,l2715h ;26ec
5701 ld iy,(REG.PC) ;26ee
5702 call sub_1f9eh ;26f2
5703 jp nc,ERROR ;26f5
5704 ld c,b ;26f8
5705 ld b,000h ;26f9
5706 ld hl,(REG.PC) ;26fb
5707 add hl,bc ;26fe
5708 call sub_1117h ;26ff
5709 ld iy,(REG.PC) ;2702
5710 ld hl,b_0x2717_start ;2706
5711 call lookup_opc ;2709
5712 ccf ;270c
5713 ret c ;270d
5714 ex de,hl ;270e
5715 call CALL.HL ;270f
5716 call c,sub_1117h ;2712
5717 l2715h:
5718 scf ;2715
5719 ret ;2716
5720
5721 b_0x2717_start:
5722 db 0ffh ;2717
5723 db 0ddh ;2718
5724 db 000h ;2719
5725 dw x278d
5726
5727 db 0ffh ;271c
5728 db 0fdh ;271d
5729 db 000h ;271e
5730 dw x2792
5731
5732 db 0ffh ;2721
5733 db 0edh ;2722
5734 db 000h ;2723
5735 dw x27a2
5736
5737 l2726h:
5738 db 0ffh ;2726
5739 db 0cdh ;2727
5740 db 000h ;2728
5741 dw x275e
5742
5743 db 0ffh ;272b
5744 db 0c3h ;272c
5745 db 000h ;272d
5746 dw x2769
5747
5748 db 0ffh ;2730
5749 db 0e9h ;2731
5750 db 000h ;2732
5751 dw x2788
5752
5753 db 0ffh ;2735
5754 db 0c9h ;2736
5755 db 000h ;2737
5756 dw x27c9
5757
5758 db 0ffh ;273a
5759 db 0cfh ;273b
5760 db 000h ;273c
5761 dw x280e
5762
5763 db 0c7h ;273f
5764 db 0c7h ;2740
5765 db 000h ;2741
5766 dw x27ea
5767
5768 db 0c7h ;2744
5769 db 0c4h ;2745
5770 db 000h ;2746
5771 dw x275e
5772
5773 db 0f7h ;2749
5774 db 010h ;274a
5775 db 000h ;274b
5776 dw x2775
5777
5778 db 0e7h ;274e
5779 db 020h ;274f
5780 db 000h ;2750
5781 dw x2775
5782
5783 db 0c7h ;2753
5784 db 0c2h ;2754
5785 db 000h ;2755
5786 dw x2769
5787
5788 db 0c7h ;2758
5789 db 0c0h ;2759
5790 db 000h ;275a
5791 dw x27b3
5792
5793 db 000h ;275d
5794
5795 x275e:
5796 ld a,(XBFE8) ;275e
5797 and a ;2761
5798 jr nz,x2769 ;2762
5799 ld a,(TCFLG) ;2764
5800 and a ;2767
5801 ret nz ;2768
5802
5803 x2769:
5804 comst ;2769
5805 ld l,(iy+001h) ;276d
5806 ld h,(iy+002h) ;2770
5807 comend
5808 scf ;2773
5809 ret ;2774
5810
5811 x2775:
5812 comst ;2775
5813 ld c,(iy+001h) ;2779
5814 comend
5815 ld a,c ;277c
5816 rla ;277d
5817 sbc a,a ;277e
5818 ld b,a ;277f
5819 ld hl,(REG.PC) ;2780
5820 add hl,bc ;2783
5821 inc hl ;2784
5822 inc hl ;2785
5823 scf ;2786
5824 ret ;2787
5825
5826 x2788:
5827 ld hl,(REG.L) ;2788
5828 scf ;278b
5829 ret ;278c
5830
5831 x278d:
5832 ld hl,(reg.ix) ;278d
5833 jr l2795h ;2790
5834
5835 x2792:
5836 ld hl,(reg.iy) ;2792
5837 l2795h:
5838 comst ;2795
5839 ld a,(iy+001h) ;2799
5840 comend
5841 cp 0e9h ;279c
5842 scf ;279e
5843 ret z ;279f
5844 and a ;27a0
5845 ret ;27a1
5846
5847 x27a2:
5848 comst ;27a2
5849 ld a,(iy+001h) ;27a6
5850 comend
5851 cp 04dh ;27a9
5852 jr z,x27c9 ;27ab
5853 cp 045h ;27ad
5854 jr z,x27c9 ;27af
5855 and a ;27b1
5856 ret ;27b2
5857
5858 x27b3:
5859 comst ;27b3
5860 ld a,(iy+000h) ;27b7
5861 comend
5862 ld (XBEDD),a ;27ba
5863 ld hl,(REG.F) ;27bd
5864 push hl ;27c0
5865 pop af ;27c1
5866 call XBEDD ;27c2
5867 scf ;27c5
5868 jr c,x27c9 ;27c6
5869 ret ;27c8
5870
5871 x27c9:
5872 ld a,(XBFE8) ;27c9
5873 and a ;27cc
5874 jr nz,l27dah ;27cd
5875 ld a,(TCFLG) ;27cf
5876 and a ;27d2
5877 jr z,l27dah ;27d3
5878 call l27dah ;27d5
5879 pop hl ;27d8
5880 ret ;27d9
5881 l27dah:
5882 ld hl,(REG.SP) ;27da
5883 comst ;27dd
5884 ld e,(hl) ;27e1
5885 inc hl ;27e2
5886 ld d,(hl) ;27e3
5887 comend
5888 ex de,hl ;27e4
5889 call sub_1117h ;27e5
5890 and a ;27e8
5891 ret ;27e9
5892
5893 x27ea:
5894 ld a,(ddtrst) ;27ea
5895 comst ;27ed
5896 cp (iy+000h) ;27f1
5897 comend
5898 ret z ;27f4
5899 comst ;27f5
5900 ld a,(iy+000h) ;27f9
5901 comend
5902 and 038h ;27fc
5903 ld l,a ;27fe
5904 ld h,000h ;27ff
5905 ld a,(XBFE8) ;2801
5906 and a ;2804
5907 jr nz,l280ch ;2805
5908 ld a,(TCFLG) ;2807
5909 and a ;280a
5910 ret nz ;280b
5911 l280ch:
5912 scf ;280c
5913 ret ;280d
5914
5915 x280e:
5916 and a ;280e
5917 ret ;280f
5918
5919 CMD.C:
5920 ld hl,CMD.C ;2810
5921 ld a,001h ;2813
5922 jr l281bh ;2815
5923
5924 CMD.T:
5925 xor a ;2817
5926 ld hl,CMD.T ;2818
5927 l281bh:
5928 ld (CMD_RPT),hl ;281b
5929 ld (TCFLG),a ;281e
5930 ld a,(de) ;2821
5931 sub 'N' ;2822
5932 jr nz,l2827h ;2824
5933 inc de ;2826
5934 l2827h:
5935 ld (TCNFLG),a ;2827
5936 ld a,(de) ;282a
5937 sub 'J' ;282b
5938 jr nz,l2830h ;282d
5939 inc de ;282f
5940 l2830h:
5941 ld (TRJFLG),a ;2830
5942 call sub_289fh ;2833
5943 jr z,l283eh ;2836
5944 ld hl,1 ;2838
5945 call get_lastarg_def ;283b
5946 l283eh:
5947 ld (TCCSTR),hl ;283e
5948 sub a ;2841
5949 ld (XA747),a ;2842
5950 l2845h:
5951 call sub_26e7h ;2845
5952 jr l289ch ;2848
5953 l284ah:
5954 call sub_0e68h ;284a
5955 ld a,(TRJFLG) ;284d
5956 and a ;2850
5957 jr nz,l2864h ;2851
5958 ld iy,(REG.PC) ;2853
5959 call sub_28c1h ;2857
5960 jr z,l2864h ;285a
5961 ld hl,l2726h ;285c
5962 call lookup_opc ;285f
5963 jr nc,l2845h ;2862
5964 l2864h:
5965 ld a,(XBFEA) ;2864
5966 and a ;2867
5967 jr z,l2881h ;2868
5968 ld de,(TCCSTR) ;286a
5969 call EXPR ;286e
5970 ld a,h ;2871
5971 or l ;2872
5972 add a,0ffh ;2873
5973 sbc a,a ;2875
5974 ld hl,XBFEA ;2876
5975 xor (hl) ;2879
5976 bit 1,a ;287a
5977 jr z,l288ch ;287c
5978 l287eh:
5979 jp l102eh ;287e
5980 l2881h:
5981 ld hl,(TCCSTR) ;2881
5982 dec hl ;2884
5983 ld (TCCSTR),hl ;2885
5984 ld a,h ;2888
5985 or l ;2889
5986 jr z,l287eh ;288a
5987 l288ch:
5988 call sub_26e7h ;288c
5989 jr nc,l287eh ;288f
5990 ld a,(TCNFLG) ;2891
5991 ld b,a ;2894
5992 ld a,(XA747) ;2895
5993 or b ;2898
5994 ld (XA747),a ;2899
5995 l289ch:
5996 jp l1183h ;289c
5997
5998 sub_289fh:
5999 call SKIPBL ;289f
6000 xor a ;28a2
6001 ld (XBFEA),a ;28a3
6002 ld a,(de) ;28a6
6003 cp 'U' ;28a7
6004 jr z,l28aeh ;28a9
6005 cp 'W' ;28ab
6006 ret nz ;28ad
6007
6008 l28aeh:
6009 inc de ;28ae
6010 push af ;28af
6011 push de ;28b0
6012 call EXPR ;28b1
6013 jp c,ERROR ;28b4
6014 call assert_eol ;28b7
6015 pop hl ;28ba
6016 pop af ;28bb
6017 ld (XBFEA),a ;28bc
6018 sub a ;28bf
6019 ret ;28c0
6020
6021 sub_28c1h:
6022 comst
6023 ld a,(iy+000h)
6024 ld b,(iy+0001)
6025 comend
6026 cp 0edh
6027 jr z,l28dbh
6028 and 0dfh
6029 cp 0ddh
6030 ret nz
6031 ld a,b
6032 cp 0e9h
6033 ret
6034 l28dbh:
6035 ld a,b
6036 and 0f7h
6037 cp 045h
6038 ret
6039
6040 ?excom:
6041 ex (sp),hl ;28e7
6042 push af ;28e8
6043 push bc ;28e9
6044 push de ;28ea
6045 ld c,(hl) ;28eb
6046 ld b,000h ;28ec
6047 inc hl ;28ee
6048 ld a,?lcmax
6049 sub c
6050 ld de,?exeit ;28ef
6051 ldir
6052 ex de,hl
6053 ld (hl),018h
6054 inc hl
6055 ld (hl),a
6056 ex de,hl
6057 pop de ;28f7
6058 pop bc ;28f8
6059 pop af ;28f9
6060 ex (sp),hl ;28fa
6061 ?exclst:
6062 push hl ;28fb
6063 ld hl,(ubbr) ;2900
6064
6065 if ROMSYS
6066 push af ;28fc
6067 ld a,(uromen) ;28fd
6068 endif
6069 jp ?comcod ;2903
6070
6071 ;------------------------------------------
6072 ; ddtram
6073 ;------------------------------------------
6074
6075 vartab:
6076 dseg
6077 ddtram:
6078 ;todo:
6079 ; The following 2 params are changeable by user.
6080 ; Should these moved to top ram?
6081 ;
6082 ddtrst: inidat ;
6083 rst DRSTNUM ;rst used by ddtz
6084 inidate ;
6085 ddtei: inidat ;
6086 ei ;ints enabled/disabled while ddtz is running
6087 ret ;
6088 inidate ;
6089 offs.pc:
6090 inidat
6091 dw TPA
6092 inidate
6093 offs.@:
6094 inidat
6095 dw 0
6096 inidate
6097 CMD_ERR:
6098 inidat
6099 dw 0
6100 inidate
6101 CMD_RPT:
6102 inidat
6103 dw DDTZML
6104 inidate
6105 ci.buf:
6106 inidat
6107 db 80
6108 rept 83
6109 db 0
6110 endm
6111 inidate
6112 CON.COL:
6113 inidat
6114 db 0
6115 inidate
6116 XA747:
6117 inidat
6118 db 0
6119 inidate
6120 bp_tab:
6121 inidat
6122 rept BP_CNT
6123 db 0,0
6124 dw 0,0,0
6125 endm
6126 BP_SIZE equ 8
6127 inidate
6128 sexp1:
6129 inidat
6130 dw sexpbuf
6131 inidate
6132 sexp2:
6133 inidat
6134 dw sexpbuf
6135 inidate
6136 sexpbuf:
6137 inidat
6138 rept 128
6139 db 0
6140 endm
6141 inidate
6142 sexpbufe:
6143
6144 msg.Y:
6145 inidat
6146 dc 'Y0'
6147 inidate
6148 reg.Y:
6149 inidat
6150 rept 10
6151 dw 0
6152 endm
6153 inidate
6154 lst.S:
6155 inidat
6156 dw 0
6157 inidate
6158 lst.IP:
6159 inidat
6160 dw 0
6161 inidate
6162 lst.OP:
6163 inidat
6164 dw 0
6165 inidate
6166 lst.OD:
6167 inidat
6168 db 0
6169 inidate
6170 lst.Qj:
6171 inidat
6172 db 0
6173 inidate
6174 lst.D:
6175 inidat
6176 dw 0
6177 inidate
6178 HILOD:
6179 inidat
6180 dw 0
6181 inidate
6182 MAXLOD:
6183 inidat
6184 dw 0
6185 inidate
6186 XB068:
6187 inidat
6188 dw 0
6189 inidate
6190 lst.A:
6191 inidat
6192 dw 0
6193 inidate
6194 XB06C:
6195 inidat
6196 dw 0
6197 inidate
6198 pfx.IXY:
6199 inidat
6200 db 000h
6201 inidate
6202 is.pfx.IXY:
6203 inidat
6204 db 000h
6205 inidate
6206 lst.L:
6207 inidat
6208 dw 0
6209 inidate
6210 XBE01:
6211 inidat
6212 dw 0
6213 inidate
6214 XBE03:
6215 inidat
6216 db 000h
6217 inidate
6218 XBEDD:
6219 inidat
6220 ret ;ret cc
6221 and a
6222 pop hl
6223 inc hl
6224 jp (hl)
6225 inidate
6226 XBFE8:
6227 inidat
6228 db 0
6229 inidate
6230 TCFLG:
6231 inidat
6232 db 0
6233 inidate
6234 XBFEA:
6235 inidat
6236 db 0
6237 inidate
6238 TCCSTR:
6239 inidat
6240 dw 0
6241 inidate
6242 TCNFLG:
6243 inidat
6244 db 0
6245 inidate
6246 TRJFLG:
6247 inidat
6248 db 0
6249 inidate
6250 wstrtflg:
6251 inidat
6252 db 1
6253 inidate
6254
6255 cseg
6256 vartabe:
6257
6258 ;------------------------------------------
6259
6260 .phase sysram_start+stacksize
6261 $stack:
6262 $stcka equ $ - stacksize
6263
6264 curphse defl $
6265 .dephase
6266 sysramc:
6267 .phase curphse
6268 topcodbeg:
6269
6270 reg.l2: db 0 ; 0fe50h
6271 reg.h2: db 0 ; 0fe51h
6272 reg.e2: db 0 ; 0fe52h
6273 reg.d2: db 0 ; 0fe53h
6274 reg.c2: db 0 ; 0fe54h
6275 reg.b2: db 0 ; 0fe55h
6276 reg.f2: db 0 ; 0fe56h
6277 reg.a2: db 0 ; 0fe57h
6278 db 0
6279 reg.i: db high ivtab
6280 reg.iy: dw 0 ; 0fe5ah
6281 reg.ix: dw 0 ; 0fe5ch
6282 reg.e: db 0 ; 0fe5eh
6283 reg.d: db 0 ; 0fe5fh
6284 reg.c: db 0 ; 0fe60h
6285 reg.b: db 0 ; 0fe61h
6286 if ROMSYS
6287 udcntl: db CWAITIO ; 0fe62h (mem-, io- wait)
6288 uromen: db ROM_DIS ; 0fe63h
6289 endif
6290 ubbr: db 0 ; 0fe64h
6291 ucbar: db USR$CBAR ; 0fe65h
6292 reg.f: db 0 ; 0fe66h
6293 reg.a: db 0 ; 0fe67h
6294 reg.l: db 0 ; 0fe68h
6295 reg.h: db 0 ; 0fe69h
6296 reg.sp: dw TOPRAM ; 0fe6ah
6297
6298 $go:
6299 if ROMSYS
6300 out (000h),a ;064c fe6c
6301 out0 (dcntl),l ;064e
6302 pop hl ;0651
6303 endif
6304 out0 (cbar),h ;0652
6305 out0 (bbr),l ;0655
6306 pop af ;0658
6307 pop hl ;0659
6308 ld sp,(reg.sp) ;065a
6309 reg.iff:
6310 ei ;065e
6311 db 0C3h ;jp TPA ;065f feff ($+1): reg.pc
6312 reg.pc:
6313 dw TPA
6314
6315 bpent:
6316 ld (reg.l),hl ;0662 fe82: bpent:
6317 pop hl ;0665
6318 dec hl ;0666
6319 ld (reg.pc),hl ;0667
6320 ld (reg.sp),sp ;066a
6321 ld sp,reg.l ;066e
6322 push af ;0671
6323 in0 h,(cbar) ;0672
6324 in0 l,(bbr) ;0675
6325 push hl ;0678
6326 ld a,SYS$CBAR ;0679
6327 out0 (cbar),a ;067b
6328
6329 if ROMSYS
6330 in0 l,(dcntl) ;067e
6331 ld a,CWAITROM+CWAITIO ;0681
6332 out0 (dcntl),a ;0683
6333 ld a,($crom) ;0686
6334 cp c$rom ;0689
6335 ld a,ROM_EN ;068b
6336 out (000h),a ;068d
6337 endif
6338
6339 jp bpddtz ;068f
6340
6341 ?comcod:
6342 if ROMSYS
6343 out (000h),a ;0692 feb2
6344 pop af ;069a
6345 endif
6346
6347 out0 (cbar),h ;0694
6348 out0 (bbr),l ;0697
6349 pop hl ;069b
6350 ?exeit:
6351 ds ?lcmax+2
6352 push af ;069f
6353 ld a,SYS$CBAR ;06a0
6354 out0 (cbar),a ;06a2
6355
6356 if ROMSYS
6357 ld a,ROM_EN ;06a5
6358 out (000h),a ;06a7
6359 endif
6360
6361 pop af ;06a9
6362 ret ;06aa
6363
6364 topcodend:
6365 curph defl $
6366 .dephase
6367 sysrame:
6368
6369 end
6370