4 external $ci, $co, $cists
25 MEMDUMP_CNT equ 16 ;mem dump bytes per line
26 BP_CNT equ 12 ;number of breakbpoints
29 ;--------------------------------------------------
32 ; copy code to common memory and execute it there
39 ; mark end of common code snippet
54 ; repeat execution of last 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
127 ld (CMD_ERR),hl ;0767
129 ld (OFFS.pc),hl ;076d
131 ld hl,(CMD_RPT) ;0773
136 call nz,OUTCHAR ;0781
142 ld (CMD_RPT),hl ;0792
157 ld hl,(CMD_ERR) ;07ab
391 db 3eh ;0904 ld a,0E5h
412 call nz,sub_0917h ;0921
564 ld de,$stack-50 ;09ee
595 ld hl,b_0x132A_start ;0a0e
614 db 3eh ;0a26 ld a,0c5h
629 call z,sub_0d20h ;0a38
663 call get_arg_range ;0a59
666 call skip_to_nextarg ;0a5e
684 call get_arg_def ;0a74
701 db 0e6h ;0a87 and 037h (clear carry)
730 call skip_to_nextarg ;0aa5
765 call do_subexpr ;0acc
771 call do_subexpr ;0ad6
804 ld hl,tab_eq_le_ge ;0afb
826 ld hl,tab_func_eqlege ;0b1c
853 call do_binary_op ;0b3e
973 ld hl,tab_func_opa ;0bc1
1002 call get.number ;0bf2
1011 ld hl,(MAXLOD) ;0c03
1017 ld hl,(offs.@) ;0c0f
1020 ld hl,(OFFS.pc) ;0c15
1024 jr z,fact_factneg ;0c1d
1026 jr z,fact_factinv ;0c21
1028 jr z,fact_factor ;0c25
1030 jr z,fact_reg.CPU ;0c29
1032 jr z,fact_reg.Y ;0c2d
1036 jp z,EXPR_BRCKT ;0c35 [ expression ]
1038 jr z,fact_factstring ;0c3a
1044 call get.decdigit ;0c3f
1083 call sub_1315h ;0c70
1096 call fact_factor ;0c80
1107 call fact_factor ;0c8b
1143 call get.hexdigit ;0cbe
1148 call get.hexdigit ;0cc4
1157 call get.hexdigit ;0cd5
1175 call get.decdigit ;0cec
1185 call get.decdigit ;0cfd
1192 call get.decdigit ;0d07
1196 add hl,hl ;0d0e hl *= 10
1244 call assert_eol ;0d41
1249 ld hl,b_0x0DFD_start ;0d4a
1250 ld de,b_0x0E1D_start ;0d4d
1253 call prnt_regs ;0d52
1257 ld iy,(REG.PC) ;0d59
1258 call sub_1f77h ;0d5d
1268 call prnt_regs ;0d6f
1275 call sub_1f5bh ;0d7c
1281 call prnt_flags ;0d85
1282 ld a,(reg.iff) ;0d88
1290 call prnt_flags ;0d98
1296 call sub_0dbeh ;0da1
1298 call sub_0dbeh ;0da6
1301 call sub_0dbeh ;0dad
1304 call sub_0dbeh ;0db4
1306 call sub_0dbeh ;0db9
1404 ld (REG.PC),hl ;0e51
1412 call sub_0f24h ;0e62
1419 ld a,(ix+000h) ;0e6e
1421 ld (ix+000h),a ;0e73
1422 call sub_11c5h ;0e76
1442 jp c,assert_eol ;0e99
1444 call sub_0ea7h ;0e9d
1446 call skip_to_nextarg ;0ea1
1456 ld e,(ix+002h) ;0eb0
1457 ld d,(ix+003h) ;0eb3
1461 ld (ix+000h),000h ;0ebb
1462 call sub_11c5h ;0ebf
1473 bit 0,(ix+000h) ;0ed1
1476 bit 4,(ix+000h) ;0ed9
1482 ld l,(ix+002h) ;0ee7
1483 ld h,(ix+003h) ;0eea
1488 ld l,(ix+004h) ;0ef8
1489 ld h,(ix+005h) ;0efb
1491 ld l,(ix+006h) ;0f01
1492 ld h,(ix+007h) ;0f04
1526 call nz,sub_0ea7h ;0f3d
1528 call sub_0f68h ;0f41
1530 ld (ix+002h),l ;0f45
1531 ld (ix+003h),h ;0f48
1532 call sub_0f80h ;0f4b
1533 ld (ix+004h),l ;0f4e
1534 ld (ix+005h),h ;0f51
1535 call sub_0f91h ;0f54
1536 ld (ix+006h),l ;0f57
1537 ld (ix+007h),h ;0f5a
1538 call skip_to_nextarg ;0f5d
1540 ld (ix+000h),a ;0f61
1547 ld a,(ix+000h) ;0f6e
1585 ld de,sexpbufe ;0fb1
1607 push hl ;0fd2 save rom enable stat
1621 ld (reg.iff),a ;0fe6
1639 ld hl,(REG.PC) ;100a
1641 ld (REG.PC),hl ;100e
1643 ld hl,MSG_trap ;1011
1651 call sub_1059h ;1022
1657 call sub_0e68h ;102e
1658 call prnt_cpustat ;1031
1662 DB CR,LF,'Undefined opcode trap'
1677 ld a,(ix+000h) ;1066
1680 ld e,(ix+002h) ;106d
1681 ld d,(ix+003h) ;1070
1682 ld hl,(REG.PC) ;1073
1685 call z,sub_1087h ;107a
1697 ld e,(ix+006h) ;108b
1698 ld d,(ix+007h) ;108e
1706 ld e,(ix+004h) ;109d
1707 ld d,(ix+005h) ;10a0
1712 ld (ix+004h),e ;10a8
1713 ld (ix+005h),d ;10ab
1715 bit 4,(ix+000h) ;10ae
1730 bit 5,(ix+000h) ;10c5
1731 res 5,(ix+000h) ;10c9
1733 ld l,(ix+002h) ;10cf
1734 ld h,(ix+003h) ;10d2
1740 ld a,(ix+001h) ;10df
1745 res 3,(ix+000h) ;10e7
1754 ld a,(ix+000h) ;10f9
1757 ld e,(ix+002h) ;1100
1758 ld d,(ix+003h) ;1103
1759 ld hl,(REG.PC) ;1106
1770 call sub_0f68h ;1117
1771 ld (ix+004h),001h ;111a
1772 ld (ix+005h),000h ;111e
1773 ld (ix+002h),l ;1122
1774 ld (ix+003h),h ;1125
1775 ld (ix+006h),000h ;1128
1776 ld (ix+007h),000h ;112c
1783 ld (ix+000h),a ;113a
1790 ld a,(ix+000h) ;1144
1793 set 5,(ix+000h) ;114a
1794 ld l,(ix+002h) ;114e
1795 ld h,(ix+003h) ;1151
1802 ld (ix+001h),a ;1159
1827 ld (ix+001h),e ;1159
1853 call nz,prnt_cpustat ;118b
1854 call sub_10f3h ;118e
1859 call sub_26e7h ;119a
1863 ld sp,$stack ;11a2 set/restore user cpu state
1891 jp $go ;11c2 common ram, switch banks and go to user prog
1894 ld a,(ix+000h) ;11c5
1897 ld e,(ix+006h) ;11cb
1898 ld d,(ix+007h) ;11ce
1906 ld (ix+006h),a ;11d8
1907 ld (ix+007h),a ;11db
1916 call sub_11ffh ;11ee
1931 ld e,(iy+006h) ;1204
1932 ld d,(iy+007h) ;1207
1940 ld (iy+006h),e ;1217
1941 ld (iy+007h),d ;121a
1945 call get.decdigit ;121e
1949 call assert_eol ;1225
1951 call sub_1248h ;1229
1954 call assert_eol ;122f
1958 call sub_1248h ;1234
1973 add a,'0'+080h ;124b
1986 call sub_1315h ;1260
1988 call assert_eol ;1266
1995 ld hl,b_0x132A_start ;1273
1996 call sub_0a48h ;1276
2041 ld (reg.iff),a ;12bb
2043 call sub_12d1h ;12bf
2050 call sub_12d1h ;12ca
2058 call assert_eol ;12d7
2065 ld hl,tab_pr_flags ;12e3
2087 ld (reg.iff),a ;1305
2096 call sub_0a0eh ;1315
2101 ld hl,b_0x136C_start ;131c
2223 call get_lastarg_def ;13d5
2240 jp z,assert_eol ;13f9
2250 call get_bytes_m ;1407
2254 call assert_eol ;140c
2264 ld (CMD_RPT),hl ;141e
2265 ld hl,(lst.IP) ;1421
2266 call get_lastarg_def ;1424
2267 ld (lst.IP),hl ;1427
2290 call out.bin.b ;144c
2294 ld (CMD_RPT),hl ;1455
2295 ld hl,(lst.OD) ;1458
2296 call get_arg_def ;145b
2300 call skip_to_nextarg ;1463
2301 ld hl,(lst.OP) ;1466
2302 call get_lastarg_def ;1469
2303 ld (lst.OP),hl ;146c
2328 call get_arg3 ;1490 get from, size, to
2366 push af ;14c9 save 'V' flag
2372 jr nc,bm_mvdown ;14d3
2392 jr z,cmp_mem ;14ed validate?
2397 call skip_to_nextarg ;14f6
2401 call assert_eol ;14fe
2415 call out.hl ;1511 val
2417 call sub_0928h ;1517 -val
2419 call out.hl.dec ;151d dec
2421 call out.hl.decm ;1523 -dec
2423 call out.bin.w ;1529 bin
2426 call out.ascii ;1530
2436 call get_arg_range ;153f
2439 call sub_15a7h ;1544
2442 call sub_1594h ;1548
2452 ld bc,MEMDUMP_CNT ;1559
2469 call get_arg_range ;156c
2472 call sub_15a7h ;1571
2519 ld hl,ci.buf+1 ;15a7
2520 call get_bytes ;15aa
2521 ld de,ci.buf+1 ;15ad
2529 db 0e6h ;15b8 and 037h (clear carry, skip next opc)
2534 call skip_to_nextarg ;15bb
2539 call sub_0a68h ;15c4
2622 ld (CMD_RPT),hl ;162f
2625 call sub_0a82h ;1638
2662 call sub_168fh ;1673
2690 ; Read Intel Hex File from console.
2694 call get_lastarg_def ;169e
2699 call i.getchar ;16a8
2702 jr nz,w_recstart ;16af
2703 ld c,0 ;16b1 init checksum
2704 call i.gethexbyte ;16b3 record len
2706 call i.gethexbyte ;16b7 address high
2708 call i.gethexbyte ;16bb address low
2710 call i.gethexbyte ;16bf record type (ignored)
2712 and a ;16c3 record len == 0?
2715 call i.gethexbyte ;16c6
2720 call i.storebyte ;16cd
2724 call i.gethexbyte ;16d4
2727 jp nz,ERROR ;16d9 exit if checksum error
2728 jr w_recstart ;16dc next record
2731 call i.gethexbyte ;16df
2735 call sub_16f6h ;16e5
2741 call sub_16f6h ;16ed
2750 call i.getchar ;16f6
2752 call sub_0d26h ;16fb
2776 ld de,(MAXLOD) ;1728
2779 ld (MAXLOD),hl ;1731
2789 call assert_eol ;173c
2791 ld hl,MSG_high ;173f
2797 ld hl,(MAXLOD) ;1751
2808 call get_lastarg_def ;176c
2812 ld (CMD_ERR),hl ;1775
2818 ld (OFFS.pc),hl ;1782
2820 call sub_1f3fh ;1786
2823 ld de,(offs.@) ;178c
2831 ld a,(CON.COL) ;179b
2846 call nz,sub_17cdh ;17b7
2858 ld hl,t_MNEMONICS ;17d0
2859 call sub_0a15h ;17d3
2866 ld hl,b_0x17EE_start ;17e0
2920 defw gen.opc.ED2 ;1803
2926 defw gen.opc.ED2 ;1806
2932 defw gen.opc.ED2 ;1809
2938 defw gen.opc.ED2 ;180c
3016 defw gen.opc.ED2 ;1833
3022 defw gen.opc.ED2 ;1836
3028 defw gen.opc.ED2 ;1839
3034 defw gen.opc.ED2 ;183c
3058 defw gen.opc.ED2 ;1848
3064 defw gen.opc.ED2 ;184b
3070 defw gen.opc.ED2 ;184e
3076 defw gen.opc.ED2 ;1851
3082 defw gen.opc.ED2 ;1854
3100 defw gen.opc.ED2 ;185d
3106 defw gen.opc.ED2 ;1860
3118 defw gen.opc.ED2 ;1866
3124 defw gen.opc.ED2 ;1869
3154 defw gen.opc.ED2 ;1878
3160 defw gen.opc.ED2 ;187b
3190 defw gen.opc.ED2 ;188a
3220 defw gen.opc.ED2 ;1899
3297 defw gen.opc.ED2 ;18c0
3303 defw gen.opc.ED2 ;18c3
3309 defw gen.opc.ED2 ;18c6
3321 defw gen.opc.ED2 ;18cc
3338 call sub_1e41h ;18d5
3347 call sub_1ed1h ;18e3
3348 call sub_1e06h ;18e6
3350 call assert_eol ;18e9
3352 ld (iy+000h),0edh ;18f0
3353 ld (iy+001h),b ;18f4
3354 ld (iy+002h),l ;18f7
3359 call sub_1e06h ;18fd
3360 call sub_1ed1h ;1900
3361 call sub_1e41h ;1903
3372 call sub_1e2eh ;1913
3376 jp gen.opc.ED2 ;191a
3378 call sub_1e41h ;191d
3385 jp gen.opc.ED2 ;1927
3389 call sub_1e12h ;192c
3394 call sub_1e41h ;1934
3396 call sub_1e68h ;193a
3398 call sub_1e2eh ;1940
3400 call sub_1e50h ;1946
3410 call sub_1e2eh ;195d
3413 call sub_1ed8h ;1966
3414 call sub_1ed1h ;1969
3415 call sub_1e2eh ;196c
3417 call sub_1e50h ;1971
3421 call assert_eol ;1978
3422 ld a,(pfx.IXY) ;197b
3425 ld (iy+000h),a ;1982
3426 ld (iy+001h),b ;1985
3427 ld (iy+002h),l ;1988
3428 ld (iy+003h),h ;198b
3439 call assert_eol ;199a
3441 ld (iy+000h),b ;19a1
3442 ld (iy+001h),l ;19a4
3443 ld (iy+002h),h ;19a7
3453 call assert_eol ;19b4
3461 call sub_1ed1h ;19c0
3462 call sub_1e41h ;19c3
3479 call sub_1e68h ;19db
3490 call assert_eol ;19ec
3491 ld a,(pfx.IXY) ;19ef
3493 ld (iy+000h),a ;19f6
3494 ld (iy+001h),b ;19f9
3495 ld (iy+002h),c ;19fc
3517 jp gen.opc.ED2 ;1a1e
3521 call sub_1e12h ;1a25
3522 ld a,b ;1a28 ld r,nn
3530 call assert_eol ;1a2f
3532 ld (iy+000h),b ;1a36
3533 ld (iy+001h),l ;1a39
3542 call sub_1e2eh ;1a46
3548 call sub_1ed8h ;1a53
3552 call sub_1ed8h ;1a5c
3556 call sub_1ed1h ;1a64
3557 call sub_1e41h ;1a67
3564 call sub_1e12h ;1a76
3565 call assert_eol ;1a79
3566 ld a,(pfx.IXY) ;1a7c
3568 ld (iy+000h),a ;1a83 dd/fd
3569 ld (iy+001h),036h ;1a86
3570 ld (iy+002h),c ;1a8a displacement
3571 ld (iy+003h),l ;1a8d nn
3577 call sub_1ed1h ;1a94
3579 call sub_0a23h ;1a9a
3581 call sub_1e50h ;1a9f
3588 call assert_eol ;1aab
3589 ld a,(pfx.IXY) ;1aae
3591 ld (iy+000h),a ;1ab5
3592 ld (iy+001h),b ;1ab8
3608 call sub_1ed8h ;1ad0
3620 call assert_eol ;1ae6
3626 call sub_1ed1h ;1af0
3632 call sub_1ed8h ;1afc
3641 call sub_1ed1h ;1b0d
3646 call sub_1ed1h ;1b15
3652 jr z,gen.opc.ED2 ;1b1e
3660 call sub_1ed8h ;1b2a
3661 call sub_1ed1h ;1b2d
3667 call assert_eol ;1b36
3669 ld (iy+000h),b ;1b3d
3674 call assert_eol ;1b43
3676 ld (iy+000h),0edh ;1b4a
3677 ld (iy+001h),b ;1b4e
3683 call sub_0a23h ;1b57
3685 call sub_1ed1h ;1b5c
3686 call sub_1e2eh ;1b5f
3699 jr gen.opc.ED2 ;1b72
3702 call sub_0a23h ;1b77
3704 call sub_1e50h ;1b7c
3706 call sub_1ed1h ;1b81
3707 ld hl,t_BC.DE.IX.SP ;1b84
3708 ld a,(pfx.IXY) ;1b87
3711 ld hl,t_BC.DE.IY.SP ;1b8e
3713 call sub_1e2bh ;1b91
3720 call sub_1ed1h ;1b9d
3721 call sub_1e2eh ;1ba0
3731 call skip_to_nextarg ;1bb2
3738 call sub_1e41h ;1bbb
3740 call sub_1e68h ;1bc0
3742 call sub_1e12h ;1bc5
3754 call sub_1e41h ;1bd8
3756 call sub_1e68h ;1bdd
3762 call assert_eol ;1be7
3763 ld a,(pfx.IXY) ;1bea
3765 ld (iy+000h),a ;1bf1
3766 ld (iy+001h),0cbh ;1bf4
3767 ld (iy+002h),c ;1bf8
3768 ld (iy+003h),b ;1bfb
3776 call assert_eol ;1c03
3778 ld (iy+000h),0cbh ;1c0a
3779 ld (iy+001h),b ;1c0e
3784 call sub_1de6h ;1c14
3785 call sub_1ed1h ;1c17
3786 call sub_1e41h ;1c1a
3788 call sub_1e68h ;1c1f
3809 call sub_1eb8h ;1c39
3813 call skip_to_nextarg ;1c40
3824 call sub_1eb8h ;1c50
3835 call sub_1eb8h ;1c5f
3839 ld hl,b_0x1C97_start ;1c65
3840 call sub_0a15h ;1c68
3847 call skip_to_nextarg ;1c73
3854 call assert_eol ;1c7f
3876 call skip_to_nextarg ;1ca4
3880 call sub_1ebfh ;1cab
3887 call sub_1ed1h ;1cb6
3889 call sub_1defh ;1cb9
3892 call sub_1e12h ;1cbf
3903 jp gen.opc.ED2 ;1cd2
3905 call sub_1e12h ;1cd5
3915 call sub_1e50h ;1ce4
3917 call sub_1e25h ;1ce9
3926 call sub_1e41h ;1cf8
3937 call sub_1ed1h ;1d0a
3938 call sub_1d26h ;1d0d
3940 call sub_1e06h ;1d12
3944 call sub_1ed1h ;1d1a
3945 call sub_1d26h ;1d1d
3947 jp c,gen.opc.ED2 ;1d20
3954 call sub_1d26h ;1d2c
3956 call sub_1ed1h ;1d31
3957 call sub_1e41h ;1d34
3967 call sub_1e06h ;1d44
3968 call sub_1ed1h ;1d47
3975 ld hl,b_0x1D80_start ;1d54
3976 call sub_0a15h ;1d57
3979 call assert_eol ;1d5e
3981 ld hl,b_0x1DA1_start ;1d63
3986 ld (iy+000h),a ;1d6d
3994 ld (iy+001h),a ;1d7a
4020 call sub_1e50h ;1dab
4022 call sub_1e2eh ;1db0
4024 call sub_1e41h ;1db5
4026 call sub_1e68h ;1dba
4057 call sub_1e12h ;1de6
4072 call sub_1e15h ;1dfc
4081 jr nz,sub_1e12h ;1e09
4083 call sub_1e12h ;1e0c
4105 ld hl,t_BC.DE.HL.AF ;1e26
4112 ld hl,t_BC.DE.HL.SP ;1e2f
4115 call sub_0a15h ;1e33
4131 ld hl,t_BCDEHL_HL_A ;1e46
4132 call sub_0a15h ;1e49
4141 call sub_0a15h ;1e55
4148 ld (pfx.IXY),a ;1e61
4163 call sub_0a15h ;1e74
4171 ld (pfx.IXY),a ;1e81
4183 call sub_1e12h ;1e97 get displacement
4211 ld hl,t_tstfl_ZCPS ;1eb8
4215 ld hl,t_tstfl_ZC ;1ebf
4219 call sub_0a15h ;1ec5
4230 call skip_to_nextarg ;1ed1
4242 ld (CMD_RPT),hl ;1ee2
4249 call skip_to_nextarg ;1ef0
4250 call sub_0aa5h ;1ef3
4252 call assert_eol ;1ef8
4259 call sub_1f3fh ;1f02
4270 call assert_eol ;1f17
4282 call sub_1f3fh ;1f26
4300 ld (CON.COL),a ;1f49
4301 call sub_1f77h ;1f4c
4306 ld a,(CON.COL) ;1f54
4310 ld de,(offs.@) ;1f5b
4326 call sub_1f9eh ;1f7b
4329 call sub_2581h ;1f81
4331 call sub_1fdbh ;1f85
4338 ld hl,b_0x1F9B_start ;1f91
4349 ld (is.pfx.IXY),a ;1f9f
4351 ld a,(iy+000h) ;1fa6
4354 jp z,disas_pfx.ED ;1fab
4361 ld a,(iy+000h) ;1fba
4372 ld (is.pfx.IXY),a ;1fcb
4373 call sub_1fdch ;1fce
4376 call sub_1fb6h ;1fd3
4388 ld hl,b_0x2011_start ;1fde
4389 call sub_20bbh ;1fe1
4393 call sub_20bbh ;1fea
4397 ld a,(iy+000h) ;1ff4
4402 ld a,(iy+002h) ;1fff
4463 ld hl,b_0x2200_start ;203d
4464 call sub_209dh ;2040
4468 call lookup_opc ;2049
4472 call lookup_opc ;2052
4476 call lookup_opc ;205b
4482 ld a,(is.pfx.IXY) ;2065
4488 call lookup_opc ;2070
4493 ld hl,b_0x218B_start ;2078
4494 call lookup_opc ;207b
4497 ld hl,b_0x20ED_start ;2081
4498 call sub_209dh ;2084
4501 ld hl,b_0x2108_start ;208a
4502 call lookup_opc ;208d
4505 ld hl,b_0x21D2_start ;2093
4506 call lookup_opc ;2096
4525 ld hl,t_MNEMONICS ;20b0
4539 jr nz,sub_20bbh ;20c6
4545 ld a,(iy+000h) ;20ce
4557 jr nz,lookup_opc ;20dc
4566 ld hl,t_MNEMONICS ;20e5
4572 b_0x20ED_start: ; 1 byte opcodes (no parameters)
4601 b_0x2108_start: ; 1 byte opcodes
4602 defb 0c0h ;2108 ld r,r
4607 defb 0f8h ;210d add a,r
4612 defb 0f8h ;2112 adc a,r
4648 defb 0c0h ;2136 ret cc
4662 defb 0cfh ;2144 pop rr
4667 defb 0cfh ;2149 push rr
4672 defb 0ffh ;214e ex (sp),hl
4677 defb 0ffh ;2153 jp (hl)
4682 defb 0ffh ;2158 ex de,hl
4687 defb 0ffh ;215d ld sp,hl
4692 defb 0cfh ;2162 inc rr
4697 defb 0cfh ;2167 dec rr
4702 defb 0c7h ;216c inc r
4707 defb 0c7h ;2171 dec r
4712 defb 0ffh ;2176 ex af,af'
4717 defb 0cfh ;217b add hl,rr
4722 defb 0efh ;2180 ld (rr),a ;rr=bc,de
4727 defb 0efh ;2185 ld a,(rr) ;rr=bc,de
4734 b_0x218B_start: ; 2 byte opdodes
4735 defb 0c7h ;218b ld r,nn
4740 defb 0ffh ;2190 add a,nn
4745 defb 0ffh ;2195 adc a,nn
4750 defb 0ffh ;219a sub a,nn
4760 defb 0ffh ;21a4 and a,nn
4775 defb 0ffh ;21b3 cp a,nn
4780 defb 0ffh ;21b8 djnz
4790 defb 0e7h ;21c2 jr,cc
4796 defb 0d3h ;21c8 out (nn),a
4800 defb 0ffh ;21cc in a,(nn)
4807 b_0x21D2_start: ; 3 byte opcodes
4855 b_0x2200_start: ; prefix ED + 1 byte opcode
4858 defb 045h ;2202 retn
4860 defb 04dh ;2204 reti
4882 defb 0b0h ;221a ldir
4890 defb 0b8h ;2222 lddr
4898 defb 08bh ;222a otdm
4900 defb 09bh ;222c otdmr
4902 defb 083h ;222e otim
4904 defb 093h ;2230 otimr
4911 defb 0e7h ;2235 in r,(c) ;r=bcde
4916 defb 0f7h ;223a in r,(c) ;r=hl
4921 defb 0ffh ;223f in r,(c) ;r=a
4936 defb 0ffh ;224e out (c),r ;r=a
4941 defb 0cfh ;2253 sbc hl,rr
4946 defb 0cfh ;2258 adc hl,rr
4951 defb 0ffh ;225d im 0
4956 defb 0ffh ;2262 im 1
4961 defb 0ffh ;2267 im 2
4966 defb 0ffh ;226c ld i,a
4986 defb 0cfh ;2280 mlt rr
4991 defb 0c7h ;2285 tst r
5182 call sub_257ch ;22ff
5185 call sub_2579h ;2305
5191 call sub_257ch ;230f
5195 call sub_257ch ;2318
5199 ld a,(iy+000h) ;2322
5204 ld hl,b_0x2333_start ;232a
5221 ld hl,b_0x2354_start ;234b
5229 ld hl,b_0x1D80_start ;2357
5233 call sub_257ch ;2360
5236 call sub_2372h ;2366
5237 call sub_257ch ;2369
5240 call sub_2579h ;236f
5248 call sub_2579h ;237f
5252 call sub_257ch ;2387
5253 ld a,(is.pfx.IXY) ;238a
5256 ld a,(iy+002h) ;2392
5261 ld a,(iy+001h) ;239b
5267 ld a,(iy+000h) ;23a5
5270 call sub_2568h ;23aa
5271 call sub_257ch ;23ad
5274 ld c,(iy+001h) ;23b4
5287 call sub_2579h ;23c3
5292 ld a,(iy+001h) ;23cf
5297 call sub_257ch ;23d8
5303 call sub_257ch ;23e3
5306 ld l,(iy+001h) ;23ea
5307 ld h,(iy+002h) ;23ed
5318 call sub_257ch ;23ff
5321 call sub_24c6h ;2404
5322 call sub_257ch ;2407
5326 call sub_257ch ;2410
5329 call sub_24c6h ;2416
5330 call sub_257ch ;2419
5334 call sub_2579h ;2421
5347 ld hl,b_0x2449_start ;2434
5371 call sub_257ch ;2458
5377 call sub_257ch ;2467
5381 call sub_257ch ;2470
5384 call sub_24c6h ;2476
5385 call sub_257ch ;2479
5389 call sub_257ch ;2482
5392 ld a,(is.pfx.IXY) ;2487
5396 ld a,(iy+001h) ;2491
5401 ld a,(iy+002h) ;249a
5411 call sub_257ch ;24a8
5415 ld a,(is.pfx.IXY) ;24ae
5419 ld a,(iy+001h) ;24b8
5424 ld a,(iy+002h) ;24c1
5432 ld l,(iy+001h) ;24cf
5433 ld h,(iy+002h) ;24d2
5436 call sub_23f2h ;24d7
5441 ld a,(iy+000h) ;24e3
5449 ld a,(iy+000h) ;24ef
5455 ld a,(is.pfx.IXY) ;24f8
5459 ld hl,b_0x2538_start ;2500
5460 ld a,(is.pfx.IXY) ;2503
5463 ld hl,b_0x253B_start ;2509
5467 ld a,(iy+001h) ;2513
5486 ld hl,t_BCDEHL_HL_A ;2533
5495 ld a,(is.pfx.IXY) ;253e
5496 ld hl,t_HL.IX.IY ;2541
5499 ld hl,t_BC.DE.HL.AF ;2546
5502 ld hl,t_BC.DE.HL.SP ;254b
5505 ld a,(iy+000h) ;2552
5517 ld a,(iy+000h) ;2565
5524 ld hl,t_tstfl_ZCPS ;256d
5528 call sub_0a48h ;2573
5697 ld hl,(REG.PC) ;26e7
5701 ld iy,(REG.PC) ;26ee
5702 call sub_1f9eh ;26f2
5706 ld hl,(REG.PC) ;26fb
5708 call sub_1117h ;26ff
5709 ld iy,(REG.PC) ;2702
5710 ld hl,b_0x2717_start ;2706
5711 call lookup_opc ;2709
5716 call c,sub_1117h ;2712
5805 ld l,(iy+001h) ;276d
5806 ld h,(iy+002h) ;2770
5813 ld c,(iy+001h) ;2779
5819 ld hl,(REG.PC) ;2780
5832 ld hl,(reg.ix) ;278d
5836 ld hl,(reg.iy) ;2792
5839 ld a,(iy+001h) ;2799
5849 ld a,(iy+001h) ;27a6
5860 ld a,(iy+000h) ;27b7
5882 ld hl,(REG.SP) ;27da
5889 call sub_1117h ;27e5
5900 ld a,(iy+000h) ;27f9
5928 ld (CMD_RPT),hl ;281b
5942 call sub_289fh ;2833
5945 call get_lastarg_def ;283b
5947 ld (TCCSTR),hl ;283e
5951 call sub_26e7h ;2845
5954 call sub_0e68h ;284a
5958 ld iy,(REG.PC) ;2853
5959 call sub_28c1h ;2857
5962 call lookup_opc ;285f
5968 ld de,(TCCSTR) ;286a
5981 ld hl,(TCCSTR) ;2881
5983 ld (TCCSTR),hl ;2885
5988 call sub_26e7h ;288c
6014 call assert_eol ;28b7
6071 ;------------------------------------------
6073 ;------------------------------------------
6079 ; The following 2 params are chageable by user.
6080 ; Should these moved to top ram?
6083 rst DRSTNUM ;rst used by ddtz
6086 ei ;ints enabled/disabled while ddtz is running
6258 ;------------------------------------------
6260 .phase sysram_start+stacksize
6262 $stcka equ $ - stacksize
6270 reg.l2: db 0 ; 0fe50h
6271 reg.h2: db 0 ; 0fe51h
6272 reg.e2: db 0 ; 0fe52h
6273 reg.d2: db 0 ; 0fe53h
6274 reg.c2: db 0 ; 0fe54h
6275 reg.b2: db 0 ; 0fe55h
6276 reg.f2: db 0 ; 0fe56h
6277 reg.a2: db 0 ; 0fe57h
6279 reg.i: db high ivtab
6280 reg.iy: dw 0 ; 0fe5ah
6281 reg.ix: dw 0 ; 0fe5ch
6282 reg.e: db 0 ; 0fe5eh
6283 reg.d: db 0 ; 0fe5fh
6284 reg.c: db 0 ; 0fe60h
6285 reg.b: db 0 ; 0fe61h
6287 udcntl: db CWAITIO ; 0fe62h (mem-, io- wait)
6288 uromen: db ROM_DIS ; 0fe63h
6291 ucbar: db USR$CBAR ; 0fe65h
6292 reg.f: db 0 ; 0fe66h
6293 reg.a: db 0 ; 0fe67h
6294 reg.l: db 0 ; 0fe68h
6295 reg.h: db 0 ; 0fe69h
6296 reg.sp: dw TOPRAM ; 0fe6ah
6300 out (000h),a ;064c fe6c
6301 out0 (dcntl),l ;064e
6308 ld sp,(reg.sp) ;065a
6311 db 0C3h ;jp TPA ;065f feff ($+1): reg.pc
6316 ld (reg.l),hl ;0662 fe82: bpent:
6319 ld (reg.pc),hl ;0667
6320 ld (reg.sp),sp ;066a
6331 ld a,CWAITROM+CWAITIO ;0681
6332 out0 (dcntl),a ;0683
6343 out (000h),a ;0692 feb2