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