4 extrn ?const,?conin,?cono
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
415 db 3eh ;0904 ld a,0E5h
436 call nz,sub_0917h ;0921
600 ld de,$stack-50 ;09ee
631 ld hl,b_0x132A_start ;0a0e
650 db 3eh ;0a26 ld a,0c5h
665 call z,sub_0d20h ;0a38
699 call get_arg_range ;0a59
702 call skip_to_nextarg ;0a5e
720 call get_arg_def ;0a74
737 db 0e6h ;0a87 and 037h (clear carry)
766 call skip_to_nextarg ;0aa5
801 call do_subexpr ;0acc
807 call do_subexpr ;0ad6
840 ld hl,tab_eq_le_ge ;0afb
862 ld hl,tab_func_eqlege ;0b1c
889 call do_binary_op ;0b3e
1006 ld hl,tab_op_a ;0bba
1009 ld hl,tab_func_opa ;0bc1
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
1028 defw do_op_xor ;0be4
1032 call do_factor ;0be8
1038 call get.number ;0bf2
1047 ld hl,(MAXLOD) ;0c03
1053 ld hl,(offs.@) ;0c0f
1056 ld hl,(OFFS.pc) ;0c15
1060 jr z,fact_factneg ;0c1d
1062 jr z,fact_factinv ;0c21
1064 jr z,fact_factor ;0c25
1066 jr z,fact_reg.CPU ;0c29
1068 jr z,fact_reg.Y ;0c2d
1072 jp z,EXPR_BRCKT ;0c35 [ expression ]
1074 jr z,fact_factstring ;0c3a
1080 call get.decdigit ;0c3f
1119 call sub_1315h ;0c70
1132 call fact_factor ;0c80
1143 call fact_factor ;0c8b
1179 call get.hexdigit ;0cbe
1184 call get.hexdigit ;0cc4
1193 call get.hexdigit ;0cd5
1211 call get.decdigit ;0cec
1221 call get.decdigit ;0cfd
1228 call get.decdigit ;0d07
1232 add hl,hl ;0d0e hl *= 10
1280 call assert_eol ;0d41
1285 ld hl,b_0x0DFD_start ;0d4a
1286 ld de,b_0x0E1D_start ;0d4d
1289 call prnt_regs ;0d52
1293 ld iy,(REG.PC) ;0d59
1294 call sub_1f77h ;0d5d
1304 call prnt_regs ;0d6f
1311 call sub_1f5bh ;0d7c
1317 call prnt_flags ;0d85
1318 ld a,(reg.iff) ;0d88
1326 call prnt_flags ;0d98
1332 call sub_0dbeh ;0da1
1334 call sub_0dbeh ;0da6
1337 call sub_0dbeh ;0dad
1340 call sub_0dbeh ;0db4
1342 call sub_0dbeh ;0db9
1440 ld (REG.PC),hl ;0e51
1448 call sub_0f24h ;0e62
1455 ld a,(ix+000h) ;0e6e
1457 ld (ix+000h),a ;0e73
1458 call sub_11c5h ;0e76
1478 jp c,assert_eol ;0e99
1480 call sub_0ea7h ;0e9d
1482 call skip_to_nextarg ;0ea1
1492 ld e,(ix+002h) ;0eb0
1493 ld d,(ix+003h) ;0eb3
1497 ld (ix+000h),000h ;0ebb
1498 call sub_11c5h ;0ebf
1509 bit 0,(ix+000h) ;0ed1
1512 bit 4,(ix+000h) ;0ed9
1518 ld l,(ix+002h) ;0ee7
1519 ld h,(ix+003h) ;0eea
1524 ld l,(ix+004h) ;0ef8
1525 ld h,(ix+005h) ;0efb
1527 ld l,(ix+006h) ;0f01
1528 ld h,(ix+007h) ;0f04
1562 call nz,sub_0ea7h ;0f3d
1564 call sub_0f68h ;0f41
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
1576 ld (ix+000h),a ;0f61
1583 ld a,(ix+000h) ;0f6e
1621 ld de,sexpbufe ;0fb1
1643 push hl ;0fd2 save rom enable stat
1657 ld (reg.iff),a ;0fe6
1675 ld hl,(REG.PC) ;100a
1677 ld (REG.PC),hl ;100e
1679 ld hl,MSG_trap ;1011
1687 call sub_1059h ;1022
1693 call sub_0e68h ;102e
1694 call prnt_cpustat ;1031
1698 DB CR,LF,'Undefined opcode trap'
1713 ld a,(ix+000h) ;1066
1716 ld e,(ix+002h) ;106d
1717 ld d,(ix+003h) ;1070
1718 ld hl,(REG.PC) ;1073
1721 call z,sub_1087h ;107a
1733 ld e,(ix+006h) ;108b
1734 ld d,(ix+007h) ;108e
1742 ld e,(ix+004h) ;109d
1743 ld d,(ix+005h) ;10a0
1748 ld (ix+004h),e ;10a8
1749 ld (ix+005h),d ;10ab
1751 bit 4,(ix+000h) ;10ae
1766 bit 5,(ix+000h) ;10c5
1767 res 5,(ix+000h) ;10c9
1769 ld l,(ix+002h) ;10cf
1770 ld h,(ix+003h) ;10d2
1776 ld a,(ix+001h) ;10df
1781 res 3,(ix+000h) ;10e7
1790 ld a,(ix+000h) ;10f9
1793 ld e,(ix+002h) ;1100
1794 ld d,(ix+003h) ;1103
1795 ld hl,(REG.PC) ;1106
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
1819 ld (ix+000h),a ;113a
1826 ld a,(ix+000h) ;1144
1829 set 5,(ix+000h) ;114a
1830 ld l,(ix+002h) ;114e
1831 ld h,(ix+003h) ;1151
1838 ld (ix+001h),a ;1159
1863 ld (ix+001h),e ;1159
1889 call nz,prnt_cpustat ;118b
1890 call sub_10f3h ;118e
1895 call sub_26e7h ;119a
1899 ld sp,$stack ;11a2 set/restore user cpu state
1927 jp $go ;11c2 common ram, switch banks and go to user prog
1930 ld a,(ix+000h) ;11c5
1933 ld e,(ix+006h) ;11cb
1934 ld d,(ix+007h) ;11ce
1942 ld (ix+006h),a ;11d8
1943 ld (ix+007h),a ;11db
1952 call sub_11ffh ;11ee
1967 ld e,(iy+006h) ;1204
1968 ld d,(iy+007h) ;1207
1976 ld (iy+006h),e ;1217
1977 ld (iy+007h),d ;121a
1981 call get.decdigit ;121e
1985 call assert_eol ;1225
1987 call sub_1248h ;1229
1990 call assert_eol ;122f
1994 call sub_1248h ;1234
2009 add a,'0'+080h ;124b
2022 call sub_1315h ;1260
2024 call assert_eol ;1266
2031 ld hl,b_0x132A_start ;1273
2032 call sub_0a48h ;1276
2077 ld (reg.iff),a ;12bb
2079 call sub_12d1h ;12bf
2086 call sub_12d1h ;12ca
2094 call assert_eol ;12d7
2101 ld hl,tab_pr_flags ;12e3
2123 ld (reg.iff),a ;1305
2132 call sub_0a0eh ;1315
2137 ld hl,b_0x136C_start ;131c
2259 call get_lastarg_def ;13d5
2276 jp z,assert_eol ;13f9
2286 call get_bytes_m ;1407
2290 call assert_eol ;140c
2300 ld (CMD_RPT),hl ;141e
2301 ld hl,(lst.IP) ;1421
2302 call get_lastarg_def ;1424
2303 ld (lst.IP),hl ;1427
2326 call out.bin.b ;144c
2330 ld (CMD_RPT),hl ;1455
2331 ld hl,(lst.OD) ;1458
2332 call get_arg_def ;145b
2336 call skip_to_nextarg ;1463
2337 ld hl,(lst.OP) ;1466
2338 call get_lastarg_def ;1469
2339 ld (lst.OP),hl ;146c
2364 call get_arg3 ;1490 get from, size, to
2402 push af ;14c9 save 'V' flag
2408 jr nc,bm_mvdown ;14d3
2428 jr z,cmp_mem ;14ed validate?
2433 call skip_to_nextarg ;14f6
2437 call assert_eol ;14fe
2451 call out.hl ;1511 val
2453 call sub_0928h ;1517 -val
2455 call out.hl.dec ;151d dec
2457 call out.hl.decm ;1523 -dec
2459 call out.bin.w ;1529 bin
2462 call out.ascii ;1530
2472 call get_arg_range ;153f
2475 call sub_15a7h ;1544
2478 call sub_1594h ;1548
2488 ld bc,MEMDUMP_CNT ;1559
2505 call get_arg_range ;156c
2508 call sub_15a7h ;1571
2555 ld hl,ci.buf+1 ;15a7
2556 call get_bytes ;15aa
2557 ld de,ci.buf+1 ;15ad
2565 db 0e6h ;15b8 and 037h (clear carry, skip next opc)
2570 call skip_to_nextarg ;15bb
2575 call sub_0a68h ;15c4
2658 ld (CMD_RPT),hl ;162f
2661 call sub_0a82h ;1638
2698 call sub_168fh ;1673
2726 ; Read Intel Hex File from console.
2730 call get_lastarg_def ;169e
2735 call i.getchar ;16a8
2738 jr nz,w_recstart ;16af
2739 ld c,0 ;16b1 init checksum
2740 call i.gethexbyte ;16b3 record len
2742 call i.gethexbyte ;16b7 address high
2744 call i.gethexbyte ;16bb address low
2746 call i.gethexbyte ;16bf record type (ignored)
2748 and a ;16c3 record len == 0?
2751 call i.gethexbyte ;16c6
2756 call i.storebyte ;16cd
2760 call i.gethexbyte ;16d4
2763 jp nz,ERROR ;16d9 exit if checksum error
2764 jr w_recstart ;16dc next record
2767 call i.gethexbyte ;16df
2771 call sub_16f6h ;16e5
2777 call sub_16f6h ;16ed
2786 call i.getchar ;16f6
2788 call sub_0d26h ;16fb
2812 ld de,(MAXLOD) ;1728
2815 ld (MAXLOD),hl ;1731
2825 call assert_eol ;173c
2827 ld hl,MSG_high ;173f
2833 ld hl,(MAXLOD) ;1751
2844 call get_lastarg_def ;176c
2848 ld (CMD_ERR),hl ;1775
2854 ld (OFFS.pc),hl ;1782
2856 call sub_1f3fh ;1786
2859 ld de,(offs.@) ;178c
2867 ld a,(CON.COL) ;179b
2882 call nz,sub_17cdh ;17b7
2894 ld hl,t_MNEMONICS ;17d0
2895 call sub_0a15h ;17d3
2902 ld hl,b_0x17EE_start ;17e0
2956 defw gen.opc.ED2 ;1803
2962 defw gen.opc.ED2 ;1806
2968 defw gen.opc.ED2 ;1809
2974 defw gen.opc.ED2 ;180c
3052 defw gen.opc.ED2 ;1833
3058 defw gen.opc.ED2 ;1836
3064 defw gen.opc.ED2 ;1839
3070 defw gen.opc.ED2 ;183c
3094 defw gen.opc.ED2 ;1848
3100 defw gen.opc.ED2 ;184b
3106 defw gen.opc.ED2 ;184e
3112 defw gen.opc.ED2 ;1851
3118 defw gen.opc.ED2 ;1854
3136 defw gen.opc.ED2 ;185d
3142 defw gen.opc.ED2 ;1860
3154 defw gen.opc.ED2 ;1866
3160 defw gen.opc.ED2 ;1869
3190 defw gen.opc.ED2 ;1878
3196 defw gen.opc.ED2 ;187b
3226 defw gen.opc.ED2 ;188a
3256 defw gen.opc.ED2 ;1899
3333 defw gen.opc.ED2 ;18c0
3339 defw gen.opc.ED2 ;18c3
3345 defw gen.opc.ED2 ;18c6
3357 defw gen.opc.ED2 ;18cc
3374 call sub_1e41h ;18d5
3383 call sub_1ed1h ;18e3
3384 call sub_1e06h ;18e6
3386 call assert_eol ;18e9
3388 ld (iy+000h),0edh ;18f0
3389 ld (iy+001h),b ;18f4
3390 ld (iy+002h),l ;18f7
3395 call sub_1e06h ;18fd
3396 call sub_1ed1h ;1900
3397 call sub_1e41h ;1903
3408 call sub_1e2eh ;1913
3412 jp gen.opc.ED2 ;191a
3414 call sub_1e41h ;191d
3421 jp gen.opc.ED2 ;1927
3425 call sub_1e12h ;192c
3430 call sub_1e41h ;1934
3432 call sub_1e68h ;193a
3434 call sub_1e2eh ;1940
3436 call sub_1e50h ;1946
3446 call sub_1e2eh ;195d
3449 call sub_1ed8h ;1966
3450 call sub_1ed1h ;1969
3451 call sub_1e2eh ;196c
3453 call sub_1e50h ;1971
3457 call assert_eol ;1978
3458 ld a,(pfx.IXY) ;197b
3461 ld (iy+000h),a ;1982
3462 ld (iy+001h),b ;1985
3463 ld (iy+002h),l ;1988
3464 ld (iy+003h),h ;198b
3475 call assert_eol ;199a
3477 ld (iy+000h),b ;19a1
3478 ld (iy+001h),l ;19a4
3479 ld (iy+002h),h ;19a7
3489 call assert_eol ;19b4
3497 call sub_1ed1h ;19c0
3498 call sub_1e41h ;19c3
3515 call sub_1e68h ;19db
3526 call assert_eol ;19ec
3527 ld a,(pfx.IXY) ;19ef
3529 ld (iy+000h),a ;19f6
3530 ld (iy+001h),b ;19f9
3531 ld (iy+002h),c ;19fc
3553 jp gen.opc.ED2 ;1a1e
3557 call sub_1e12h ;1a25
3558 ld a,b ;1a28 ld r,nn
3566 call assert_eol ;1a2f
3568 ld (iy+000h),b ;1a36
3569 ld (iy+001h),l ;1a39
3578 call sub_1e2eh ;1a46
3584 call sub_1ed8h ;1a53
3588 call sub_1ed8h ;1a5c
3592 call sub_1ed1h ;1a64
3593 call sub_1e41h ;1a67
3600 call sub_1e12h ;1a76
3601 call assert_eol ;1a79
3602 ld a,(pfx.IXY) ;1a7c
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
3613 call sub_1ed1h ;1a94
3615 call sub_0a23h ;1a9a
3617 call sub_1e50h ;1a9f
3624 call assert_eol ;1aab
3625 ld a,(pfx.IXY) ;1aae
3627 ld (iy+000h),a ;1ab5
3628 ld (iy+001h),b ;1ab8
3644 call sub_1ed8h ;1ad0
3656 call assert_eol ;1ae6
3662 call sub_1ed1h ;1af0
3668 call sub_1ed8h ;1afc
3677 call sub_1ed1h ;1b0d
3682 call sub_1ed1h ;1b15
3688 jr z,gen.opc.ED2 ;1b1e
3696 call sub_1ed8h ;1b2a
3697 call sub_1ed1h ;1b2d
3703 call assert_eol ;1b36
3705 ld (iy+000h),b ;1b3d
3710 call assert_eol ;1b43
3712 ld (iy+000h),0edh ;1b4a
3713 ld (iy+001h),b ;1b4e
3719 call sub_0a23h ;1b57
3721 call sub_1ed1h ;1b5c
3722 call sub_1e2eh ;1b5f
3735 jr gen.opc.ED2 ;1b72
3738 call sub_0a23h ;1b77
3740 call sub_1e50h ;1b7c
3742 call sub_1ed1h ;1b81
3743 ld hl,t_BC.DE.IX.SP ;1b84
3744 ld a,(pfx.IXY) ;1b87
3747 ld hl,t_BC.DE.IY.SP ;1b8e
3749 call sub_1e2bh ;1b91
3756 call sub_1ed1h ;1b9d
3757 call sub_1e2eh ;1ba0
3767 call skip_to_nextarg ;1bb2
3774 call sub_1e41h ;1bbb
3776 call sub_1e68h ;1bc0
3778 call sub_1e12h ;1bc5
3790 call sub_1e41h ;1bd8
3792 call sub_1e68h ;1bdd
3798 call assert_eol ;1be7
3799 ld a,(pfx.IXY) ;1bea
3801 ld (iy+000h),a ;1bf1
3802 ld (iy+001h),0cbh ;1bf4
3803 ld (iy+002h),c ;1bf8
3804 ld (iy+003h),b ;1bfb
3812 call assert_eol ;1c03
3814 ld (iy+000h),0cbh ;1c0a
3815 ld (iy+001h),b ;1c0e
3820 call sub_1de6h ;1c14
3821 call sub_1ed1h ;1c17
3822 call sub_1e41h ;1c1a
3824 call sub_1e68h ;1c1f
3845 call sub_1eb8h ;1c39
3849 call skip_to_nextarg ;1c40
3860 call sub_1eb8h ;1c50
3871 call sub_1eb8h ;1c5f
3875 ld hl,b_0x1C97_start ;1c65
3876 call sub_0a15h ;1c68
3883 call skip_to_nextarg ;1c73
3890 call assert_eol ;1c7f
3912 call skip_to_nextarg ;1ca4
3916 call sub_1ebfh ;1cab
3923 call sub_1ed1h ;1cb6
3925 call sub_1defh ;1cb9
3928 call sub_1e12h ;1cbf
3939 jp gen.opc.ED2 ;1cd2
3941 call sub_1e12h ;1cd5
3951 call sub_1e50h ;1ce4
3953 call sub_1e25h ;1ce9
3962 call sub_1e41h ;1cf8
3973 call sub_1ed1h ;1d0a
3974 call sub_1d26h ;1d0d
3976 call sub_1e06h ;1d12
3980 call sub_1ed1h ;1d1a
3981 call sub_1d26h ;1d1d
3983 jp c,gen.opc.ED2 ;1d20
3990 call sub_1d26h ;1d2c
3992 call sub_1ed1h ;1d31
3993 call sub_1e41h ;1d34
4003 call sub_1e06h ;1d44
4004 call sub_1ed1h ;1d47
4011 ld hl,b_0x1D80_start ;1d54
4012 call sub_0a15h ;1d57
4015 call assert_eol ;1d5e
4017 ld hl,b_0x1DA1_start ;1d63
4022 ld (iy+000h),a ;1d6d
4030 ld (iy+001h),a ;1d7a
4056 call sub_1e50h ;1dab
4058 call sub_1e2eh ;1db0
4060 call sub_1e41h ;1db5
4062 call sub_1e68h ;1dba
4093 call sub_1e12h ;1de6
4108 call sub_1e15h ;1dfc
4117 jr nz,sub_1e12h ;1e09
4119 call sub_1e12h ;1e0c
4141 ld hl,t_BC.DE.HL.AF ;1e26
4148 ld hl,t_BC.DE.HL.SP ;1e2f
4151 call sub_0a15h ;1e33
4167 ld hl,t_BCDEHL_HL_A ;1e46
4168 call sub_0a15h ;1e49
4177 call sub_0a15h ;1e55
4184 ld (pfx.IXY),a ;1e61
4199 call sub_0a15h ;1e74
4207 ld (pfx.IXY),a ;1e81
4219 call sub_1e12h ;1e97 get displacement
4247 ld hl,t_tstfl_ZCPS ;1eb8
4251 ld hl,t_tstfl_ZC ;1ebf
4255 call sub_0a15h ;1ec5
4266 call skip_to_nextarg ;1ed1
4278 ld (CMD_RPT),hl ;1ee2
4285 call skip_to_nextarg ;1ef0
4286 call sub_0aa5h ;1ef3
4288 call assert_eol ;1ef8
4295 call sub_1f3fh ;1f02
4306 call assert_eol ;1f17
4318 call sub_1f3fh ;1f26
4336 ld (CON.COL),a ;1f49
4337 call sub_1f77h ;1f4c
4342 ld a,(CON.COL) ;1f54
4346 ld de,(offs.@) ;1f5b
4362 call sub_1f9eh ;1f7b
4365 call sub_2581h ;1f81
4367 call sub_1fdbh ;1f85
4374 ld hl,b_0x1F9B_start ;1f91
4385 ld (is.pfx.IXY),a ;1f9f
4387 ld a,(iy+000h) ;1fa6
4390 jp z,disas_pfx.ED ;1fab
4397 ld a,(iy+000h) ;1fba
4408 ld (is.pfx.IXY),a ;1fcb
4409 call sub_1fdch ;1fce
4412 call sub_1fb6h ;1fd3
4424 ld hl,b_0x2011_start ;1fde
4425 call sub_20bbh ;1fe1
4429 call sub_20bbh ;1fea
4433 ld a,(iy+000h) ;1ff4
4438 ld a,(iy+002h) ;1fff
4499 ld hl,b_0x2200_start ;203d
4500 call sub_209dh ;2040
4504 call lookup_opc ;2049
4508 call lookup_opc ;2052
4512 call lookup_opc ;205b
4518 ld a,(is.pfx.IXY) ;2065
4524 call lookup_opc ;2070
4529 ld hl,b_0x218B_start ;2078
4530 call lookup_opc ;207b
4533 ld hl,b_0x20ED_start ;2081
4534 call sub_209dh ;2084
4537 ld hl,b_0x2108_start ;208a
4538 call lookup_opc ;208d
4541 ld hl,b_0x21D2_start ;2093
4542 call lookup_opc ;2096
4561 ld hl,t_MNEMONICS ;20b0
4575 jr nz,sub_20bbh ;20c6
4581 ld a,(iy+000h) ;20ce
4593 jr nz,lookup_opc ;20dc
4602 ld hl,t_MNEMONICS ;20e5
4608 b_0x20ED_start: ; 1 byte opcodes (no parameters)
4637 b_0x2108_start: ; 1 byte opcodes
4638 defb 0c0h ;2108 ld r,r
4643 defb 0f8h ;210d add a,r
4648 defb 0f8h ;2112 adc a,r
4684 defb 0c0h ;2136 ret cc
4698 defb 0cfh ;2144 pop rr
4703 defb 0cfh ;2149 push rr
4708 defb 0ffh ;214e ex (sp),hl
4713 defb 0ffh ;2153 jp (hl)
4718 defb 0ffh ;2158 ex de,hl
4723 defb 0ffh ;215d ld sp,hl
4728 defb 0cfh ;2162 inc rr
4733 defb 0cfh ;2167 dec rr
4738 defb 0c7h ;216c inc r
4743 defb 0c7h ;2171 dec r
4748 defb 0ffh ;2176 ex af,af'
4753 defb 0cfh ;217b add hl,rr
4758 defb 0efh ;2180 ld (rr),a ;rr=bc,de
4763 defb 0efh ;2185 ld a,(rr) ;rr=bc,de
4770 b_0x218B_start: ; 2 byte opdodes
4771 defb 0c7h ;218b ld r,nn
4776 defb 0ffh ;2190 add a,nn
4781 defb 0ffh ;2195 adc a,nn
4786 defb 0ffh ;219a sub a,nn
4796 defb 0ffh ;21a4 and a,nn
4811 defb 0ffh ;21b3 cp a,nn
4816 defb 0ffh ;21b8 djnz
4826 defb 0e7h ;21c2 jr,cc
4832 defb 0d3h ;21c8 out (nn),a
4836 defb 0ffh ;21cc in a,(nn)
4843 b_0x21D2_start: ; 3 byte opcodes
4891 b_0x2200_start: ; prefix ED + 1 byte opcode
4894 defb 045h ;2202 retn
4896 defb 04dh ;2204 reti
4918 defb 0b0h ;221a ldir
4926 defb 0b8h ;2222 lddr
4934 defb 08bh ;222a otdm
4936 defb 09bh ;222c otdmr
4938 defb 083h ;222e otim
4940 defb 093h ;2230 otimr
4947 defb 0e7h ;2235 in r,(c) ;r=bcde
4952 defb 0f7h ;223a in r,(c) ;r=hl
4957 defb 0ffh ;223f in r,(c) ;r=a
4972 defb 0ffh ;224e out (c),r ;r=a
4977 defb 0cfh ;2253 sbc hl,rr
4982 defb 0cfh ;2258 adc hl,rr
4987 defb 0ffh ;225d im 0
4992 defb 0ffh ;2262 im 1
4997 defb 0ffh ;2267 im 2
5002 defb 0ffh ;226c ld i,a
5022 defb 0cfh ;2280 mlt rr
5027 defb 0c7h ;2285 tst r
5218 call sub_257ch ;22ff
5221 call sub_2579h ;2305
5227 call sub_257ch ;230f
5231 call sub_257ch ;2318
5235 ld a,(iy+000h) ;2322
5240 ld hl,b_0x2333_start ;232a
5257 ld hl,b_0x2354_start ;234b
5265 ld hl,b_0x1D80_start ;2357
5269 call sub_257ch ;2360
5272 call sub_2372h ;2366
5273 call sub_257ch ;2369
5276 call sub_2579h ;236f
5284 call sub_2579h ;237f
5288 call sub_257ch ;2387
5289 ld a,(is.pfx.IXY) ;238a
5292 ld a,(iy+002h) ;2392
5297 ld a,(iy+001h) ;239b
5303 ld a,(iy+000h) ;23a5
5306 call sub_2568h ;23aa
5307 call sub_257ch ;23ad
5310 ld c,(iy+001h) ;23b4
5323 call sub_2579h ;23c3
5328 ld a,(iy+001h) ;23cf
5333 call sub_257ch ;23d8
5339 call sub_257ch ;23e3
5342 ld l,(iy+001h) ;23ea
5343 ld h,(iy+002h) ;23ed
5354 call sub_257ch ;23ff
5357 call sub_24c6h ;2404
5358 call sub_257ch ;2407
5362 call sub_257ch ;2410
5365 call sub_24c6h ;2416
5366 call sub_257ch ;2419
5370 call sub_2579h ;2421
5383 ld hl,b_0x2449_start ;2434
5407 call sub_257ch ;2458
5413 call sub_257ch ;2467
5417 call sub_257ch ;2470
5420 call sub_24c6h ;2476
5421 call sub_257ch ;2479
5425 call sub_257ch ;2482
5428 ld a,(is.pfx.IXY) ;2487
5432 ld a,(iy+001h) ;2491
5437 ld a,(iy+002h) ;249a
5447 call sub_257ch ;24a8
5451 ld a,(is.pfx.IXY) ;24ae
5455 ld a,(iy+001h) ;24b8
5460 ld a,(iy+002h) ;24c1
5468 ld l,(iy+001h) ;24cf
5469 ld h,(iy+002h) ;24d2
5472 call sub_23f2h ;24d7
5477 ld a,(iy+000h) ;24e3
5485 ld a,(iy+000h) ;24ef
5491 ld a,(is.pfx.IXY) ;24f8
5495 ld hl,b_0x2538_start ;2500
5496 ld a,(is.pfx.IXY) ;2503
5499 ld hl,b_0x253B_start ;2509
5503 ld a,(iy+001h) ;2513
5522 ld hl,t_BCDEHL_HL_A ;2533
5531 ld a,(is.pfx.IXY) ;253e
5532 ld hl,t_HL.IX.IY ;2541
5535 ld hl,t_BC.DE.HL.AF ;2546
5538 ld hl,t_BC.DE.HL.SP ;254b
5541 ld a,(iy+000h) ;2552
5553 ld a,(iy+000h) ;2565
5560 ld hl,t_tstfl_ZCPS ;256d
5564 call sub_0a48h ;2573
5733 ld hl,(REG.PC) ;26e7
5737 ld iy,(REG.PC) ;26ee
5738 call sub_1f9eh ;26f2
5742 ld hl,(REG.PC) ;26fb
5744 call sub_1117h ;26ff
5745 ld iy,(REG.PC) ;2702
5746 ld hl,b_0x2717_start ;2706
5747 call lookup_opc ;2709
5752 call c,sub_1117h ;2712
5841 ld l,(iy+001h) ;276d
5842 ld h,(iy+002h) ;2770
5849 ld c,(iy+001h) ;2779
5855 ld hl,(REG.PC) ;2780
5868 ld hl,(reg.ix) ;278d
5872 ld hl,(reg.iy) ;2792
5875 ld a,(iy+001h) ;2799
5885 ld a,(iy+001h) ;27a6
5896 ld a,(iy+000h) ;27b7
5918 ld hl,(REG.SP) ;27da
5925 call sub_1117h ;27e5
5936 ld a,(iy+000h) ;27f9
5964 ld (CMD_RPT),hl ;281b
5978 call sub_289fh ;2833
5981 call get_lastarg_def ;283b
5983 ld (TCCSTR),hl ;283e
5987 call sub_26e7h ;2845
5990 call sub_0e68h ;284a
5994 ld iy,(REG.PC) ;2853
5995 call sub_28c1h ;2857
5998 call lookup_opc ;285f
6004 ld de,(TCCSTR) ;286a
6017 ld hl,(TCCSTR) ;2881
6019 ld (TCCSTR),hl ;2885
6024 call sub_26e7h ;288c
6050 call assert_eol ;28b7
6107 ;------------------------------------------
6109 ;------------------------------------------
6115 ; The following 2 params are changeable by user.
6116 ; Should these moved to top ram?
6119 rst DRSTNUM ;rst used by ddtz
6122 ei ;ints enabled/disabled while ddtz is running
6294 ;------------------------------------------
6296 .phase sysram_start+stacksize
6298 $stcka equ $ - stacksize
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
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
6323 udcntl: db CWAITIO ; 0fe62h (mem-, io- wait)
6324 uromen: db ROM_DIS ; 0fe63h
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
6336 out (000h),a ;064c fe6c
6337 out0 (dcntl),l ;064e
6344 ld sp,(reg.sp) ;065a
6347 db 0C3h ;jp TPA ;065f feff ($+1): reg.pc
6352 ld (reg.l),hl ;0662 fe82: bpent:
6355 ld (reg.pc),hl ;0667
6356 ld (reg.sp),sp ;066a
6367 ld a,CWAITROM+CWAITIO ;0681
6368 out0 (dcntl),a ;0683
6379 out (000h),a ;0692 feb2