4 extrn ?const,?conin,?cono
29 MEMDUMP_CNT equ 16 ;mem dump bytes per line
30 BP_CNT equ 12 ;number of breakbpoints
33 ;--------------------------------------------------
36 ; copy code to common memory and execute it there
43 ; mark end of common code snippet
63 ;----------------------------------------------------------
66 DB 'DDT/Z - HD64180 (ROM)'
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
98 ld a,(wstrtflg) ;check warm start flag
105 ld bc,topcodend-topcodbeg
125 ld (CMD_ERR),hl ;0767
127 ld (OFFS.pc),hl ;076d
129 ld hl,(CMD_RPT) ;0773
134 call nz,OUTCHAR ;0781
140 ld (CMD_RPT),hl ;0792
155 ld hl,(CMD_ERR) ;07ab
271 jr z,inl_e ;Accept line
273 jr z,inl_e ;Accept line
276 call DELC ;Delete Char
281 call DELC ;Delete Char
286 call DELL ;Delete Line
296 ld a,'^' ;Controll characters
434 call nz,sub_0917h ;0921
598 ld de,$stack-50 ;09ee
629 ld hl,b_0x132A_start ;0a0e
648 db 3eh ;0a26 ld a,0c5h
663 call z,sub_0d20h ;0a38
697 call get_arg_range ;0a59
700 call skip_to_nextarg ;0a5e
718 call get_arg_def ;0a74
735 db 0e6h ;0a87 and 037h (clear carry)
764 call skip_to_nextarg ;0aa5
799 call do_subexpr ;0acc
805 call do_subexpr ;0ad6
838 ld hl,tab_eq_le_ge ;0afb
860 ld hl,tab_func_eqlege ;0b1c
887 call do_binary_op ;0b3e
1021 ld hl,tab_op_a ;0bba
1024 ld hl,tab_func_opa ;0bc1
1036 defw do_op_add ;0bd6
1037 defw do_op_sub ;0bd8
1038 defw do_op_mlt ;0bda
1039 defw do_op_div ;0bdc
1040 defw do_op_mod ;0bde
1041 defw do_op_and ;0be0
1043 defw do_op_xor ;0be4
1047 call do_factor ;0be8
1053 call get.number ;0bf2
1062 ld hl,(MAXLOD) ;0c03
1068 ld hl,(offs.@) ;0c0f
1071 ld hl,(OFFS.pc) ;0c15
1075 jr z,fact_factneg ;0c1d
1077 jr z,fact_factinv ;0c21
1079 jr z,fact_factor ;0c25
1081 jr z,fact_reg.CPU ;0c29
1083 jr z,fact_reg.Y ;0c2d
1087 jp z,EXPR_BRCKT ;0c35 [ expression ]
1089 jr z,fact_factstring ;0c3a
1095 call get.decdigit ;0c3f
1134 call sub_1315h ;0c70
1147 call fact_factor ;0c80
1158 call fact_factor ;0c8b
1194 call get.hexdigit ;0cbe
1199 call get.hexdigit ;0cc4
1208 call get.hexdigit ;0cd5
1226 call get.decdigit ;0cec
1236 call get.decdigit ;0cfd
1243 call get.decdigit ;0d07
1247 add hl,hl ;0d0e hl *= 10
1295 call assert_eol ;0d41
1300 ld hl,b_0x0DFD_start ;0d4a
1301 ld de,b_0x0E1D_start ;0d4d
1304 call prnt_regs ;0d52
1308 ld iy,(REG.PC) ;0d59
1309 call sub_1f77h ;0d5d
1319 call prnt_regs ;0d6f
1326 call sub_1f5bh ;0d7c
1332 call prnt_flags ;0d85
1333 ld a,(reg.iff) ;0d88
1341 call prnt_flags ;0d98
1347 call sub_0dbeh ;0da1
1349 call sub_0dbeh ;0da6
1352 call sub_0dbeh ;0dad
1355 call sub_0dbeh ;0db4
1357 call sub_0dbeh ;0db9
1455 ld (REG.PC),hl ;0e51
1463 call sub_0f24h ;0e62
1470 ld a,(ix+000h) ;0e6e
1472 ld (ix+000h),a ;0e73
1473 call sub_11c5h ;0e76
1493 jp c,assert_eol ;0e99
1495 call sub_0ea7h ;0e9d
1497 call skip_to_nextarg ;0ea1
1507 ld e,(ix+002h) ;0eb0
1508 ld d,(ix+003h) ;0eb3
1512 ld (ix+000h),000h ;0ebb
1513 call sub_11c5h ;0ebf
1524 bit 0,(ix+000h) ;0ed1
1527 bit 4,(ix+000h) ;0ed9
1533 ld l,(ix+002h) ;0ee7
1534 ld h,(ix+003h) ;0eea
1539 ld l,(ix+004h) ;0ef8
1540 ld h,(ix+005h) ;0efb
1542 ld l,(ix+006h) ;0f01
1543 ld h,(ix+007h) ;0f04
1577 call nz,sub_0ea7h ;0f3d
1579 call sub_0f68h ;0f41
1581 ld (ix+002h),l ;0f45
1582 ld (ix+003h),h ;0f48
1583 call sub_0f80h ;0f4b
1584 ld (ix+004h),l ;0f4e
1585 ld (ix+005h),h ;0f51
1586 call sub_0f91h ;0f54
1587 ld (ix+006h),l ;0f57
1588 ld (ix+007h),h ;0f5a
1589 call skip_to_nextarg ;0f5d
1591 ld (ix+000h),a ;0f61
1598 ld a,(ix+000h) ;0f6e
1636 ld de,sexpbufe ;0fb1
1658 push hl ;save rom enable stat
1667 push hl ;save I register
1673 else ;NMOS Z80 design flaw
1674 call getiff ;return Carry set, if INTs are disabled.
1720 call prnt_cpustat ;1031
1725 DB CR,LF,'Undefined opcode trap'
1741 ld a,(ix+000h) ;1066
1744 ld e,(ix+002h) ;106d
1745 ld d,(ix+003h) ;1070
1746 ld hl,(REG.PC) ;1073
1749 call z,sub_1087h ;107a
1761 ld e,(ix+006h) ;108b
1762 ld d,(ix+007h) ;108e
1770 ld e,(ix+004h) ;109d
1771 ld d,(ix+005h) ;10a0
1776 ld (ix+004h),e ;10a8
1777 ld (ix+005h),d ;10ab
1779 bit 4,(ix+000h) ;10ae
1794 bit 5,(ix+000h) ;10c5
1795 res 5,(ix+000h) ;10c9
1797 ld l,(ix+002h) ;10cf
1798 ld h,(ix+003h) ;10d2
1804 ld a,(ix+001h) ;10df
1809 res 3,(ix+000h) ;10e7
1818 ld a,(ix+000h) ;10f9
1821 ld e,(ix+002h) ;1100
1822 ld d,(ix+003h) ;1103
1823 ld hl,(REG.PC) ;1106
1834 call sub_0f68h ;1117
1835 ld (ix+004h),001h ;111a
1836 ld (ix+005h),000h ;111e
1837 ld (ix+002h),l ;1122
1838 ld (ix+003h),h ;1125
1839 ld (ix+006h),000h ;1128
1840 ld (ix+007h),000h ;112c
1847 ld (ix+000h),a ;113a
1854 ld a,(ix+000h) ;1144
1857 set 5,(ix+000h) ;114a
1858 ld l,(ix+002h) ;114e
1859 ld h,(ix+003h) ;1151
1867 ld (ix+001h),e ;1159
1892 call nz,prnt_cpustat ;118b
1893 call sub_10f3h ;118e
1898 call sub_26e7h ;119a
1902 ld sp,$stack ;11a2 set/restore user cpu state
1930 jp $go ;11c2 common ram, switch banks and go to user prog
1933 ld a,(ix+000h) ;11c5
1936 ld e,(ix+006h) ;11cb
1937 ld d,(ix+007h) ;11ce
1945 ld (ix+006h),a ;11d8
1946 ld (ix+007h),a ;11db
1955 call sub_11ffh ;11ee
1970 ld e,(iy+006h) ;1204
1971 ld d,(iy+007h) ;1207
1979 ld (iy+006h),e ;1217
1980 ld (iy+007h),d ;121a
1984 call get.decdigit ;121e
1988 call assert_eol ;1225
1990 call sub_1248h ;1229
1993 call assert_eol ;122f
1997 call sub_1248h ;1234
2012 add a,'0'+080h ;124b
2025 call sub_1315h ;1260
2027 call assert_eol ;1266
2034 ld hl,b_0x132A_start ;1273
2035 call sub_0a48h ;1276
2080 ld (reg.iff),a ;12bb
2082 call sub_12d1h ;12bf
2089 call sub_12d1h ;12ca
2097 call assert_eol ;12d7
2104 ld hl,tab_pr_flags ;12e3
2126 ld (reg.iff),a ;1305
2135 call sub_0a0eh ;1315
2140 ld hl,b_0x136C_start ;131c
2271 call get_lastarg_def ;13d5
2288 jp z,assert_eol ;13f9
2298 call get_bytes_m ;1407
2302 call assert_eol ;140c
2312 ld (CMD_RPT),hl ;141e
2313 ld hl,(lst.IP) ;1421
2314 call get_lastarg_def ;1424
2315 ld (lst.IP),hl ;1427
2340 call out.bin.b ;144c
2344 ld (CMD_RPT),hl ;1455
2345 ld hl,(lst.OD) ;1458
2346 call get_arg_def ;145b
2350 call skip_to_nextarg ;1463
2351 ld hl,(lst.OP) ;1466
2352 call get_lastarg_def ;1469
2353 ld (lst.OP),hl ;146c
2382 call get_arg3 ;1490 get from, size, to
2420 push af ;14c9 save 'V' flag
2426 jr nc,bm_mvdown ;14d3
2446 jr z,cmp_mem ;14ed validate?
2451 call skip_to_nextarg ;14f6
2455 call assert_eol ;14fe
2469 call out.hl ;1511 val
2471 call sub_0928h ;1517 -val
2473 call out.hl.dec ;151d dec
2475 call out.hl.decm ;1523 -dec
2477 call out.bin.w ;1529 bin
2480 call out.ascii ;1530
2490 call get_arg_range ;153f
2493 call sub_15a7h ;1544
2496 call sub_1594h ;1548
2506 ld bc,MEMDUMP_CNT ;1559
2523 call get_arg_range ;156c
2526 call sub_15a7h ;1571
2573 ld hl,ci.buf+1 ;15a7
2574 call get_bytes ;15aa
2575 ld de,ci.buf+1 ;15ad
2583 db 0e6h ;15b8 and 037h (clear carry, skip next opc)
2588 call skip_to_nextarg ;15bb
2593 call sub_0a68h ;15c4
2676 ld (CMD_RPT),hl ;162f
2679 call sub_0a82h ;1638
2716 call sub_168fh ;1673
2744 ; Read Intel Hex File from console.
2747 call get_lastarg_def ;169e get offset from command line
2752 call i.getchar ;16a8
2755 jr nz,w_recstart ;16af
2756 ld c,0 ;16b1 init checksum
2757 call i.gethexbyte ;16b3 record len
2759 call i.gethexbyte ;16b7 address high
2761 call i.gethexbyte ;16bb address low
2763 call i.gethexbyte ;16bf record type (ignored)
2765 and a ;16c3 record len == 0?
2768 call i.gethexbyte ;16c6
2773 call i.storebyte ;16cd
2776 djnz l16c6h ;16d2 repeat for record len
2777 call i.gethexbyte ;16d4 checksum
2780 jp nz,ERROR ;16d9 exit if checksum error
2781 jr w_recstart ;16dc next record
2784 call i.gethexbyte ;16df
2788 call sub_16f6h ;16e5
2794 call sub_16f6h ;16ed
2803 call i.getchar ;16f6
2805 call sub_0d26h ;16fb
2818 ld de,TPA ;170a lowest allowed load address
2821 ld de,$stcka ;1713 highest allowed load address
2829 ld de,(MAXLOD) ;1728
2832 ld (MAXLOD),hl ;1731
2837 ld (hl),a ;173a store byte
2842 call assert_eol ;173c
2844 ld hl,MSG_high ;173f
2850 ld hl,(MAXLOD) ;1751
2861 call get_lastarg_def ;176c
2865 ld (CMD_ERR),hl ;1775
2871 ld (OFFS.pc),hl ;1782
2873 call sub_1f3fh ;1786
2876 ld de,(offs.@) ;178c
2884 ld a,(CON.COL) ;179b
2899 call nz,sub_17cdh ;17b7
2911 ld hl,t_MNEMONICS ;17d0
2912 call sub_0a15h ;17d3
2919 ld hl,b_0x17EE_start ;17e0
2973 defw gen.opc.ED2 ;1803
2979 defw gen.opc.ED2 ;1806
2985 defw gen.opc.ED2 ;1809
2991 defw gen.opc.ED2 ;180c
3069 defw gen.opc.ED2 ;1833
3075 defw gen.opc.ED2 ;1836
3081 defw gen.opc.ED2 ;1839
3087 defw gen.opc.ED2 ;183c
3111 defw gen.opc.ED2 ;1848
3117 defw gen.opc.ED2 ;184b
3123 defw gen.opc.ED2 ;184e
3129 defw gen.opc.ED2 ;1851
3135 defw gen.opc.ED2 ;1854
3153 defw gen.opc.ED2 ;185d
3159 defw gen.opc.ED2 ;1860
3171 defw gen.opc.ED2 ;1866
3177 defw gen.opc.ED2 ;1869
3207 defw gen.opc.ED2 ;1878
3213 defw gen.opc.ED2 ;187b
3243 defw gen.opc.ED2 ;188a
3273 defw gen.opc.ED2 ;1899
3350 defw gen.opc.ED2 ;18c0
3356 defw gen.opc.ED2 ;18c3
3362 defw gen.opc.ED2 ;18c6
3374 defw gen.opc.ED2 ;18cc
3391 call sub_1e41h ;18d5
3400 call sub_1ed1h ;18e3
3401 call sub_1e06h ;18e6
3403 call assert_eol ;18e9
3405 ld (iy+000h),0edh ;18f0
3406 ld (iy+001h),b ;18f4
3407 ld (iy+002h),l ;18f7
3412 call sub_1e06h ;18fd
3413 call sub_1ed1h ;1900
3414 call sub_1e41h ;1903
3425 call sub_1e2eh ;1913
3429 jp gen.opc.ED2 ;191a
3431 call sub_1e41h ;191d
3438 jp gen.opc.ED2 ;1927
3442 call sub_1e12h ;192c
3447 call sub_1e41h ;1934
3449 call sub_1e68h ;193a
3451 call sub_1e2eh ;1940
3453 call sub_1e50h ;1946
3463 call sub_1e2eh ;195d
3466 call sub_1ed8h ;1966
3467 call sub_1ed1h ;1969
3468 call sub_1e2eh ;196c
3470 call sub_1e50h ;1971
3474 call assert_eol ;1978
3475 ld a,(pfx.IXY) ;197b
3478 ld (iy+000h),a ;1982
3479 ld (iy+001h),b ;1985
3480 ld (iy+002h),l ;1988
3481 ld (iy+003h),h ;198b
3492 call assert_eol ;199a
3494 ld (iy+000h),b ;19a1
3495 ld (iy+001h),l ;19a4
3496 ld (iy+002h),h ;19a7
3506 call assert_eol ;19b4
3514 call sub_1ed1h ;19c0
3515 call sub_1e41h ;19c3
3532 call sub_1e68h ;19db
3543 call assert_eol ;19ec
3544 ld a,(pfx.IXY) ;19ef
3546 ld (iy+000h),a ;19f6
3547 ld (iy+001h),b ;19f9
3548 ld (iy+002h),c ;19fc
3570 jp gen.opc.ED2 ;1a1e
3574 call sub_1e12h ;1a25
3575 ld a,b ;1a28 ld r,nn
3583 call assert_eol ;1a2f
3585 ld (iy+000h),b ;1a36
3586 ld (iy+001h),l ;1a39
3595 call sub_1e2eh ;1a46
3601 call sub_1ed8h ;1a53
3605 call sub_1ed8h ;1a5c
3609 call sub_1ed1h ;1a64
3610 call sub_1e41h ;1a67
3617 call sub_1e12h ;1a76
3618 call assert_eol ;1a79
3619 ld a,(pfx.IXY) ;1a7c
3621 ld (iy+000h),a ;1a83 dd/fd
3622 ld (iy+001h),036h ;1a86
3623 ld (iy+002h),c ;1a8a displacement
3624 ld (iy+003h),l ;1a8d nn
3630 call sub_1ed1h ;1a94
3632 call sub_0a23h ;1a9a
3634 call sub_1e50h ;1a9f
3641 call assert_eol ;1aab
3642 ld a,(pfx.IXY) ;1aae
3644 ld (iy+000h),a ;1ab5
3645 ld (iy+001h),b ;1ab8
3661 call sub_1ed8h ;1ad0
3673 call assert_eol ;1ae6
3679 call sub_1ed1h ;1af0
3685 call sub_1ed8h ;1afc
3694 call sub_1ed1h ;1b0d
3699 call sub_1ed1h ;1b15
3705 jr z,gen.opc.ED2 ;1b1e
3713 call sub_1ed8h ;1b2a
3714 call sub_1ed1h ;1b2d
3720 call assert_eol ;1b36
3722 ld (iy+000h),b ;1b3d
3727 call assert_eol ;1b43
3729 ld (iy+000h),0edh ;1b4a
3730 ld (iy+001h),b ;1b4e
3736 call sub_0a23h ;1b57
3738 call sub_1ed1h ;1b5c
3739 call sub_1e2eh ;1b5f
3752 jr gen.opc.ED2 ;1b72
3755 call sub_0a23h ;1b77
3757 call sub_1e50h ;1b7c
3759 call sub_1ed1h ;1b81
3760 ld hl,t_BC.DE.IX.SP ;1b84
3761 ld a,(pfx.IXY) ;1b87
3764 ld hl,t_BC.DE.IY.SP ;1b8e
3766 call sub_1e2bh ;1b91
3773 call sub_1ed1h ;1b9d
3774 call sub_1e2eh ;1ba0
3784 call skip_to_nextarg ;1bb2
3791 call sub_1e41h ;1bbb
3793 call sub_1e68h ;1bc0
3795 call sub_1e12h ;1bc5
3807 call sub_1e41h ;1bd8
3809 call sub_1e68h ;1bdd
3815 call assert_eol ;1be7
3816 ld a,(pfx.IXY) ;1bea
3818 ld (iy+000h),a ;1bf1
3819 ld (iy+001h),0cbh ;1bf4
3820 ld (iy+002h),c ;1bf8
3821 ld (iy+003h),b ;1bfb
3829 call assert_eol ;1c03
3831 ld (iy+000h),0cbh ;1c0a
3832 ld (iy+001h),b ;1c0e
3837 call sub_1de6h ;1c14
3838 call sub_1ed1h ;1c17
3839 call sub_1e41h ;1c1a
3841 call sub_1e68h ;1c1f
3862 call sub_1eb8h ;1c39
3866 call skip_to_nextarg ;1c40
3877 call sub_1eb8h ;1c50
3888 call sub_1eb8h ;1c5f
3892 ld hl,b_0x1C97_start ;1c65
3893 call sub_0a15h ;1c68
3900 call skip_to_nextarg ;1c73
3907 call assert_eol ;1c7f
3929 call skip_to_nextarg ;1ca4
3933 call sub_1ebfh ;1cab
3940 call sub_1ed1h ;1cb6
3942 call sub_1defh ;1cb9
3945 call sub_1e12h ;1cbf
3956 jp gen.opc.ED2 ;1cd2
3958 call sub_1e12h ;1cd5
3968 call sub_1e50h ;1ce4
3970 call sub_1e25h ;1ce9
3979 call sub_1e41h ;1cf8
3990 call sub_1ed1h ;1d0a
3991 call sub_1d26h ;1d0d
3993 call sub_1e06h ;1d12
3997 call sub_1ed1h ;1d1a
3998 call sub_1d26h ;1d1d
4000 jp c,gen.opc.ED2 ;1d20
4007 call sub_1d26h ;1d2c
4009 call sub_1ed1h ;1d31
4010 call sub_1e41h ;1d34
4020 call sub_1e06h ;1d44
4021 call sub_1ed1h ;1d47
4028 ld hl,b_0x1D80_start ;1d54
4029 call sub_0a15h ;1d57
4032 call assert_eol ;1d5e
4034 ld hl,b_0x1DA1_start ;1d63
4039 ld (iy+000h),a ;1d6d
4047 ld (iy+001h),a ;1d7a
4073 call sub_1e50h ;1dab
4075 call sub_1e2eh ;1db0
4077 call sub_1e41h ;1db5
4079 call sub_1e68h ;1dba
4110 call sub_1e12h ;1de6
4125 call sub_1e15h ;1dfc
4134 jr nz,sub_1e12h ;1e09
4136 call sub_1e12h ;1e0c
4158 ld hl,t_BC.DE.HL.AF ;1e26
4165 ld hl,t_BC.DE.HL.SP ;1e2f
4168 call sub_0a15h ;1e33
4184 ld hl,t_BCDEHL_HL_A ;1e46
4185 call sub_0a15h ;1e49
4194 call sub_0a15h ;1e55
4201 ld (pfx.IXY),a ;1e61
4216 call sub_0a15h ;1e74
4224 ld (pfx.IXY),a ;1e81
4236 call sub_1e12h ;1e97 get displacement
4264 ld hl,t_tstfl_ZCPS ;1eb8
4268 ld hl,t_tstfl_ZC ;1ebf
4272 call sub_0a15h ;1ec5
4283 call skip_to_nextarg ;1ed1
4295 ld (CMD_RPT),hl ;1ee2
4302 call skip_to_nextarg ;1ef0
4303 call sub_0aa5h ;1ef3
4305 call assert_eol ;1ef8
4312 call sub_1f3fh ;1f02
4323 call assert_eol ;1f17
4335 call sub_1f3fh ;1f26
4353 ld (CON.COL),a ;1f49
4354 call sub_1f77h ;1f4c
4359 ld a,(CON.COL) ;1f54
4363 ld de,(offs.@) ;1f5b
4379 call sub_1f9eh ;1f7b
4382 call sub_2581h ;1f81
4384 call sub_1fdbh ;1f85
4391 ld hl,b_0x1F9B_start ;1f91
4402 ld (is.pfx.IXY),a ;1f9f
4404 ld a,(iy+000h) ;1fa6
4407 jp z,disas_pfx.ED ;1fab
4414 ld a,(iy+000h) ;1fba
4425 ld (is.pfx.IXY),a ;1fcb
4426 call sub_1fdch ;1fce
4429 call sub_1fb6h ;1fd3
4441 ld hl,b_0x2011_start ;1fde
4442 call sub_20bbh ;1fe1
4446 call sub_20bbh ;1fea
4450 ld a,(iy+000h) ;1ff4
4455 ld a,(iy+002h) ;1fff
4516 ld hl,b_0x2200_start ;203d
4517 call sub_209dh ;2040
4521 call lookup_opc ;2049
4525 call lookup_opc ;2052
4529 call lookup_opc ;205b
4535 ld a,(is.pfx.IXY) ;2065
4541 call lookup_opc ;2070
4546 ld hl,b_0x218B_start ;2078
4547 call lookup_opc ;207b
4550 ld hl,b_0x20ED_start ;2081
4551 call sub_209dh ;2084
4554 ld hl,b_0x2108_start ;208a
4555 call lookup_opc ;208d
4558 ld hl,b_0x21D2_start ;2093
4559 call lookup_opc ;2096
4578 ld hl,t_MNEMONICS ;20b0
4592 jr nz,sub_20bbh ;20c6
4598 ld a,(iy+000h) ;20ce
4610 jr nz,lookup_opc ;20dc
4619 ld hl,t_MNEMONICS ;20e5
4625 b_0x20ED_start: ; 1 byte opcodes (no parameters)
4654 b_0x2108_start: ; 1 byte opcodes
4655 defb 0c0h ;2108 ld r,r
4660 defb 0f8h ;210d add a,r
4665 defb 0f8h ;2112 adc a,r
4701 defb 0c0h ;2136 ret cc
4715 defb 0cfh ;2144 pop rr
4720 defb 0cfh ;2149 push rr
4725 defb 0ffh ;214e ex (sp),hl
4730 defb 0ffh ;2153 jp (hl)
4735 defb 0ffh ;2158 ex de,hl
4740 defb 0ffh ;215d ld sp,hl
4745 defb 0cfh ;2162 inc rr
4750 defb 0cfh ;2167 dec rr
4755 defb 0c7h ;216c inc r
4760 defb 0c7h ;2171 dec r
4765 defb 0ffh ;2176 ex af,af'
4770 defb 0cfh ;217b add hl,rr
4775 defb 0efh ;2180 ld (rr),a ;rr=bc,de
4780 defb 0efh ;2185 ld a,(rr) ;rr=bc,de
4787 b_0x218B_start: ; 2 byte opdodes
4788 defb 0c7h ;218b ld r,nn
4793 defb 0ffh ;2190 add a,nn
4798 defb 0ffh ;2195 adc a,nn
4803 defb 0ffh ;219a sub a,nn
4813 defb 0ffh ;21a4 and a,nn
4828 defb 0ffh ;21b3 cp a,nn
4833 defb 0ffh ;21b8 djnz
4843 defb 0e7h ;21c2 jr,cc
4849 defb 0d3h ;21c8 out (nn),a
4853 defb 0ffh ;21cc in a,(nn)
4860 b_0x21D2_start: ; 3 byte opcodes
4908 b_0x2200_start: ; prefix ED + 1 byte opcode
4911 defb 045h ;2202 retn
4913 defb 04dh ;2204 reti
4935 defb 0b0h ;221a ldir
4943 defb 0b8h ;2222 lddr
4951 defb 08bh ;222a otdm
4953 defb 09bh ;222c otdmr
4955 defb 083h ;222e otim
4957 defb 093h ;2230 otimr
4964 defb 0e7h ;2235 in r,(c) ;r=bcde
4969 defb 0f7h ;223a in r,(c) ;r=hl
4974 defb 0ffh ;223f in r,(c) ;r=a
4989 defb 0ffh ;224e out (c),r ;r=a
4994 defb 0cfh ;2253 sbc hl,rr
4999 defb 0cfh ;2258 adc hl,rr
5004 defb 0ffh ;225d im 0
5009 defb 0ffh ;2262 im 1
5014 defb 0ffh ;2267 im 2
5019 defb 0ffh ;226c ld i,a
5039 defb 0cfh ;2280 mlt rr
5044 defb 0c7h ;2285 tst r
5235 call sub_257ch ;22ff
5238 call sub_2579h ;2305
5244 call sub_257ch ;230f
5248 call sub_257ch ;2318
5252 ld a,(iy+000h) ;2322
5257 ld hl,b_0x2333_start ;232a
5274 ld hl,b_0x2354_start ;234b
5282 ld hl,b_0x1D80_start ;2357
5286 call sub_257ch ;2360
5289 call sub_2372h ;2366
5290 call sub_257ch ;2369
5293 call sub_2579h ;236f
5301 call sub_2579h ;237f
5305 call sub_257ch ;2387
5306 ld a,(is.pfx.IXY) ;238a
5309 ld a,(iy+002h) ;2392
5314 ld a,(iy+001h) ;239b
5320 ld a,(iy+000h) ;23a5
5323 call sub_2568h ;23aa
5324 call sub_257ch ;23ad
5327 ld c,(iy+001h) ;23b4
5340 call sub_2579h ;23c3
5345 ld a,(iy+001h) ;23cf
5350 call sub_257ch ;23d8
5356 call sub_257ch ;23e3
5359 ld l,(iy+001h) ;23ea
5360 ld h,(iy+002h) ;23ed
5371 call sub_257ch ;23ff
5374 call sub_24c6h ;2404
5375 call sub_257ch ;2407
5379 call sub_257ch ;2410
5382 call sub_24c6h ;2416
5383 call sub_257ch ;2419
5387 call sub_2579h ;2421
5400 ld hl,b_0x2449_start ;2434
5424 call sub_257ch ;2458
5430 call sub_257ch ;2467
5434 call sub_257ch ;2470
5437 call sub_24c6h ;2476
5438 call sub_257ch ;2479
5442 call sub_257ch ;2482
5445 ld a,(is.pfx.IXY) ;2487
5449 ld a,(iy+001h) ;2491
5454 ld a,(iy+002h) ;249a
5464 call sub_257ch ;24a8
5468 ld a,(is.pfx.IXY) ;24ae
5472 ld a,(iy+001h) ;24b8
5477 ld a,(iy+002h) ;24c1
5485 ld l,(iy+001h) ;24cf
5486 ld h,(iy+002h) ;24d2
5489 call sub_23f2h ;24d7
5494 ld a,(iy+000h) ;24e3
5502 ld a,(iy+000h) ;24ef
5508 ld a,(is.pfx.IXY) ;24f8
5512 ld hl,b_0x2538_start ;2500
5513 ld a,(is.pfx.IXY) ;2503
5516 ld hl,b_0x253B_start ;2509
5520 ld a,(iy+001h) ;2513
5539 ld hl,t_BCDEHL_HL_A ;2533
5548 ld a,(is.pfx.IXY) ;253e
5549 ld hl,t_HL.IX.IY ;2541
5552 ld hl,t_BC.DE.HL.AF ;2546
5555 ld hl,t_BC.DE.HL.SP ;254b
5558 ld a,(iy+000h) ;2552
5570 ld a,(iy+000h) ;2565
5577 ld hl,t_tstfl_ZCPS ;256d
5581 call sub_0a48h ;2573
5750 ld hl,(REG.PC) ;26e7
5754 ld iy,(REG.PC) ;26ee
5755 call sub_1f9eh ;26f2
5759 ld hl,(REG.PC) ;26fb
5761 call sub_1117h ;26ff
5762 ld iy,(REG.PC) ;2702
5763 ld hl,b_0x2717_start ;2706
5764 call lookup_opc ;2709
5769 call c,sub_1117h ;2712
5858 ld l,(iy+001h) ;276d
5859 ld h,(iy+002h) ;2770
5866 ld c,(iy+001h) ;2779
5872 ld hl,(REG.PC) ;2780
5885 ld hl,(reg.ix) ;278d
5889 ld hl,(reg.iy) ;2792
5892 ld a,(iy+001h) ;2799
5902 ld a,(iy+001h) ;27a6
5913 ld a,(iy+000h) ;27b7
5935 ld hl,(REG.SP) ;27da
5942 call sub_1117h ;27e5
5953 ld a,(iy+000h) ;27f9
5981 ld (CMD_RPT),hl ;281b
5995 call sub_289fh ;2833
5998 call get_lastarg_def ;283b
6000 ld (TCCSTR),hl ;283e
6004 call sub_26e7h ;2845
6007 call sub_0e68h ;284a
6011 ld iy,(REG.PC) ;2853
6012 call sub_28c1h ;2857
6015 call lookup_opc ;285f
6021 ld de,(TCCSTR) ;286a
6034 ld hl,(TCCSTR) ;2881
6036 ld (TCCSTR),hl ;2885
6041 call sub_26e7h ;288c
6067 call assert_eol ;28b7
6128 ;------------------------------------------
6130 ;------------------------------------------
6136 ; The following 2 params are changeable by user.
6137 ; Should these moved to top ram?
6139 ddtrst: rst DRSTNUM ;rst used by ddtz
6140 ddtei: ei ;ints enabled/disabled while ddtz is running
6237 ;------------------------------------------
6239 .phase sysram_start+stacksize
6241 $stcka equ $ - stacksize
6249 reg.l2: db 0 ; 0fe50h
6250 reg.h2: db 0 ; 0fe51h
6251 reg.e2: db 0 ; 0fe52h
6252 reg.d2: db 0 ; 0fe53h
6253 reg.c2: db 0 ; 0fe54h
6254 reg.b2: db 0 ; 0fe55h
6255 reg.f2: db 0 ; 0fe56h
6256 reg.a2: db 0 ; 0fe57h
6258 reg.i: db high ivtab
6259 reg.iy: dw 0 ; 0fe5ah
6260 reg.ix: dw 0 ; 0fe5ch
6261 reg.e: db 0 ; 0fe5eh
6262 reg.d: db 0 ; 0fe5fh
6263 reg.c: db 0 ; 0fe60h
6264 reg.b: db 0 ; 0fe61h
6266 udcntl: db CWAITIO ; 0fe62h (mem-, io- wait)
6267 uromen: db ROM_DIS ; 0fe63h
6271 ucbar: db USR$CBAR ; 0fe65h
6276 reg.f: db 0 ; 0fe66h
6277 reg.a: db 0 ; 0fe67h
6278 reg.l: db 0 ; 0fe68h
6279 reg.h: db 0 ; 0fe69h
6280 reg.sp: dw TOPRAM ; 0fe6ah
6284 out (000h),a ;064c fe6c
6285 out0 (dcntl),l ;064e
6297 ld sp,(reg.sp) ;065a
6300 db 0C3h ;jp TPA ;065f feff ($+1): reg.pc
6305 ld (reg.l),hl ;0662 fe82: bpent:
6308 ld (reg.pc),hl ;0667
6309 ld (reg.sp),sp ;066a
6329 ld a,CWAITROM+CWAITIO ;0681
6330 out0 (dcntl),a ;0683
6341 out (000h),a ;0692 feb2