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