#include "z80dis.h" #include #include #include "z80.h" namespace z80dis { char buffer[256]; int opcode_size = 0; // $%04x // $%02x // %hhd const char *base_opcodes[256] = {"nop", "ld bc,$%04x", "ld (bc),a", "inc bc", "inc b", "dec b", "ld b,$%02x", "rlca", "ex af,af'", "add hl,bc", "ld a,(bc)", "dec bc", "inc c", "dec c", "ld c,$%02x", "rrca", "djnz $%Xx", "ld de,$%04x", "ld (de),a", "inc de", "inc d", "dec d", "ld d,$%02x", "rla", "jr $%Xx", "add hl,de", "ld a,(de)", "dec de", "inc e", "dec e", "ld e,$%02x", "rra", "jr nz,$%Xx", "ld hl,$%04x", "ld ($%04x),hl", "inc hl", "inc h", "dec h", "ld h,$%02x", "daa", "jr z,$%Xx", "add hl,hl", "ld hl,($%04x)", "dec hl", "inc l", "dec l", "ld l,$%02x", "cpl", "jr nc,$%Xx", "ld sp,$%04x", "ld ($%04x),a", "inc sp", "inc (hl)", "dec (hl)", "ld (hl),$%02x", "scf", "jr c,$%Xx", "add hl,sp", "ld a,($%04x)", "dec sp", "inc a", "dec a", "ld a,$%02x", "ccf", "ld b,b", "ld b,c", "ld b,d", "ld b,e", "ld b,h", "ld b,l", "ld b,(hl)", "ld b,a", "ld c,b", "ld c,c", "ld c,d", "ld c,e", "ld c,h", "ld c,l", "ld c,(hl)", "ld c,a", "ld d,b", "ld d,c", "ld d,d", "ld d,e", "ld d,h", "ld d,l", "ld d,(hl)", "ld d,a", "ld e,b", "ld e,c", "ld e,d", "ld e,e", "ld e,h", "ld e,l", "ld e,(hl)", "ld e,a", "ld h,b", "ld h,c", "ld h,d", "ld h,e", "ld h,h", "ld h,l", "ld h,(hl)", "ld h,a", "ld l,b", "ld l,c", "ld l,d", "ld l,e", "ld l,h", "ld l,l", "ld l,(hl)", "ld l,a", "ld (hl),b", "ld (hl),c", "ld (hl),d", "ld (hl),e", "ld (hl),h", "ld (hl),l", "halt", "ld (hl),a", "ld a,b", "ld a,c", "ld a,d", "ld a,e", "ld a,h", "ld a,l", "ld a,(hl)", "ld a,a", "add a,b", "add a,c", "add a,d", "add a,e", "add a,h", "add a,l", "add a,(hl)", "add a,a", "adc a,b", "adc a,c", "adc a,d", "adc a,e", "adc a,h", "adc a,l", "adc a,(hl)", "adc a,a", "sub b", "sub c", "sub d", "sub e", "sub h", "sub l", "sub (hl)", "sub a", "sbc a,b", "sbc a,c", "sbc a,d", "sbc a,e", "sbc a,h", "sbc a,l", "sbc a,(hl)", "sbc a,a", "and b", "and c", "and d", "and e", "and h", "and l", "and (hl)", "and a", "xor b", "xor c", "xor d", "xor e", "xor h", "xor l", "xor (hl)", "xor a", "or b", "or c", "or d", "or e", "or h", "or l", "or (hl)", "or a", "cp b", "cp c", "cp d", "cp e", "cp h", "cp l", "cp (hl)", "cp a", "ret nz", "pop bc", "jp nz,$%04x", "jp $%04x", "call nz,$%04x", "push bc", "add a,$%02x", "rst 00h", "ret z", "ret", "jp z,$%04x", "_Bit_", "call z,$%04x", "call $%04x", "adc a,$%02x", "rst 08h", "ret nc", "pop de", "jp nc,$%04x", "out ($%02x),a", "call nc,$%04x", "push de", "sub $%02x", "rst 10h", "ret c", "exx", "jp c,$%04x", "in a,($%02x)", "call c,$%04x", "_IX_", "sbc a,$%02x", "rst 18h", "ret po", "pop hl", "jp po,$%04x", "ex (sp),hl", "call po,$%04x", "push hl", "and $%02x", "rst 20h", "ret pe", "jp (hl)", "jp pe,$%04x", "ex de,hl", "call pe,$%04x", "_Misc._", "xor $%02x", "rst 28h", "ret p", "pop af", "jp p,$%04x", "di", "call p,$%04x", "push af", "or $%02x", "rst 30h", "ret m", "ld sp,hl", "jp m,$%04x", "ei", "call m,$%04x", "_IY_", "cp $%02x", "rst 38h"}; const char *cb_opcodes[256] = {"rlc b", "rlc c", "rlc d", "rlc e", "rlc h", "rlc l", "rlc (hl)", "rlc a", "rrc b", "rrc c", "rrc d", "rrc e", "rrc h", "rrc l", "rrc (hl)", "rrc a", "rl b", "rl c", "rl d", "rl e", "rl h", "rl l", "rl (hl)", "rl a", "rr b", "rr c", "rr d", "rr e", "rr h", "rr l", "rr (hl)", "rr a", "sla b", "sla c", "sla d", "sla e", "sla h", "sla l", "sla (hl)", "sla a", "sra b", "sra c", "sra d", "sra e", "sra h", "sra l", "sra (hl)", "sra a", "sll b", "sll c", "sll d", "sll e", "sll h", "sll l", "sll (hl)", "sll a", "srl b", "srl c", "srl d", "srl e", "srl h", "srl l", "srl (hl)", "srl a", "bit 0,b", "bit 0,c", "bit 0,d", "bit 0,e", "bit 0,h", "bit 0,l", "bit 0,(hl)", "bit 0,a", "bit 1,b", "bit 1,c", "bit 1,d", "bit 1,e", "bit 1,h", "bit 1,l", "bit 1,(hl)", "bit 1,a", "bit 2,b", "bit 2,c", "bit 2,d", "bit 2,e", "bit 2,h", "bit 2,l", "bit 2,(hl)", "bit 2,a", "bit 3,b", "bit 3,c", "bit 3,d", "bit 3,e", "bit 3,h", "bit 3,l", "bit 3,(hl)", "bit 3,a", "bit 4,b", "bit 4,c", "bit 4,d", "bit 4,e", "bit 4,h", "bit 4,l", "bit 4,(hl)", "bit 4,a", "bit 5,b", "bit 5,c", "bit 5,d", "bit 5,e", "bit 5,h", "bit 5,l", "bit 5,(hl)", "bit 5,a", "bit 6,b", "bit 6,c", "bit 6,d", "bit 6,e", "bit 6,h", "bit 6,l", "bit 6,(hl)", "bit 6,a", "bit 7,b", "bit 7,c", "bit 7,d", "bit 7,e", "bit 7,h", "bit 7,l", "bit 7,(hl)", "bit 7,a", "res 0,b", "res 0,c", "res 0,d", "res 0,e", "res 0,h", "res 0,l", "res 0,(hl)", "res 0,a", "res 1,b", "res 1,c", "res 1,d", "res 1,e", "res 1,h", "res 1,l", "res 1,(hl)", "res 1,a", "res 2,b", "res 2,c", "res 2,d", "res 2,e", "res 2,h", "res 2,l", "res 2,(hl)", "res 2,a", "res 3,b", "res 3,c", "res 3,d", "res 3,e", "res 3,h", "res 3,l", "res 3,(hl)", "res 3,a", "res 4,b", "res 4,c", "res 4,d", "res 4,e", "res 4,h", "res 4,l", "res 4,(hl)", "res 4,a", "res 5,b", "res 5,c", "res 5,d", "res 5,e", "res 5,h", "res 5,l", "res 5,(hl)", "res 5,a", "res 6,b", "res 6,c", "res 6,d", "res 6,e", "res 6,h", "res 6,l", "res 6,(hl)", "res 6,a", "res 7,b", "res 7,c", "res 7,d", "res 7,e", "res 7,h", "res 7,l", "res 7,(hl)", "res 7,a", "set 0,b", "set 0,c", "set 0,d", "set 0,e", "set 0,h", "set 0,l", "set 0,(hl)", "set 0,a", "set 1,b", "set 1,c", "set 1,d", "set 1,e", "set 1,h", "set 1,l", "set 1,(hl)", "set 1,a", "set 2,b", "set 2,c", "set 2,d", "set 2,e", "set 2,h", "set 2,l", "set 2,(hl)", "set 2,a", "set 3,b", "set 3,c", "set 3,d", "set 3,e", "set 3,h", "set 3,l", "set 3,(hl)", "set 3,a", "set 4,b", "set 4,c", "set 4,d", "set 4,e", "set 4,h", "set 4,l", "set 4,(hl)", "set 4,a", "set 5,b", "set 5,c", "set 5,d", "set 5,e", "set 5,h", "set 5,l", "set 5,(hl)", "set 5,a", "set 6,b", "set 6,c", "set 6,d", "set 6,e", "set 6,h", "set 6,l", "set 6,(hl)", "set 6,a", "set 7,b", "set 7,c", "set 7,d", "set 7,e", "set 7,h", "set 7,l", "set 7,(hl)", "set 7,a"}; const char *ix_opcodes[256] = {"", "", "", "", "inc b", "dec b", "ld b,$%02x", "", "", "add ix,bc", "", "", "inc c", "dec c", "ld c,$%02x", "", "", "", "", "", "inc d", "dec d", "ld d,$%02x", "", "", "add ix,de", "", "", "inc e", "dec e", "ld e,$%02x", "", "", "ld ix,$%04x", "ld ($%04x),ix", "inc ix", "inc ixh", "dec ixh", "ld ixh,$%02x", "", "", "add ix,ix", "ld ix,($%04x)", "dec ix", "inc ixl", "dec ixl", "ld ixl,$%02x", "", "", "", "", "", "inc (ix+%hhd)", "dec (ix+%hhd)", "ld (ix+%hhd),$%02x", "", "", "add ix,sp", "", "", "inc a", "dec a", "ld a,$%02x", "", "ld b,b", "ld b,c", "ld b,d", "ld b,e", "ld b,ixh", "ld b,ixl", "ld b,(ix+%hhd)", "ld b,a", "ld c,b", "ld c,c", "ld c,d", "ld c,e", "ld c,ixh", "ld c,ixl", "ld c,(ix+%hhd)", "ld c,a", "ld d,b", "ld d,c", "ld d,d", "ld d,e", "ld d,ixh", "ld d,ixl", "ld d,(ix+%hhd)", "ld d,a", "ld e,b", "ld e,c", "ld e,d", "ld e,e", "ld e,ixh", "ld e,ixl", "ld e,(ix+%hhd)", "ld e,a", "ld ixh,b", "ld ixh,c", "ld ixh,d", "ld ixh,e", "ld ixh,ixh", "ld ixh,ixl", "ld h,(ix+%hhd)", "ld ixh,a", "ld ixl,b", "ld ixl,c", "ld ixl,d", "ld ixl,e", "ld ixl,ixh", "ld ixl,ixl", "ld l,(ix+%hhd)", "ld ixl,a", "ld (ix+%hhd),b", "ld (ix+%hhd),c", "ld (ix+%hhd),d", "ld (ix+%hhd),e", "ld (ix+%hhd),h", "ld (ix+%hhd),l", "", "ld (ix+%hhd),a", "ld a,b", "ld a,c", "ld a,d", "ld a,e", "ld a,ixh", "ld a,ixl", "ld a,(ix+%hhd)", "ld a,a", "add a,b", "add a,c", "add a,d", "add a,e", "add a,ixh", "add a,ixl", "add a,(ix+%hhd)", "add a,a", "adc a,b", "adc a,c", "adc a,d", "adc a,e", "adc a,ixh", "adc a,ixl", "adc a,(ix+%hhd)", "adc a,a", "sub b", "sub c", "sub d", "sub e", "sub ixh", "sub ixl", "sub (ix+%hhd)", "sub a", "sbc a,b", "sbc a,c", "sbc a,d", "sbc a,e", "sbc a,ixh", "sbc a,ixl", "sbc a,(ix+%hhd)", "sbc a,a", "and b", "and c", "and d", "and e", "and ixh", "and ixl", "and (ix+%hhd)", "and a", "xor b", "xor c", "xor d", "xor e", "xor ixh", "xor ixl", "xor (ix+%hhd)", "xor a", "or b", "or c", "or d", "or e", "or ixh", "or ixl", "or (ix+%hhd)", "or a", "cp b", "cp c", "cp d", "cp e", "cp ixh", "cp ixl", "cp (ix+%hhd)", "cp a", "", "", "", "", "", "", "", "", "", "", "", "_IX Bit_", "", "", "", "", "", "pop ix", "", "ex (sp),ix", "", "push ix", "", "", "", "jp (ix)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ld sp,ix", "", "", "", "", "", ""}; const char *ix_bit_opcodes[256] = {"rlc (ix+%hhd),b", "rlc (ix+%hhd),c", "rlc (ix+%hhd),d", "rlc (ix+%hhd),e", "rlc (ix+%hhd),h", "rlc (ix+%hhd),l", "rlc (ix+%hhd)", "rlc (ix+%hhd),a", "rrc (ix+%hhd),b", "rrc (ix+%hhd),c", "rrc (ix+%hhd),d", "rrc (ix+%hhd),e", "rrc (ix+%hhd),h", "rrc (ix+%hhd),l", "rrc (ix+%hhd)", "rrc (ix+%hhd),a", "rl (ix+%hhd),b", "rl (ix+%hhd),c", "rl (ix+%hhd),d", "rl (ix+%hhd),e", "rl (ix+%hhd),h", "rl (ix+%hhd),l", "rl (ix+%hhd)", "rl (ix+%hhd),a", "rr (ix+%hhd),b", "rr (ix+%hhd),c", "rr (ix+%hhd),d", "rr (ix+%hhd),e", "rr (ix+%hhd),h", "rr (ix+%hhd),l", "rr (ix+%hhd)", "rr (ix+%hhd),a", "sla (ix+%hhd),b", "sla (ix+%hhd),c", "sla (ix+%hhd),d", "sla (ix+%hhd),e", "sla (ix+%hhd),h", "sla (ix+%hhd),l", "sla (ix+%hhd)", "sla (ix+%hhd),a", "sra (ix+%hhd),b", "sra (ix+%hhd),c", "sra (ix+%hhd),d", "sra (ix+%hhd),e", "sra (ix+%hhd),h", "sra (ix+%hhd),l", "sra (ix+%hhd)", "sra (ix+%hhd),a", "sll (ix+%hhd),b", "sll (ix+%hhd),c", "sll (ix+%hhd),d", "sll (ix+%hhd),e", "sll (ix+%hhd),h", "sll (ix+%hhd),l", "sll (ix+%hhd)", "sll (ix+%hhd),a", "srl (ix+%hhd),b", "srl (ix+%hhd),c", "srl (ix+%hhd),d", "srl (ix+%hhd),e", "srl (ix+%hhd),h", "srl (ix+%hhd),l", "srl (ix+%hhd)", "srl (ix+%hhd),a", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "res 0,(ix+%hhd),b", "res 0,(ix+%hhd),c", "res 0,(ix+%hhd),d", "res 0,(ix+%hhd),e", "res 0,(ix+%hhd),h", "res 0,(ix+%hhd),l", "res 0,(ix+%hhd)", "res 0,(ix+%hhd),a", "res 1,(ix+%hhd),b", "res 1,(ix+%hhd),c", "res 1,(ix+%hhd),d", "res 1,(ix+%hhd),e", "res 1,(ix+%hhd),h", "res 1,(ix+%hhd),l", "res 1,(ix+%hhd)", "res 1,(ix+%hhd),a", "res 2,(ix+%hhd),b", "res 2,(ix+%hhd),c", "res 2,(ix+%hhd),d", "res 2,(ix+%hhd),e", "res 2,(ix+%hhd),h", "res 2,(ix+%hhd),l", "res 2,(ix+%hhd)", "res 2,(ix+%hhd),a", "res 3,(ix+%hhd),b", "res 3,(ix+%hhd),c", "res 3,(ix+%hhd),d", "res 3,(ix+%hhd),e", "res 3,(ix+%hhd),h", "res 3,(ix+%hhd),l", "res 3,(ix+%hhd)", "res 3,(ix+%hhd),a", "res 4,(ix+%hhd),b", "res 4,(ix+%hhd),c", "res 4,(ix+%hhd),d", "res 4,(ix+%hhd),e", "res 4,(ix+%hhd),h", "res 4,(ix+%hhd),l", "res 4,(ix+%hhd)", "res 4,(ix+%hhd),a", "res 5,(ix+%hhd),b", "res 5,(ix+%hhd),c", "res 5,(ix+%hhd),d", "res 5,(ix+%hhd),e", "res 5,(ix+%hhd),h", "res 5,(ix+%hhd),l", "res 5,(ix+%hhd)", "res 5,(ix+%hhd),a", "res 6,(ix+%hhd),b", "res 6,(ix+%hhd),c", "res 6,(ix+%hhd),d", "res 6,(ix+%hhd),e", "res 6,(ix+%hhd),h", "res 6,(ix+%hhd),l", "res 6,(ix+%hhd)", "res 6,(ix+%hhd),a", "res 7,(ix+%hhd),b", "res 7,(ix+%hhd),c", "res 7,(ix+%hhd),d", "res 7,(ix+%hhd),e", "res 7,(ix+%hhd),h", "res 7,(ix+%hhd),l", "res 7,(ix+%hhd)", "res 7,(ix+%hhd),a", "set 0,(ix+%hhd),b", "set 0,(ix+%hhd),c", "set 0,(ix+%hhd),d", "set 0,(ix+%hhd),e", "set 0,(ix+%hhd),h", "set 0,(ix+%hhd),l", "set 0,(ix+%hhd)", "set 0,(ix+%hhd),a", "set 1,(ix+%hhd),b", "set 1,(ix+%hhd),c", "set 1,(ix+%hhd),d", "set 1,(ix+%hhd),e", "set 1,(ix+%hhd),h", "set 1,(ix+%hhd),l", "set 1,(ix+%hhd)", "set 1,(ix+%hhd),a", "set 2,(ix+%hhd),b", "set 2,(ix+%hhd),c", "set 2,(ix+%hhd),d", "set 2,(ix+%hhd),e", "set 2,(ix+%hhd),h", "set 2,(ix+%hhd),l", "set 2,(ix+%hhd)", "set 2,(ix+%hhd),a", "set 3,(ix+%hhd),b", "set 3,(ix+%hhd),c", "set 3,(ix+%hhd),d", "set 3,(ix+%hhd),e", "set 3,(ix+%hhd),h", "set 3,(ix+%hhd),l", "set 3,(ix+%hhd)", "set 3,(ix+%hhd),a", "set 4,(ix+%hhd),b", "set 4,(ix+%hhd),c", "set 4,(ix+%hhd),d", "set 4,(ix+%hhd),e", "set 4,(ix+%hhd),h", "set 4,(ix+%hhd),l", "set 4,(ix+%hhd)", "set 4,(ix+%hhd),a", "set 5,(ix+%hhd),b", "set 5,(ix+%hhd),c", "set 5,(ix+%hhd),d", "set 5,(ix+%hhd),e", "set 5,(ix+%hhd),h", "set 5,(ix+%hhd),l", "set 5,(ix+%hhd)", "set 5,(ix+%hhd),a", "set 6,(ix+%hhd),b", "set 6,(ix+%hhd),c", "set 6,(ix+%hhd),d", "set 6,(ix+%hhd),e", "set 6,(ix+%hhd),h", "set 6,(ix+%hhd),l", "set 6,(ix+%hhd)", "set 6,(ix+%hhd),a", "set 7,(ix+%hhd),b", "set 7,(ix+%hhd),c", "set 7,(ix+%hhd),d", "set 7,(ix+%hhd),e", "set 7,(ix+%hhd),h", "set 7,(ix+%hhd),l", "set 7,(ix+%hhd)", "set 7,(ix+%hhd),a"}; const char *misc_opcodes[128] = {"in b,(c)", "out (c),b", "sbc hl,bc", "ld ($%04x),bc", "neg", "retn", "im 0", "ld i,a", "in c,(c)", "out (c),c", "adc hl,bc", "ld bc,($%04x)", "mlt bc", "reti", "", "ld r,a", "in d,(c)", "out (c),d", "sbc hl,de", "ld ($%04x),de", "", "", "im 1", "ld a,i", "in e,(c)", "out (c),e", "adc hl,de", "ld de,($%04x)", "mlt de", "", "im 2", "ld a,r", "in h,(c)", "out (c),h", "sbc hl,hl", "ld ($%04x),hl", "tst $%02x", "", "", "rrd", "in l,(c)", "out (c),l", "adc hl,hl", "ld hl,($%04x)", "mlt hl", "", "", "rld", "in (c)", "out (c),0", "sbc hl,sp", "ld ($%04x),sp", "tstio $%02x", "", "slp", "", "in a,(c)", "out (c),a", "adc hl,sp", "ld sp,($%04x)", "mlt sp", "", "", "", "", "", "", "otim", "", "", "", "", "", "", "", "otdm", "", "", "", "", "", "", "", "otimr", "", "", "", "", "", "", "", "otdmr", "", "", "", "", "ldi", "cpi", "ini", "outi", "", "", "", "", "ldd", "cpd", "ind", "outd", "", "", "", "", "ldir", "cpir", "inir", "otir", "", "", "", "", "lddr", "cpdr", "indr", "otdr", "", "", "", ""}; const char *iy_opcodes[256] = {"", "", "", "", "inc b", "dec b", "ld b,$%02x", "", "", "add iy,bc", "", "", "inc c", "dec c", "ld c,$%02x", "", "", "", "", "", "inc d", "dec d", "ld d,$%02x", "", "", "add iy,de", "", "", "inc e", "dec e", "ld e,$%02x", "", "", "ld iy,$%04x", "ld ($%04x),iy", "inc iy", "inc iyh", "dec iyh", "ld iyh,$%02x", "", "", "add iy,iy", "ld iy,($%04x)", "dec iy", "inc iyl", "dec iyl", "ld iyl,$%02x", "", "", "", "", "", "inc (iy+%hhd)", "dec (iy+%hhd)", "ld (iy+%hhd),$%02x", "", "", "add iy,sp", "", "", "inc a", "dec a", "ld a,$%02x", "", "ld b,b", "ld b,c", "ld b,d", "ld b,e", "ld b,iyh", "ld b,iyl", "ld b,(iy+%hhd)", "ld b,a", "ld c,b", "ld c,c", "ld c,d", "ld c,e", "ld c,iyh", "ld c,iyl", "ld c,(iy+%hhd)", "ld c,a", "ld d,b", "ld d,c", "ld d,d", "ld d,e", "ld d,iyh", "ld d,iyl", "ld d,(iy+%hhd)", "ld d,a", "ld e,b", "ld e,c", "ld e,d", "ld e,e", "ld e,iyh", "ld e,iyl", "ld e,(iy+%hhd)", "ld e,a", "ld iyh,b", "ld iyh,c", "ld iyh,d", "ld iyh,e", "ld iyh,iyh", "ld iyh,iyl", "ld h,(iy+%hhd)", "ld iyh,a", "ld iyl,b", "ld iyl,c", "ld iyl,d", "ld iyl,e", "ld iyl,iyh", "ld iyl,iyl", "ld l,(iy+%hhd)", "ld iyl,a", "ld (iy+%hhd),b", "ld (iy+%hhd),c", "ld (iy+%hhd),d", "ld (iy+%hhd),e", "ld (iy+%hhd),h", "ld (iy+%hhd),l", "", "ld (iy+%hhd),a", "ld a,b", "ld a,c", "ld a,d", "ld a,e", "ld a,iyh", "ld a,iyl", "ld a,(iy+%hhd)", "ld a,a", "add a,b", "add a,c", "add a,d", "add a,e", "add a,iyh", "add a,iyl", "add a,(iy+%hhd)", "add a,a", "adc a,b", "adc a,c", "adc a,d", "adc a,e", "adc a,iyh", "adc a,iyl", "adc a,(iy+%hhd)", "adc a,a", "sub b", "sub c", "sub d", "sub e", "sub iyh", "sub iyl", "sub (iy+%hhd)", "sub a", "sbc a,b", "sbc a,c", "sbc a,d", "sbc a,e", "sbc a,iyh", "sbc a,iyl", "sbc a,(iy+%hhd)", "sbc a,a", "and b", "and c", "and d", "and e", "and iyh", "and iyl", "and (iy+%hhd)", "and a", "xor b", "xor c", "xor d", "xor e", "xor iyh", "xor iyl", "xor (iy+%hhd)", "xor a", "or b", "or c", "or d", "or e", "or iyh", "or iyl", "or (iy+%hhd)", "or a", "cp b", "cp c", "cp d", "cp e", "cp iyh", "cp iyl", "cp (iy+%hhd)", "cp a", "", "", "", "", "", "", "", "", "", "", "", "_IY Bit_", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "pop iy", "", "ex (sp),iy", "", "push iy", "", "", "", "jp (iy)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ld sp,iy", "", "", "", "", "", ""}; const char *iy_bit_opcodes[256] = {"rlc (iy+%hhd),b", "rlc (iy+%hhd),c", "rlc (iy+%hhd),d", "rlc (iy+%hhd),e", "rlc (iy+%hhd),h", "rlc (iy+%hhd),l", "rlc (iy+%hhd)", "rlc (iy+%hhd),a", "rrc (iy+%hhd),b", "rrc (iy+%hhd),c", "rrc (iy+%hhd),d", "rrc (iy+%hhd),e", "rrc (iy+%hhd),h", "rrc (iy+%hhd),l", "rrc (iy+%hhd)", "rrc (iy+%hhd),a", "rl (iy+%hhd),b", "rl (iy+%hhd),c", "rl (iy+%hhd),d", "rl (iy+%hhd),e", "rl (iy+%hhd),h", "rl (iy+%hhd),l", "rl (iy+%hhd)", "rl (iy+%hhd),a", "rr (iy+%hhd),b", "rr (iy+%hhd),c", "rr (iy+%hhd),d", "rr (iy+%hhd),e", "rr (iy+%hhd),h", "rr (iy+%hhd),l", "rr (iy+%hhd)", "rr (iy+%hhd),a", "sla (iy+%hhd),b", "sla (iy+%hhd),c", "sla (iy+%hhd),d", "sla (iy+%hhd),e", "sla (iy+%hhd),h", "sla (iy+%hhd),l", "sla (iy+%hhd)", "sla (iy+%hhd),a", "sra (iy+%hhd),b", "sra (iy+%hhd),c", "sra (iy+%hhd),d", "sra (iy+%hhd),e", "sra (iy+%hhd),h", "sra (iy+%hhd),l", "sra (iy+%hhd)", "sra (iy+%hhd),a", "sll (iy+%hhd),b", "sll (iy+%hhd),c", "sll (iy+%hhd),d", "sll (iy+%hhd),e", "sll (iy+%hhd),h", "sll (iy+%hhd),l", "sll (iy+%hhd)", "sll (iy+%hhd),a", "srl (iy+%hhd),b", "srl (iy+%hhd),c", "srl (iy+%hhd),d", "srl (iy+%hhd),e", "srl (iy+%hhd),h", "srl (iy+%hhd),l", "srl (iy+%hhd)", "srl (iy+%hhd),a", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "res 0,(iy+%hhd),b", "res 0,(iy+%hhd),c", "res 0,(iy+%hhd),d", "res 0,(iy+%hhd),e", "res 0,(iy+%hhd),h", "res 0,(iy+%hhd),l", "res 0,(iy+%hhd)", "res 0,(iy+%hhd),a", "res 1,(iy+%hhd),b", "res 1,(iy+%hhd),c", "res 1,(iy+%hhd),d", "res 1,(iy+%hhd),e", "res 1,(iy+%hhd),h", "res 1,(iy+%hhd),l", "res 1,(iy+%hhd)", "res 1,(iy+%hhd),a", "res 2,(iy+%hhd),b", "res 2,(iy+%hhd),c", "res 2,(iy+%hhd),d", "res 2,(iy+%hhd),e", "res 2,(iy+%hhd),h", "res 2,(iy+%hhd),l", "res 2,(iy+%hhd)", "res 2,(iy+%hhd),a", "res 3,(iy+%hhd),b", "res 3,(iy+%hhd),c", "res 3,(iy+%hhd),d", "res 3,(iy+%hhd),e", "res 3,(iy+%hhd),h", "res 3,(iy+%hhd),l", "res 3,(iy+%hhd)", "res 3,(iy+%hhd),a", "res 4,(iy+%hhd),b", "res 4,(iy+%hhd),c", "res 4,(iy+%hhd),d", "res 4,(iy+%hhd),e", "res 4,(iy+%hhd),h", "res 4,(iy+%hhd),l", "res 4,(iy+%hhd)", "res 4,(iy+%hhd),a", "res 5,(iy+%hhd),b", "res 5,(iy+%hhd),c", "res 5,(iy+%hhd),d", "res 5,(iy+%hhd),e", "res 5,(iy+%hhd),h", "res 5,(iy+%hhd),l", "res 5,(iy+%hhd)", "res 5,(iy+%hhd),a", "res 6,(iy+%hhd),b", "res 6,(iy+%hhd),c", "res 6,(iy+%hhd),d", "res 6,(iy+%hhd),e", "res 6,(iy+%hhd),h", "res 6,(iy+%hhd),l", "res 6,(iy+%hhd)", "res 6,(iy+%hhd),a", "res 7,(iy+%hhd),b", "res 7,(iy+%hhd),c", "res 7,(iy+%hhd),d", "res 7,(iy+%hhd),e", "res 7,(iy+%hhd),h", "res 7,(iy+%hhd),l", "res 7,(iy+%hhd)", "res 7,(iy+%hhd),a", "set 0,(iy+%hhd),b", "set 0,(iy+%hhd),c", "set 0,(iy+%hhd),d", "set 0,(iy+%hhd),e", "set 0,(iy+%hhd),h", "set 0,(iy+%hhd),l", "set 0,(iy+%hhd)", "set 0,(iy+%hhd),a", "set 1,(iy+%hhd),b", "set 1,(iy+%hhd),c", "set 1,(iy+%hhd),d", "set 1,(iy+%hhd),e", "set 1,(iy+%hhd),h", "set 1,(iy+%hhd),l", "set 1,(iy+%hhd)", "set 1,(iy+%hhd),a", "set 2,(iy+%hhd),b", "set 2,(iy+%hhd),c", "set 2,(iy+%hhd),d", "set 2,(iy+%hhd),e", "set 2,(iy+%hhd),h", "set 2,(iy+%hhd),l", "set 2,(iy+%hhd)", "set 2,(iy+%hhd),a", "set 3,(iy+%hhd),b", "set 3,(iy+%hhd),c", "set 3,(iy+%hhd),d", "set 3,(iy+%hhd),e", "set 3,(iy+%hhd),h", "set 3,(iy+%hhd),l", "set 3,(iy+%hhd)", "set 3,(iy+%hhd),a", "set 4,(iy+%hhd),b", "set 4,(iy+%hhd),c", "set 4,(iy+%hhd),d", "set 4,(iy+%hhd),e", "set 4,(iy+%hhd),h", "set 4,(iy+%hhd),l", "set 4,(iy+%hhd)", "set 4,(iy+%hhd),a", "set 5,(iy+%hhd),b", "set 5,(iy+%hhd),c", "set 5,(iy+%hhd),d", "set 5,(iy+%hhd),e", "set 5,(iy+%hhd),h", "set 5,(iy+%hhd),l", "set 5,(iy+%hhd)", "set 5,(iy+%hhd),a", "set 6,(iy+%hhd),b", "set 6,(iy+%hhd),c", "set 6,(iy+%hhd),d", "set 6,(iy+%hhd),e", "set 6,(iy+%hhd),h", "set 6,(iy+%hhd),l", "set 6,(iy+%hhd)", "set 6,(iy+%hhd),a", "set 7,(iy+%hhd),b", "set 7,(iy+%hhd),c", "set 7,(iy+%hhd),d", "set 7,(iy+%hhd),e", "set 7,(iy+%hhd),h", "set 7,(iy+%hhd),l", "set 7,(iy+%hhd)", "set 7,(iy+%hhd),a"}; // const char *base_opcodes[256] = {"nop", "ld bc,$%04x", "ld (bc),a", "inc bc", "inc b", "dec b", "ld b,$%02x", "rlca", "ex af,af'", "add hl,bc", "ld a,(bc)", "dec bc", "inc c", "dec c", "ld c,$%02x", "rrca", "djnz %hhd", "ld de,$%04x", "ld (de),a", "inc de", "inc d", "dec d", "ld d,$%02x", "rla", "jr %hhd", "add hl,de", "ld a,(de)", "dec de", "inc e", "dec e", "ld e,$%02x", "rra", "jr nz,%hhd", "ld hl,$%04x", "ld ($%04x),hl", "inc hl", "inc h", "dec h", "ld h,$%02x", "daa", "jr z,%hhd", "add hl,hl", "ld hl,($%04x)", "dec hl", "inc l", "dec l", "ld l,$%02x", "cpl", "jr nc,%hhd", "ld sp,$%04x", "ld ($%04x),a", "inc sp", "inc (hl)", "dec (hl)", "ld (hl),$%02x", "scf", "jr c,%hhd", "add hl,sp", "ld a,($%04x)", "dec sp", "inc a", "dec a", "ld a,$%02x", "ccf", "ld b,b", "ld b,c", "ld b,d", "ld b,e", "ld b,h", "ld b,l", "ld b,(hl)", "ld b,a", "ld c,b", "ld c,c", "ld c,d", "ld c,e", "ld c,h", "ld c,l", "ld c,(hl)", "ld c,a", "ld d,b", "ld d,c", "ld d,d", "ld d,e", "ld d,h", "ld d,l", "ld d,(hl)", "ld d,a", "ld e,b", "ld e,c", "ld e,d", "ld e,e", "ld e,h", "ld e,l", "ld e,(hl)", "ld e,a", "ld h,b", "ld h,c", "ld h,d", "ld h,e", "ld h,h", "ld h,l", "ld h,(hl)", "ld h,a", "ld l,b", "ld l,c", "ld l,d", "ld l,e", "ld l,h", "ld l,l", "ld l,(hl)", "ld l,a", "ld (hl),b", "ld (hl),c", "ld (hl),d", "ld (hl),e", "ld (hl),h", "ld (hl),l", "halt", "ld (hl),a", "ld a,b", "ld a,c", "ld a,d", "ld a,e", "ld a,h", "ld a,l", "ld a,(hl)", "ld a,a", "add a,b", "add a,c", "add a,d", "add a,e", "add a,h", "add a,l", "add a,(hl)", "add a,a", "adc a,b", "adc a,c", "adc a,d", "adc a,e", "adc a,h", "adc a,l", "adc a,(hl)", "adc a,a", "sub b", "sub c", "sub d", "sub e", "sub h", "sub l", "sub (hl)", "sub a", "sbc a,b", "sbc a,c", "sbc a,d", "sbc a,e", "sbc a,h", "sbc a,l", "sbc a,(hl)", "sbc a,a", "and b", "and c", "and d", "and e", "and h", "and l", "and (hl)", "and a", "xor b", "xor c", "xor d", "xor e", "xor h", "xor l", "xor (hl)", "xor a", "or b", "or c", "or d", "or e", "or h", "or l", "or (hl)", "or a", "cp b", "cp c", "cp d", "cp e", "cp h", "cp l", "cp (hl)", "cp a", "ret nz", "pop bc", "jp nz,$%04x", "jp $%04x", "call nz,$%04x", "push bc", "add a,$%02x", "rst 00h", "ret z", "ret", "jp z,$%04x", "_Bit_", "call z,$%04x", "call $%04x", "adc a,$%02x", "rst 08h", "ret nc", "pop de", "jp nc,$%04x", "out ($%02x),a", "call nc,$%04x", "push de", "sub $%02x", "rst 10h", "ret c", "exx", "jp c,$%04x", "in a,($%02x)", "call c,$%04x", "_IX_", "sbc a,$%02x", "rst 18h", "ret po", "pop hl", "jp po,$%04x", "ex (sp),hl", "call po,$%04x", "push hl", "and $%02x", "rst 20h", "ret pe", "jp (hl)", "jp pe,$%04x", "ex de,hl", "call pe,$%04x", "_Misc._", "xor $%02x", "rst 28h", "ret p", "pop af", "jp p,$%04x", "di", "call p,$%04x", "push af", "or $%02x", "rst 30h", "ret m", "ld sp,hl", "jp m,$%04x", "ei", "call m,$%04x", "_IY_", "cp $%02x", "rst 38h"}; // const char *cb_opcodes[256] = {"rlc b", "rlc c", "rlc d", "rlc e", "rlc h", "rlc l", "rlc (hl)", "rlc a", "rrc b", "rrc c", "rrc d", "rrc e", "rrc h", "rrc l", "rrc (hl)", "rrc a", "rl b", "rl c", "rl d", "rl e", "rl h", "rl l", "rl (hl)", "rl a", "rr b", "rr c", "rr d", "rr e", "rr h", "rr l", "rr (hl)", "rr a", "sla b", "sla c", "sla d", "sla e", "sla h", "sla l", "sla (hl)", "sla a", "sra b", "sra c", "sra d", "sra e", "sra h", "sra l", "sra (hl)", "sra a", "sll b", "sll c", "sll d", "sll e", "sll h", "sll l", "sll (hl)", "sll a", "srl b", "srl c", "srl d", "srl e", "srl h", "srl l", "srl (hl)", "srl a", "bit 0,b", "bit 0,c", "bit 0,d", "bit 0,e", "bit 0,h", "bit 0,l", "bit 0,(hl)", "bit 0,a", "bit 1,b", "bit 1,c", "bit 1,d", "bit 1,e", "bit 1,h", "bit 1,l", "bit 1,(hl)", "bit 1,a", "bit 2,b", "bit 2,c", "bit 2,d", "bit 2,e", "bit 2,h", "bit 2,l", "bit 2,(hl)", "bit 2,a", "bit 3,b", "bit 3,c", "bit 3,d", "bit 3,e", "bit 3,h", "bit 3,l", "bit 3,(hl)", "bit 3,a", "bit 4,b", "bit 4,c", "bit 4,d", "bit 4,e", "bit 4,h", "bit 4,l", "bit 4,(hl)", "bit 4,a", "bit 5,b", "bit 5,c", "bit 5,d", "bit 5,e", "bit 5,h", "bit 5,l", "bit 5,(hl)", "bit 5,a", "bit 6,b", "bit 6,c", "bit 6,d", "bit 6,e", "bit 6,h", "bit 6,l", "bit 6,(hl)", "bit 6,a", "bit 7,b", "bit 7,c", "bit 7,d", "bit 7,e", "bit 7,h", "bit 7,l", "bit 7,(hl)", "bit 7,a", "res 0,b", "res 0,c", "res 0,d", "res 0,e", "res 0,h", "res 0,l", "res 0,(hl)", "res 0,a", "res 1,b", "res 1,c", "res 1,d", "res 1,e", "res 1,h", "res 1,l", "res 1,(hl)", "res 1,a", "res 2,b", "res 2,c", "res 2,d", "res 2,e", "res 2,h", "res 2,l", "res 2,(hl)", "res 2,a", "res 3,b", "res 3,c", "res 3,d", "res 3,e", "res 3,h", "res 3,l", "res 3,(hl)", "res 3,a", "res 4,b", "res 4,c", "res 4,d", "res 4,e", "res 4,h", "res 4,l", "res 4,(hl)", "res 4,a", "res 5,b", "res 5,c", "res 5,d", "res 5,e", "res 5,h", "res 5,l", "res 5,(hl)", "res 5,a", "res 6,b", "res 6,c", "res 6,d", "res 6,e", "res 6,h", "res 6,l", "res 6,(hl)", "res 6,a", "res 7,b", "res 7,c", "res 7,d", "res 7,e", "res 7,h", "res 7,l", "res 7,(hl)", "res 7,a", "set 0,b", "set 0,c", "set 0,d", "set 0,e", "set 0,h", "set 0,l", "set 0,(hl)", "set 0,a", "set 1,b", "set 1,c", "set 1,d", "set 1,e", "set 1,h", "set 1,l", "set 1,(hl)", "set 1,a", "set 2,b", "set 2,c", "set 2,d", "set 2,e", "set 2,h", "set 2,l", "set 2,(hl)", "set 2,a", "set 3,b", "set 3,c", "set 3,d", "set 3,e", "set 3,h", "set 3,l", "set 3,(hl)", "set 3,a", "set 4,b", "set 4,c", "set 4,d", "set 4,e", "set 4,h", "set 4,l", "set 4,(hl)", "set 4,a", "set 5,b", "set 5,c", "set 5,d", "set 5,e", "set 5,h", "set 5,l", "set 5,(hl)", "set 5,a", "set 6,b", "set 6,c", "set 6,d", "set 6,e", "set 6,h", "set 6,l", "set 6,(hl)", "set 6,a", "set 7,b", "set 7,c", "set 7,d", "set 7,e", "set 7,h", "set 7,l", "set 7,(hl)", "set 7,a"}; // const char *ix_opcodes[256] = {"", "", "", "", "inc b", "dec b", "ld b,$%02x", "", "", "add ix,bc", "", "", "inc c", "dec c", "ld c,$%02x", "", "", "", "", "", "inc d", "dec d", "ld d,$%02x", "", "", "add ix,de", "", "", "inc e", "dec e", "ld e,$%02x", "", "", "ld ix,$%04x", "ld ($%04x),ix", "inc ix", "inc ixh", "dec ixh", "ld ixh,$%02x", "", "", "add ix,ix", "ld ix,($%04x)", "dec ix", "inc ixl", "dec ixl", "ld ixl,$%02x", "", "", "", "", "", "inc (ix+%hhd)", "dec (ix+%hhd)", "ld (ix+%hhd),$%02x", "", "", "add ix,sp", "", "", "inc a", "dec a", "ld a,$%02x", "", "ld b,b", "ld b,c", "ld b,d", "ld b,e", "ld b,ixh", "ld b,ixl", "ld b,(ix+%hhd)", "ld b,a", "ld c,b", "ld c,c", "ld c,d", "ld c,e", "ld c,ixh", "ld c,ixl", "ld c,(ix+%hhd)", "ld c,a", "ld d,b", "ld d,c", "ld d,d", "ld d,e", "ld d,ixh", "ld d,ixl", "ld d,(ix+%hhd)", "ld d,a", "ld e,b", "ld e,c", "ld e,d", "ld e,e", "ld e,ixh", "ld e,ixl", "ld e,(ix+%hhd)", "ld e,a", "ld ixh,b", "ld ixh,c", "ld ixh,d", "ld ixh,e", "ld ixh,ixh", "ld ixh,ixl", "ld h,(ix+%hhd)", "ld ixh,a", "ld ixl,b", "ld ixl,c", "ld ixl,d", "ld ixl,e", "ld ixl,ixh", "ld ixl,ixl", "ld l,(ix+%hhd)", "ld ixl,a", "ld (ix+%hhd),b", "ld (ix+%hhd),c", "ld (ix+%hhd),d", "ld (ix+%hhd),e", "ld (ix+%hhd),h", "ld (ix+%hhd),l", "", "ld (ix+%hhd),a", "ld a,b", "ld a,c", "ld a,d", "ld a,e", "ld a,ixh", "ld a,ixl", "ld a,(ix+%hhd)", "ld a,a", "add a,b", "add a,c", "add a,d", "add a,e", "add a,ixh", "add a,ixl", "add a,(ix+%hhd)", "add a,a", "adc a,b", "adc a,c", "adc a,d", "adc a,e", "adc a,ixh", "adc a,ixl", "adc a,(ix+%hhd)", "adc a,a", "sub b", "sub c", "sub d", "sub e", "sub ixh", "sub ixl", "sub (ix+%hhd)", "sub a", "sbc a,b", "sbc a,c", "sbc a,d", "sbc a,e", "sbc a,ixh", "sbc a,ixl", "sbc a,(ix+%hhd)", "sbc a,a", "and b", "and c", "and d", "and e", "and ixh", "and ixl", "and (ix+%hhd)", "and a", "xor b", "xor c", "xor d", "xor e", "xor ixh", "xor ixl", "xor (ix+%hhd)", "xor a", "or b", "or c", "or d", "or e", "or ixh", "or ixl", "or (ix+%hhd)", "or a", "cp b", "cp c", "cp d", "cp e", "cp ixh", "cp ixl", "cp (ix+%hhd)", "cp a", "", "", "", "", "", "", "", "", "", "", "", "_IX Bit_", "", "", "", "", "", "pop ix", "", "ex (sp),ix", "", "push ix", "", "", "", "jp (ix)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ld sp,ix", "", "", "", "", "", ""}; // const char *ix_bit_opcodes[256] = {"rlc (ix+%hhd),b", "rlc (ix+%hhd),c", "rlc (ix+%hhd),d", "rlc (ix+%hhd),e", "rlc (ix+%hhd),h", "rlc (ix+%hhd),l", "rlc (ix+%hhd)", "rlc (ix+%hhd),a", "rrc (ix+%hhd),b", "rrc (ix+%hhd),c", "rrc (ix+%hhd),d", "rrc (ix+%hhd),e", "rrc (ix+%hhd),h", "rrc (ix+%hhd),l", "rrc (ix+%hhd)", "rrc (ix+%hhd),a", "rl (ix+%hhd),b", "rl (ix+%hhd),c", "rl (ix+%hhd),d", "rl (ix+%hhd),e", "rl (ix+%hhd),h", "rl (ix+%hhd),l", "rl (ix+%hhd)", "rl (ix+%hhd),a", "rr (ix+%hhd),b", "rr (ix+%hhd),c", "rr (ix+%hhd),d", "rr (ix+%hhd),e", "rr (ix+%hhd),h", "rr (ix+%hhd),l", "rr (ix+%hhd)", "rr (ix+%hhd),a", "sla (ix+%hhd),b", "sla (ix+%hhd),c", "sla (ix+%hhd),d", "sla (ix+%hhd),e", "sla (ix+%hhd),h", "sla (ix+%hhd),l", "sla (ix+%hhd)", "sla (ix+%hhd),a", "sra (ix+%hhd),b", "sra (ix+%hhd),c", "sra (ix+%hhd),d", "sra (ix+%hhd),e", "sra (ix+%hhd),h", "sra (ix+%hhd),l", "sra (ix+%hhd)", "sra (ix+%hhd),a", "sll (ix+%hhd),b", "sll (ix+%hhd),c", "sll (ix+%hhd),d", "sll (ix+%hhd),e", "sll (ix+%hhd),h", "sll (ix+%hhd),l", "sll (ix+%hhd)", "sll (ix+%hhd),a", "srl (ix+%hhd),b", "srl (ix+%hhd),c", "srl (ix+%hhd),d", "srl (ix+%hhd),e", "srl (ix+%hhd),h", "srl (ix+%hhd),l", "srl (ix+%hhd)", "srl (ix+%hhd),a", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 0,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 1,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 2,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 3,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 4,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 5,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 6,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "bit 7,(ix+%hhd)", "res 0,(ix+%hhd),b", "res 0,(ix+%hhd),c", "res 0,(ix+%hhd),d", "res 0,(ix+%hhd),e", "res 0,(ix+%hhd),h", "res 0,(ix+%hhd),l", "res 0,(ix+%hhd)", "res 0,(ix+%hhd),a", "res 1,(ix+%hhd),b", "res 1,(ix+%hhd),c", "res 1,(ix+%hhd),d", "res 1,(ix+%hhd),e", "res 1,(ix+%hhd),h", "res 1,(ix+%hhd),l", "res 1,(ix+%hhd)", "res 1,(ix+%hhd),a", "res 2,(ix+%hhd),b", "res 2,(ix+%hhd),c", "res 2,(ix+%hhd),d", "res 2,(ix+%hhd),e", "res 2,(ix+%hhd),h", "res 2,(ix+%hhd),l", "res 2,(ix+%hhd)", "res 2,(ix+%hhd),a", "res 3,(ix+%hhd),b", "res 3,(ix+%hhd),c", "res 3,(ix+%hhd),d", "res 3,(ix+%hhd),e", "res 3,(ix+%hhd),h", "res 3,(ix+%hhd),l", "res 3,(ix+%hhd)", "res 3,(ix+%hhd),a", "res 4,(ix+%hhd),b", "res 4,(ix+%hhd),c", "res 4,(ix+%hhd),d", "res 4,(ix+%hhd),e", "res 4,(ix+%hhd),h", "res 4,(ix+%hhd),l", "res 4,(ix+%hhd)", "res 4,(ix+%hhd),a", "res 5,(ix+%hhd),b", "res 5,(ix+%hhd),c", "res 5,(ix+%hhd),d", "res 5,(ix+%hhd),e", "res 5,(ix+%hhd),h", "res 5,(ix+%hhd),l", "res 5,(ix+%hhd)", "res 5,(ix+%hhd),a", "res 6,(ix+%hhd),b", "res 6,(ix+%hhd),c", "res 6,(ix+%hhd),d", "res 6,(ix+%hhd),e", "res 6,(ix+%hhd),h", "res 6,(ix+%hhd),l", "res 6,(ix+%hhd)", "res 6,(ix+%hhd),a", "res 7,(ix+%hhd),b", "res 7,(ix+%hhd),c", "res 7,(ix+%hhd),d", "res 7,(ix+%hhd),e", "res 7,(ix+%hhd),h", "res 7,(ix+%hhd),l", "res 7,(ix+%hhd)", "res 7,(ix+%hhd),a", "set 0,(ix+%hhd),b", "set 0,(ix+%hhd),c", "set 0,(ix+%hhd),d", "set 0,(ix+%hhd),e", "set 0,(ix+%hhd),h", "set 0,(ix+%hhd),l", "set 0,(ix+%hhd)", "set 0,(ix+%hhd),a", "set 1,(ix+%hhd),b", "set 1,(ix+%hhd),c", "set 1,(ix+%hhd),d", "set 1,(ix+%hhd),e", "set 1,(ix+%hhd),h", "set 1,(ix+%hhd),l", "set 1,(ix+%hhd)", "set 1,(ix+%hhd),a", "set 2,(ix+%hhd),b", "set 2,(ix+%hhd),c", "set 2,(ix+%hhd),d", "set 2,(ix+%hhd),e", "set 2,(ix+%hhd),h", "set 2,(ix+%hhd),l", "set 2,(ix+%hhd)", "set 2,(ix+%hhd),a", "set 3,(ix+%hhd),b", "set 3,(ix+%hhd),c", "set 3,(ix+%hhd),d", "set 3,(ix+%hhd),e", "set 3,(ix+%hhd),h", "set 3,(ix+%hhd),l", "set 3,(ix+%hhd)", "set 3,(ix+%hhd),a", "set 4,(ix+%hhd),b", "set 4,(ix+%hhd),c", "set 4,(ix+%hhd),d", "set 4,(ix+%hhd),e", "set 4,(ix+%hhd),h", "set 4,(ix+%hhd),l", "set 4,(ix+%hhd)", "set 4,(ix+%hhd),a", "set 5,(ix+%hhd),b", "set 5,(ix+%hhd),c", "set 5,(ix+%hhd),d", "set 5,(ix+%hhd),e", "set 5,(ix+%hhd),h", "set 5,(ix+%hhd),l", "set 5,(ix+%hhd)", "set 5,(ix+%hhd),a", "set 6,(ix+%hhd),b", "set 6,(ix+%hhd),c", "set 6,(ix+%hhd),d", "set 6,(ix+%hhd),e", "set 6,(ix+%hhd),h", "set 6,(ix+%hhd),l", "set 6,(ix+%hhd)", "set 6,(ix+%hhd),a", "set 7,(ix+%hhd),b", "set 7,(ix+%hhd),c", "set 7,(ix+%hhd),d", "set 7,(ix+%hhd),e", "set 7,(ix+%hhd),h", "set 7,(ix+%hhd),l", "set 7,(ix+%hhd)", "set 7,(ix+%hhd),a"}; // const char *misc_opcodes[128] = {"in b,(c)", "out (c),b", "sbc hl,bc", "ld ($%04x),bc", "neg", "retn", "im 0", "ld i,a", "in c,(c)", "out (c),c", "adc hl,bc", "ld bc,($%04x)", "mlt bc", "reti", "", "ld r,a", "in d,(c)", "out (c),d", "sbc hl,de", "ld ($%04x),de", "", "", "im 1", "ld a,i", "in e,(c)", "out (c),e", "adc hl,de", "ld de,($%04x)", "mlt de", "", "im 2", "ld a,r", "in h,(c)", "out (c),h", "sbc hl,hl", "ld ($%04x),hl", "tst $%02x", "", "", "rrd", "in l,(c)", "out (c),l", "adc hl,hl", "ld hl,($%04x)", "mlt hl", "", "", "rld", "in (c)", "out (c),0", "sbc hl,sp", "ld ($%04x),sp", "tstio $%02x", "", "slp", "", "in a,(c)", "out (c),a", "adc hl,sp", "ld sp,($%04x)", "mlt sp", "", "", "", "", "", "", "otim", "", "", "", "", "", "", "", "otdm", "", "", "", "", "", "", "", "otimr", "", "", "", "", "", "", "", "otdmr", "", "", "", "", "ldi", "cpi", "ini", "outi", "", "", "", "", "ldd", "cpd", "ind", "outd", "", "", "", "", "ldir", "cpir", "inir", "otir", "", "", "", "", "lddr", "cpdr", "indr", "otdr", "", "", "", ""}; // const char *iy_opcodes[256] = {"", "", "", "", "inc b", "dec b", "ld b,$%02x", "", "", "add iy,bc", "", "", "inc c", "dec c", "ld c,$%02x", "", "", "", "", "", "inc d", "dec d", "ld d,$%02x", "", "", "add iy,de", "", "", "inc e", "dec e", "ld e,$%02x", "", "", "ld iy,$%04x", "ld ($%04x),iy", "inc iy", "inc iyh", "dec iyh", "ld iyh,$%02x", "", "", "add iy,iy", "ld iy,($%04x)", "dec iy", "inc iyl", "dec iyl", "ld iyl,$%02x", "", "", "", "", "", "inc (iy+%hhd)", "dec (iy+%hhd)", "ld (iy+%hhd),$%02x", "", "", "add iy,sp", "", "", "inc a", "dec a", "ld a,$%02x", "", "ld b,b", "ld b,c", "ld b,d", "ld b,e", "ld b,iyh", "ld b,iyl", "ld b,(iy+%hhd)", "ld b,a", "ld c,b", "ld c,c", "ld c,d", "ld c,e", "ld c,iyh", "ld c,iyl", "ld c,(iy+%hhd)", "ld c,a", "ld d,b", "ld d,c", "ld d,d", "ld d,e", "ld d,iyh", "ld d,iyl", "ld d,(iy+%hhd)", "ld d,a", "ld e,b", "ld e,c", "ld e,d", "ld e,e", "ld e,iyh", "ld e,iyl", "ld e,(iy+%hhd)", "ld e,a", "ld iyh,b", "ld iyh,c", "ld iyh,d", "ld iyh,e", "ld iyh,iyh", "ld iyh,iyl", "ld h,(iy+%hhd)", "ld iyh,a", "ld iyl,b", "ld iyl,c", "ld iyl,d", "ld iyl,e", "ld iyl,iyh", "ld iyl,iyl", "ld l,(iy+%hhd)", "ld iyl,a", "ld (iy+%hhd),b", "ld (iy+%hhd),c", "ld (iy+%hhd),d", "ld (iy+%hhd),e", "ld (iy+%hhd),h", "ld (iy+%hhd),l", "", "ld (iy+%hhd),a", "ld a,b", "ld a,c", "ld a,d", "ld a,e", "ld a,iyh", "ld a,iyl", "ld a,(iy+%hhd)", "ld a,a", "add a,b", "add a,c", "add a,d", "add a,e", "add a,iyh", "add a,iyl", "add a,(iy+%hhd)", "add a,a", "adc a,b", "adc a,c", "adc a,d", "adc a,e", "adc a,iyh", "adc a,iyl", "adc a,(iy+%hhd)", "adc a,a", "sub b", "sub c", "sub d", "sub e", "sub iyh", "sub iyl", "sub (iy+%hhd)", "sub a", "sbc a,b", "sbc a,c", "sbc a,d", "sbc a,e", "sbc a,iyh", "sbc a,iyl", "sbc a,(iy+%hhd)", "sbc a,a", "and b", "and c", "and d", "and e", "and iyh", "and iyl", "and (iy+%hhd)", "and a", "xor b", "xor c", "xor d", "xor e", "xor iyh", "xor iyl", "xor (iy+%hhd)", "xor a", "or b", "or c", "or d", "or e", "or iyh", "or iyl", "or (iy+%hhd)", "or a", "cp b", "cp c", "cp d", "cp e", "cp iyh", "cp iyl", "cp (iy+%hhd)", "cp a", "", "", "", "", "", "", "", "", "", "", "", "_IY Bit_", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "pop iy", "", "ex (sp),iy", "", "push iy", "", "", "", "jp (iy)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ld sp,iy", "", "", "", "", "", ""}; // const char *iy_bit_opcodes[256] = {"rlc (iy+%hhd),b", "rlc (iy+%hhd),c", "rlc (iy+%hhd),d", "rlc (iy+%hhd),e", "rlc (iy+%hhd),h", "rlc (iy+%hhd),l", "rlc (iy+%hhd)", "rlc (iy+%hhd),a", "rrc (iy+%hhd),b", "rrc (iy+%hhd),c", "rrc (iy+%hhd),d", "rrc (iy+%hhd),e", "rrc (iy+%hhd),h", "rrc (iy+%hhd),l", "rrc (iy+%hhd)", "rrc (iy+%hhd),a", "rl (iy+%hhd),b", "rl (iy+%hhd),c", "rl (iy+%hhd),d", "rl (iy+%hhd),e", "rl (iy+%hhd),h", "rl (iy+%hhd),l", "rl (iy+%hhd)", "rl (iy+%hhd),a", "rr (iy+%hhd),b", "rr (iy+%hhd),c", "rr (iy+%hhd),d", "rr (iy+%hhd),e", "rr (iy+%hhd),h", "rr (iy+%hhd),l", "rr (iy+%hhd)", "rr (iy+%hhd),a", "sla (iy+%hhd),b", "sla (iy+%hhd),c", "sla (iy+%hhd),d", "sla (iy+%hhd),e", "sla (iy+%hhd),h", "sla (iy+%hhd),l", "sla (iy+%hhd)", "sla (iy+%hhd),a", "sra (iy+%hhd),b", "sra (iy+%hhd),c", "sra (iy+%hhd),d", "sra (iy+%hhd),e", "sra (iy+%hhd),h", "sra (iy+%hhd),l", "sra (iy+%hhd)", "sra (iy+%hhd),a", "sll (iy+%hhd),b", "sll (iy+%hhd),c", "sll (iy+%hhd),d", "sll (iy+%hhd),e", "sll (iy+%hhd),h", "sll (iy+%hhd),l", "sll (iy+%hhd)", "sll (iy+%hhd),a", "srl (iy+%hhd),b", "srl (iy+%hhd),c", "srl (iy+%hhd),d", "srl (iy+%hhd),e", "srl (iy+%hhd),h", "srl (iy+%hhd),l", "srl (iy+%hhd)", "srl (iy+%hhd),a", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 0,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 1,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 2,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 3,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 4,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 5,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 6,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "bit 7,(iy+%hhd)", "res 0,(iy+%hhd),b", "res 0,(iy+%hhd),c", "res 0,(iy+%hhd),d", "res 0,(iy+%hhd),e", "res 0,(iy+%hhd),h", "res 0,(iy+%hhd),l", "res 0,(iy+%hhd)", "res 0,(iy+%hhd),a", "res 1,(iy+%hhd),b", "res 1,(iy+%hhd),c", "res 1,(iy+%hhd),d", "res 1,(iy+%hhd),e", "res 1,(iy+%hhd),h", "res 1,(iy+%hhd),l", "res 1,(iy+%hhd)", "res 1,(iy+%hhd),a", "res 2,(iy+%hhd),b", "res 2,(iy+%hhd),c", "res 2,(iy+%hhd),d", "res 2,(iy+%hhd),e", "res 2,(iy+%hhd),h", "res 2,(iy+%hhd),l", "res 2,(iy+%hhd)", "res 2,(iy+%hhd),a", "res 3,(iy+%hhd),b", "res 3,(iy+%hhd),c", "res 3,(iy+%hhd),d", "res 3,(iy+%hhd),e", "res 3,(iy+%hhd),h", "res 3,(iy+%hhd),l", "res 3,(iy+%hhd)", "res 3,(iy+%hhd),a", "res 4,(iy+%hhd),b", "res 4,(iy+%hhd),c", "res 4,(iy+%hhd),d", "res 4,(iy+%hhd),e", "res 4,(iy+%hhd),h", "res 4,(iy+%hhd),l", "res 4,(iy+%hhd)", "res 4,(iy+%hhd),a", "res 5,(iy+%hhd),b", "res 5,(iy+%hhd),c", "res 5,(iy+%hhd),d", "res 5,(iy+%hhd),e", "res 5,(iy+%hhd),h", "res 5,(iy+%hhd),l", "res 5,(iy+%hhd)", "res 5,(iy+%hhd),a", "res 6,(iy+%hhd),b", "res 6,(iy+%hhd),c", "res 6,(iy+%hhd),d", "res 6,(iy+%hhd),e", "res 6,(iy+%hhd),h", "res 6,(iy+%hhd),l", "res 6,(iy+%hhd)", "res 6,(iy+%hhd),a", "res 7,(iy+%hhd),b", "res 7,(iy+%hhd),c", "res 7,(iy+%hhd),d", "res 7,(iy+%hhd),e", "res 7,(iy+%hhd),h", "res 7,(iy+%hhd),l", "res 7,(iy+%hhd)", "res 7,(iy+%hhd),a", "set 0,(iy+%hhd),b", "set 0,(iy+%hhd),c", "set 0,(iy+%hhd),d", "set 0,(iy+%hhd),e", "set 0,(iy+%hhd),h", "set 0,(iy+%hhd),l", "set 0,(iy+%hhd)", "set 0,(iy+%hhd),a", "set 1,(iy+%hhd),b", "set 1,(iy+%hhd),c", "set 1,(iy+%hhd),d", "set 1,(iy+%hhd),e", "set 1,(iy+%hhd),h", "set 1,(iy+%hhd),l", "set 1,(iy+%hhd)", "set 1,(iy+%hhd),a", "set 2,(iy+%hhd),b", "set 2,(iy+%hhd),c", "set 2,(iy+%hhd),d", "set 2,(iy+%hhd),e", "set 2,(iy+%hhd),h", "set 2,(iy+%hhd),l", "set 2,(iy+%hhd)", "set 2,(iy+%hhd),a", "set 3,(iy+%hhd),b", "set 3,(iy+%hhd),c", "set 3,(iy+%hhd),d", "set 3,(iy+%hhd),e", "set 3,(iy+%hhd),h", "set 3,(iy+%hhd),l", "set 3,(iy+%hhd)", "set 3,(iy+%hhd),a", "set 4,(iy+%hhd),b", "set 4,(iy+%hhd),c", "set 4,(iy+%hhd),d", "set 4,(iy+%hhd),e", "set 4,(iy+%hhd),h", "set 4,(iy+%hhd),l", "set 4,(iy+%hhd)", "set 4,(iy+%hhd),a", "set 5,(iy+%hhd),b", "set 5,(iy+%hhd),c", "set 5,(iy+%hhd),d", "set 5,(iy+%hhd),e", "set 5,(iy+%hhd),h", "set 5,(iy+%hhd),l", "set 5,(iy+%hhd)", "set 5,(iy+%hhd),a", "set 6,(iy+%hhd),b", "set 6,(iy+%hhd),c", "set 6,(iy+%hhd),d", "set 6,(iy+%hhd),e", "set 6,(iy+%hhd),h", "set 6,(iy+%hhd),l", "set 6,(iy+%hhd)", "set 6,(iy+%hhd),a", "set 7,(iy+%hhd),b", "set 7,(iy+%hhd),c", "set 7,(iy+%hhd),d", "set 7,(iy+%hhd),e", "set 7,(iy+%hhd),h", "set 7,(iy+%hhd),l", "set 7,(iy+%hhd)", "set 7,(iy+%hhd),a"}; // const char *base_opcodes[256] = {"nop", "ld bc,NN", "ld (bc),a", "inc bc", "inc b", "dec b", "ld b,N", "rlca", "ex af,af'", "add hl,bc", "ld a,(bc)", "dec bc", "inc c", "dec c", "ld c,N", "rrca", "djnz D", "ld de,NN", "ld (de),a", "inc de", "inc d", "dec d", "ld d,N", "rla", "jr D", "add hl,de", "ld a,(de)", "dec de", "inc e", "dec e", "ld e,N", "rra", "jr nz,D", "ld hl,NN", "ld (NN),hl", "inc hl", "inc h", "dec h", "ld h,N", "daa", "jr z,D", "add hl,hl", "ld hl,(NN)", "dec hl", "inc l", "dec l", "ld l,N", "cpl", "jr nc,D", "ld sp,NN", "ld (NN),a", "inc sp", "inc (hl)", "dec (hl)", "ld (hl),N", "scf", "jr c,D", "add hl,sp", "ld a,(NN)", "dec sp", "inc a", "dec a", "ld a,N", "ccf", "ld b,b", "ld b,c", "ld b,d", "ld b,e", "ld b,h", "ld b,l", "ld b,(hl)", "ld b,a", "ld c,b", "ld c,c", "ld c,d", "ld c,e", "ld c,h", "ld c,l", "ld c,(hl)", "ld c,a", "ld d,b", "ld d,c", "ld d,d", "ld d,e", "ld d,h", "ld d,l", "ld d,(hl)", "ld d,a", "ld e,b", "ld e,c", "ld e,d", "ld e,e", "ld e,h", "ld e,l", "ld e,(hl)", "ld e,a", "ld h,b", "ld h,c", "ld h,d", "ld h,e", "ld h,h", "ld h,l", "ld h,(hl)", "ld h,a", "ld l,b", "ld l,c", "ld l,d", "ld l,e", "ld l,h", "ld l,l", "ld l,(hl)", "ld l,a", "ld (hl),b", "ld (hl),c", "ld (hl),d", "ld (hl),e", "ld (hl),h", "ld (hl),l", "halt", "ld (hl),a", "ld a,b", "ld a,c", "ld a,d", "ld a,e", "ld a,h", "ld a,l", "ld a,(hl)", "ld a,a", "add a,b", "add a,c", "add a,d", "add a,e", "add a,h", "add a,l", "add a,(hl)", "add a,a", "adc a,b", "adc a,c", "adc a,d", "adc a,e", "adc a,h", "adc a,l", "adc a,(hl)", "adc a,a", "sub b", "sub c", "sub d", "sub e", "sub h", "sub l", "sub (hl)", "sub a", "sbc a,b", "sbc a,c", "sbc a,d", "sbc a,e", "sbc a,h", "sbc a,l", "sbc a,(hl)", "sbc a,a", "and b", "and c", "and d", "and e", "and h", "and l", "and (hl)", "and a", "xor b", "xor c", "xor d", "xor e", "xor h", "xor l", "xor (hl)", "xor a", "or b", "or c", "or d", "or e", "or h", "or l", "or (hl)", "or a", "cp b", "cp c", "cp d", "cp e", "cp h", "cp l", "cp (hl)", "cp a", "ret nz", "pop bc", "jp nz,NN", "jp NN", "call nz,NN", "push bc", "add a,N", "rst 00h", "ret z", "ret", "jp z,NN", "_Bit_", "call z,NN", "call NN", "adc a,N", "rst 08h", "ret nc", "pop de", "jp nc,NN", "out (N),a", "call nc,NN", "push de", "sub N", "rst 10h", "ret c", "exx", "jp c,NN", "in a,(N)", "call c,NN", "_IX_", "sbc a,N", "rst 18h", "ret po", "pop hl", "jp po,NN", "ex (sp),hl", "call po,NN", "push hl", "and N", "rst 20h", "ret pe", "jp (hl)", "jp pe,NN", "ex de,hl", "call pe,NN", "_Misc._", "xor N", "rst 28h", "ret p", "pop af", "jp p,NN", "di", "call p,NN", "push af", "or N", "rst 30h", "ret m", "ld sp,hl", "jp m,NN", "ei", "call m,NN", "_IY_", "cp N", "rst 38h"}; // const char *cb_opcodes[256] = {"rlc b", "rlc c", "rlc d", "rlc e", "rlc h", "rlc l", "rlc (hl)", "rlc a", "rrc b", "rrc c", "rrc d", "rrc e", "rrc h", "rrc l", "rrc (hl)", "rrc a", "rl b", "rl c", "rl d", "rl e", "rl h", "rl l", "rl (hl)", "rl a", "rr b", "rr c", "rr d", "rr e", "rr h", "rr l", "rr (hl)", "rr a", "sla b", "sla c", "sla d", "sla e", "sla h", "sla l", "sla (hl)", "sla a", "sra b", "sra c", "sra d", "sra e", "sra h", "sra l", "sra (hl)", "sra a", "sll b", "sll c", "sll d", "sll e", "sll h", "sll l", "sll (hl)", "sll a", "srl b", "srl c", "srl d", "srl e", "srl h", "srl l", "srl (hl)", "srl a", "bit 0,b", "bit 0,c", "bit 0,d", "bit 0,e", "bit 0,h", "bit 0,l", "bit 0,(hl)", "bit 0,a", "bit 1,b", "bit 1,c", "bit 1,d", "bit 1,e", "bit 1,h", "bit 1,l", "bit 1,(hl)", "bit 1,a", "bit 2,b", "bit 2,c", "bit 2,d", "bit 2,e", "bit 2,h", "bit 2,l", "bit 2,(hl)", "bit 2,a", "bit 3,b", "bit 3,c", "bit 3,d", "bit 3,e", "bit 3,h", "bit 3,l", "bit 3,(hl)", "bit 3,a", "bit 4,b", "bit 4,c", "bit 4,d", "bit 4,e", "bit 4,h", "bit 4,l", "bit 4,(hl)", "bit 4,a", "bit 5,b", "bit 5,c", "bit 5,d", "bit 5,e", "bit 5,h", "bit 5,l", "bit 5,(hl)", "bit 5,a", "bit 6,b", "bit 6,c", "bit 6,d", "bit 6,e", "bit 6,h", "bit 6,l", "bit 6,(hl)", "bit 6,a", "bit 7,b", "bit 7,c", "bit 7,d", "bit 7,e", "bit 7,h", "bit 7,l", "bit 7,(hl)", "bit 7,a", "res 0,b", "res 0,c", "res 0,d", "res 0,e", "res 0,h", "res 0,l", "res 0,(hl)", "res 0,a", "res 1,b", "res 1,c", "res 1,d", "res 1,e", "res 1,h", "res 1,l", "res 1,(hl)", "res 1,a", "res 2,b", "res 2,c", "res 2,d", "res 2,e", "res 2,h", "res 2,l", "res 2,(hl)", "res 2,a", "res 3,b", "res 3,c", "res 3,d", "res 3,e", "res 3,h", "res 3,l", "res 3,(hl)", "res 3,a", "res 4,b", "res 4,c", "res 4,d", "res 4,e", "res 4,h", "res 4,l", "res 4,(hl)", "res 4,a", "res 5,b", "res 5,c", "res 5,d", "res 5,e", "res 5,h", "res 5,l", "res 5,(hl)", "res 5,a", "res 6,b", "res 6,c", "res 6,d", "res 6,e", "res 6,h", "res 6,l", "res 6,(hl)", "res 6,a", "res 7,b", "res 7,c", "res 7,d", "res 7,e", "res 7,h", "res 7,l", "res 7,(hl)", "res 7,a", "set 0,b", "set 0,c", "set 0,d", "set 0,e", "set 0,h", "set 0,l", "set 0,(hl)", "set 0,a", "set 1,b", "set 1,c", "set 1,d", "set 1,e", "set 1,h", "set 1,l", "set 1,(hl)", "set 1,a", "set 2,b", "set 2,c", "set 2,d", "set 2,e", "set 2,h", "set 2,l", "set 2,(hl)", "set 2,a", "set 3,b", "set 3,c", "set 3,d", "set 3,e", "set 3,h", "set 3,l", "set 3,(hl)", "set 3,a", "set 4,b", "set 4,c", "set 4,d", "set 4,e", "set 4,h", "set 4,l", "set 4,(hl)", "set 4,a", "set 5,b", "set 5,c", "set 5,d", "set 5,e", "set 5,h", "set 5,l", "set 5,(hl)", "set 5,a", "set 6,b", "set 6,c", "set 6,d", "set 6,e", "set 6,h", "set 6,l", "set 6,(hl)", "set 6,a", "set 7,b", "set 7,c", "set 7,d", "set 7,e", "set 7,h", "set 7,l", "set 7,(hl)", "set 7,a"}; // const char *ix_opcodes[256] = {"", "", "", "", "inc b", "dec b", "ld b,N", "", "", "add ix,bc", "", "", "inc c", "dec c", "ld c,N", "", "", "", "", "", "inc d", "dec d", "ld d,N", "", "", "add ix,de", "", "", "inc e", "dec e", "ld e,N", "", "", "ld ix,NN", "ld (NN),ix", "inc ix", "inc ixh", "dec ixh", "ld ixh,N", "", "", "add ix,ix", "ld ix,(NN)", "dec ix", "inc ixl", "dec ixl", "ld ixl,N", "", "", "", "", "", "inc (ix+D)", "dec (ix+D)", "ld (ix+D),N", "", "", "add ix,sp", "", "", "inc a", "dec a", "ld a,N", "", "ld b,b", "ld b,c", "ld b,d", "ld b,e", "ld b,ixh", "ld b,ixl", "ld b,(ix+D)", "ld b,a", "ld c,b", "ld c,c", "ld c,d", "ld c,e", "ld c,ixh", "ld c,ixl", "ld c,(ix+D)", "ld c,a", "ld d,b", "ld d,c", "ld d,d", "ld d,e", "ld d,ixh", "ld d,ixl", "ld d,(ix+D)", "ld d,a", "ld e,b", "ld e,c", "ld e,d", "ld e,e", "ld e,ixh", "ld e,ixl", "ld e,(ix+D)", "ld e,a", "ld ixh,b", "ld ixh,c", "ld ixh,d", "ld ixh,e", "ld ixh,ixh", "ld ixh,ixl", "ld h,(ix+D)", "ld ixh,a", "ld ixl,b", "ld ixl,c", "ld ixl,d", "ld ixl,e", "ld ixl,ixh", "ld ixl,ixl", "ld l,(ix+D)", "ld ixl,a", "ld (ix+D),b", "ld (ix+D),c", "ld (ix+D),d", "ld (ix+D),e", "ld (ix+D),h", "ld (ix+D),l", "", "ld (ix+D),a", "ld a,b", "ld a,c", "ld a,d", "ld a,e", "ld a,ixh", "ld a,ixl", "ld a,(ix+D)", "ld a,a", "add a,b", "add a,c", "add a,d", "add a,e", "add a,ixh", "add a,ixl", "add a,(ix+D)", "add a,a", "adc a,b", "adc a,c", "adc a,d", "adc a,e", "adc a,ixh", "adc a,ixl", "adc a,(ix+D)", "adc a,a", "sub b", "sub c", "sub d", "sub e", "sub ixh", "sub ixl", "sub (ix+D)", "sub a", "sbc a,b", "sbc a,c", "sbc a,d", "sbc a,e", "sbc a,ixh", "sbc a,ixl", "sbc a,(ix+D)", "sbc a,a", "and b", "and c", "and d", "and e", "and ixh", "and ixl", "and (ix+D)", "and a", "xor b", "xor c", "xor d", "xor e", "xor ixh", "xor ixl", "xor (ix+D)", "xor a", "or b", "or c", "or d", "or e", "or ixh", "or ixl", "or (ix+D)", "or a", "cp b", "cp c", "cp d", "cp e", "cp ixh", "cp ixl", "cp (ix+D)", "cp a", "", "", "", "", "", "", "", "", "", "", "", "_IX Bit_", "", "", "", "", "", "pop ix", "", "ex (sp),ix", "", "push ix", "", "", "", "jp (ix)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ld sp,ix", "", "", "", "", "", ""}; // const char *ix_bit_opcodes[256] = {"rlc (ix+D),b", "rlc (ix+D),c", "rlc (ix+D),d", "rlc (ix+D),e", "rlc (ix+D),h", "rlc (ix+D),l", "rlc (ix+D)", "rlc (ix+D),a", "rrc (ix+D),b", "rrc (ix+D),c", "rrc (ix+D),d", "rrc (ix+D),e", "rrc (ix+D),h", "rrc (ix+D),l", "rrc (ix+D)", "rrc (ix+D),a", "rl (ix+D),b", "rl (ix+D),c", "rl (ix+D),d", "rl (ix+D),e", "rl (ix+D),h", "rl (ix+D),l", "rl (ix+D)", "rl (ix+D),a", "rr (ix+D),b", "rr (ix+D),c", "rr (ix+D),d", "rr (ix+D),e", "rr (ix+D),h", "rr (ix+D),l", "rr (ix+D)", "rr (ix+D),a", "sla (ix+D),b", "sla (ix+D),c", "sla (ix+D),d", "sla (ix+D),e", "sla (ix+D),h", "sla (ix+D),l", "sla (ix+D)", "sla (ix+D),a", "sra (ix+D),b", "sra (ix+D),c", "sra (ix+D),d", "sra (ix+D),e", "sra (ix+D),h", "sra (ix+D),l", "sra (ix+D)", "sra (ix+D),a", "sll (ix+D),b", "sll (ix+D),c", "sll (ix+D),d", "sll (ix+D),e", "sll (ix+D),h", "sll (ix+D),l", "sll (ix+D)", "sll (ix+D),a", "srl (ix+D),b", "srl (ix+D),c", "srl (ix+D),d", "srl (ix+D),e", "srl (ix+D),h", "srl (ix+D),l", "srl (ix+D)", "srl (ix+D),a", "bit 0,(ix+D)", "bit 0,(ix+D)", "bit 0,(ix+D)", "bit 0,(ix+D)", "bit 0,(ix+D)", "bit 0,(ix+D)", "bit 0,(ix+D)", "bit 0,(ix+D)", "bit 1,(ix+D)", "bit 1,(ix+D)", "bit 1,(ix+D)", "bit 1,(ix+D)", "bit 1,(ix+D)", "bit 1,(ix+D)", "bit 1,(ix+D)", "bit 1,(ix+D)", "bit 2,(ix+D)", "bit 2,(ix+D)", "bit 2,(ix+D)", "bit 2,(ix+D)", "bit 2,(ix+D)", "bit 2,(ix+D)", "bit 2,(ix+D)", "bit 2,(ix+D)", "bit 3,(ix+D)", "bit 3,(ix+D)", "bit 3,(ix+D)", "bit 3,(ix+D)", "bit 3,(ix+D)", "bit 3,(ix+D)", "bit 3,(ix+D)", "bit 3,(ix+D)", "bit 4,(ix+D)", "bit 4,(ix+D)", "bit 4,(ix+D)", "bit 4,(ix+D)", "bit 4,(ix+D)", "bit 4,(ix+D)", "bit 4,(ix+D)", "bit 4,(ix+D)", "bit 5,(ix+D)", "bit 5,(ix+D)", "bit 5,(ix+D)", "bit 5,(ix+D)", "bit 5,(ix+D)", "bit 5,(ix+D)", "bit 5,(ix+D)", "bit 5,(ix+D)", "bit 6,(ix+D)", "bit 6,(ix+D)", "bit 6,(ix+D)", "bit 6,(ix+D)", "bit 6,(ix+D)", "bit 6,(ix+D)", "bit 6,(ix+D)", "bit 6,(ix+D)", "bit 7,(ix+D)", "bit 7,(ix+D)", "bit 7,(ix+D)", "bit 7,(ix+D)", "bit 7,(ix+D)", "bit 7,(ix+D)", "bit 7,(ix+D)", "bit 7,(ix+D)", "res 0,(ix+D),b", "res 0,(ix+D),c", "res 0,(ix+D),d", "res 0,(ix+D),e", "res 0,(ix+D),h", "res 0,(ix+D),l", "res 0,(ix+D)", "res 0,(ix+D),a", "res 1,(ix+D),b", "res 1,(ix+D),c", "res 1,(ix+D),d", "res 1,(ix+D),e", "res 1,(ix+D),h", "res 1,(ix+D),l", "res 1,(ix+D)", "res 1,(ix+D),a", "res 2,(ix+D),b", "res 2,(ix+D),c", "res 2,(ix+D),d", "res 2,(ix+D),e", "res 2,(ix+D),h", "res 2,(ix+D),l", "res 2,(ix+D)", "res 2,(ix+D),a", "res 3,(ix+D),b", "res 3,(ix+D),c", "res 3,(ix+D),d", "res 3,(ix+D),e", "res 3,(ix+D),h", "res 3,(ix+D),l", "res 3,(ix+D)", "res 3,(ix+D),a", "res 4,(ix+D),b", "res 4,(ix+D),c", "res 4,(ix+D),d", "res 4,(ix+D),e", "res 4,(ix+D),h", "res 4,(ix+D),l", "res 4,(ix+D)", "res 4,(ix+D),a", "res 5,(ix+D),b", "res 5,(ix+D),c", "res 5,(ix+D),d", "res 5,(ix+D),e", "res 5,(ix+D),h", "res 5,(ix+D),l", "res 5,(ix+D)", "res 5,(ix+D),a", "res 6,(ix+D),b", "res 6,(ix+D),c", "res 6,(ix+D),d", "res 6,(ix+D),e", "res 6,(ix+D),h", "res 6,(ix+D),l", "res 6,(ix+D)", "res 6,(ix+D),a", "res 7,(ix+D),b", "res 7,(ix+D),c", "res 7,(ix+D),d", "res 7,(ix+D),e", "res 7,(ix+D),h", "res 7,(ix+D),l", "res 7,(ix+D)", "res 7,(ix+D),a", "set 0,(ix+D),b", "set 0,(ix+D),c", "set 0,(ix+D),d", "set 0,(ix+D),e", "set 0,(ix+D),h", "set 0,(ix+D),l", "set 0,(ix+D)", "set 0,(ix+D),a", "set 1,(ix+D),b", "set 1,(ix+D),c", "set 1,(ix+D),d", "set 1,(ix+D),e", "set 1,(ix+D),h", "set 1,(ix+D),l", "set 1,(ix+D)", "set 1,(ix+D),a", "set 2,(ix+D),b", "set 2,(ix+D),c", "set 2,(ix+D),d", "set 2,(ix+D),e", "set 2,(ix+D),h", "set 2,(ix+D),l", "set 2,(ix+D)", "set 2,(ix+D),a", "set 3,(ix+D),b", "set 3,(ix+D),c", "set 3,(ix+D),d", "set 3,(ix+D),e", "set 3,(ix+D),h", "set 3,(ix+D),l", "set 3,(ix+D)", "set 3,(ix+D),a", "set 4,(ix+D),b", "set 4,(ix+D),c", "set 4,(ix+D),d", "set 4,(ix+D),e", "set 4,(ix+D),h", "set 4,(ix+D),l", "set 4,(ix+D)", "set 4,(ix+D),a", "set 5,(ix+D),b", "set 5,(ix+D),c", "set 5,(ix+D),d", "set 5,(ix+D),e", "set 5,(ix+D),h", "set 5,(ix+D),l", "set 5,(ix+D)", "set 5,(ix+D),a", "set 6,(ix+D),b", "set 6,(ix+D),c", "set 6,(ix+D),d", "set 6,(ix+D),e", "set 6,(ix+D),h", "set 6,(ix+D),l", "set 6,(ix+D)", "set 6,(ix+D),a", "set 7,(ix+D),b", "set 7,(ix+D),c", "set 7,(ix+D),d", "set 7,(ix+D),e", "set 7,(ix+D),h", "set 7,(ix+D),l", "set 7,(ix+D)", "set 7,(ix+D),a"}; // const char *misc_opcodes[128] = {"in b,(c)", "out (c),b", "sbc hl,bc", "ld (NN),bc", "neg", "retn", "im 0", "ld i,a", "in c,(c)", "out (c),c", "adc hl,bc", "ld bc,(NN)", "mlt bc", "reti", "", "ld r,a", "in d,(c)", "out (c),d", "sbc hl,de", "ld (NN),de", "", "", "im 1", "ld a,i", "in e,(c)", "out (c),e", "adc hl,de", "ld de,(NN)", "mlt de", "", "im 2", "ld a,r", "in h,(c)", "out (c),h", "sbc hl,hl", "ld (NN),hl", "tst N", "", "", "rrd", "in l,(c)", "out (c),l", "adc hl,hl", "ld hl,(NN)", "mlt hl", "", "", "rld", "in (c)", "out (c),0", "sbc hl,sp", "ld (NN),sp", "tstio N", "", "slp", "", "in a,(c)", "out (c),a", "adc hl,sp", "ld sp,(NN)", "mlt sp", "", "", "", "", "", "", "otim", "", "", "", "", "", "", "", "otdm", "", "", "", "", "", "", "", "otimr", "", "", "", "", "", "", "", "otdmr", "", "", "", "", "ldi", "cpi", "ini", "outi", "", "", "", "", "ldd", "cpd", "ind", "outd", "", "", "", "", "ldir", "cpir", "inir", "otir", "", "", "", "", "lddr", "cpdr", "indr", "otdr", "", "", "", ""}; // const char *iy_opcodes[256] = {"", "", "", "", "inc b", "dec b", "ld b,N", "", "", "add iy,bc", "", "", "inc c", "dec c", "ld c,N", "", "", "", "", "", "inc d", "dec d", "ld d,N", "", "", "add iy,de", "", "", "inc e", "dec e", "ld e,N", "", "", "ld iy,NN", "ld (NN),iy", "inc iy", "inc iyh", "dec iyh", "ld iyh,N", "", "", "add iy,iy", "ld iy,(NN)", "dec iy", "inc iyl", "dec iyl", "ld iyl,N", "", "", "", "", "", "inc (iy+D)", "dec (iy+D)", "ld (iy+D),N", "", "", "add iy,sp", "", "", "inc a", "dec a", "ld a,N", "", "ld b,b", "ld b,c", "ld b,d", "ld b,e", "ld b,iyh", "ld b,iyl", "ld b,(iy+D)", "ld b,a", "ld c,b", "ld c,c", "ld c,d", "ld c,e", "ld c,iyh", "ld c,iyl", "ld c,(iy+D)", "ld c,a", "ld d,b", "ld d,c", "ld d,d", "ld d,e", "ld d,iyh", "ld d,iyl", "ld d,(iy+D)", "ld d,a", "ld e,b", "ld e,c", "ld e,d", "ld e,e", "ld e,iyh", "ld e,iyl", "ld e,(iy+D)", "ld e,a", "ld iyh,b", "ld iyh,c", "ld iyh,d", "ld iyh,e", "ld iyh,iyh", "ld iyh,iyl", "ld h,(iy+D)", "ld iyh,a", "ld iyl,b", "ld iyl,c", "ld iyl,d", "ld iyl,e", "ld iyl,iyh", "ld iyl,iyl", "ld l,(iy+D)", "ld iyl,a", "ld (iy+D),b", "ld (iy+D),c", "ld (iy+D),d", "ld (iy+D),e", "ld (iy+D),h", "ld (iy+D),l", "", "ld (iy+D),a", "ld a,b", "ld a,c", "ld a,d", "ld a,e", "ld a,iyh", "ld a,iyl", "ld a,(iy+D)", "ld a,a", "add a,b", "add a,c", "add a,d", "add a,e", "add a,iyh", "add a,iyl", "add a,(iy+D)", "add a,a", "adc a,b", "adc a,c", "adc a,d", "adc a,e", "adc a,iyh", "adc a,iyl", "adc a,(iy+D)", "adc a,a", "sub b", "sub c", "sub d", "sub e", "sub iyh", "sub iyl", "sub (iy+D)", "sub a", "sbc a,b", "sbc a,c", "sbc a,d", "sbc a,e", "sbc a,iyh", "sbc a,iyl", "sbc a,(iy+D)", "sbc a,a", "and b", "and c", "and d", "and e", "and iyh", "and iyl", "and (iy+D)", "and a", "xor b", "xor c", "xor d", "xor e", "xor iyh", "xor iyl", "xor (iy+D)", "xor a", "or b", "or c", "or d", "or e", "or iyh", "or iyl", "or (iy+D)", "or a", "cp b", "cp c", "cp d", "cp e", "cp iyh", "cp iyl", "cp (iy+D)", "cp a", "", "", "", "", "", "", "", "", "", "", "", "_IY Bit_", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "pop iy", "", "ex (sp),iy", "", "push iy", "", "", "", "jp (iy)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ld sp,iy", "", "", "", "", "", ""}; // const char *iy_bit_opcodes[256] = {"rlc (iy+D),b", "rlc (iy+D),c", "rlc (iy+D),d", "rlc (iy+D),e", "rlc (iy+D),h", "rlc (iy+D),l", "rlc (iy+D)", "rlc (iy+D),a", "rrc (iy+D),b", "rrc (iy+D),c", "rrc (iy+D),d", "rrc (iy+D),e", "rrc (iy+D),h", "rrc (iy+D),l", "rrc (iy+D)", "rrc (iy+D),a", "rl (iy+D),b", "rl (iy+D),c", "rl (iy+D),d", "rl (iy+D),e", "rl (iy+D),h", "rl (iy+D),l", "rl (iy+D)", "rl (iy+D),a", "rr (iy+D),b", "rr (iy+D),c", "rr (iy+D),d", "rr (iy+D),e", "rr (iy+D),h", "rr (iy+D),l", "rr (iy+D)", "rr (iy+D),a", "sla (iy+D),b", "sla (iy+D),c", "sla (iy+D),d", "sla (iy+D),e", "sla (iy+D),h", "sla (iy+D),l", "sla (iy+D)", "sla (iy+D),a", "sra (iy+D),b", "sra (iy+D),c", "sra (iy+D),d", "sra (iy+D),e", "sra (iy+D),h", "sra (iy+D),l", "sra (iy+D)", "sra (iy+D),a", "sll (iy+D),b", "sll (iy+D),c", "sll (iy+D),d", "sll (iy+D),e", "sll (iy+D),h", "sll (iy+D),l", "sll (iy+D)", "sll (iy+D),a", "srl (iy+D),b", "srl (iy+D),c", "srl (iy+D),d", "srl (iy+D),e", "srl (iy+D),h", "srl (iy+D),l", "srl (iy+D)", "srl (iy+D),a", "bit 0,(iy+D)", "bit 0,(iy+D)", "bit 0,(iy+D)", "bit 0,(iy+D)", "bit 0,(iy+D)", "bit 0,(iy+D)", "bit 0,(iy+D)", "bit 0,(iy+D)", "bit 1,(iy+D)", "bit 1,(iy+D)", "bit 1,(iy+D)", "bit 1,(iy+D)", "bit 1,(iy+D)", "bit 1,(iy+D)", "bit 1,(iy+D)", "bit 1,(iy+D)", "bit 2,(iy+D)", "bit 2,(iy+D)", "bit 2,(iy+D)", "bit 2,(iy+D)", "bit 2,(iy+D)", "bit 2,(iy+D)", "bit 2,(iy+D)", "bit 2,(iy+D)", "bit 3,(iy+D)", "bit 3,(iy+D)", "bit 3,(iy+D)", "bit 3,(iy+D)", "bit 3,(iy+D)", "bit 3,(iy+D)", "bit 3,(iy+D)", "bit 3,(iy+D)", "bit 4,(iy+D)", "bit 4,(iy+D)", "bit 4,(iy+D)", "bit 4,(iy+D)", "bit 4,(iy+D)", "bit 4,(iy+D)", "bit 4,(iy+D)", "bit 4,(iy+D)", "bit 5,(iy+D)", "bit 5,(iy+D)", "bit 5,(iy+D)", "bit 5,(iy+D)", "bit 5,(iy+D)", "bit 5,(iy+D)", "bit 5,(iy+D)", "bit 5,(iy+D)", "bit 6,(iy+D)", "bit 6,(iy+D)", "bit 6,(iy+D)", "bit 6,(iy+D)", "bit 6,(iy+D)", "bit 6,(iy+D)", "bit 6,(iy+D)", "bit 6,(iy+D)", "bit 7,(iy+D)", "bit 7,(iy+D)", "bit 7,(iy+D)", "bit 7,(iy+D)", "bit 7,(iy+D)", "bit 7,(iy+D)", "bit 7,(iy+D)", "bit 7,(iy+D)", "res 0,(iy+D),b", "res 0,(iy+D),c", "res 0,(iy+D),d", "res 0,(iy+D),e", "res 0,(iy+D),h", "res 0,(iy+D),l", "res 0,(iy+D)", "res 0,(iy+D),a", "res 1,(iy+D),b", "res 1,(iy+D),c", "res 1,(iy+D),d", "res 1,(iy+D),e", "res 1,(iy+D),h", "res 1,(iy+D),l", "res 1,(iy+D)", "res 1,(iy+D),a", "res 2,(iy+D),b", "res 2,(iy+D),c", "res 2,(iy+D),d", "res 2,(iy+D),e", "res 2,(iy+D),h", "res 2,(iy+D),l", "res 2,(iy+D)", "res 2,(iy+D),a", "res 3,(iy+D),b", "res 3,(iy+D),c", "res 3,(iy+D),d", "res 3,(iy+D),e", "res 3,(iy+D),h", "res 3,(iy+D),l", "res 3,(iy+D)", "res 3,(iy+D),a", "res 4,(iy+D),b", "res 4,(iy+D),c", "res 4,(iy+D),d", "res 4,(iy+D),e", "res 4,(iy+D),h", "res 4,(iy+D),l", "res 4,(iy+D)", "res 4,(iy+D),a", "res 5,(iy+D),b", "res 5,(iy+D),c", "res 5,(iy+D),d", "res 5,(iy+D),e", "res 5,(iy+D),h", "res 5,(iy+D),l", "res 5,(iy+D)", "res 5,(iy+D),a", "res 6,(iy+D),b", "res 6,(iy+D),c", "res 6,(iy+D),d", "res 6,(iy+D),e", "res 6,(iy+D),h", "res 6,(iy+D),l", "res 6,(iy+D)", "res 6,(iy+D),a", "res 7,(iy+D),b", "res 7,(iy+D),c", "res 7,(iy+D),d", "res 7,(iy+D),e", "res 7,(iy+D),h", "res 7,(iy+D),l", "res 7,(iy+D)", "res 7,(iy+D),a", "set 0,(iy+D),b", "set 0,(iy+D),c", "set 0,(iy+D),d", "set 0,(iy+D),e", "set 0,(iy+D),h", "set 0,(iy+D),l", "set 0,(iy+D)", "set 0,(iy+D),a", "set 1,(iy+D),b", "set 1,(iy+D),c", "set 1,(iy+D),d", "set 1,(iy+D),e", "set 1,(iy+D),h", "set 1,(iy+D),l", "set 1,(iy+D)", "set 1,(iy+D),a", "set 2,(iy+D),b", "set 2,(iy+D),c", "set 2,(iy+D),d", "set 2,(iy+D),e", "set 2,(iy+D),h", "set 2,(iy+D),l", "set 2,(iy+D)", "set 2,(iy+D),a", "set 3,(iy+D),b", "set 3,(iy+D),c", "set 3,(iy+D),d", "set 3,(iy+D),e", "set 3,(iy+D),h", "set 3,(iy+D),l", "set 3,(iy+D)", "set 3,(iy+D),a", "set 4,(iy+D),b", "set 4,(iy+D),c", "set 4,(iy+D),d", "set 4,(iy+D),e", "set 4,(iy+D),h", "set 4,(iy+D),l", "set 4,(iy+D)", "set 4,(iy+D),a", "set 5,(iy+D),b", "set 5,(iy+D),c", "set 5,(iy+D),d", "set 5,(iy+D),e", "set 5,(iy+D),h", "set 5,(iy+D),l", "set 5,(iy+D)", "set 5,(iy+D),a", "set 6,(iy+D),b", "set 6,(iy+D),c", "set 6,(iy+D),d", "set 6,(iy+D),e", "set 6,(iy+D),h", "set 6,(iy+D),l", "set 6,(iy+D)", "set 6,(iy+D),a", "set 7,(iy+D),b", "set 7,(iy+D),c", "set 7,(iy+D),d", "set 7,(iy+D),e", "set 7,(iy+D),h", "set 7,(iy+D),l", "set 7,(iy+D)", "set 7,(iy+D),a"}; const char *getBase(const uint16_t pos) { const uint8_t *memory = &z80::getMem()[pos]; if (*memory == 0xCB) { opcode_size=2; return cb_opcodes[*(memory+1)]; } else if (*memory == 0xDD) { if (*(memory+1) == 0xCB) { opcode_size=4; return ix_bit_opcodes[*(memory+3)]; } else { opcode_size=2; return ix_opcodes[*(memory+1)]; } } else if (*memory == 0xED) { opcode_size=2; return misc_opcodes[(*(memory+1))-64]; } else if (*memory == 0xFD) { if (*(memory+1) == 0xCB) { opcode_size=4; return iy_bit_opcodes[*(memory+3)]; } else { opcode_size=2; return iy_opcodes[*(memory+1)]; } } else { opcode_size=1; return base_opcodes[*memory]; } } void printOpcode(const uint16_t pos) { const uint8_t *memory = &z80::getMem()[pos]; char hex[4]; for (int i=0; i<4;++i) { if (opcode_size>i) sprintf(hex, "%02x ", *(memory+i)); else sprintf(hex, " "); strcat(buffer, hex); } } const char *getAsm(const uint16_t pos) { const uint8_t *memory = &z80::getMem()[pos]; opcode_size = 0; char base[256]; strcpy(buffer, getBase(pos)); if (strstr(buffer, "4x")) { opcode_size+=2; const uint16_t word = *(uint16_t*)(memory+1); strcpy(base, buffer); sprintf(buffer, base, word); } if (strstr(buffer, "2x")) { opcode_size+=1; strcpy(base, buffer); sprintf(buffer, base, *(memory+1)); } if (strstr(buffer, "Xx")) { strcpy(base, buffer); *strstr(base, "Xx") = '4'; opcode_size+=1; if (opcode_size>4) { opcode_size=4; sprintf(buffer, base, pos + opcode_size + (int8_t)*(memory+2)); } else { sprintf(buffer, base, pos + opcode_size + (int8_t)*(memory+1)); } } if (strstr(base, "hhd")) { opcode_size+=1; strcpy(base, buffer); if (opcode_size>4) { opcode_size=4; sprintf(buffer, base, (int8_t)*(memory+2)); } else { sprintf(buffer, base, (int8_t)*(memory+1)); } } return buffer; } const char *getOpcode(const uint16_t pos) { opcode_size = 0; buffer[0]=0; const char *base = getBase(pos); if (strstr(base, "4x")) opcode_size+=2; if (strstr(base, "2x")) opcode_size+=1; if (strstr(base, "Xx")) opcode_size+=1; if (strstr(base, "hh")) opcode_size+=1; printOpcode(pos); return buffer; } const int getOpcodeSize(const uint16_t pos) { opcode_size = 0; const char *base = getBase(pos); if (strstr(base, "4x")) opcode_size+=2; if (strstr(base, "2x")) opcode_size+=1; if (strstr(base, "Xx")) opcode_size+=1; if (strstr(base, "hh")) opcode_size+=1; return opcode_size; } }