]> cloudbase.mooo.com Git - z180-stamp.git/blob - z180/ddtz.180
e544b08650a41de71727d27196b6ca4ddd4c6761
[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 ;081b
255 or a ;081c
256 ret z ;081d
257 call DELC ;081e
258 jr DELL ;0821
259
260 INLINE:
261 push hl ;0823
262 ld hl,CI.BUF ;0824
263 ld c,(hl) ;0827
264 inc hl ;0828
265 ld b,000h ;0829
266 inc hl ;082b
267 inlnxtch:
268 ld a,c ;082c
269 or a ;082d
270 jr z,inl_e ;082e
271 call $ci ;0830
272 cp CR ;0833
273 jr z,inl_e ;0835
274 cp LF ;0837
275 jr z,inl_e ;0839
276 cp BS ;083b
277 jr nz,l0844h ;083d
278 call DELC ;083f
279 jr inlnxtch ;0842
280 l0844h:
281 cp DEL ;0844
282 jr nz,l084dh ;0846
283 call DELC ;0848
284 jr inlnxtch ;084b
285 l084dh:
286 cp CNTRX ;084d
287 jr nz,l0856h ;084f
288 call DELL ;0851
289 jr inlnxtch ;0854
290 l0856h:
291 cp TAB ;0856
292 jr nz,l085ch ;0858
293 ld a,' ' ;085a
294 l085ch:
295 ld (hl),a ;085c
296 cp ' ' ;085d
297 jr nc,l0869h ;085f
298 ld a,'^' ;0861
299 call $co ;0863
300 ld a,(hl) ;0866
301 add a,'@' ;0867
302 l0869h:
303 call $co ;0869
304 inc hl ;086c
305 inc b ;086d
306 dec c ;086e
307 jr inlnxtch ;086f
308
309 inl_e:
310 ld hl,ci.buf+1 ;0871
311 ld (hl),b ;0874
312 call CRLF ;0875
313 ld de,ci.buf+1 ;0878
314 ld a,(de) ;087b
315 ld b,a ;087c
316 ld c,000h ;087d
317 inc b ;087f
318 l0880h:
319 inc de ;0880
320 dec b ;0881
321 jr z,l08b2h ;0882
322 ld a,(de) ;0884
323 bit 0,c ;0885
324 call z,UPCASE ;0887
325 ld (de),a ;088a
326 cp '''' ;088b
327 jr nz,l0880h ;088d
328 push de ;088f
329 dec de ;0890
330 ld a,(de) ;0891
331 cp '''' ;0892
332 jr z,l08aeh ;0894
333 dec de ;0896
334 ld a,(de) ;0897
335 cp '^' ;0898
336 jr z,l08a2h ;089a
337 dec de ;089c
338 ld a,(de) ;089d
339 cp '^' ;089e
340 jr nz,l08aeh ;08a0
341 l08a2h:
342 inc de ;08a2
343 push bc ;08a3
344 call sub_0a0eh ;08a4
345 pop bc ;08a7
346 dec de ;08a8
347 ld a,(de) ;08a9
348 cp '''' ;08aa
349 jr z,l08afh ;08ac
350 l08aeh:
351 inc c ;08ae
352 l08afh:
353 pop de ;08af
354 jr l0880h ;08b0
355 l08b2h:
356 xor a ;08b2
357 ld (de),a ;08b3
358 ld de,ci.buf+2 ;08b4
359 pop hl ;08b7
360 ret ;08b8
361
362 UPCASE:
363 cp 'a' ;08b9
364 ret c ;08bb
365 cp 'z'+1 ;08bc
366 ret nc ;08be
367 and 05fh ;08bf
368 ret ;08c1
369
370 out.hl.@:
371 call out.hl ;08c2
372 push de ;08c5
373 push hl ;08c6
374 ld de,(offs.@) ;08c7
375 ld a,d ;08cb
376 or e ;08cc
377 jr z,l08ddh ;08cd
378 call OUTBL ;08cf
379 ld a,'@' ;08d2
380 call OUTCHAR ;08d4
381 and a ;08d7
382 sbc hl,de ;08d8
383 call out.hl ;08da
384 l08ddh:
385 pop hl ;08dd
386 pop de ;08de
387 ret ;08df
388
389 out.bin.w:
390 ld a,h ;08e0
391 call out.bin.b ;08e1
392 ld a,l ;08e4
393 out.bin.b:
394 ld b,008h ;08e5
395 l08e7h:
396 add a,a ;08e7
397 push af ;08e8
398 ld a,0 ;08e9
399 adc a,a ;08eb
400 call out.digit ;08ec
401 pop af ;08ef
402 djnz l08e7h ;08f0
403 ld a,'"' ;08f2
404 jp OUTCHAR ;08f4
405
406 sub_08f7h:
407 ld a,'-' ;08f7
408 call OUTCHAR ;08f9
409 dec hl ;08fc
410 jp cpl.hl ;08fd
411
412 out.hl.decm:
413 push hl ;0900
414 call sub_08f7h ;0901
415 db 3eh ;0904 ld a,0E5h
416 out.hl.dec:
417 push hl
418 ld b,6 ;0906
419 call sub_0917h ;0908
420 pop hl ;090b
421 ld a,'.' ;090c
422 call OUTCHAR ;090e
423 l0911h:
424 call OUTBL ;0911
425 djnz l0911h ;0914
426 ret ;0916
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
2728 CMD.R:
2729 ld hl,0 ;169b
2730 call get_lastarg_def ;169e
2731 push hl ;16a1
2732 ld hl,0 ;16a2
2733 ld (HILOD),hl ;16a5
2734 w_recstart:
2735 call i.getchar ;16a8
2736 jr z,l16deh ;16ab
2737 cp ':' ;16ad
2738 jr nz,w_recstart ;16af
2739 ld c,0 ;16b1 init checksum
2740 call i.gethexbyte ;16b3 record len
2741 ld b,a ;16b6
2742 call i.gethexbyte ;16b7 address high
2743 ld h,a ;16ba
2744 call i.gethexbyte ;16bb address low
2745 ld l,a ;16be
2746 call i.gethexbyte ;16bf record type (ignored)
2747 ld a,b ;16c2
2748 and a ;16c3 record len == 0?
2749 jr z,l16deh ;16c4
2750 l16c6h:
2751 call i.gethexbyte ;16c6
2752 pop de ;16c9
2753 push de ;16ca
2754 push hl ;16cb
2755 add hl,de ;16cc
2756 call i.storebyte ;16cd
2757 pop hl ;16d0
2758 inc hl ;16d1
2759 djnz l16c6h ;16d2
2760 call i.gethexbyte ;16d4
2761 ld a,c ;16d7
2762 and a ;16d8
2763 jp nz,ERROR ;16d9 exit if checksum error
2764 jr w_recstart ;16dc next record
2765 l16deh:
2766 pop hl ;16de
2767 call i.gethexbyte ;16df
2768 jp l173fh ;16e2
2769
2770 i.gethexbyte:
2771 call sub_16f6h ;16e5
2772 rlca ;16e8
2773 rlca ;16e9
2774 rlca ;16ea
2775 rlca ;16eb
2776 ld d,a ;16ec
2777 call sub_16f6h ;16ed
2778 add a,d ;16f0
2779 ld d,a ;16f1
2780 add a,c ;16f2
2781 ld c,a ;16f3
2782 ld a,d ;16f4
2783 ret ;16f5
2784
2785 sub_16f6h:
2786 call i.getchar ;16f6
2787 jr z,l16ffh ;16f9
2788 call sub_0d26h ;16fb
2789 ret nc ;16fe
2790 l16ffh:
2791 jp ERROR ;16ff
2792
2793 i.getchar:
2794 call $ci ;1702
2795 cp 01ah ;1705
2796 ret ;1707
2797
2798 i.storebyte:
2799 push af ;1708
2800 push de ;1709
2801 ld de,TPA ;170a
2802 call CP.HL.DE ;170d
2803 jp c,ERROR ;1710
2804 ld de,$stcka ;1713
2805 call CP.HL.DE ;1716
2806 jp nc,ERROR ;1719
2807 ld de,(HILOD) ;171c
2808 call CP.HL.DE ;1720
2809 jr c,l1728h ;1723
2810 ld (HILOD),hl ;1725
2811 l1728h:
2812 ld de,(MAXLOD) ;1728
2813 call CP.HL.DE ;172c
2814 jr c,l1734h ;172f
2815 ld (MAXLOD),hl ;1731
2816 l1734h:
2817 pop de ;1734
2818 pop af ;1735
2819 comst ;1736
2820 ld (hl),a ;173a
2821 comend
2822 ret ;173b
2823
2824 l173ch:
2825 call assert_eol ;173c
2826 l173fh:
2827 ld hl,MSG_high ;173f
2828 call PSTR ;1742
2829 ld hl,(HILOD) ;1745
2830 call out.hl ;1748
2831 ld hl,MSG_max ;174b
2832 call PSTR ;174e
2833 ld hl,(MAXLOD) ;1751
2834 call out.hl ;1754
2835 jp CRLF ;1757
2836
2837 MSG_high:
2838 DC 'High = '
2839 MSG_max:
2840 DC ' Max = '
2841
2842 CMD.A:
2843 ld hl,(lst.A) ;1769
2844 call get_lastarg_def ;176c
2845 push hl ;176f
2846 pop iy ;1770
2847 ld hl,l17c4h ;1772
2848 ld (CMD_ERR),hl ;1775
2849 ld (XB068),sp ;1778
2850 l177ch:
2851 push iy ;177c
2852 pop hl ;177e
2853 ld (lst.A),hl ;177f
2854 ld (OFFS.pc),hl ;1782
2855 push hl ;1785
2856 call sub_1f3fh ;1786
2857 pop iy ;1789
2858 ld c,b ;178b
2859 ld de,(offs.@) ;178c
2860 ld a,d ;1790
2861 or e ;1791
2862 ld b,011h ;1792
2863 jr z,l1798h ;1794
2864 ld b,019h ;1796
2865 l1798h:
2866 call OUTBL ;1798
2867 ld a,(CON.COL) ;179b
2868 cp b ;179e
2869 jr c,l1798h ;179f
2870 push bc ;17a1
2871 call INLINE ;17a2
2872 pop bc ;17a5
2873 call SKIPBL ;17a6
2874 cp '.' ;17a9
2875 ret z ;17ab
2876 cp '-' ;17ac
2877 jr nz,l17b6h ;17ae
2878 ld iy,(XB06C) ;17b0
2879 jr l177ch ;17b4
2880 l17b6h:
2881 and a ;17b6
2882 call nz,sub_17cdh ;17b7
2883 ld (XB06C),iy ;17ba
2884 ld b,0 ;17be
2885 add iy,bc ;17c0
2886 jr l177ch ;17c2
2887 l17c4h:
2888 call l07eah ;17c4
2889 ld sp,(XB068) ;17c7
2890 jr l177ch ;17cb
2891
2892 sub_17cdh:
2893 call SKIPBL ;17cd
2894 ld hl,t_MNEMONICS ;17d0
2895 call sub_0a15h ;17d3
2896 jp nc,ERROR ;17d6
2897 call SKIPBL ;17d9
2898 push de ;17dc
2899 ld a,b ;17dd
2900 add a,b ;17de
2901 add a,b ;17df
2902 ld hl,b_0x17EE_start ;17e0
2903 call ADD_HL_A ;17e3
2904 ld e,(hl) ;17e6
2905 inc hl ;17e7
2906 ld d,(hl) ;17e8
2907 inc hl ;17e9
2908 ld b,(hl) ;17ea
2909 ex de,hl ;17eb
2910 pop de ;17ec
2911 jp (hl) ;17ed
2912
2913 b_0x17EE_start:
2914 defw l1b54h ;17ee
2915
2916 b_0x17F0_start:
2917 defb 088h ;17f0
2918
2919 b_0x17F1_start:
2920 defw l1b74h ;17f1
2921
2922 b_0x17F3_start:
2923 defb 080h ;17f3
2924
2925 b_0x17F4_start:
2926 defw l1babh ;17f4
2927
2928 b_0x17F6_start:
2929 defb 0a0h ;17f6
2930
2931 b_0x17F7_start:
2932 defw l1c14h ;17f7
2933
2934 b_0x17F9_start:
2935 defb 040h ;17f9
2936
2937 b_0x17FA_start:
2938 defw l1c38h ;17fa
2939
2940 b_0x17FC_start:
2941 defb 0c4h ;17fc
2942
2943 b_0x17FD_start:
2944 defw l1b36h ;17fd
2945
2946 b_0x17FF_start:
2947 defb 03fh ;17ff
2948
2949 b_0x1800_start:
2950 defw l1babh ;1800
2951
2952 b_0x1802_start:
2953 defb 0b8h ;1802
2954
2955 b_0x1803_start:
2956 defw gen.opc.ED2 ;1803
2957
2958 b_0x1805_start:
2959 defb 0a9h ;1805
2960
2961 b_0x1806_start:
2962 defw gen.opc.ED2 ;1806
2963
2964 b_0x1808_start:
2965 defb 0b9h ;1808
2966
2967 b_0x1809_start:
2968 defw gen.opc.ED2 ;1809
2969
2970 b_0x180B_start:
2971 defb 0a1h ;180b
2972
2973 b_0x180C_start:
2974 defw gen.opc.ED2 ;180c
2975
2976 b_0x180E_start:
2977 defb 0b1h ;180e
2978
2979 b_0x180F_start:
2980 defw l1b36h ;180f
2981
2982 b_0x1811_start:
2983 defb 02fh ;1811
2984
2985 b_0x1812_start:
2986 defw l1b36h ;1812
2987
2988 b_0x1814_start:
2989 defb 027h ;1814
2990
2991 b_0x1815_start:
2992 defw l1dabh ;1815
2993
2994 b_0x1817_start:
2995 defb 005h ;1817
2996
2997 b_0x1818_start:
2998 defw l1b36h ;1818
2999
3000 b_0x181A_start:
3001 defb 0f3h ;181a
3002
3003 b_0x181B_start:
3004 defw l1ca4h ;181b
3005
3006 b_0x181D_start:
3007 defb 010h ;181d
3008
3009 b_0x181E_start:
3010 defw l1b36h ;181e
3011
3012 b_0x1820_start:
3013 defb 0fbh ;1820
3014
3015 b_0x1821_start:
3016 defw l1d54h ;1821
3017
3018 b_0x1823_start:
3019 defb 0e3h ;1823
3020
3021 b_0x1824_start:
3022 defw l1b36h ;1824
3023
3024 b_0x1826_start:
3025 defb 0d9h ;1826
3026
3027 b_0x1827_start:
3028 defw l1b36h ;1827
3029
3030 b_0x1829_start:
3031 defb 076h ;1829
3032
3033 b_0x182A_start:
3034 defw l1cbfh ;182a
3035
3036 b_0x182C_start:
3037 defb 046h ;182c
3038
3039 b_0x182D_start:
3040 defw l1cf8h ;182d
3041
3042 b_0x182F_start:
3043 defb 040h ;182f
3044
3045 b_0x1830_start:
3046 defw l1dabh ;1830
3047
3048 b_0x1832_start:
3049 defb 004h ;1832
3050
3051 b_0x1833_start:
3052 defw gen.opc.ED2 ;1833
3053
3054 b_0x1835_start:
3055 defb 0aah ;1835
3056
3057 b_0x1836_start:
3058 defw gen.opc.ED2 ;1836
3059
3060 b_0x1838_start:
3061 defb 0bah ;1838
3062
3063 b_0x1839_start:
3064 defw gen.opc.ED2 ;1839
3065
3066 b_0x183B_start:
3067 defb 0a2h ;183b
3068
3069 b_0x183C_start:
3070 defw gen.opc.ED2 ;183c
3071
3072 b_0x183E_start:
3073 defb 0b2h ;183e
3074
3075 b_0x183F_start:
3076 defw l1c5eh ;183f
3077
3078 b_0x1841_start:
3079 defb 0c2h ;1841
3080
3081 b_0x1842_start:
3082 defw l1cabh ;1842
3083
3084 b_0x1844_start:
3085 defb 020h ;1844
3086
3087 b_0x1845_start:
3088 defw l1934h ;1845
3089
3090 b_0x1847_start:
3091 defb 040h ;1847
3092
3093 b_0x1848_start:
3094 defw gen.opc.ED2 ;1848
3095
3096 b_0x184A_start:
3097 defb 0a8h ;184a
3098
3099 b_0x184B_start:
3100 defw gen.opc.ED2 ;184b
3101
3102 b_0x184D_start:
3103 defb 0b8h ;184d
3104
3105 b_0x184E_start:
3106 defw gen.opc.ED2 ;184e
3107
3108 b_0x1850_start:
3109 defb 0a0h ;1850
3110
3111 b_0x1851_start:
3112 defw gen.opc.ED2 ;1851
3113
3114 b_0x1853_start:
3115 defb 0b0h ;1853
3116
3117 b_0x1854_start:
3118 defw gen.opc.ED2 ;1854
3119
3120 b_0x1856_start:
3121 defb 044h ;1856
3122
3123 b_0x1857_start:
3124 defw l1b36h ;1857
3125
3126 b_0x1859_start:
3127 defb 000h ;1859
3128
3129 b_0x185A_start:
3130 defw l1babh ;185a
3131
3132 b_0x185C_start:
3133 defb 0b0h ;185c
3134
3135 b_0x185D_start:
3136 defw gen.opc.ED2 ;185d
3137
3138 b_0x185F_start:
3139 defb 0bbh ;185f
3140
3141 b_0x1860_start:
3142 defw gen.opc.ED2 ;1860
3143
3144 b_0x1862_start:
3145 defb 0b3h ;1862
3146
3147 b_0x1863_start:
3148 defw l1d2ch ;1863
3149
3150 b_0x1865_start:
3151 defb 041h ;1865
3152
3153 b_0x1866_start:
3154 defw gen.opc.ED2 ;1866
3155
3156 b_0x1868_start:
3157 defb 0abh ;1868
3158
3159 b_0x1869_start:
3160 defw gen.opc.ED2 ;1869
3161
3162 b_0x186B_start:
3163 defb 0a3h ;186b
3164
3165 b_0x186C_start:
3166 defw l1ce4h ;186c
3167
3168 b_0x186E_start:
3169 defb 0c1h ;186e
3170
3171 b_0x186F_start:
3172 defw l1ce4h ;186f
3173
3174 b_0x1871_start:
3175 defb 0c5h ;1871
3176
3177 b_0x1872_start:
3178 defw l1c14h ;1872
3179
3180 b_0x1874_start:
3181 defb 080h ;1874
3182
3183 b_0x1875_start:
3184 defw l1c50h ;1875
3185
3186 b_0x1877_start:
3187 defb 0c0h ;1877
3188
3189 b_0x1878_start:
3190 defw gen.opc.ED2 ;1878
3191
3192 b_0x187A_start:
3193 defb 04dh ;187a
3194
3195 b_0x187B_start:
3196 defw gen.opc.ED2 ;187b
3197
3198 b_0x187D_start:
3199 defb 045h ;187d
3200
3201 b_0x187E_start:
3202 defw l1bd8h ;187e
3203
3204 b_0x1880_start:
3205 defb 010h ;1880
3206
3207 b_0x1881_start:
3208 defw l1b36h ;1881
3209
3210 b_0x1883_start:
3211 defb 017h ;1883
3212
3213 b_0x1884_start:
3214 defw l1bd8h ;1884
3215
3216 b_0x1886_start:
3217 defb 000h ;1886
3218
3219 b_0x1887_start:
3220 defw l1b36h ;1887
3221
3222 b_0x1889_start:
3223 defb 007h ;1889
3224
3225 b_0x188A_start:
3226 defw gen.opc.ED2 ;188a
3227
3228 b_0x188C_start:
3229 defb 06fh ;188c
3230
3231 b_0x188D_start:
3232 defw l1bd8h ;188d
3233
3234 b_0x188F_start:
3235 defb 018h ;188f
3236
3237 b_0x1890_start:
3238 defw l1b36h ;1890
3239
3240 b_0x1892_start:
3241 defb 01fh ;1892
3242
3243 b_0x1893_start:
3244 defw l1bd8h ;1893
3245
3246 b_0x1895_start:
3247 defb 008h ;1895
3248
3249 b_0x1896_start:
3250 defw l1b36h ;1896
3251
3252 b_0x1898_start:
3253 defb 00fh ;1898
3254
3255 b_0x1899_start:
3256 defw gen.opc.ED2 ;1899
3257
3258 b_0x189B_start:
3259 defb 067h ;189b
3260
3261 b_0x189C_start:
3262 defw l1cd5h ;189c
3263
3264 b_0x189E_start:
3265 defb 0c7h ;189e
3266
3267 b_0x189F_start:
3268 defw l1b54h ;189f
3269
3270 b_0x18A1_start:
3271 defb 098h ;18a1
3272
3273 b_0x18A2_start:
3274 defw l1b36h ;18a2
3275
3276 b_0x18A4_start:
3277 defb 037h ;18a4
3278
3279 b_0x18A5_start:
3280 defw l1c14h ;18a5
3281
3282 b_0x18A7_start:
3283 defb 0c0h ;18a7
3284
3285 b_0x18A8_start:
3286 defw l1bd8h ;18a8
3287
3288 b_0x18AA_start:
3289 defb 020h ;18aa
3290
3291 b_0x18AB_start:
3292 defw l1bd8h ;18ab
3293
3294 b_0x18AD_start:
3295 defb 028h ;18ad
3296
3297 b_0x18AE_start:
3298 defw l1bd8h ;18ae
3299
3300 b_0x18B0_start:
3301 defb 038h ;18b0
3302
3303 b_0x18B1_start:
3304 defw l1babh ;18b1
3305
3306 b_0x18B3_start:
3307 defb 090h ;18b3
3308
3309 b_0x18B4_start:
3310 defw l1babh ;18b4
3311
3312 b_0x18B6_start:
3313 defb 0a8h ;18b6
3314
3315 b_0x18B7_start:
3316 defw A.IN0 ;18b7
3317
3318 b_0x18B9_start:
3319 defb 000h ;18b9
3320
3321 b_0x18BA_start:
3322 defw A.MLT ;18ba
3323
3324 b_0x18BC_start:
3325 defb 04ch ;18bc
3326 ld b,e ;18bd
3327 dec de ;18be
3328
3329 b_0x18BF_start:
3330 defb 08bh ;18bf
3331
3332 b_0x18C0_start:
3333 defw gen.opc.ED2 ;18c0
3334
3335 b_0x18C2_start:
3336 defb 09bh ;18c2
3337
3338 b_0x18C3_start:
3339 defw gen.opc.ED2 ;18c3
3340
3341 b_0x18C5_start:
3342 defb 083h ;18c5
3343
3344 b_0x18C6_start:
3345 defw gen.opc.ED2 ;18c6
3346
3347 b_0x18C8_start:
3348 defb 093h ;18c8
3349
3350 b_0x18C9_start:
3351 defw l18fdh ;18c9
3352
3353 b_0x18CB_start:
3354 defb 001h ;18cb
3355
3356 b_0x18CC_start:
3357 defw gen.opc.ED2 ;18cc
3358
3359 b_0x18CE_start:
3360 defb 076h ;18ce
3361
3362 b_0x18CF_start:
3363 defw l191dh ;18cf
3364
3365 b_0x18D1_start:
3366 defb 004h ;18d1
3367
3368 b_0x18D2_start:
3369 defw l192ch ;18d2
3370
3371 b_0x18D4_start:
3372 defb 074h ;18d4
3373 A.IN0:
3374 call sub_1e41h ;18d5
3375 jr nc,l1931h ;18d8
3376 cp 006h ;18da
3377 jr z,l1931h ;18dc
3378 rlca ;18de
3379 rlca ;18df
3380 rlca ;18e0
3381 add a,b ;18e1
3382 ld b,a ;18e2
3383 call sub_1ed1h ;18e3
3384 call sub_1e06h ;18e6
3385 l18e9h:
3386 call assert_eol ;18e9
3387 comst ;18ec
3388 ld (iy+000h),0edh ;18f0
3389 ld (iy+001h),b ;18f4
3390 ld (iy+002h),l ;18f7
3391 comend
3392 ld c,003h ;18fa
3393 ret ;18fc
3394 l18fdh:
3395 call sub_1e06h ;18fd
3396 call sub_1ed1h ;1900
3397 call sub_1e41h ;1903
3398 jr nc,l1931h ;1906
3399 cp 006h ;1908
3400 jr z,l1931h ;190a
3401 rlca ;190c
3402 rlca ;190d
3403 rlca ;190e
3404 add a,b ;190f
3405 ld b,a ;1910
3406 jr l18e9h ;1911
3407 A.MLT:
3408 call sub_1e2eh ;1913
3409 jr nc,l1931h ;1916
3410 add a,b ;1918
3411 ld b,a ;1919
3412 jp gen.opc.ED2 ;191a
3413 l191dh:
3414 call sub_1e41h ;191d
3415 jr nc,l192ah ;1920
3416 rlca ;1922
3417 rlca ;1923
3418 rlca ;1924
3419 add a,b ;1925
3420 ld b,a ;1926
3421 jp gen.opc.ED2 ;1927
3422 l192ah:
3423 ld b,064h ;192a
3424 l192ch:
3425 call sub_1e12h ;192c
3426 jr l18e9h ;192f
3427 l1931h:
3428 jp ERROR ;1931
3429 l1934h:
3430 call sub_1e41h ;1934
3431 jp c,l19bfh ;1937
3432 call sub_1e68h ;193a
3433 jp c,l1a64h ;193d
3434 call sub_1e2eh ;1940
3435 jp c,l1a93h ;1943
3436 call sub_1e50h ;1946
3437 jp c,l1af0h ;1949
3438 ld a,(de) ;194c
3439 cp 049h ;194d
3440 jp z,l1b0ch ;194f
3441 cp 052h ;1952
3442 jp z,l1b14h ;1954
3443 cp 028h ;1957
3444 jp nz,ERROR ;1959
3445 inc de ;195c
3446 call sub_1e2eh ;195d
3447 jp c,l1b23h ;1960
3448 call tst_EXPR ;1963
3449 call sub_1ed8h ;1966
3450 call sub_1ed1h ;1969
3451 call sub_1e2eh ;196c
3452 jr c,l19adh ;196f
3453 call sub_1e50h ;1971
3454 jr nc,l1991h ;1974
3455 ld b,022h ;1976
3456 l1978h:
3457 call assert_eol ;1978
3458 ld a,(pfx.IXY) ;197b
3459 l197eh:
3460 comst ;197e
3461 ld (iy+000h),a ;1982
3462 ld (iy+001h),b ;1985
3463 ld (iy+002h),l ;1988
3464 ld (iy+003h),h ;198b
3465 comend
3466 ld c,004h ;198e
3467 ret ;1990
3468 l1991h:
3469 ld a,(de) ;1991
3470 cp 041h ;1992
3471 jp nz,ERROR ;1994
3472 inc de ;1997
3473 ld b,032h ;1998
3474 l199ah:
3475 call assert_eol ;199a
3476 comst ;199d
3477 ld (iy+000h),b ;19a1
3478 ld (iy+001h),l ;19a4
3479 ld (iy+002h),h ;19a7
3480 comend
3481 ld c,003h ;19aa
3482 ret ;19ac
3483 l19adh:
3484 cp 020h ;19ad
3485 jr z,l19bbh ;19af
3486 add a,043h ;19b1
3487 ld b,a ;19b3
3488 l19b4h:
3489 call assert_eol ;19b4
3490 ld a,0edh ;19b7
3491 jr l197eh ;19b9
3492 l19bbh:
3493 ld b,022h ;19bb
3494 jr l199ah ;19bd
3495 l19bfh:
3496 ld b,a ;19bf
3497 call sub_1ed1h ;19c0
3498 call sub_1e41h ;19c3
3499 jr nc,l19dbh ;19c6
3500 push af ;19c8
3501 ld a,b ;19c9
3502 rlca ;19ca
3503 rlca ;19cb
3504 rlca ;19cc
3505 ld b,a ;19cd
3506 pop af ;19ce
3507 add a,b ;19cf
3508 add a,040h ;19d0
3509 cp 076h ;19d2
3510 jp z,ERROR ;19d4
3511 l19d7h:
3512 ld b,a ;19d7
3513 jp l1b36h ;19d8
3514 l19dbh:
3515 call sub_1e68h ;19db
3516 jr nc,l1a02h ;19de
3517 ld a,b ;19e0
3518 rlca ;19e1
3519 rlca ;19e2
3520 rlca ;19e3
3521 add a,046h ;19e4
3522 cp 076h ;19e6
3523 jp z,ERROR ;19e8
3524 l19ebh:
3525 ld b,a ;19eb
3526 call assert_eol ;19ec
3527 ld a,(pfx.IXY) ;19ef
3528 comst ;19f2
3529 ld (iy+000h),a ;19f6
3530 ld (iy+001h),b ;19f9
3531 ld (iy+002h),c ;19fc
3532 comend
3533 ld c,003h ;19ff
3534 ret ;1a01
3535 l1a02h:
3536 ld a,(de) ;1a02
3537 cp 'I' ;1a03
3538 jr z,l1a15h ;1a05
3539 cp 'R' ;1a07
3540 jr nz,l1a21h ;1a09
3541 ld a,b ;1a0b
3542 cp 007h ;1a0c
3543 jp nz,ERROR ;1a0e
3544 ld b,05fh ;1a11
3545 jr l1a1dh ;1a13
3546 l1a15h:
3547 ld a,b ;1a15
3548 cp 007h ;1a16
3549 jp nz,ERROR ;1a18
3550 ld b,057h ;1a1b
3551 l1a1dh:
3552 inc de ;1a1d
3553 jp gen.opc.ED2 ;1a1e
3554 l1a21h:
3555 cp '(' ;1a21
3556 jr z,l1a3fh ;1a23
3557 call sub_1e12h ;1a25
3558 ld a,b ;1a28 ld r,nn
3559 rlca ;1a29
3560 rlca ;1a2a
3561 rlca ;1a2b
3562 add a,006h ;1a2c
3563 l1a2eh:
3564 ld b,a ;1a2e
3565 l1a2fh:
3566 call assert_eol ;1a2f
3567 comst ;1a32
3568 ld (iy+000h),b ;1a36
3569 ld (iy+001h),l ;1a39
3570 comend
3571 ld c,002h ;1a3c
3572 ret ;1a3e
3573 l1a3fh:
3574 inc de ;1a3f
3575 ld a,b ;1a40
3576 cp 007h ;1a41
3577 jp nz,ERROR ;1a43
3578 call sub_1e2eh ;1a46
3579 jr nc,l1a59h ;1a49
3580 cp 030h ;1a4b
3581 jp nc,ERROR ;1a4d
3582 add a,00ah ;1a50
3583 ld b,a ;1a52
3584 call sub_1ed8h ;1a53
3585 jp l1b36h ;1a56
3586 l1a59h:
3587 call tst_EXPR ;1a59
3588 call sub_1ed8h ;1a5c
3589 ld b,03ah ;1a5f
3590 jp l199ah ;1a61
3591 l1a64h:
3592 call sub_1ed1h ;1a64
3593 call sub_1e41h ;1a67
3594 jr nc,l1a76h ;1a6a
3595 cp 006h ;1a6c
3596 jp z,ERROR ;1a6e
3597 add a,070h ;1a71
3598 jp l19ebh ;1a73
3599 l1a76h:
3600 call sub_1e12h ;1a76
3601 call assert_eol ;1a79
3602 ld a,(pfx.IXY) ;1a7c
3603 comst ;1a7f
3604 ld (iy+000h),a ;1a83 dd/fd
3605 ld (iy+001h),036h ;1a86
3606 ld (iy+002h),c ;1a8a displacement
3607 ld (iy+003h),l ;1a8d nn
3608 comend
3609 ld c,4 ;1a90
3610 ret ;1a92
3611 l1a93h:
3612 ld b,a ;1a93
3613 call sub_1ed1h ;1a94
3614 ld hl,t_HL.AF ;1a97
3615 call sub_0a23h ;1a9a
3616 jr c,l1abeh ;1a9d
3617 call sub_1e50h ;1a9f
3618 jr nc,l1ac7h ;1aa2
3619 ld a,b ;1aa4
3620 cp 030h ;1aa5
3621 jr nz,l1b20h ;1aa7
3622 ld b,0f9h ;1aa9
3623 l1aabh:
3624 call assert_eol ;1aab
3625 ld a,(pfx.IXY) ;1aae
3626 comst ;1ab1
3627 ld (iy+000h),a ;1ab5
3628 ld (iy+001h),b ;1ab8
3629 comend
3630 ld c,002h ;1abb
3631 ret ;1abd
3632 l1abeh:
3633 ld a,b ;1abe
3634 cp 030h ;1abf
3635 jr nz,l1b20h ;1ac1
3636 ld b,0f9h ;1ac3
3637 jr l1b36h ;1ac5
3638 l1ac7h:
3639 ld a,(de) ;1ac7
3640 cp 028h ;1ac8
3641 jr nz,l1ae3h ;1aca
3642 inc de ;1acc
3643 call tst_EXPR ;1acd
3644 call sub_1ed8h ;1ad0
3645 ld a,b ;1ad3
3646 cp 020h ;1ad4
3647 jr z,l1adeh ;1ad6
3648 add a,04bh ;1ad8
3649 ld b,a ;1ada
3650 jp l19b4h ;1adb
3651 l1adeh:
3652 ld b,02ah ;1ade
3653 jp l199ah ;1ae0
3654 l1ae3h:
3655 call tst_EXPR ;1ae3
3656 call assert_eol ;1ae6
3657 ld a,001h ;1ae9
3658 add a,b ;1aeb
3659 ld b,a ;1aec
3660 jp l199ah ;1aed
3661 l1af0h:
3662 call sub_1ed1h ;1af0
3663 ld a,(de) ;1af3
3664 cp 028h ;1af4
3665 jr nz,l1b04h ;1af6
3666 inc de ;1af8
3667 call tst_EXPR ;1af9
3668 call sub_1ed8h ;1afc
3669 ld b,02ah ;1aff
3670 jp l1978h ;1b01
3671 l1b04h:
3672 call tst_EXPR ;1b04
3673 ld b,021h ;1b07
3674 jp l1978h ;1b09
3675 l1b0ch:
3676 inc de ;1b0c
3677 call sub_1ed1h ;1b0d
3678 ld b,047h ;1b10
3679 jr l1b1ah ;1b12
3680 l1b14h:
3681 inc de ;1b14
3682 call sub_1ed1h ;1b15
3683 ld b,04fh ;1b18
3684 l1b1ah:
3685 ld a,(de) ;1b1a
3686 inc de ;1b1b
3687 cp 041h ;1b1c
3688 jr z,gen.opc.ED2 ;1b1e
3689 l1b20h:
3690 jp ERROR ;1b20
3691 l1b23h:
3692 cp 020h ;1b23
3693 jr nc,l1b20h ;1b25
3694 add a,002h ;1b27
3695 ld b,a ;1b29
3696 call sub_1ed8h ;1b2a
3697 call sub_1ed1h ;1b2d
3698 ld a,(de) ;1b30
3699 cp 041h ;1b31
3700 jr nz,l1b20h ;1b33
3701 inc de ;1b35
3702 l1b36h:
3703 call assert_eol ;1b36
3704 comst ;1b39
3705 ld (iy+000h),b ;1b3d
3706 comend
3707 ld c,001h ;1b40
3708 ret ;1b42
3709 gen.opc.ED2:
3710 call assert_eol ;1b43
3711 comst ;1b46
3712 ld (iy+000h),0edh ;1b4a
3713 ld (iy+001h),b ;1b4e
3714 comend
3715 ld c,002h ;1b51
3716 ret ;1b53
3717 l1b54h:
3718 ld hl,t_HL.AF ;1b54
3719 call sub_0a23h ;1b57
3720 jr nc,l1babh ;1b5a
3721 call sub_1ed1h ;1b5c
3722 call sub_1e2eh ;1b5f
3723 jp nc,ERROR ;1b62
3724 push af ;1b65
3725 ld a,b ;1b66
3726 cp 088h ;1b67
3727 ld b,04ah ;1b69
3728 jr z,l1b6fh ;1b6b
3729 ld b,042h ;1b6d
3730 l1b6fh:
3731 pop af ;1b6f
3732 add a,b ;1b70
3733 l1b71h:
3734 ld b,a ;1b71
3735 jr gen.opc.ED2 ;1b72
3736 l1b74h:
3737 ld hl,t_HL.AF ;1b74
3738 call sub_0a23h ;1b77
3739 jr c,l1b9dh ;1b7a
3740 call sub_1e50h ;1b7c
3741 jr nc,l1babh ;1b7f
3742 call sub_1ed1h ;1b81
3743 ld hl,t_BC.DE.IX.SP ;1b84
3744 ld a,(pfx.IXY) ;1b87
3745 cp 0fdh ;1b8a
3746 jr nz,l1b91h ;1b8c
3747 ld hl,t_BC.DE.IY.SP ;1b8e
3748 l1b91h:
3749 call sub_1e2bh ;1b91
3750 jp nc,ERROR ;1b94
3751 add a,009h ;1b97
3752 l1b99h:
3753 ld b,a ;1b99
3754 jp l1aabh ;1b9a
3755 l1b9dh:
3756 call sub_1ed1h ;1b9d
3757 call sub_1e2eh ;1ba0
3758 jp nc,ERROR ;1ba3
3759 add a,009h ;1ba6
3760 jp l19d7h ;1ba8
3761 l1babh:
3762 ld a,(de) ;1bab
3763 cp 041h ;1bac
3764 jr nz,l1bbbh ;1bae
3765 push de ;1bb0
3766 inc de ;1bb1
3767 call skip_to_nextarg ;1bb2
3768 jr z,l1bbah ;1bb5
3769 pop de ;1bb7
3770 jr l1bbbh ;1bb8
3771 l1bbah:
3772 pop af ;1bba
3773 l1bbbh:
3774 call sub_1e41h ;1bbb
3775 jr c,l1bceh ;1bbe
3776 call sub_1e68h ;1bc0
3777 jr c,l1bd2h ;1bc3
3778 call sub_1e12h ;1bc5
3779 ld a,b ;1bc8
3780 add a,046h ;1bc9
3781 jp l1a2eh ;1bcb
3782 l1bceh:
3783 add a,b ;1bce
3784 jp l19d7h ;1bcf
3785 l1bd2h:
3786 ld a,b ;1bd2
3787 add a,006h ;1bd3
3788 jp l19ebh ;1bd5
3789 l1bd8h:
3790 call sub_1e41h ;1bd8
3791 jr c,l1c01h ;1bdb
3792 call sub_1e68h ;1bdd
3793 jp nc,ERROR ;1be0
3794 ld a,b ;1be3
3795 add a,006h ;1be4
3796 ld b,a ;1be6
3797 l1be7h:
3798 call assert_eol ;1be7
3799 ld a,(pfx.IXY) ;1bea
3800 comst ;1bed
3801 ld (iy+000h),a ;1bf1
3802 ld (iy+001h),0cbh ;1bf4
3803 ld (iy+002h),c ;1bf8
3804 ld (iy+003h),b ;1bfb
3805 comend
3806 ld c,004h ;1bfe
3807 ret ;1c00
3808 l1c01h:
3809 add a,b ;1c01
3810 l1c02h:
3811 ld b,a ;1c02
3812 call assert_eol ;1c03
3813 comst ;1c06
3814 ld (iy+000h),0cbh ;1c0a
3815 ld (iy+001h),b ;1c0e
3816 comend
3817 ld c,002h ;1c11
3818 ret ;1c13
3819 l1c14h:
3820 call sub_1de6h ;1c14
3821 call sub_1ed1h ;1c17
3822 call sub_1e41h ;1c1a
3823 jr c,l1c2fh ;1c1d
3824 call sub_1e68h ;1c1f
3825 jp nc,ERROR ;1c22
3826 ld a,l ;1c25
3827 rlca ;1c26
3828 rlca ;1c27
3829 rlca ;1c28
3830 add a,006h ;1c29
3831 add a,b ;1c2b
3832 ld b,a ;1c2c
3833 jr l1be7h ;1c2d
3834 l1c2fh:
3835 add a,b ;1c2f
3836 ld b,a ;1c30
3837 ld a,l ;1c31
3838 rlca ;1c32
3839 rlca ;1c33
3840 rlca ;1c34
3841 add a,b ;1c35
3842 jr l1c02h ;1c36
3843 l1c38h:
3844 push de ;1c38
3845 call sub_1eb8h ;1c39
3846 jr nc,l1c47h ;1c3c
3847 add a,b ;1c3e
3848 ld b,a ;1c3f
3849 call skip_to_nextarg ;1c40
3850 jr z,l1c49h ;1c43
3851 pop de ;1c45
3852 push de ;1c46
3853 l1c47h:
3854 ld b,0cdh ;1c47
3855 l1c49h:
3856 pop af ;1c49
3857 call tst_EXPR ;1c4a
3858 jp l199ah ;1c4d
3859 l1c50h:
3860 call sub_1eb8h ;1c50
3861 jr nc,l1c59h ;1c53
3862 add a,b ;1c55
3863 ld b,a ;1c56
3864 jr l1c5bh ;1c57
3865 l1c59h:
3866 ld b,0c9h ;1c59
3867 l1c5bh:
3868 jp l1b36h ;1c5b
3869 l1c5eh:
3870 push de ;1c5e
3871 call sub_1eb8h ;1c5f
3872 jr c,l1c71h ;1c62
3873 l1c64h:
3874 pop de ;1c64
3875 ld hl,b_0x1C97_start ;1c65
3876 call sub_0a15h ;1c68
3877 jr c,l1c7fh ;1c6b
3878 ld b,0c3h ;1c6d
3879 jr l1c79h ;1c6f
3880 l1c71h:
3881 add a,b ;1c71
3882 ld b,a ;1c72
3883 call skip_to_nextarg ;1c73
3884 jr nz,l1c64h ;1c76
3885 pop af ;1c78
3886 l1c79h:
3887 call tst_EXPR ;1c79
3888 jp l199ah ;1c7c
3889 l1c7fh:
3890 call assert_eol ;1c7f
3891 ld a,b ;1c82
3892 and a ;1c83
3893 jr nz,l1c8bh ;1c84
3894 ld b,0e9h ;1c86
3895 jp l1b36h ;1c88
3896 l1c8bh:
3897 ld b,0ddh ;1c8b
3898 dec a ;1c8d
3899 jr z,l1c92h ;1c8e
3900 ld b,0fdh ;1c90
3901 l1c92h:
3902 ld l,0e9h ;1c92
3903 jp l1a2fh ;1c94
3904
3905 b_0x1C97_start:
3906 DC '(HL)'
3907 DC '(IX)'
3908 DC '(IY)'
3909 DB 0
3910
3911 l1ca4h:
3912 call skip_to_nextarg ;1ca4
3913 ld b,010h ;1ca7
3914 jr l1cb9h ;1ca9
3915 l1cabh:
3916 call sub_1ebfh ;1cab
3917 jr c,l1cb4h ;1cae
3918 ld b,018h ;1cb0
3919 jr l1cb9h ;1cb2
3920 l1cb4h:
3921 add a,b ;1cb4
3922 ld b,a ;1cb5
3923 call sub_1ed1h ;1cb6
3924 l1cb9h:
3925 call sub_1defh ;1cb9
3926 jp l1a2fh ;1cbc
3927 l1cbfh:
3928 call sub_1e12h ;1cbf
3929 ld a,l ;1cc2
3930 cp 003h ;1cc3
3931 jr nc,l1d23h ;1cc5
3932 and a ;1cc7
3933 jr z,l1cd2h ;1cc8
3934 ld b,056h ;1cca
3935 cp 001h ;1ccc
3936 jr z,l1cd2h ;1cce
3937 ld b,05eh ;1cd0
3938 l1cd2h:
3939 jp gen.opc.ED2 ;1cd2
3940 l1cd5h:
3941 call sub_1e12h ;1cd5
3942 ld a,l ;1cd8
3943 push af ;1cd9
3944 add a,b ;1cda
3945 ld b,a ;1cdb
3946 pop af ;1cdc
3947 and 0c7h ;1cdd
3948 jr nz,l1d23h ;1cdf
3949 jp l1b36h ;1ce1
3950 l1ce4h:
3951 call sub_1e50h ;1ce4
3952 jr c,l1cf2h ;1ce7
3953 call sub_1e25h ;1ce9
3954 jr nc,l1d23h ;1cec
3955 add a,b ;1cee
3956 jp l19d7h ;1cef
3957 l1cf2h:
3958 ld a,b ;1cf2
3959 add a,020h ;1cf3
3960 jp l1b99h ;1cf5
3961 l1cf8h:
3962 call sub_1e41h ;1cf8
3963 jr nc,l1d23h ;1cfb
3964 cp 006h ;1cfd
3965 jr z,l1d23h ;1cff
3966 rlca ;1d01
3967 rlca ;1d02
3968 rlca ;1d03
3969 add a,b ;1d04
3970 ld b,a ;1d05
3971 cp 078h ;1d06
3972 jr nz,l1d1ah ;1d08
3973 call sub_1ed1h ;1d0a
3974 call sub_1d26h ;1d0d
3975 jr c,l1d20h ;1d10
3976 call sub_1e06h ;1d12
3977 ld b,0dbh ;1d15
3978 jp l1a2fh ;1d17
3979 l1d1ah:
3980 call sub_1ed1h ;1d1a
3981 call sub_1d26h ;1d1d
3982 l1d20h:
3983 jp c,gen.opc.ED2 ;1d20
3984 l1d23h:
3985 jp ERROR ;1d23
3986 sub_1d26h:
3987 ld hl,t__C_ ;1d26
3988 jp sub_0a23h ;1d29
3989 l1d2ch:
3990 call sub_1d26h ;1d2c
3991 jr nc,l1d44h ;1d2f
3992 call sub_1ed1h ;1d31
3993 call sub_1e41h ;1d34
3994 jr nc,l1d23h ;1d37
3995 cp 006h ;1d39
3996 jr z,l1d23h ;1d3b
3997 rlca ;1d3d
3998 rlca ;1d3e
3999 rlca ;1d3f
4000 add a,b ;1d40
4001 jp l1b71h ;1d41
4002 l1d44h:
4003 call sub_1e06h ;1d44
4004 call sub_1ed1h ;1d47
4005 cp 041h ;1d4a
4006 jr nz,l1d23h ;1d4c
4007 inc de ;1d4e
4008 ld b,0d3h ;1d4f
4009 jp l1a2fh ;1d51
4010 l1d54h:
4011 ld hl,b_0x1D80_start ;1d54
4012 call sub_0a15h ;1d57
4013 jp nc,ERROR ;1d5a
4014 ld c,b ;1d5d
4015 call assert_eol ;1d5e
4016 ld b,000h ;1d61
4017 ld hl,b_0x1DA1_start ;1d63
4018 add hl,bc ;1d66
4019 add hl,bc ;1d67
4020 ld a,(hl) ;1d68
4021 comst ;1d69
4022 ld (iy+000h),a ;1d6d
4023 comend
4024 ld c,001h ;1d70
4025 inc hl ;1d72
4026 ld a,(hl) ;1d73
4027 and a ;1d74
4028 ret z ;1d75
4029 comst ;1d76
4030 ld (iy+001h),a ;1d7a
4031 comend
4032 ld c,002h ;1d7d
4033 ret ;1d7f
4034
4035 b_0x1D80_start:
4036 DC 'AF,AF'''
4037 l1d86h:
4038 DC 'DE,HL'
4039 DC '(SP),HL'
4040 DC '(SP),IX'
4041 DC '(SP),IY'
4042 db 000h ;1da0
4043
4044 b_0x1DA1_start:
4045 db 008h ;1da1
4046 db 000h ;1da2
4047 db 0ebh ;1da3
4048 db 000h ;1da4
4049 db 0e3h ;1da5
4050 db 000h ;1da6
4051 db 0ddh ;1da7
4052 db 0e3h ;1da8
4053 db 0fdh ;1da9
4054 db 0e3h ;1daa
4055 l1dabh:
4056 call sub_1e50h ;1dab
4057 jr c,l1dc6h ;1dae
4058 call sub_1e2eh ;1db0
4059 jr c,l1dd2h ;1db3
4060 call sub_1e41h ;1db5
4061 jr c,l1ddfh ;1db8
4062 call sub_1e68h ;1dba
4063 jp nc,ERROR ;1dbd
4064 ld a,b ;1dc0
4065 add a,030h ;1dc1
4066 jp l19ebh ;1dc3
4067 l1dc6h:
4068 ld a,b ;1dc6
4069 ld b,023h ;1dc7
4070 cp 004h ;1dc9
4071 jr z,l1dcfh ;1dcb
4072 ld b,02bh ;1dcd
4073 l1dcfh:
4074 jp l1aabh ;1dcf
4075 l1dd2h:
4076 push af ;1dd2
4077 ld a,b ;1dd3
4078 ld b,003h ;1dd4
4079 cp 004h ;1dd6
4080 jr z,l1ddch ;1dd8
4081 ld b,00bh ;1dda
4082 l1ddch:
4083 pop af ;1ddc
4084 jr l1de2h ;1ddd
4085 l1ddfh:
4086 rlca ;1ddf
4087 rlca ;1de0
4088 rlca ;1de1
4089 l1de2h:
4090 add a,b ;1de2
4091 jp l19d7h ;1de3
4092 sub_1de6h:
4093 call sub_1e12h ;1de6
4094 ld a,l ;1de9
4095 cp 008h ;1dea
4096 jr nc,error1 ;1dec
4097 ret ;1dee
4098 sub_1defh:
4099 call tst_EXPR ;1def
4100 push bc ;1df2
4101 push iy ;1df3
4102 pop bc ;1df5
4103 and a ;1df6
4104 sbc hl,bc ;1df7
4105 dec hl ;1df9
4106 dec hl ;1dfa
4107 pop bc ;1dfb
4108 call sub_1e15h ;1dfc
4109 ld a,h ;1dff
4110 xor l ;1e00
4111 bit 7,a ;1e01
4112 jr nz,error1 ;1e03
4113 ret ;1e05
4114 sub_1e06h:
4115 ld a,(de) ;1e06
4116 cp 028h ;1e07
4117 jr nz,sub_1e12h ;1e09
4118 inc de ;1e0b
4119 call sub_1e12h ;1e0c
4120 jp sub_1ed8h ;1e0f
4121
4122 sub_1e12h:
4123 call tst_EXPR ;1e12
4124 sub_1e15h:
4125 ld a,h ;1e15
4126 and a ;1e16
4127 ret z ;1e17
4128 inc a ;1e18
4129 ret z ;1e19
4130 jr error1 ;1e1a
4131
4132 tst_EXPR:
4133 push bc ;1e1c
4134 call EXPR ;1e1d
4135 pop bc ;1e20
4136 ret nc ;1e21
4137 error1:
4138 jp ERROR ;1e22
4139 sub_1e25h:
4140 push hl ;1e25
4141 ld hl,t_BC.DE.HL.AF ;1e26
4142 jr l1e32h ;1e29
4143 sub_1e2bh:
4144 push hl ;1e2b
4145 jr l1e32h ;1e2c
4146 sub_1e2eh:
4147 push hl ;1e2e
4148 ld hl,t_BC.DE.HL.SP ;1e2f
4149 l1e32h:
4150 push bc ;1e32
4151 call sub_0a15h ;1e33
4152 jr nc,l1e3eh ;1e36
4153 ld a,b ;1e38
4154 rlca ;1e39
4155 rlca ;1e3a
4156 rlca ;1e3b
4157 rlca ;1e3c
4158 scf ;1e3d
4159 l1e3eh:
4160 pop bc ;1e3e
4161 pop hl ;1e3f
4162 ret ;1e40
4163 sub_1e41h:
4164 call SKIPBL ;1e41
4165 push bc ;1e44
4166 push hl ;1e45
4167 ld hl,t_BCDEHL_HL_A ;1e46
4168 call sub_0a15h ;1e49
4169 ld a,b ;1e4c
4170 pop hl ;1e4d
4171 pop bc ;1e4e
4172 ret ;1e4f
4173 sub_1e50h:
4174 push hl ;1e50
4175 push bc ;1e51
4176 ld hl,t_IX.IY ;1e52
4177 call sub_0a15h ;1e55
4178 jr nc,l1e65h ;1e58
4179 ld a,0ddh ;1e5a
4180 dec b ;1e5c
4181 jr nz,l1e61h ;1e5d
4182 ld a,0fdh ;1e5f
4183 l1e61h:
4184 ld (pfx.IXY),a ;1e61
4185 scf ;1e64
4186 l1e65h:
4187 pop bc ;1e65
4188 pop hl ;1e66
4189 ret ;1e67
4190 sub_1e68h:
4191 push hl ;1e68
4192 push bc ;1e69
4193 ld a,(de) ;1e6a
4194 cp '(' ;1e6b
4195 jr nz,l1eb4h ;1e6d
4196 push de ;1e6f
4197 inc de ;1e70
4198 ld hl,t_IX.IY ;1e71
4199 call sub_0a15h ;1e74
4200 jr nc,l1eb3h ;1e77
4201 pop af ;1e79
4202 ld a,0ddh ;1e7a
4203 dec b ;1e7c
4204 jr nz,l1e81h ;1e7d
4205 ld a,0fdh ;1e7f
4206 l1e81h:
4207 ld (pfx.IXY),a ;1e81
4208 ld a,(de) ;1e84
4209 cp '+' ;1e85
4210 jr z,l1e95h ;1e87
4211 cp ')' ;1e89
4212 ld hl,0 ;1e8b
4213 jr z,l1eadh ;1e8e
4214 cp '-' ;1e90
4215 jp nz,ERROR ;1e92
4216 l1e95h:
4217 push af ;1e95
4218 inc de ;1e96
4219 call sub_1e12h ;1e97 get displacement
4220 pop af ;1e9a
4221 cp '+' ;1e9b
4222 jr z,l1ea7h ;1e9d
4223 ld b,h ;1e9f
4224 ld c,l ;1ea0
4225 ld hl,0 ;1ea1
4226 and a ;1ea4
4227 sbc hl,bc ;1ea5
4228 l1ea7h:
4229 ld a,(de) ;1ea7
4230 cp ')' ;1ea8
4231 jp nz,ERROR ;1eaa
4232 l1eadh:
4233 inc de ;1ead
4234 pop bc ;1eae
4235 ld c,l ;1eaf
4236 pop hl ;1eb0
4237 scf ;1eb1
4238 ret ;1eb2
4239 l1eb3h:
4240 pop de ;1eb3
4241 l1eb4h:
4242 pop bc ;1eb4
4243 pop hl ;1eb5
4244 and a ;1eb6
4245 ret ;1eb7
4246 sub_1eb8h:
4247 ld hl,t_tstfl_ZCPS ;1eb8
4248 ld c,007h ;1ebb
4249 jr l1ec4h ;1ebd
4250 sub_1ebfh:
4251 ld hl,t_tstfl_ZC ;1ebf
4252 ld c,003h ;1ec2
4253 l1ec4h:
4254 push bc ;1ec4
4255 call sub_0a15h ;1ec5
4256 ld a,b ;1ec8
4257 pop bc ;1ec9
4258 ret nc ;1eca
4259 and c ;1ecb
4260 rlca ;1ecc
4261 rlca ;1ecd
4262 rlca ;1ece
4263 scf ;1ecf
4264 ret ;1ed0
4265 sub_1ed1h:
4266 call skip_to_nextarg ;1ed1
4267 ret z ;1ed4
4268 l1ed5h:
4269 jp ERROR ;1ed5
4270 sub_1ed8h:
4271 ld a,(de) ;1ed8
4272 cp 029h ;1ed9
4273 jr nz,l1ed5h ;1edb
4274 inc de ;1edd
4275 ret ;1ede
4276 CMD.L:
4277 ld hl,CMD.L ;1edf
4278 ld (CMD_RPT),hl ;1ee2
4279 call EXPR ;1ee5
4280 jr nc,l1eedh ;1ee8
4281 ld hl,(lst.L) ;1eea
4282 l1eedh:
4283 push hl ;1eed
4284 pop iy ;1eee
4285 call skip_to_nextarg ;1ef0
4286 call sub_0aa5h ;1ef3
4287 jr nc,l1f17h ;1ef6
4288 call assert_eol ;1ef8
4289 ld b,010h ;1efb
4290 l1efdh:
4291 push bc ;1efd
4292 push iy ;1efe
4293 pop hl ;1f00
4294 push hl ;1f01
4295 call sub_1f3fh ;1f02
4296 call CRLF ;1f05
4297 pop iy ;1f08
4298 ld c,b ;1f0a
4299 ld b,000h ;1f0b
4300 add iy,bc ;1f0d
4301 ld (lst.L),iy ;1f0f
4302 pop bc ;1f13
4303 djnz l1efdh ;1f14
4304 ret ;1f16
4305 l1f17h:
4306 call assert_eol ;1f17
4307 ld h,b ;1f1a
4308 ld l,c ;1f1b
4309 ld a,b ;1f1c
4310 or c ;1f1d
4311 jr nz,l1f21h ;1f1e
4312 dec hl ;1f20
4313 l1f21h:
4314 push hl ;1f21
4315 push iy ;1f22
4316 pop hl ;1f24
4317 push hl ;1f25
4318 call sub_1f3fh ;1f26
4319 call CRLF ;1f29
4320 pop iy ;1f2c
4321 ld e,b ;1f2e
4322 ld d,000h ;1f2f
4323 add iy,de ;1f31
4324 ld (lst.L),iy ;1f33
4325 pop hl ;1f37
4326 and a ;1f38
4327 sbc hl,de ;1f39
4328 ret z ;1f3b
4329 ret c ;1f3c
4330 jr l1f21h ;1f3d
4331 sub_1f3fh:
4332 call out.hl.@ ;1f3f
4333 call z,OUTBL ;1f42
4334 call OUTBL ;1f45
4335 sub a ;1f48
4336 ld (CON.COL),a ;1f49
4337 call sub_1f77h ;1f4c
4338 and a ;1f4f
4339 ret z ;1f50
4340 l1f51h:
4341 call OUTBL ;1f51
4342 ld a,(CON.COL) ;1f54
4343 cp 010h ;1f57
4344 jr c,l1f51h ;1f59
4345 sub_1f5bh:
4346 ld de,(offs.@) ;1f5b
4347 ld a,d ;1f5f
4348 or e ;1f60
4349 ret z ;1f61
4350 ld a,'(' ;1f62
4351 call OUTCHAR ;1f64
4352 ld a,'@' ;1f67
4353 call OUTCHAR ;1f69
4354 and a ;1f6c
4355 sbc hl,de ;1f6d
4356 call out.hl ;1f6f
4357 ld a,')' ;1f72
4358 jp OUTCHAR ;1f74
4359 sub_1f77h:
4360 sub a ;1f77
4361 ld (XBE03),a ;1f78
4362 call sub_1f9eh ;1f7b
4363 jr nc,l1f91h ;1f7e
4364 push bc ;1f80
4365 call sub_2581h ;1f81
4366 ex de,hl ;1f84
4367 call sub_1fdbh ;1f85
4368 pop bc ;1f88
4369 ld a,(XBE03) ;1f89
4370 ld hl,(XBE01) ;1f8c
4371 scf ;1f8f
4372 ret ;1f90
4373 l1f91h:
4374 ld hl,b_0x1F9B_start ;1f91
4375 call PSTR ;1f94
4376 ld b,001h ;1f97
4377 sub a ;1f99
4378 ret ;1f9a
4379
4380 b_0x1F9B_start:
4381 DC '???'
4382
4383 sub_1f9eh:
4384 sub a ;1f9e
4385 ld (is.pfx.IXY),a ;1f9f
4386 comst ;1fa2
4387 ld a,(iy+000h) ;1fa6
4388 comend
4389 cp 0edh ;1fa9
4390 jp z,disas_pfx.ED ;1fab
4391 cp 0ddh ;1fae
4392 jr z,l1fc5h ;1fb0
4393 cp 0fdh ;1fb2
4394 jr z,l1fc9h ;1fb4
4395 sub_1fb6h:
4396 comst ;1fb6
4397 ld a,(iy+000h) ;1fba
4398 comend
4399 cp 0cbh ;1fbd
4400 jp z,l2061h ;1fbf
4401 jp l2078h ;1fc2
4402 l1fc5h:
4403 ld a,001h ;1fc5
4404 jr l1fcbh ;1fc7
4405 l1fc9h:
4406 ld a,002h ;1fc9
4407 l1fcbh:
4408 ld (is.pfx.IXY),a ;1fcb
4409 call sub_1fdch ;1fce
4410 ret nc ;1fd1
4411 push bc ;1fd2
4412 call sub_1fb6h ;1fd3
4413 pop af ;1fd6
4414 add a,b ;1fd7
4415 ld b,a ;1fd8
4416 scf ;1fd9
4417 ret ;1fda
4418
4419 sub_1fdbh:
4420 jp (hl) ;1fdb
4421
4422 sub_1fdch:
4423 inc iy ;1fdc
4424 ld hl,b_0x2011_start ;1fde
4425 call sub_20bbh ;1fe1
4426 ld b,002h ;1fe4
4427 ret c ;1fe6
4428 ld hl,l202ch ;1fe7
4429 call sub_20bbh ;1fea
4430 ld b,001h ;1fed
4431 ret c ;1fef
4432 comst ;1ff0
4433 ld a,(iy+000h) ;1ff4
4434 comend
4435 cp 0cbh ;1ff7
4436 jr nz,l200fh ;1ff9
4437 comst ;1ffb
4438 ld a,(iy+002h) ;1fff
4439 comend
4440 cp 036h ;2002
4441 ret z ;2004
4442 and 007h ;2005
4443 cp 006h ;2007
4444 jr nz,l200fh ;2009
4445 ld b,002h ;200b
4446 scf ;200d
4447 ret ;200e
4448 l200fh:
4449 and a ;200f
4450 ret ;2010
4451
4452 b_0x2011_start:
4453 db 034h ;2011
4454 db 035h ;2012
4455 db 036h ;2013
4456 db 046h ;2014
4457 db 04eh ;2015
4458 db 056h ;2016
4459 db 05eh ;2017
4460 db 066h ;2018
4461 db 06eh ;2019
4462 db 070h ;201a
4463 db 071h ;201b
4464 db 072h ;201c
4465 db 073h ;201d
4466 db 074h ;201e
4467 db 075h ;201f
4468 db 076h ;2020
4469 db 077h ;2021
4470 db 07eh ;2022
4471 db 086h ;2023
4472 db 08eh ;2024
4473 db 096h ;2025
4474 db 09eh ;2026
4475 db 0a6h ;2027
4476 db 0aeh ;2028
4477 db 0b6h ;2029
4478 db 0beh ;202a
4479 db 000h ;202b
4480 l202ch:
4481 db 009h ;202c
4482 db 019h ;202d
4483 db 021h ;202e
4484 db 022h ;202f
4485 db 023h ;2030
4486 db 029h ;2031
4487 db 02ah ;2032
4488 db 02bh ;2033
4489 db 039h ;2034
4490 db 0e1h ;2035
4491 db 0e3h ;2036
4492 db 0e5h ;2037
4493 db 0e9h ;2038
4494 db 0f9h ;2039
4495 db 000h ;203a
4496
4497 disas_pfx.ED:
4498 inc iy ;203b
4499 ld hl,b_0x2200_start ;203d
4500 call sub_209dh ;2040
4501 ld b,002h ;2043
4502 ret c ;2045
4503 ld hl,l2235h ;2046
4504 call lookup_opc ;2049
4505 ld b,002h ;204c
4506 ret c ;204e
4507 ld hl,l228bh ;204f
4508 call lookup_opc ;2052
4509 ld b,003h ;2055
4510 ret c ;2057
4511 ld hl,l22b4h ;2058
4512 call lookup_opc ;205b
4513 ld b,004h ;205e
4514 ret ;2060
4515 l2061h:
4516 push iy ;2061
4517 inc iy ;2063
4518 ld a,(is.pfx.IXY) ;2065
4519 and a ;2068
4520 jr z,l206dh ;2069
4521 inc iy ;206b
4522 l206dh:
4523 ld hl,l22c9h ;206d
4524 call lookup_opc ;2070
4525 pop iy ;2073
4526 ld b,002h ;2075
4527 ret ;2077
4528 l2078h:
4529 ld hl,b_0x218B_start ;2078
4530 call lookup_opc ;207b
4531 ld b,002h ;207e
4532 ret c ;2080
4533 ld hl,b_0x20ED_start ;2081
4534 call sub_209dh ;2084
4535 ld b,001h ;2087
4536 ret c ;2089
4537 ld hl,b_0x2108_start ;208a
4538 call lookup_opc ;208d
4539 ld b,001h ;2090
4540 ret c ;2092
4541 ld hl,b_0x21D2_start ;2093
4542 call lookup_opc ;2096
4543 ret nc ;2099
4544 ld b,003h ;209a
4545 ret ;209c
4546
4547 sub_209dh:
4548 ld a,(hl) ;209d
4549 cp 0ffh ;209e
4550 ret z ;20a0
4551 comst ;20a1
4552 cp (iy+000h) ;20a5
4553 comend
4554 jr z,l20aeh ;20a8
4555 inc hl ;20aa
4556 inc hl ;20ab
4557 jr sub_209dh ;20ac
4558 l20aeh:
4559 inc hl ;20ae
4560 ld c,(hl) ;20af
4561 ld hl,t_MNEMONICS ;20b0
4562 ld b,000h ;20b3
4563 add hl,bc ;20b5
4564 ld de,l230bh ;20b6
4565 scf ;20b9
4566 ret ;20ba
4567 sub_20bbh:
4568 ld a,(hl) ;20bb
4569 and a ;20bc
4570 ret z ;20bd
4571 inc hl ;20be
4572 comst ;20bf
4573 cp (iy+000h) ;20c3
4574 comend
4575 jr nz,sub_20bbh ;20c6
4576 scf ;20c8
4577 ret ;20c9
4578
4579 lookup_opc:
4580 comst ;20ca
4581 ld a,(iy+000h) ;20ce
4582 comend
4583 and (hl) ;20d1
4584 inc hl ;20d2
4585 cp (hl) ;20d3
4586 jr z,l20dfh ;20d4
4587 inc hl ;20d6
4588 inc hl ;20d7
4589 inc hl ;20d8
4590 inc hl ;20d9
4591 ld a,(hl) ;20da
4592 and a ;20db
4593 jr nz,lookup_opc ;20dc
4594 ret ;20de
4595 l20dfh:
4596 inc hl ;20df
4597 ld c,(hl) ;20e0
4598 inc hl ;20e1
4599 ld e,(hl) ;20e2
4600 inc hl ;20e3
4601 ld d,(hl) ;20e4
4602 ld hl,t_MNEMONICS ;20e5
4603 ld b,000h ;20e8
4604 add hl,bc ;20ea
4605 scf ;20eb
4606 ret ;20ec
4607
4608 b_0x20ED_start: ; 1 byte opcodes (no parameters)
4609 db 076h ;20ed halt
4610 db 039h ;20ee
4611 db 0d9h ;20ef exx
4612 db 036h ;20f0
4613 db 0f3h ;20f1 di
4614 db 02ch ;20f2
4615 db 0fbh ;20f3 ei
4616 db 032h ;20f4
4617 db 000h ;20f5 nop
4618 db 069h ;20f6
4619 db 007h ;20f7 rlca
4620 db 09eh ;20f8
4621 db 00fh ;20f9 rrca
4622 db 0adh ;20fa
4623 db 017h ;20fb rla
4624 db 098h ;20fc
4625 db 01fh ;20fd rra
4626 db 0a7h ;20fe
4627 db 027h ;20ff daa
4628 db 026h ;2100
4629 db 02fh ;2101 cpl
4630 db 023h ;2102
4631 db 037h ;2103 scf
4632 db 0bah ;2104
4633 db 03fh ;2105 ccf
4634 db 010h ;2106
4635 db 0ffh ;2107 EOT
4636
4637 b_0x2108_start: ; 1 byte opcodes
4638 defb 0c0h ;2108 ld r,r
4639 defb 040h ;2109
4640 defb 056h ;210a
4641 defw l22fch ;210b
4642
4643 defb 0f8h ;210d add a,r
4644 defb 080h ;210e
4645 defb 003h ;210f
4646 defw l2305h ;2110
4647
4648 defb 0f8h ;2112 adc a,r
4649 defb 088h ;2113
4650 defb 000h ;2114
4651 defw l2305h ;2115
4652
4653 defb 0f8h ;2117
4654 defb 090h ;2118
4655 defb 0c9h ;2119
4656 defw l24ebh ;211a
4657
4658 defb 0f8h ;211c
4659 defb 098h ;211d
4660 defb 0b7h ;211e
4661 defw l2305h ;211f
4662
4663 defb 0f8h ;2121
4664 defb 0a0h ;2122
4665 defb 006h ;2123
4666 defw l24ebh ;2124
4667
4668 defb 0f8h ;2126
4669 defb 0a8h ;2127
4670 defb 0cch ;2128
4671 defw l24ebh ;2129
4672
4673 defb 0f8h ;212b
4674 defb 0b0h ;212c
4675 defb 06ch ;212d
4676 defw l24ebh ;212e
4677
4678 defb 0f8h ;2130
4679 defb 0b8h ;2131
4680 defb 013h ;2132
4681 defw l24ebh ;2133
4682
4683 defb 0c7h ;2135
4684 defb 0c0h ;2136 ret cc
4685 defb 08bh ;2137
4686 defw l2561h ;2138
4687
4688 defb 0c7h ;213a rst
4689 defb 0c7h ;213b
4690 defb 0b4h ;213c
4691 defw l231eh ;213d
4692
4693 defb 0ffh ;213f ret
4694 defb 0c9h ;2140
4695 defb 08bh ;2141
4696 defw l230bh ;2142
4697
4698 defb 0cfh ;2144 pop rr
4699 defb 0c1h ;2145
4700 defb 081h ;2146
4701 defw l2546h ;2147
4702
4703 defb 0cfh ;2149 push rr
4704 defb 0c5h ;214a
4705 defb 084h ;214b
4706 defw l2546h ;214c
4707
4708 defb 0ffh ;214e ex (sp),hl
4709 defb 0e3h ;214f
4710 defb 034h ;2150
4711 defw l232ah ;2151
4712
4713 defb 0ffh ;2153 jp (hl)
4714 defb 0e9h ;2154
4715 defb 052h ;2155
4716 defw l2338h ;2156
4717
4718 defb 0ffh ;2158 ex de,hl
4719 defb 0ebh ;2159
4720 defb 034h ;215a
4721 defw l2345h ;215b
4722
4723 defb 0ffh ;215d ld sp,hl
4724 defb 0f9h ;215e
4725 defb 056h ;215f
4726 defw l234bh ;2160
4727
4728 defb 0cfh ;2162 inc rr
4729 defb 003h ;2163
4730 defb 041h ;2164
4731 defw l254bh ;2165
4732
4733 defb 0cfh ;2167 dec rr
4734 defb 00bh ;2168
4735 defb 029h ;2169
4736 defw l254bh ;216a
4737
4738 defb 0c7h ;216c inc r
4739 defb 004h ;216d
4740 defb 041h ;216e
4741 defw l24dfh ;216f
4742
4743 defb 0c7h ;2171 dec r
4744 defb 005h ;2172
4745 defb 029h ;2173
4746 defw l24dfh ;2174
4747
4748 defb 0ffh ;2176 ex af,af'
4749 defb 008h ;2177
4750 defb 034h ;2178
4751 defw l2357h ;2179
4752
4753 defb 0cfh ;217b add hl,rr
4754 defb 009h ;217c
4755 defb 003h ;217d
4756 defw l235dh ;217e
4757
4758 defb 0efh ;2180 ld (rr),a ;rr=bc,de
4759 defb 002h ;2181
4760 defb 056h ;2182
4761 defw l2366h ;2183
4762
4763 defb 0efh ;2185 ld a,(rr) ;rr=bc,de
4764 defb 00ah ;2186
4765 defb 056h ;2187
4766 defw l236fh ;2188
4767
4768 defb 000h ;218a EOT
4769
4770 b_0x218B_start: ; 2 byte opdodes
4771 defb 0c7h ;218b ld r,nn
4772 defb 006h ;218c
4773 defb 056h ;218d
4774 defw l2384h ;218e
4775
4776 defb 0ffh ;2190 add a,nn
4777 defb 0c6h ;2191
4778 defb 003h ;2192
4779 defw l237fh ;2193
4780
4781 defb 0ffh ;2195 adc a,nn
4782 defb 0ceh ;2196
4783 defb 000h ;2197
4784 defw l237fh ;2198
4785
4786 defb 0ffh ;219a sub a,nn
4787 defb 0d6h ;219b
4788 defb 0c9h ;219c
4789 defw l2397h ;219d
4790
4791 defb 0ffh ;219f
4792 defb 0deh ;21a0
4793 defb 0b7h ;21a1
4794 defw l237fh ;21a2
4795
4796 defb 0ffh ;21a4 and a,nn
4797 defb 0e6h ;21a5
4798 defb 006h ;21a6
4799 defw l2397h ;21a7
4800
4801 defb 0ffh ;21a9
4802 defb 0eeh ;21aa
4803 defb 0cch ;21ab
4804 defw l2397h ;21ac
4805
4806 defb 0ffh ;21ae
4807 defb 0f6h ;21af
4808 defb 06ch ;21b0
4809 defw l2397h ;21b1
4810
4811 defb 0ffh ;21b3 cp a,nn
4812 defb 0feh ;21b4
4813 defb 013h ;21b5
4814 defw l2397h ;21b6
4815
4816 defb 0ffh ;21b8 djnz
4817 defb 010h ;21b9
4818 defb 02eh ;21ba
4819 defw l23b0h ;21bb
4820
4821 defb 0ffh ;21bd jr
4822 defb 018h ;21be
4823 defb 054h ;21bf
4824 defw l23b0h ;21c0
4825
4826 defb 0e7h ;21c2 jr,cc
4827 defb 020h ;21c3
4828 defb 054h ;21c4
4829 defw l23a1h ;21c5
4830
4831 defb 0ffh ;21c7
4832 defb 0d3h ;21c8 out (nn),a
4833 defb 076h ;21c9
4834 defw l23d5h ;21ca
4835
4836 defb 0ffh ;21cc in a,(nn)
4837 defb 0dbh ;21cd
4838 defb 03fh ;21ce
4839 defw l23c3h ;21cf
4840
4841 defb 000h ;21d1 EOT
4842
4843 b_0x21D2_start: ; 3 byte opcodes
4844 defb 0c7h ;21d2
4845 defb 0c2h ;21d3
4846 defb 052h ;21d4
4847 defw l23e0h ;21d5
4848
4849 defb 0c7h ;21d7
4850 defb 0c4h ;21d8
4851 defb 00ch ;21d9
4852 defw l23e0h ;21da
4853
4854 defb 0cfh ;21dc
4855 defb 001h ;21dd
4856 defb 056h ;21de
4857 defw l23fch ;21df
4858
4859 defb 0ffh ;21e1
4860 defb 0c3h ;21e2
4861 defb 052h ;21e3
4862 defw l23e6h ;21e4
4863
4864 defb 0ffh ;21e6
4865 defb 0cdh ;21e7
4866 defb 00ch ;21e8
4867 defw l23e6h ;21e9
4868
4869 defb 0ffh ;21eb
4870 defb 022h ;21ec
4871 defb 056h ;21ed
4872 defw l2404h ;21ee
4873
4874 defb 0ffh ;21f0
4875 defb 02ah ;21f1
4876 defb 056h ;21f2
4877 defw l240dh ;21f3
4878
4879 defb 0ffh ;21f5
4880 defb 032h ;21f6
4881 defb 056h ;21f7
4882 defw l2416h ;21f8
4883
4884 defb 0ffh ;21fa
4885 defb 03ah ;21fb
4886 defb 056h ;21fc
4887 defw l2421h ;21fd
4888
4889 defb 000h ;21ff
4890
4891 b_0x2200_start: ; prefix ED + 1 byte opcode
4892 defb 044h ;2200 neg
4893 defb 066h ;2201
4894 defb 045h ;2202 retn
4895 defb 092h ;2203
4896 defb 04dh ;2204 reti
4897 defb 08eh ;2205
4898 defb 067h ;2206 rrd
4899 defb 0b1h ;2207
4900 defb 06fh ;2208 rld
4901 defb 0a2h ;2209
4902 defb 0a0h ;220a ldi
4903 defb 05fh ;220b
4904 defb 0a1h ;220c
4905 defb 01ch ;220d
4906 defb 0a2h ;220e
4907 defb 04bh ;220f
4908 defb 0a3h ;2210
4909 defb 07dh ;2211
4910 defb 0a8h ;2212 ldd
4911 defb 058h ;2213
4912 defb 0a9h ;2214
4913 defb 015h ;2215
4914 defb 0aah ;2216
4915 defb 044h ;2217
4916 defb 0abh ;2218
4917 defb 079h ;2219
4918 defb 0b0h ;221a ldir
4919 defb 062h ;221b
4920 defb 0b1h ;221c
4921 defb 01fh ;221d
4922 defb 0b2h ;221e
4923 defb 04eh ;221f
4924 defb 0b3h ;2220
4925 defb 072h ;2221
4926 defb 0b8h ;2222 lddr
4927 defb 05bh ;2223
4928 defb 0b9h ;2224
4929 defb 018h ;2225
4930 defb 0bah ;2226
4931 defb 047h ;2227
4932 defb 0bbh ;2228
4933 defb 06eh ;2229
4934 defb 08bh ;222a otdm
4935 defb 0d5h ;222b
4936 defb 09bh ;222c otdmr
4937 defb 0d9h ;222d
4938 defb 083h ;222e otim
4939 defb 0deh ;222f
4940 defb 093h ;2230 otimr
4941 defb 0e2h ;2231
4942 defb 076h ;2232 slp
4943 defb 0ebh ;2233
4944 defb 0ffh ;2234 EOT
4945
4946 l2235h:
4947 defb 0e7h ;2235 in r,(c) ;r=bcde
4948 defb 040h ;2236
4949 defb 03fh ;2237
4950 defw l2455h ;2238
4951
4952 defb 0f7h ;223a in r,(c) ;r=hl
4953 defb 060h ;223b
4954 defb 03fh ;223c
4955 defw l2455h ;223d
4956
4957 defb 0ffh ;223f in r,(c) ;r=a
4958 defb 078h ;2240
4959 defb 03fh ;2241
4960 defw l2455h ;2242
4961
4962 defb 0e7h ;2244
4963 defb 041h ;2245
4964 defb 076h ;2246
4965 defw l2461h ;2247
4966
4967 defb 0f7h ;2249
4968 defb 061h ;224a
4969 defb 076h ;224b
4970 defw l2461h ;224c
4971
4972 defb 0ffh ;224e out (c),r ;r=a
4973 defb 079h ;224f
4974 defb 076h ;2250
4975 defw l2461h ;2251
4976
4977 defb 0cfh ;2253 sbc hl,rr
4978 defb 042h ;2254
4979 defb 0b7h ;2255
4980 defw l246dh ;2256
4981
4982 defb 0cfh ;2258 adc hl,rr
4983 defb 04ah ;2259
4984 defb 000h ;225a
4985 defw l246dh ;225b
4986
4987 defb 0ffh ;225d im 0
4988 defb 046h ;225e
4989 defb 03dh ;225f
4990 defw l2427h ;2260
4991
4992 defb 0ffh ;2262 im 1
4993 defb 056h ;2263
4994 defb 03dh ;2264
4995 defw l242bh ;2265
4996
4997 defb 0ffh ;2267 im 2
4998 defb 05eh ;2268
4999 defb 03dh ;2269
5000 defw l242fh ;226a
5001
5002 defb 0ffh ;226c ld i,a
5003 defb 047h ;226d
5004 defb 056h ;226e
5005 defw l2434h ;226f
5006
5007 defb 0ffh ;2271
5008 defb 057h ;2272
5009 defb 056h ;2273
5010 defw l2439h ;2274
5011
5012 defb 0ffh ;2276
5013 defb 04fh ;2277
5014 defb 056h ;2278
5015 defw l243eh ;2279
5016
5017 defb 0ffh ;227b
5018 defb 05fh ;227c
5019 defb 056h ;227d
5020 defw l2443h ;227e
5021
5022 defb 0cfh ;2280 mlt rr
5023 defb 04ch ;2281
5024 defb 0d2h ;2282
5025 defw l254bh ;2283
5026
5027 defb 0c7h ;2285 tst r
5028 defb 004h ;2286
5029 defb 0eeh ;2287
5030 defw l24dfh ;2288
5031
5032 defb 000h ;228a
5033
5034 l228bh:
5035 defb 0e7h ;228b
5036 defb 000h ;228c
5037 defb 0cfh ;228d
5038
5039 b_0x228E_start:
5040 defw l230ch ;228e
5041
5042 b_0x2290_start:
5043 defb 0f7h ;2290
5044 defb 020h ;2291
5045 defb 0cfh ;2292
5046
5047 b_0x2293_start:
5048 defw l230ch ;2293
5049
5050 b_0x2295_start:
5051 defb 0ffh ;2295
5052 defb 038h ;2296
5053 defb 0cfh ;2297
5054
5055 b_0x2298_start:
5056 defw l230ch ;2298
5057
5058 b_0x229A_start:
5059 defb 0e7h ;229a
5060 defb 001h ;229b
5061 defb 0e7h ;229c
5062
5063 b_0x229D_start:
5064 defw l2315h ;229d
5065
5066 b_0x229F_start:
5067 defb 0f7h ;229f
5068 defb 021h ;22a0
5069 defb 0e7h ;22a1
5070
5071 b_0x22A2_start:
5072 defw l2315h ;22a2
5073
5074 b_0x22A4_start:
5075 defb 0ffh ;22a4
5076 defb 039h ;22a5
5077 defb 0e7h ;22a6
5078
5079 b_0x22A7_start:
5080 defw l2315h ;22a7
5081
5082 b_0x22A9_start:
5083 defb 0ffh ;22a9
5084 defb 064h ;22aa
5085 defb 0eeh ;22ab
5086
5087 b_0x22AC_start:
5088 defw l2397h ;22ac
5089
5090 b_0x22AE_start:
5091 defb 0ffh ;22ae
5092 defb 074h ;22af
5093 defb 0f1h ;22b0
5094
5095 b_0x22B1_start:
5096 defw l2397h ;22b1
5097
5098 b_0x22B3_start:
5099 defb 000h ;22b3
5100 l22b4h:
5101 defb 0efh ;22b4
5102 defb 043h ;22b5
5103 defb 056h ;22b6
5104
5105 b_0x22B7_start:
5106 defw l2476h ;22b7
5107
5108 b_0x22B9_start:
5109 defb 0ffh ;22b9
5110 defb 073h ;22ba
5111 defb 056h ;22bb
5112
5113 b_0x22BC_start:
5114 defw l2476h ;22bc
5115
5116 b_0x22BE_start:
5117 defb 0efh ;22be
5118 defb 04bh ;22bf
5119 defb 056h ;22c0
5120
5121 b_0x22C1_start:
5122 defw l247fh ;22c1
5123
5124 b_0x22C3_start:
5125 defb 0ffh ;22c3
5126 defb 07bh ;22c4
5127 defb 056h ;22c5
5128
5129 b_0x22C6_start:
5130 defw l247fh ;22c6
5131
5132 b_0x22C8_start:
5133 defb 000h ;22c8
5134 l22c9h:
5135 defb 0f8h ;22c9
5136 defb 000h ;22ca
5137 defb 09bh ;22cb
5138
5139 b_0x22CC_start:
5140 defw l24aeh ;22cc
5141
5142 b_0x22CE_start:
5143 defb 0f8h ;22ce
5144 defb 008h ;22cf
5145 defb 0aah ;22d0
5146
5147 b_0x22D1_start:
5148 defw l24aeh ;22d1
5149
5150 b_0x22D3_start:
5151 defb 0f8h ;22d3
5152 defb 010h ;22d4
5153 defb 096h ;22d5
5154
5155 b_0x22D6_start:
5156 defw l24aeh ;22d6
5157
5158 b_0x22D8_start:
5159 defb 0f8h ;22d8
5160 defb 018h ;22d9
5161 defb 0a5h ;22da
5162
5163 b_0x22DB_start:
5164 defw l24aeh ;22db
5165
5166 b_0x22DD_start:
5167 defb 0f8h ;22dd
5168 defb 020h ;22de
5169 defb 0c0h ;22df
5170
5171 b_0x22E0_start:
5172 defw l24aeh ;22e0
5173
5174 b_0x22E2_start:
5175 defb 0f8h ;22e2
5176 defb 028h ;22e3
5177 defb 0c3h ;22e4
5178
5179 b_0x22E5_start:
5180 defw l24aeh ;22e5
5181
5182 b_0x22E7_start:
5183 defb 0f8h ;22e7
5184 defb 038h ;22e8
5185 defb 0c6h ;22e9
5186
5187 b_0x22EA_start:
5188 defw l24aeh ;22ea
5189
5190 b_0x22EC_start:
5191 defb 0c0h ;22ec
5192 defb 040h ;22ed
5193 defb 009h ;22ee
5194
5195 b_0x22EF_start:
5196 defw l2487h ;22ef
5197
5198 b_0x22F1_start:
5199 defb 0c0h ;22f1
5200 defb 080h ;22f2
5201 defb 088h ;22f3
5202
5203 b_0x22F4_start:
5204 defw l2487h ;22f4
5205
5206 b_0x22F6_start:
5207 defb 0c0h ;22f6
5208 defb 0c0h ;22f7
5209 defb 0bdh ;22f8
5210
5211 b_0x22F9_start:
5212 defw l2487h ;22f9
5213
5214 b_0x22FB_start:
5215 defb 000h ;22fb
5216 l22fch:
5217 call l24dfh ;22fc
5218 call sub_257ch ;22ff
5219 jp l24ebh ;2302
5220 l2305h:
5221 call sub_2579h ;2305
5222 jp l24ebh ;2308
5223 l230bh:
5224 ret ;230b
5225 l230ch:
5226 call l24dfh ;230c
5227 call sub_257ch ;230f
5228 jp l23c6h ;2312
5229 l2315h:
5230 call l23c6h ;2315
5231 call sub_257ch ;2318
5232 jp l24dfh ;231b
5233 l231eh:
5234 comst ;231e
5235 ld a,(iy+000h) ;2322
5236 comend
5237 and 038h ;2325
5238 jp out.hex ;2327
5239 l232ah:
5240 ld hl,b_0x2333_start ;232a
5241 call PSTR ;232d
5242 jp l253eh ;2330
5243
5244 b_0x2333_start:
5245 DC '(SP),'
5246
5247 l2338h:
5248 ld a,'(' ;2338
5249 call OUTCHAR ;233a
5250 call l253eh ;233d
5251 ld a,')' ;2340
5252 jp OUTCHAR ;2342
5253 l2345h:
5254 ld hl,l1d86h ;2345
5255 jp PSTR ;2348
5256 l234bh:
5257 ld hl,b_0x2354_start ;234b
5258 call PSTR ;234e
5259 jp l253eh ;2351
5260
5261 b_0x2354_start:
5262 DC 'SP,'
5263
5264 l2357h:
5265 ld hl,b_0x1D80_start ;2357
5266 jp PSTR ;235a
5267 l235dh:
5268 call l253eh ;235d
5269 call sub_257ch ;2360
5270 jp l254bh ;2363
5271 l2366h:
5272 call sub_2372h ;2366
5273 call sub_257ch ;2369
5274 jp l23dbh ;236c
5275 l236fh:
5276 call sub_2579h ;236f
5277 sub_2372h:
5278 ld a,'(' ;2372
5279 call OUTCHAR ;2374
5280 call l254bh ;2377
5281 ld a,')' ;237a
5282 jp OUTCHAR ;237c
5283 l237fh:
5284 call sub_2579h ;237f
5285 jr l2397h ;2382
5286 l2384h:
5287 call l24dfh ;2384
5288 call sub_257ch ;2387
5289 ld a,(is.pfx.IXY) ;238a
5290 and a ;238d
5291 comst ;238e
5292 ld a,(iy+002h) ;2392
5293 comend
5294 jr nz,l239eh ;2395
5295 l2397h:
5296 comst ;2397
5297 ld a,(iy+001h) ;239b
5298 comend
5299 l239eh:
5300 jp out.hex ;239e
5301 l23a1h:
5302 comst ;23a1
5303 ld a,(iy+000h) ;23a5
5304 comend
5305 and 018h ;23a8
5306 call sub_2568h ;23aa
5307 call sub_257ch ;23ad
5308 l23b0h:
5309 comst ;23b0
5310 ld c,(iy+001h) ;23b4
5311 comend
5312 ld a,c ;23b7
5313 rla ;23b8
5314 sbc a,a ;23b9
5315 ld b,a ;23ba
5316 push iy ;23bb
5317 pop hl ;23bd
5318 add hl,bc ;23be
5319 inc hl ;23bf
5320 inc hl ;23c0
5321 jr l23f0h ;23c1
5322 l23c3h:
5323 call sub_2579h ;23c3
5324 l23c6h:
5325 ld a,028h ;23c6
5326 call OUTCHAR ;23c8
5327 comst ;23cb
5328 ld a,(iy+001h) ;23cf
5329 comend
5330 jp l252bh ;23d2
5331 l23d5h:
5332 call l23c6h ;23d5
5333 call sub_257ch ;23d8
5334 l23dbh:
5335 ld a,041h ;23db
5336 jp OUTCHAR ;23dd
5337 l23e0h:
5338 call l2561h ;23e0
5339 call sub_257ch ;23e3
5340 l23e6h:
5341 comst ;23e6
5342 ld l,(iy+001h) ;23ea
5343 ld h,(iy+002h) ;23ed
5344 comend
5345 l23f0h:
5346 ld a,002h ;23f0
5347 sub_23f2h:
5348 ld (XBE03),a ;23f2
5349 ld (XBE01),hl ;23f5
5350 call out.hl ;23f8
5351 ret ;23fb
5352 l23fch:
5353 call l254bh ;23fc
5354 call sub_257ch ;23ff
5355 jr l23e6h ;2402
5356 l2404h:
5357 call sub_24c6h ;2404
5358 call sub_257ch ;2407
5359 jp l253eh ;240a
5360 l240dh:
5361 call l253eh ;240d
5362 call sub_257ch ;2410
5363 jp sub_24c6h ;2413
5364 l2416h:
5365 call sub_24c6h ;2416
5366 call sub_257ch ;2419
5367 ld a,041h ;241c
5368 jp OUTCHAR ;241e
5369 l2421h:
5370 call sub_2579h ;2421
5371 jp sub_24c6h ;2424
5372 l2427h:
5373 ld a,030h ;2427
5374 jr l2431h ;2429
5375 l242bh:
5376 ld a,031h ;242b
5377 jr l2431h ;242d
5378 l242fh:
5379 ld a,032h ;242f
5380 l2431h:
5381 jp OUTCHAR ;2431
5382 l2434h:
5383 ld hl,b_0x2449_start ;2434
5384 jr l2446h ;2437
5385 l2439h:
5386 ld hl,l244ch ;2439
5387 jr l2446h ;243c
5388 l243eh:
5389 ld hl,l244fh ;243e
5390 jr l2446h ;2441
5391 l2443h:
5392 ld hl,l2452h ;2443
5393 l2446h:
5394 jp PSTR ;2446
5395
5396 b_0x2449_start:
5397 DC 'I,A'
5398 l244ch:
5399 DC 'A,I'
5400 l244fh:
5401 DC 'R,A'
5402 l2452h:
5403 DC 'A,R'
5404
5405 l2455h:
5406 call l24dfh ;2455
5407 call sub_257ch ;2458
5408 ld hl,t__C_ ;245b
5409 jp PSTR ;245e
5410 l2461h:
5411 ld hl,t__C_ ;2461
5412 call PSTR ;2464
5413 call sub_257ch ;2467
5414 jp l24dfh ;246a
5415 l246dh:
5416 call l253eh ;246d
5417 call sub_257ch ;2470
5418 jp l254bh ;2473
5419 l2476h:
5420 call sub_24c6h ;2476
5421 call sub_257ch ;2479
5422 jp l254bh ;247c
5423 l247fh:
5424 call l254bh ;247f
5425 call sub_257ch ;2482
5426 jr sub_24c6h ;2485
5427 l2487h:
5428 ld a,(is.pfx.IXY) ;2487
5429 and a ;248a
5430 jr nz,l2496h ;248b
5431 comst ;248d
5432 ld a,(iy+001h) ;2491
5433 comend
5434 jr l249dh ;2494
5435 l2496h:
5436 comst ;2496
5437 ld a,(iy+002h) ;249a
5438 comend
5439 l249dh:
5440 push af ;249d
5441 rra ;249e
5442 rra ;249f
5443 rra ;24a0
5444 and 007h ;24a1
5445 add a,'0' ;24a3
5446 call OUTCHAR ;24a5
5447 call sub_257ch ;24a8
5448 pop af ;24ab
5449 jr l24f2h ;24ac
5450 l24aeh:
5451 ld a,(is.pfx.IXY) ;24ae
5452 and a ;24b1
5453 jr nz,l24bdh ;24b2
5454 comst ;24b4
5455 ld a,(iy+001h) ;24b8
5456 comend
5457 jr l24c4h ;24bb
5458 l24bdh:
5459 comst ;24bd
5460 ld a,(iy+002h) ;24c1
5461 comend
5462 l24c4h:
5463 jr l24f2h ;24c4
5464 sub_24c6h:
5465 ld a,'(' ;24c6
5466 call OUTCHAR ;24c8
5467 comst ;24cb
5468 ld l,(iy+001h) ;24cf
5469 ld h,(iy+002h) ;24d2
5470 comend
5471 ld a,001h ;24d5
5472 call sub_23f2h ;24d7
5473 ld a,')' ;24da
5474 jp OUTCHAR ;24dc
5475 l24dfh:
5476 comst ;24df
5477 ld a,(iy+000h) ;24e3
5478 comend
5479 rra ;24e6
5480 rra ;24e7
5481 rra ;24e8
5482 jr l24f2h ;24e9
5483 l24ebh:
5484 comst ;24eb
5485 ld a,(iy+000h) ;24ef
5486 comend
5487 l24f2h:
5488 and 007h ;24f2
5489 cp 006h ;24f4
5490 jr nz,l2533h ;24f6
5491 ld a,(is.pfx.IXY) ;24f8
5492 and a ;24fb
5493 ld a,006h ;24fc
5494 jr z,l2533h ;24fe
5495 ld hl,b_0x2538_start ;2500
5496 ld a,(is.pfx.IXY) ;2503
5497 dec a ;2506
5498 jr z,l250ch ;2507
5499 ld hl,b_0x253B_start ;2509
5500 l250ch:
5501 call PSTR ;250c
5502 comst ;250f
5503 ld a,(iy+001h) ;2513
5504 comend
5505 and a ;2516
5506 push af ;2517
5507 jp m,l2523h ;2518
5508 ld a,'+' ;251b
5509 call OUTCHAR ;251d
5510 pop af ;2520
5511 jr l252bh ;2521
5512 l2523h:
5513 ld a,'-' ;2523
5514 call OUTCHAR ;2525
5515 pop af ;2528
5516 neg ;2529
5517 l252bh:
5518 call out.hex ;252b
5519 ld a,')' ;252e
5520 jp OUTCHAR ;2530
5521 l2533h:
5522 ld hl,t_BCDEHL_HL_A ;2533
5523 jr l2572h ;2536
5524
5525 b_0x2538_start:
5526 DC '(IX'
5527 b_0x253B_start:
5528 DC '(IY'
5529
5530 l253eh:
5531 ld a,(is.pfx.IXY) ;253e
5532 ld hl,t_HL.IX.IY ;2541
5533 jr l2572h ;2544
5534 l2546h:
5535 ld hl,t_BC.DE.HL.AF ;2546
5536 jr l254eh ;2549
5537 l254bh:
5538 ld hl,t_BC.DE.HL.SP ;254b
5539 l254eh:
5540 comst ;254e
5541 ld a,(iy+000h) ;2552
5542 comend
5543 rra ;2555
5544 rra ;2556
5545 rra ;2557
5546 rra ;2558
5547 and 003h ;2559
5548 cp 002h ;255b
5549 jr z,l253eh ;255d
5550 jr l2572h ;255f
5551 l2561h:
5552 comst ;2561
5553 ld a,(iy+000h) ;2565
5554 comend
5555 sub_2568h:
5556 rra ;2568
5557 rra ;2569
5558 rra ;256a
5559 and 007h ;256b
5560 ld hl,t_tstfl_ZCPS ;256d
5561 jr l2572h ;2570
5562 l2572h:
5563 ld b,a ;2572
5564 call sub_0a48h ;2573
5565 jp PSTR ;2576
5566 sub_2579h:
5567 call l23dbh ;2579
5568 sub_257ch:
5569 ld a,',' ;257c
5570 jp OUTCHAR ;257e
5571 sub_2581h:
5572 call PSTR ;2581
5573 l2584h:
5574 call OUTBL ;2584
5575 inc c ;2587
5576 ld a,c ;2588
5577 cp 006h ;2589
5578 jr nz,l2584h ;258b
5579 ret ;258d
5580
5581 t_MNEMONICS:
5582 DC 'ADC'
5583 DC 'ADD'
5584 DC 'AND'
5585 DC 'BIT'
5586 DC 'CALL'
5587 DC 'CCF'
5588 DC 'CP'
5589 DC 'CPD'
5590 DC 'CPDR'
5591 DC 'CPI'
5592 DC 'CPIR'
5593 DC 'CPL'
5594 DC 'DAA'
5595 DC 'DEC'
5596 DC 'DI'
5597 DC 'DJNZ'
5598 DC 'EI'
5599 DC 'EX'
5600 DC 'EXX'
5601 DC 'HALT'
5602 DC 'IM'
5603 DC 'IN'
5604 DC 'INC'
5605 DC 'IND'
5606 DC 'INDR'
5607 DC 'INI'
5608 DC 'INIR'
5609 DC 'JP'
5610 DC 'JR'
5611 DC 'LD'
5612 DC 'LDD'
5613 DC 'LDDR'
5614 DC 'LDI'
5615 DC 'LDIR'
5616 DC 'NEG'
5617 DC 'NOP'
5618 DC 'OR'
5619 DC 'OTDR'
5620 DC 'OTIR'
5621 DC 'OUT'
5622 DC 'OUTD'
5623 DC 'OUTI'
5624 DC 'POP'
5625 DC 'PUSH'
5626 DC 'RES'
5627 DC 'RET'
5628 DC 'RETI'
5629 DC 'RETN'
5630 DC 'RL'
5631 DC 'RLA'
5632 DC 'RLC'
5633 DC 'RLCA'
5634 DC 'RLD'
5635 DC 'RR'
5636 DC 'RRA'
5637 DC 'RRC'
5638 DC 'RRCA'
5639 DC 'RRD'
5640 DC 'RST'
5641 DC 'SBC'
5642 DC 'SCF'
5643 DC 'SET'
5644 DC 'SLA'
5645 DC 'SRA'
5646 DC 'SRL'
5647 DC 'SUB'
5648 DC 'XOR'
5649 DC 'IN0'
5650 DC 'MLT'
5651 DC 'OTDM'
5652 DC 'OTDMR'
5653 DC 'OTIM'
5654 DC 'OTIMR'
5655 DC 'OUT0'
5656 DC 'SLP'
5657 DC 'TST'
5658 DC 'TSTIO'
5659 DB 0
5660
5661 t_BCDEHL_HL_A:
5662 DC 'B'
5663 DC 'C'
5664 DC 'D'
5665 DC 'E'
5666 DC 'H'
5667 DC 'L'
5668 DC '(HL)'
5669 DC 'A'
5670 DB 0
5671 t_BC.DE.HL.SP:
5672 DC 'BC'
5673 DC 'DE'
5674 DC 'HL'
5675 DC 'SP'
5676 DB 0
5677 t_BC.DE.HL.AF:
5678 DC 'BC'
5679 DC 'DE'
5680 t_HL.AF:
5681 DC 'HL'
5682 DC 'AF'
5683 DB 0
5684 t_BC.DE.IY.SP:
5685 DC 'BC'
5686 DC 'DE'
5687 DC 'IY'
5688 DC 'SP'
5689 DB 0
5690 t_BC.DE.IX.SP:
5691 DC 'BC'
5692 DC 'DE'
5693 DC 'IX'
5694 DC 'SP'
5695 DB 0
5696 t_HL.IX.IY:
5697 DC 'HL'
5698 t_IX.IY:
5699 DC 'IX'
5700 DC 'IY'
5701 DB 0
5702 t_tstfl_ZC:
5703 DC 'NZ'
5704 DC 'Z'
5705 DC 'NC'
5706 DC 'C'
5707 DC 'NE'
5708 DC 'EQ'
5709 DC 'GE'
5710 DC 'LT'
5711 DB 0
5712 t_tstfl_ZCPS:
5713 DC 'NZ'
5714 DC 'Z'
5715 DC 'NC'
5716 DC 'C'
5717 DC 'PO'
5718 DC 'PE'
5719 DC 'P'
5720 DC 'M'
5721 DC 'NE'
5722 DC 'EQ'
5723 DC 'GE'
5724 DC 'LT'
5725 DC 'NV'
5726 DC 'V'
5727 DB 0
5728 t__C_:
5729 DC '(C)'
5730 DB 0
5731
5732 sub_26e7h:
5733 ld hl,(REG.PC) ;26e7
5734 ld a,h ;26ea
5735 or l ;26eb
5736 jr z,l2715h ;26ec
5737 ld iy,(REG.PC) ;26ee
5738 call sub_1f9eh ;26f2
5739 jp nc,ERROR ;26f5
5740 ld c,b ;26f8
5741 ld b,000h ;26f9
5742 ld hl,(REG.PC) ;26fb
5743 add hl,bc ;26fe
5744 call sub_1117h ;26ff
5745 ld iy,(REG.PC) ;2702
5746 ld hl,b_0x2717_start ;2706
5747 call lookup_opc ;2709
5748 ccf ;270c
5749 ret c ;270d
5750 ex de,hl ;270e
5751 call CALL.HL ;270f
5752 call c,sub_1117h ;2712
5753 l2715h:
5754 scf ;2715
5755 ret ;2716
5756
5757 b_0x2717_start:
5758 db 0ffh ;2717
5759 db 0ddh ;2718
5760 db 000h ;2719
5761 dw x278d
5762
5763 db 0ffh ;271c
5764 db 0fdh ;271d
5765 db 000h ;271e
5766 dw x2792
5767
5768 db 0ffh ;2721
5769 db 0edh ;2722
5770 db 000h ;2723
5771 dw x27a2
5772
5773 l2726h:
5774 db 0ffh ;2726
5775 db 0cdh ;2727
5776 db 000h ;2728
5777 dw x275e
5778
5779 db 0ffh ;272b
5780 db 0c3h ;272c
5781 db 000h ;272d
5782 dw x2769
5783
5784 db 0ffh ;2730
5785 db 0e9h ;2731
5786 db 000h ;2732
5787 dw x2788
5788
5789 db 0ffh ;2735
5790 db 0c9h ;2736
5791 db 000h ;2737
5792 dw x27c9
5793
5794 db 0ffh ;273a
5795 db 0cfh ;273b
5796 db 000h ;273c
5797 dw x280e
5798
5799 db 0c7h ;273f
5800 db 0c7h ;2740
5801 db 000h ;2741
5802 dw x27ea
5803
5804 db 0c7h ;2744
5805 db 0c4h ;2745
5806 db 000h ;2746
5807 dw x275e
5808
5809 db 0f7h ;2749
5810 db 010h ;274a
5811 db 000h ;274b
5812 dw x2775
5813
5814 db 0e7h ;274e
5815 db 020h ;274f
5816 db 000h ;2750
5817 dw x2775
5818
5819 db 0c7h ;2753
5820 db 0c2h ;2754
5821 db 000h ;2755
5822 dw x2769
5823
5824 db 0c7h ;2758
5825 db 0c0h ;2759
5826 db 000h ;275a
5827 dw x27b3
5828
5829 db 000h ;275d
5830
5831 x275e:
5832 ld a,(XBFE8) ;275e
5833 and a ;2761
5834 jr nz,x2769 ;2762
5835 ld a,(TCFLG) ;2764
5836 and a ;2767
5837 ret nz ;2768
5838
5839 x2769:
5840 comst ;2769
5841 ld l,(iy+001h) ;276d
5842 ld h,(iy+002h) ;2770
5843 comend
5844 scf ;2773
5845 ret ;2774
5846
5847 x2775:
5848 comst ;2775
5849 ld c,(iy+001h) ;2779
5850 comend
5851 ld a,c ;277c
5852 rla ;277d
5853 sbc a,a ;277e
5854 ld b,a ;277f
5855 ld hl,(REG.PC) ;2780
5856 add hl,bc ;2783
5857 inc hl ;2784
5858 inc hl ;2785
5859 scf ;2786
5860 ret ;2787
5861
5862 x2788:
5863 ld hl,(REG.L) ;2788
5864 scf ;278b
5865 ret ;278c
5866
5867 x278d:
5868 ld hl,(reg.ix) ;278d
5869 jr l2795h ;2790
5870
5871 x2792:
5872 ld hl,(reg.iy) ;2792
5873 l2795h:
5874 comst ;2795
5875 ld a,(iy+001h) ;2799
5876 comend
5877 cp 0e9h ;279c
5878 scf ;279e
5879 ret z ;279f
5880 and a ;27a0
5881 ret ;27a1
5882
5883 x27a2:
5884 comst ;27a2
5885 ld a,(iy+001h) ;27a6
5886 comend
5887 cp 04dh ;27a9
5888 jr z,x27c9 ;27ab
5889 cp 045h ;27ad
5890 jr z,x27c9 ;27af
5891 and a ;27b1
5892 ret ;27b2
5893
5894 x27b3:
5895 comst ;27b3
5896 ld a,(iy+000h) ;27b7
5897 comend
5898 ld (XBEDD),a ;27ba
5899 ld hl,(REG.F) ;27bd
5900 push hl ;27c0
5901 pop af ;27c1
5902 call XBEDD ;27c2
5903 scf ;27c5
5904 jr c,x27c9 ;27c6
5905 ret ;27c8
5906
5907 x27c9:
5908 ld a,(XBFE8) ;27c9
5909 and a ;27cc
5910 jr nz,l27dah ;27cd
5911 ld a,(TCFLG) ;27cf
5912 and a ;27d2
5913 jr z,l27dah ;27d3
5914 call l27dah ;27d5
5915 pop hl ;27d8
5916 ret ;27d9
5917 l27dah:
5918 ld hl,(REG.SP) ;27da
5919 comst ;27dd
5920 ld e,(hl) ;27e1
5921 inc hl ;27e2
5922 ld d,(hl) ;27e3
5923 comend
5924 ex de,hl ;27e4
5925 call sub_1117h ;27e5
5926 and a ;27e8
5927 ret ;27e9
5928
5929 x27ea:
5930 ld a,(ddtrst) ;27ea
5931 comst ;27ed
5932 cp (iy+000h) ;27f1
5933 comend
5934 ret z ;27f4
5935 comst ;27f5
5936 ld a,(iy+000h) ;27f9
5937 comend
5938 and 038h ;27fc
5939 ld l,a ;27fe
5940 ld h,000h ;27ff
5941 ld a,(XBFE8) ;2801
5942 and a ;2804
5943 jr nz,l280ch ;2805
5944 ld a,(TCFLG) ;2807
5945 and a ;280a
5946 ret nz ;280b
5947 l280ch:
5948 scf ;280c
5949 ret ;280d
5950
5951 x280e:
5952 and a ;280e
5953 ret ;280f
5954
5955 CMD.C:
5956 ld hl,CMD.C ;2810
5957 ld a,001h ;2813
5958 jr l281bh ;2815
5959
5960 CMD.T:
5961 xor a ;2817
5962 ld hl,CMD.T ;2818
5963 l281bh:
5964 ld (CMD_RPT),hl ;281b
5965 ld (TCFLG),a ;281e
5966 ld a,(de) ;2821
5967 sub 'N' ;2822
5968 jr nz,l2827h ;2824
5969 inc de ;2826
5970 l2827h:
5971 ld (TCNFLG),a ;2827
5972 ld a,(de) ;282a
5973 sub 'J' ;282b
5974 jr nz,l2830h ;282d
5975 inc de ;282f
5976 l2830h:
5977 ld (TRJFLG),a ;2830
5978 call sub_289fh ;2833
5979 jr z,l283eh ;2836
5980 ld hl,1 ;2838
5981 call get_lastarg_def ;283b
5982 l283eh:
5983 ld (TCCSTR),hl ;283e
5984 sub a ;2841
5985 ld (XA747),a ;2842
5986 l2845h:
5987 call sub_26e7h ;2845
5988 jr l289ch ;2848
5989 l284ah:
5990 call sub_0e68h ;284a
5991 ld a,(TRJFLG) ;284d
5992 and a ;2850
5993 jr nz,l2864h ;2851
5994 ld iy,(REG.PC) ;2853
5995 call sub_28c1h ;2857
5996 jr z,l2864h ;285a
5997 ld hl,l2726h ;285c
5998 call lookup_opc ;285f
5999 jr nc,l2845h ;2862
6000 l2864h:
6001 ld a,(XBFEA) ;2864
6002 and a ;2867
6003 jr z,l2881h ;2868
6004 ld de,(TCCSTR) ;286a
6005 call EXPR ;286e
6006 ld a,h ;2871
6007 or l ;2872
6008 add a,0ffh ;2873
6009 sbc a,a ;2875
6010 ld hl,XBFEA ;2876
6011 xor (hl) ;2879
6012 bit 1,a ;287a
6013 jr z,l288ch ;287c
6014 l287eh:
6015 jp l102eh ;287e
6016 l2881h:
6017 ld hl,(TCCSTR) ;2881
6018 dec hl ;2884
6019 ld (TCCSTR),hl ;2885
6020 ld a,h ;2888
6021 or l ;2889
6022 jr z,l287eh ;288a
6023 l288ch:
6024 call sub_26e7h ;288c
6025 jr nc,l287eh ;288f
6026 ld a,(TCNFLG) ;2891
6027 ld b,a ;2894
6028 ld a,(XA747) ;2895
6029 or b ;2898
6030 ld (XA747),a ;2899
6031 l289ch:
6032 jp l1183h ;289c
6033
6034 sub_289fh:
6035 call SKIPBL ;289f
6036 xor a ;28a2
6037 ld (XBFEA),a ;28a3
6038 ld a,(de) ;28a6
6039 cp 'U' ;28a7
6040 jr z,l28aeh ;28a9
6041 cp 'W' ;28ab
6042 ret nz ;28ad
6043
6044 l28aeh:
6045 inc de ;28ae
6046 push af ;28af
6047 push de ;28b0
6048 call EXPR ;28b1
6049 jp c,ERROR ;28b4
6050 call assert_eol ;28b7
6051 pop hl ;28ba
6052 pop af ;28bb
6053 ld (XBFEA),a ;28bc
6054 sub a ;28bf
6055 ret ;28c0
6056
6057 sub_28c1h:
6058 comst
6059 ld a,(iy+000h)
6060 ld b,(iy+0001)
6061 comend
6062 cp 0edh
6063 jr z,l28dbh
6064 and 0dfh
6065 cp 0ddh
6066 ret nz
6067 ld a,b
6068 cp 0e9h
6069 ret
6070 l28dbh:
6071 ld a,b
6072 and 0f7h
6073 cp 045h
6074 ret
6075
6076 ?excom:
6077 ex (sp),hl ;28e7
6078 push af ;28e8
6079 push bc ;28e9
6080 push de ;28ea
6081 ld c,(hl) ;28eb
6082 ld b,000h ;28ec
6083 inc hl ;28ee
6084 ld a,?lcmax
6085 sub c
6086 ld de,?exeit ;28ef
6087 ldir
6088 ex de,hl
6089 ld (hl),018h
6090 inc hl
6091 ld (hl),a
6092 ex de,hl
6093 pop de ;28f7
6094 pop bc ;28f8
6095 pop af ;28f9
6096 ex (sp),hl ;28fa
6097 ?exclst:
6098 push hl ;28fb
6099 ld hl,(ubbr) ;2900
6100
6101 if ROMSYS
6102 push af ;28fc
6103 ld a,(uromen) ;28fd
6104 endif
6105 jp ?comcod ;2903
6106
6107 ;------------------------------------------
6108 ; ddtram
6109 ;------------------------------------------
6110
6111 vartab:
6112 dseg
6113 ddtram:
6114 ;todo:
6115 ; The following 2 params are changeable by user.
6116 ; Should these moved to top ram?
6117 ;
6118 ddtrst: inidat ;
6119 rst DRSTNUM ;rst used by ddtz
6120 inidate ;
6121 ddtei: inidat ;
6122 ei ;ints enabled/disabled while ddtz is running
6123 ret ;
6124 inidate ;
6125 offs.pc:
6126 inidat
6127 dw TPA
6128 inidate
6129 offs.@:
6130 inidat
6131 dw 0
6132 inidate
6133 CMD_ERR:
6134 inidat
6135 dw 0
6136 inidate
6137 CMD_RPT:
6138 inidat
6139 dw DDTZML
6140 inidate
6141 ci.buf:
6142 inidat
6143 db 80
6144 rept 83
6145 db 0
6146 endm
6147 inidate
6148 CON.COL:
6149 inidat
6150 db 0
6151 inidate
6152 XA747:
6153 inidat
6154 db 0
6155 inidate
6156 bp_tab:
6157 inidat
6158 rept BP_CNT
6159 db 0,0
6160 dw 0,0,0
6161 endm
6162 BP_SIZE equ 8
6163 inidate
6164 sexp1:
6165 inidat
6166 dw sexpbuf
6167 inidate
6168 sexp2:
6169 inidat
6170 dw sexpbuf
6171 inidate
6172 sexpbuf:
6173 inidat
6174 rept 128
6175 db 0
6176 endm
6177 inidate
6178 sexpbufe:
6179
6180 msg.Y:
6181 inidat
6182 dc 'Y0'
6183 inidate
6184 reg.Y:
6185 inidat
6186 rept 10
6187 dw 0
6188 endm
6189 inidate
6190 lst.S:
6191 inidat
6192 dw 0
6193 inidate
6194 lst.IP:
6195 inidat
6196 dw 0
6197 inidate
6198 lst.OP:
6199 inidat
6200 dw 0
6201 inidate
6202 lst.OD:
6203 inidat
6204 db 0
6205 inidate
6206 lst.Qj:
6207 inidat
6208 db 0
6209 inidate
6210 lst.D:
6211 inidat
6212 dw 0
6213 inidate
6214 HILOD:
6215 inidat
6216 dw 0
6217 inidate
6218 MAXLOD:
6219 inidat
6220 dw 0
6221 inidate
6222 XB068:
6223 inidat
6224 dw 0
6225 inidate
6226 lst.A:
6227 inidat
6228 dw 0
6229 inidate
6230 XB06C:
6231 inidat
6232 dw 0
6233 inidate
6234 pfx.IXY:
6235 inidat
6236 db 000h
6237 inidate
6238 is.pfx.IXY:
6239 inidat
6240 db 000h
6241 inidate
6242 lst.L:
6243 inidat
6244 dw 0
6245 inidate
6246 XBE01:
6247 inidat
6248 dw 0
6249 inidate
6250 XBE03:
6251 inidat
6252 db 000h
6253 inidate
6254 XBEDD:
6255 inidat
6256 ret ;ret cc
6257 and a
6258 pop hl
6259 inc hl
6260 jp (hl)
6261 inidate
6262 XBFE8:
6263 inidat
6264 db 0
6265 inidate
6266 TCFLG:
6267 inidat
6268 db 0
6269 inidate
6270 XBFEA:
6271 inidat
6272 db 0
6273 inidate
6274 TCCSTR:
6275 inidat
6276 dw 0
6277 inidate
6278 TCNFLG:
6279 inidat
6280 db 0
6281 inidate
6282 TRJFLG:
6283 inidat
6284 db 0
6285 inidate
6286 wstrtflg:
6287 inidat
6288 db 1
6289 inidate
6290
6291 cseg
6292 vartabe:
6293
6294 ;------------------------------------------
6295
6296 .phase sysram_start+stacksize
6297 $stack:
6298 $stcka equ $ - stacksize
6299
6300 curphse defl $
6301 .dephase
6302 sysramc:
6303 .phase curphse
6304 topcodbeg:
6305
6306 reg.l2: db 0 ; 0fe50h
6307 reg.h2: db 0 ; 0fe51h
6308 reg.e2: db 0 ; 0fe52h
6309 reg.d2: db 0 ; 0fe53h
6310 reg.c2: db 0 ; 0fe54h
6311 reg.b2: db 0 ; 0fe55h
6312 reg.f2: db 0 ; 0fe56h
6313 reg.a2: db 0 ; 0fe57h
6314 db 0
6315 reg.i: db high ivtab
6316 reg.iy: dw 0 ; 0fe5ah
6317 reg.ix: dw 0 ; 0fe5ch
6318 reg.e: db 0 ; 0fe5eh
6319 reg.d: db 0 ; 0fe5fh
6320 reg.c: db 0 ; 0fe60h
6321 reg.b: db 0 ; 0fe61h
6322 if ROMSYS
6323 udcntl: db CWAITIO ; 0fe62h (mem-, io- wait)
6324 uromen: db ROM_DIS ; 0fe63h
6325 endif
6326 ubbr: db 0 ; 0fe64h
6327 ucbar: db USR$CBAR ; 0fe65h
6328 reg.f: db 0 ; 0fe66h
6329 reg.a: db 0 ; 0fe67h
6330 reg.l: db 0 ; 0fe68h
6331 reg.h: db 0 ; 0fe69h
6332 reg.sp: dw TOPRAM ; 0fe6ah
6333
6334 $go:
6335 if ROMSYS
6336 out (000h),a ;064c fe6c
6337 out0 (dcntl),l ;064e
6338 pop hl ;0651
6339 endif
6340 out0 (cbar),h ;0652
6341 out0 (bbr),l ;0655
6342 pop af ;0658
6343 pop hl ;0659
6344 ld sp,(reg.sp) ;065a
6345 reg.iff:
6346 ei ;065e
6347 db 0C3h ;jp TPA ;065f feff ($+1): reg.pc
6348 reg.pc:
6349 dw TPA
6350
6351 bpent:
6352 ld (reg.l),hl ;0662 fe82: bpent:
6353 pop hl ;0665
6354 dec hl ;0666
6355 ld (reg.pc),hl ;0667
6356 ld (reg.sp),sp ;066a
6357 ld sp,reg.l ;066e
6358 push af ;0671
6359 in0 h,(cbar) ;0672
6360 in0 l,(bbr) ;0675
6361 push hl ;0678
6362 ld a,SYS$CBAR ;0679
6363 out0 (cbar),a ;067b
6364
6365 if ROMSYS
6366 in0 l,(dcntl) ;067e
6367 ld a,CWAITROM+CWAITIO ;0681
6368 out0 (dcntl),a ;0683
6369 ld a,($crom) ;0686
6370 cp c$rom ;0689
6371 ld a,ROM_EN ;068b
6372 out (000h),a ;068d
6373 endif
6374
6375 jp bpddtz ;068f
6376
6377 ?comcod:
6378 if ROMSYS
6379 out (000h),a ;0692 feb2
6380 pop af ;069a
6381 endif
6382
6383 out0 (cbar),h ;0694
6384 out0 (bbr),l ;0697
6385 pop hl ;069b
6386 ?exeit:
6387 ds ?lcmax+2
6388 push af ;069f
6389 ld a,SYS$CBAR ;06a0
6390 out0 (cbar),a ;06a2
6391
6392 if ROMSYS
6393 ld a,ROM_EN ;06a5
6394 out (000h),a ;06a7
6395 endif
6396
6397 pop af ;06a9
6398 ret ;06aa
6399
6400 topcodend:
6401 curph defl $
6402 .dephase
6403 sysrame:
6404
6405 end
6406