X-Git-Url: http://cloudbase.mooo.com/gitweb/ddt180.git/blobdiff_plain/0f35ae663b256a187a3ab139a2d5dcfa2a53abc8..25ba7c19777f6d5dad514864f40f57bbedcb3e13:/ddt180.z80 diff --git a/ddt180.z80 b/ddt180.z80 index 4f167f6..5e17667 100644 --- a/ddt180.z80 +++ b/ddt180.z80 @@ -390,6 +390,14 @@ outchar: pop ix ret +pstr_sel: + inc b + jr pstr_sel2 +pstr_sel1: + call sub_0345h +pstr_sel2: + djnz pstr_sel1 + ;fall thru pstr: ld a,(hl) inc hl @@ -654,14 +662,6 @@ l0339h: pop bc ret -sel_dc_string: - inc b -l033eh: - dec b - ret z - call sub_0345h - jr l033eh - sub_0345h: ld a,(hl) and a @@ -1682,15 +1682,13 @@ cmd_X: jp nc,p_cpustat0 call assert_eol ld a,b - cp 01eh + cp 25 jr z,l0c5fh - cp 01fh + cp 26 jr z,l0c4fh - cp 01dh - jp z,ERROR ex de,hl ld hl,t_reg_names - call sel_dc_string + call pstr_sel call l0c33h call outbl @@ -1715,7 +1713,6 @@ l0c30h: ret l0c33h: - call pstr call pstr_inl dc '=' ld a,(de) @@ -1800,38 +1797,33 @@ sub_0caeh: ret t_reg_names: - DC 'BC''' - DC 'DE''' - DC 'HL''' - DC 'BC' - DC 'DE' - DC 'HL' - DC 'A''' - DC 'B''' - DC 'C''' - DC 'D''' - DC 'E''' - DC 'H''' - DC 'L''' - DC 'A' - DC 'B' - DC 'C' - DC 'D' - DC 'E' - DC 'H' - DC 'L' - DC 'IX' - DC 'IY' - DC 'SP' - DC 'PC' - DC 'X' - DC 'Y' - DC 'S' - DC 'P' - DC 'I' - DC 'IP' - DC 'F''' - DC 'F' + DC 'BC''' ;0 + DC 'DE''' ;1 + DC 'HL''' ;2 + DC 'BC' ;3 + DC 'DE' ;4 + DC 'HL' ;5 + DC 'A''' ;6 + DC 'B''' ;7 + DC 'C''' ;8 + DC 'D''' ;9 + DC 'E''' ;10 + DC 'H''' ;11 + DC 'L''' ;12 + DC 'A' ;13 + DC 'B' ;14 + DC 'C' ;15 + DC 'D' ;16 + DC 'E' ;17 + DC 'H' ;18 + DC 'L' ;19 + DC 'IX' ;20 + DC 'IY' ;21 + DC 'SP' ;22 + DC 'PC' ;23 + DC 'I' ;24 + DC 'F''' ;25 + DC 'F' ;26 DB 0 b_0cfa_start: @@ -1883,18 +1875,8 @@ b_0cfa_start: dw reg_sp db 003h dw reg.pc - db 003h - dw reg.ix - db 003h - dw reg.iy - db 003h - dw reg_sp - db 003h - dw reg.pc db 000h dw reg.i - db 003h - dw l004eh db 000h dw reg.f2 db 000h @@ -2400,19 +2382,6 @@ p_max_high: CALL_HL: jp (hl) -;------------------------------------------------------------------------------- - - - - -b_176d_start: - DC 'AF,AF''' -l1773h: - DC 'DE,HL' - DC '(SP),HL' - DC '(SP),IX' - DC '(SP),IY' - db 0 ;------------------------------------------------------------------------------- ; >>L [startaddr] [endaddr] @@ -2464,21 +2433,13 @@ cmdl_p_line: ret p_disas_line: - call outbl2 call out_hl - call z,outbl - call outbl + call outbl2 sub a ld (con_col),a push hl pop iy call p_disas_instr - ret z - - ld c,15 - call p_goto_col - ; fall thru -;------------------------------------------------------------------------------- ret ;------------------------------------------------------------------------------- @@ -2673,7 +2634,6 @@ disas_nopfx: ret c ld hl,b_1b9b_start call lookup_opc - ret nc ld b,3 ret @@ -2689,7 +2649,7 @@ sub_1a72h: inc hl jr sub_1a72h l1a7fh: - ld de,l1c97h + ld de,p_arg_none inc hl ld c,(hl) jr get_mnemonic @@ -2723,6 +2683,9 @@ lookup_opc: l1aa8h: inc hl ld c,(hl) + inc c + ret z + dec c inc hl ld e,(hl) inc hl @@ -2738,253 +2701,237 @@ get_mnemonic: ; 1 byte opcodes (no parameters) ; Format: db opcode, t_MNEMONICS-index b_1ab6_start: - db 076h,039h ;halt - db 0d9h,036h ;exx - db 0f3h,02ch ;di - db 0fbh,032h ;ei - db 000h,069h ;nop - db 007h,09eh ;rlca - db 00fh,0adh ;rrca - db 017h,098h ;rla - db 01fh,0a7h ;rra - db 027h,026h ;daa - db 02fh,023h ;cpl - db 037h,0bah ;scf - db 03fh,010h ;ccf + db 076h,o_HALT ;halt + db 0d9h,o_EXX ;exx + db 0f3h,o_DI ;di + db 0fbh,o_EI ;ei + db 000h,o_NOP ;nop + db 007h,o_RLCA ;rlca + db 00fh,o_RRCA ;rrca + db 017h,o_RLA ;rla + db 01fh,o_RRA ;rra + db 027h,o_DAA ;daa + db 02fh,o_CPL ;cpl + db 037h,o_SCF ;scf + db 03fh,o_CCF ;ccf + db 0c9h,o_RET ;ret db 0ffh ; 1 byte opcodes ; Format: db mask, match, t_MNEMONICS-index -; dw argument formating fuction +; dw argument formating function b_1ad1_start: - db 0c0h,040h,056h ;ld r,r + db 0c0h,040h,o_LD ;ld r,r dw p_arg_r_r - db 0f8h,080h,003h ;add a,r + db 0f8h,080h,o_ADD ;add a,r dw p_arg_a_r - db 0f8h,088h,000h ;adc a,r + db 0f8h,088h,o_ADC ;adc a,r dw p_arg_a_r - db 0f8h,090h,0c9h ;sub r + db 0f8h,090h,o_SUB ;sub r dw p_arg_rs - db 0f8h,098h,0b7h ;sbc a,r + db 0f8h,098h,o_SBC ;sbc a,r dw p_arg_a_r - db 0f8h,0a0h,006h ;and r + db 0f8h,0a0h,o_AND ;and r dw p_arg_rs - db 0f8h,0a8h,0cch ;xor r + db 0f8h,0a8h,o_XOR ;xor r dw p_arg_rs - db 0f8h,0b0h,06ch ;or r + db 0f8h,0b0h,o_OR ;or r dw p_arg_rs - db 0f8h,0b8h,013h ;cp r + db 0f8h,0b8h,o_CP ;cp r dw p_arg_rs - db 0c7h,0c0h,08bh ;ret cc + db 0c7h,0c0h,o_RET ;ret cc dw p_arg_cc - db 0c7h,0c7h,0b4h ;rst - dw l1c98h - db 0ffh,0c9h,08bh ;ret - dw l1c97h - db 0cfh,0c1h,081h ;pop rr + db 0c7h,0c7h,o_RST ;rst + dw p_arg_rst + db 0cfh,0c1h,o_POP ;pop rr dw p_arg_zz - db 0cfh,0c5h,084h ;push rr + db 0cfh,0c5h,o_PUSH ;push rr dw p_arg_zz - db 0ffh,0e3h,034h ;ex (sp),hl + db 0ffh,0e3h,o_EX ;ex (sp),hl dw l1ca0h - db 0ffh,0e9h,052h ;jp (hl) + db 0ffh,0e9h,o_JP ;jp (hl) dw l1caeh - db 0ffh,0ebh,034h ;ex de,hl + db 0ffh,0ebh,o_EX ;ex de,hl dw p_arg_ex_dehl - db 0ffh,0f9h,056h ;ld sp,hl + db 0ffh,0f9h,o_LD ;ld sp,hl dw l1cc1h - db 0cfh,003h,041h ;inc rr + db 0cfh,003h,o_INC ;inc rr dw p_arg_ww - db 0cfh,00bh,029h ;dec rr + db 0cfh,00bh,o_DEC ;dec rr dw p_arg_ww - db 0c7h,004h,041h ;inc r + db 0c7h,004h,o_INC ;inc r dw p_arg_r - db 0c7h,005h,029h ;dec r + db 0c7h,005h,o_DEC ;dec r dw p_arg_r - db 0ffh,008h,034h ;ex af,af' + db 0ffh,008h,o_EX ;ex af,af' dw p_arg_ex_afaf - db 0cfh,009h,003h ;add hl,rr + db 0cfh,009h,o_ADD ;add hl,rr dw l1cd3h - db 0efh,002h,056h ;ld (rr),a ;rr=bc,de + db 0efh,002h,o_LD ;ld (rr),a ;rr=bc,de dw l1cdch - db 0efh,00ah,056h ;ld a,(rr) ;rr=bc,de + db 0efh,00ah,o_LD ;ld a,(rr) ;rr=bc,de dw l1ce5h db 0 ; 2 byte opdodes b_1b54_start: - db 0c7h,006h,056h ;ld r,nn + db 0c7h,006h,o_LD ;ld r,nn dw l1cfah - db 0ffh,0c6h,003h ;add a,nn + db 0ffh,0c6h,o_ADD ;add a,nn dw l1cf5h - db 0ffh,0ceh,000h ;adc a,nn + db 0ffh,0ceh,o_ADC ;adc a,nn dw l1cf5h - db 0ffh,0d6h,0c9h ;sub a,nn + db 0ffh,0d6h,o_SUB ;sub nn dw l1d09h - db 0ffh,0deh,0b7h ;sbc a,nn + db 0ffh,0deh,o_SBC ;sbc a,nn dw l1cf5h - db 0ffh,0e6h,006h ;and a,nn + db 0ffh,0e6h,o_AND ;and nn dw l1d09h - db 0ffh,0eeh,0cch ;xor nn + db 0ffh,0eeh,o_XOR ;xor nn dw l1d09h - db 0ffh,0f6h,06ch ;or nn + db 0ffh,0f6h,o_OR ;or nn dw l1d09h - db 0ffh,0feh,013h ;cp a,nn + db 0ffh,0feh,o_CP ;cp nn dw l1d09h - db 0ffh,010h,02eh ;djnz + db 0ffh,010h,o_DJNZ ;djnz dw p_arg_jrel - db 0ffh,018h,054h ;jr + db 0ffh,018h,o_JR ;jr dw p_arg_jrel - db 0e7h,020h,054h ;jr cc, + db 0e7h,020h,o_JR ;jr cc, dw p_arg_cc_jrel - db 0ffh,0d3h,076h ;out (nn),a + db 0ffh,0d3h,o_OUT ;out (nn),a dw l1d37h - db 0ffh,0dbh,03fh ;in a,(nn) + db 0ffh,0dbh,o_IN ;in a,(nn) dw l1d29h db 0 ; 3 byte opcodes b_1b9b_start: - db 0c7h,0c2h,052h ;jp cc,mn + db 0c7h,0c2h,o_JP ;jp cc,mn dw p_arg_cc_mn - db 0c7h,0c4h,00ch ;call cc,mn + db 0c7h,0c4h,o_CALL ;call cc,mn dw p_arg_cc_mn - db 0cfh,001h,056h ;ld ww,mn + db 0cfh,001h,o_LD ;ld ww,mn dw p_arg_ww_mn - db 0ffh,0c3h,052h ;jp mn + db 0ffh,0c3h,o_JP ;jp mn dw p_arg_mn - db 0ffh,0cdh,00ch ;call mn + db 0ffh,0cdh,o_CALL ;call mn dw p_arg_mn - db 0ffh,022h,056h ;ld (mn),hl + db 0ffh,022h,o_LD ;ld (mn),hl dw p_arg_addr_hl - db 0ffh,02ah,056h ;ld hl,(mn) + db 0ffh,02ah,o_LD ;ld hl,(mn) dw p_arg_hl_addr - db 0ffh,032h,056h ;ld (mn),a + db 0ffh,032h,o_LD ;ld (mn),a dw p_arg_addr_a - db 0ffh,03ah,056h ;ld a,(mn) + db 0ffh,03ah,o_LD ;ld a,(mn) dw p_arg_a_addr db 0 ; Prefix ED + 1 byte opcode, no arguments ; Format: opcode, t_MNEMONICS index b_1bc9_start: - db 044h,066h ;neg - db 045h,092h ;retn - db 04dh,08eh ;reti - db 067h,0b1h ;rrd - db 06fh,0a2h ;rld - db 0a0h,05fh ;ldi - db 0a1h,01ch ;cpi - db 0a2h,04bh ;ini - db 0a3h,07dh ;outi - db 0a8h,058h ;ldd - db 0a9h,015h ;cpd - db 0aah,044h ;ind - db 0abh,079h ;outd - db 0b0h,062h ;ldir - db 0b1h,01fh ;cpir - db 0b2h,04eh ;inir - db 0b3h,072h ;otir - db 0b8h,05bh ;lddr - db 0b9h,018h ;cpdr - db 0bah,047h ;indr - db 0bbh,06eh ;otdr - db 08bh,0d5h ;otdm - db 09bh,0d9h ;otdmr - db 083h,0deh ;otim - db 093h,0e2h ;otimr - db 076h,0ebh ;slp + db 044h,o_NEG ;neg + db 045h,o_RETN ;retn + db 04dh,o_RETI ;reti + db 067h,o_RRD ;rrd + db 06fh,o_RLD ;rld + db 0a0h,o_LDI ;ldi + db 0a1h,o_CPI ;cpi + db 0a2h,o_INI ;ini + db 0a3h,o_OUTI ;outi + db 0a8h,o_LDD ;ldd + db 0a9h,o_CPD ;cpd + db 0aah,o_IND ;ind + db 0abh,o_OUTD ;outd + db 0b0h,o_LDIR ;ldir + db 0b1h,o_CPIR ;cpir + db 0b2h,o_INIR ;inir + db 0b3h,o_OTIR ;otir + db 0b8h,o_LDDR ;lddr + db 0b9h,o_CPDR ;cpdr + db 0bah,o_INDR ;indr + db 0bbh,o_OTDR ;otdr + db 08bh,o_OTDM ;otdm + db 09bh,o_OTDMR ;otdmr + db 083h,o_OTDM ;otim + db 093h,o_OTDMR ;otimr + db 076h,o_SLP ;slp db 0ffh ; b_1bf4_start: - db 0e7h,040h,03fh ;in r,(c) ;r=b,c,d,e + db 0ffh,070h,0ffh ;in (c) ; dw p_arg_in_c ; - db 0f7h,060h,03fh ;in r,(c) ;r=h,l + db 0c7h,040h,o_IN ;in r,(c) ;r=b,c,d,e,h,l,a dw p_arg_in_c ; - db 0ffh,078h,03fh ;in r,(c) ;r=a - dw p_arg_in_c ; - db 0e7h,041h,076h ;out (c),r ;r=b,c,d,e - dw p_arg_out_c ; - db 0f7h,061h,076h ;out (c),r ;r=h,l + db 0ffh,071h,0ffh ;out (c),0 ; dw p_arg_out_c ; - db 0ffh,079h,076h ;out (c),r ;r=a + db 0c7h,041h,o_OUT ;out (c),r ;r=b,c,d,e,h,l,a dw p_arg_out_c ; - db 0cfh,042h,0b7h ;sbc hl,rr + db 0cfh,042h,o_SBC ;sbc hl,rr dw l1dcah ; - db 0cfh,04ah,000h ;adc hl,rr + db 0cfh,04ah,o_ADC ;adc hl,rr dw l1dcah ; - db 0ffh,046h,03dh ;im 0 + db 0ffh,046h,o_IM ;im 0 dw l1d85h ; - db 0ffh,056h,03dh ;im 1 + db 0ffh,056h,o_IM ;im 1 dw l1d89h ; - db 0ffh,05eh,03dh ;im 2 + db 0ffh,05eh,o_IM ;im 2 dw l1d8dh ; - db 0ffh,047h,056h ;ld i,a - dw l1d92h ; - db 0ffh,057h,056h ;ld a,i - dw l1d97h ; - db 0ffh,04fh,056h ;ld r,a - dw l1d9ch ; - db 0ffh,05fh,056h ;ld a,r - dw l1da1h - db 0cfh,04ch,0d2h ;mlt rr + db 0e7h,047h,o_LD ;ld i,a ... ld a,r + dw p_arg_IR ; + db 0cfh,04ch,o_MLT ;mlt rr dw p_arg_ww - db 0c7h,004h,0eeh ;tst r + db 0c7h,004h,o_TST ;tst r dw p_arg_r db 0 l228bh: - db 0e7h,000h,0cfh ;in0 r,(m) ;r=b,c,d,e + db 0ffh,030h,0ffh ;in0 (m) dw p_arg_r_m - db 0f7h,020h,0cfh ;in0 r,(m) ;r=h,l + db 0c7h,000h,o_IN ;in0 r,(m) ;r=b,c,d,e,h,l,a dw p_arg_r_m - db 0ffh,038h,0cfh ;in0 a,(m) - dw p_arg_r_m - db 0e7h,001h,0e7h ;out0 (m),r ;r=b,c,d,e - dw p_arg_m_r - db 0f7h,021h,0e7h ;out0 (m),r ;r=h,l + db 0ffh,031h,0ffh ;out0 (m),0 dw p_arg_m_r - db 0ffh,039h,0e7h ;out0 (m),a + db 0ech,001h,o_OUT0 ;out0 (m),r ;r=b,c,d,e dw p_arg_m_r - db 0ffh,064h,0eeh ;tst m + db 0ffh,064h,o_TST ;tst m dw l1d09h - db 0ffh,074h,0f1h ;tstio m + db 0ffh,074h,o_TSTIO ;tstio m dw l1d09h db 0 +; Prefix ED + 1 byte opcode + 2 byte address +; Format: db mask, match, t_MNEMONICS-index +; dw argument formating function b_1c40_start: - db 0efh,043h,056h ;ld (mn),ww ;ww=bc,de - dw p_arg_addr_ww - db 0ffh,073h,056h ;ld (mn),sp + db 0cfh,043h,o_LD ;ld (mn),ww ;ww=bc,de,hl,sp dw p_arg_addr_ww - db 0efh,04bh,056h ;ld ww,(mn) ;ww=bc,de - dw p_arg_ww_addr - db 0ffh,07bh,056h ;ld sp,(mn) + db 0cfh,04bh,o_LD ;ld ww,(mn) ;ww=bc,de,hl,sp dw p_arg_ww_addr db 0 ; CB b_1c55_start: - db 0f8h,000h,09bh ;rlc g + db 0f8h,000h,o_RLC ;rlc g dw l1e03h - db 0f8h,008h,0aah ;rrc g + db 0f8h,008h,o_RRC ;rrc g dw l1e03h - db 0f8h,010h,096h ;rl g + db 0f8h,010h,o_RL ;rl g dw l1e03h - db 0f8h,018h,0a5h ;rr g + db 0f8h,018h,o_RR ;rr g dw l1e03h - db 0f8h,020h,0c0h ;sla g + db 0f8h,020h,o_SLA ;sla g dw l1e03h - db 0f8h,028h,0c3h ;sra g + db 0f8h,028h,o_SRA ;sra g dw l1e03h - db 0f8h,038h,0c6h ;srl g + db 0f8h,038h,o_SRL ;srl g dw l1e03h - db 0c0h,040h,009h ;bit b,g + db 0c0h,040h,o_BIT ;bit b,g dw p_arg_bitop - db 0c0h,080h,088h ;res b,g + db 0c0h,080h,o_RES ;res b,g dw p_arg_bitop - db 0c0h,0c0h,0bdh ;set b,g + db 0c0h,0c0h,o_SET ;set b,g dw p_arg_bitop db 0 @@ -2997,8 +2944,6 @@ p_arg_r_r: p_arg_a_r: call p_A_comma jp p_arg_rs -l1c97h: - ret p_arg_r_m: call p_arg_r @@ -3010,7 +2955,7 @@ p_arg_m_r: call p_char_comma jp p_arg_r -l1c98h: +p_arg_rst: ld a,(iy+000h) and 038h jp out_hex @@ -3026,8 +2971,10 @@ l1caeh: jr out_rparen p_arg_ex_dehl: - ld hl,l1773h - jp pstr + call pstr_inl + DC 'DE,HL' +p_arg_none: + ret l1cc1h: call pstr_inl @@ -3035,8 +2982,9 @@ l1cc1h: jp p_arg_hlixiy p_arg_ex_afaf: - ld hl,b_176d_start - jp pstr + call pstr_inl + DC 'AF,AF''' + ret l1cd3h: call p_arg_hlixiy @@ -3159,28 +3107,21 @@ p_char_lparen: ld a,'(' jp outchar -l1d92h: - ld hl,b_1da7_start - jr l1da4h -l1d97h: - ld hl,l1daah - jr l1da4h -l1d9ch: - ld hl,l1dadh - jr l1da4h -l1da1h: - ld hl,l1db0h -l1da4h: - jp pstr +p_arg_IR: + ld a,(iy+000h) + rra + rra + rra + and 03 + ld hl,t_arg_IR + jp p_arg -b_1da7_start: +t_arg_IR: DC 'I,A' -l1daah: - DC 'A,I' -l1dadh: DC 'R,A' -l1db0h: + DC 'A,I' DC 'A,R' + db 0 p_arg_in_c: call p_arg_r @@ -3261,18 +3202,15 @@ p_arg_rs: p_arg_r0: and 007h cp 006h - jr nz,p_arg_r1 + ld b,a + ld hl,t_BCDEHL_HL_A + jr nz,p_arg0 ld a,(isprefix_ixiy) and a - ld a,006h - jr z,p_arg_r1 - ld hl,b_1e78_start - ld a,(isprefix_ixiy) + jr z,p_arg0 + ld hl,t_lp_IXIY dec a - jr z,l1e4dh - ld hl,l1e7bh -l1e4dh: - call pstr + call p_arg ld a,(iy+001h) push af rlca @@ -3287,19 +3225,15 @@ l1e61h: pop af jp p_arg_nn_rp -p_arg_r1: - ld hl,t_BCDEHL_HL_A - jr p_arg - -b_1e78_start: +t_lp_IXIY: DC '(IX' -l1e7bh: DC '(IY' p_arg_hlixiy: ld a,(isprefix_ixiy) ld hl,t_HL.IX.IY jr p_arg + p_arg_zz: ld hl,t_BC.DE.HL.AF jr l1e8eh @@ -3326,89 +3260,131 @@ p_arg_cc0: ld hl,t_tstfl_ZCPS p_arg: ld b,a - call sel_dc_string - jp pstr +p_arg0: + jp pstr_sel + +if 0 +p_bli: + ld a,(iy+000h) + rra + and 00ch + ld b,a + ld a,(iy+000h) + and 003h + or b + ld hl,t_mn_bli + jr p_arg +endif ;------------------------------------------------------------------------------- +opc_index defl 0 +opc_offset defl 0 + +opc macro x + local pos +pos defl $ +i_&x equ opc_index +o_&x equ opc_offset + dc '&x' +opc_index defl opc_index+1 +opc_offset defl opc_offset+$-pos + endm + + t_MNEMONICS: - DC 'ADC' - DC 'ADD' - DC 'AND' - DC 'BIT' - DC 'CALL' - DC 'CCF' - DC 'CP' - DC 'CPD' - DC 'CPDR' - DC 'CPI' - DC 'CPIR' - DC 'CPL' - DC 'DAA' - DC 'DEC' - DC 'DI' - DC 'DJNZ' - DC 'EI' - DC 'EX' - DC 'EXX' - DC 'HALT' - DC 'IM' - DC 'IN' - DC 'INC' - DC 'IND' - DC 'INDR' - DC 'INI' - DC 'INIR' - DC 'JP' - DC 'JR' - DC 'LD' - DC 'LDD' - DC 'LDDR' - DC 'LDI' - DC 'LDIR' - DC 'NEG' - DC 'NOP' - DC 'OR' - DC 'OTDR' - DC 'OTIR' - DC 'OUT' - DC 'OUTD' - DC 'OUTI' - DC 'POP' - DC 'PUSH' - DC 'RES' - DC 'RET' - DC 'RETI' - DC 'RETN' - DC 'RL' - DC 'RLA' - DC 'RLC' - DC 'RLCA' - DC 'RLD' - DC 'RR' - DC 'RRA' - DC 'RRC' - DC 'RRCA' - DC 'RRD' - DC 'RST' - DC 'SBC' - DC 'SCF' - DC 'SET' - DC 'SLA' - DC 'SRA' - DC 'SRL' - DC 'SUB' - DC 'XOR' - DC 'IN0' - DC 'MLT' - DC 'OTDM' - DC 'OTDMR' - DC 'OTIM' - DC 'OTIMR' - DC 'OUT0' - DC 'SLP' - DC 'TST' - DC 'TSTIO' +; 1-byte other + opc NOP + opc LD + opc INC + opc DEC + opc DJNZ + opc JR + opc HALT + + opc RLCA + opc RRCA + opc RLA + opc RRA + opc DAA + opc CPL + opc SCF + opc CCF + +; 1-byte "alu" + opc ADD + opc ADC + opc SUB + opc SBC + opc AND + opc XOR + opc OR + opc CP + + opc RET + opc POP + opc JP + opc CALL + opc PUSH + opc RST + opc OUT + opc EXX + opc IN + opc EX + opc DI + opc EI +; CB + opc RLC + opc RRC + opc RL + opc RR + opc SLA + opc SRA +; SLL + opc SRL + opc BIT + opc RES + opc SET + +; ED + opc NEG + opc RETN + opc RETI + opc IM + opc RRD + opc RLD + +;Block instructions +t_mn_bli: + opc LDI + opc CPI + opc INI + opc OUTI + opc LDD + opc CPD + opc IND + opc OUTD + opc LDIR + opc CPIR + opc INIR + opc OTIR + opc LDDR + opc CPDR + opc INDR + opc OTDR + +;Z180 + opc IN0 + opc OUT0 + opc TST + opc MLT + opc TSTIO + opc SLP + opc OTIM + opc OTDM + opc OTIMR + opc OTDMR + DB 0 t_BCDEHL_HL_A: @@ -3430,13 +3406,11 @@ t_BC.DE.HL.SP: t_BC.DE.HL.AF: DC 'BC' DC 'DE' - DC 'HL' DC 'AF' DB 0 t_HL.IX.IY: DC 'HL' - DC 'IX' DC 'IY' DB 0 @@ -3449,12 +3423,6 @@ t_tstfl_ZCPS: DC 'PE' DC 'P' DC 'M' - DC 'NE' - DC 'EQ' - DC 'GE' - DC 'LT' - DC 'NV' - DC 'V' DB 0 t__C_: DC '(C)' @@ -3481,7 +3449,7 @@ tc_set_bp: add hl,bc call bp_trace_enter ld iy,(reg.pc) - ld hl,b_2039_start + ld hl,t_op_branch call lookup_opc ccf ret c @@ -3495,36 +3463,35 @@ l2037h: ;------------------------------------------------------------------------------- -b_2039_start: - db 0ffh,0ddh,000h ;Prefix DD +t_op_branch: + db 0ffh,0ddh,0 ;Prefix DD dw l20a7h - db 0ffh,0fdh,000h ;Prefix FD + db 0ffh,0fdh,0 ;Prefix FD dw l20ach - db 0ffh,0edh,000h ;Prefix ED + db 0ffh,0edh,0 ;Prefix ED dw l20b8h - -b_2048_start: - db 0ffh,0cdh,000h ;call mn +t_op_branch0: + db 0ffh,0cdh,0 ;call mn dw l2080h - db 0ffh,0c3h,000h ;jp mn + db 0ffh,0c3h,0 ;jp mn dw l208bh - db 0ffh,0e9h,000h ;jp () + db 0ffh,0e9h,0 ;jp () dw l20a2h - db 0ffh,0c9h,000h ;ret + db 0ffh,0c9h,0 ;ret dw l20dch - db 0ffh,0cfh,000h ;rst 8 + db 0ffh,0cfh,0 ;rst 8 dw l2115h - db 0c7h,0c7h,000h ;rst n + db 0c7h,0c7h,0 ;rst n dw l20f9h - db 0c7h,0c4h,000h ;call cc,mn + db 0c7h,0c4h,0 ;call cc,mn dw l2080h - db 0f7h,010h,000h ;djnz d; jr d + db 0f7h,010h,0 ;djnz d; jr d dw l2093h - db 0e7h,020h,000h ;jr cc,d + db 0e7h,020h,0 ;jr cc,d dw l2093h - db 0c7h,0c2h,000h ;jp cc,mn + db 0c7h,0c2h,0 ;jp cc,mn dw l208bh - db 0c7h,0c0h,000h ;ret cc + db 0c7h,0c0h,0 ;ret cc dw l20c5h db 0 @@ -3622,7 +3589,6 @@ l20f9h: ld a,(b_21e2_start) and a ret z - scf ret