Skip to content

Instantly share code, notes, and snippets.

@Pigu-A
Last active January 8, 2022 17:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pigu-A/bab67ae5812fd25c803babe47451c69e to your computer and use it in GitHub Desktop.
Save Pigu-A/bab67ae5812fd25c803babe47451c69e to your computer and use it in GitHub Desktop.
Yo dawg, I heard you like GB-Z80 disassembly so I made a GB-Z80 disassembler in GB-Z80 disassembly so you can disassemble GB-Z80 code while using GB-Z80 assembly
; code by PikalaxALT, not me
FarDisassemble:
; Disassemble the opcode at a:hl to wStringBuffer1
ld [hBuffer], a
ld a, [hROMBank]
push af
ld a, [hBuffer]
rst Bankswitch
call Disassemble
pop af
rst Bankswitch
ret
Disassemble:
; Disassemble the opcode at hl to wStringBuffer1
ld a, [hli]
push de
push hl
ld hl, .Opcodes
ld e, a
ld d, 0
add hl, de
add hl, de
add hl, de
ld a, [hli]
push af
ld a, [hli]
ld d, [hl]
ld e, a
ld hl, wStringBuffer1
ld bc, wStringBuffer2 - wStringBuffer1
ld a, "@"
call ByteFill
ld hl, wStringBuffer1
call PlaceString
pop af
ld hl, .Params
ld e, a
ld d, 0
add hl, de
add hl, de
ld a, [hli]
ld d, [hl]
ld e, a
pop hl
call _de_
pop de
ret
.Params:
dw .NoParam
dw .OneByteParam
dw .TwoByteParam
dw .RelativeParam
dw .ExtendedOp
.NoParam:
ret
.ExtendedOp:
ld a, [hli]
push hl
ld hl, .ExtendedOpcodes
call GetNthString
ld d, h
ld e, l
ld hl, wStringBuffer1
call PlaceString
pop hl
ret
.RelativeParam:
call .FindParamPlaceholder
inc de
inc de
inc de
ld a, [hli]
push hl
bit 7, a
jr c, .subtract
add l
ld l, a
jr nc, .load
inc h
jr .load
.subtract
cpl
inc a
ld b, a
ld a, l
sub b
ld l, a
jr nc, .load
dec h
.load
call .PlaceRelativeByte
ld l, h
.PlaceRelativeByte
call .PlaceRelativeDigit
swap l
.PlaceRelativeDigit
ld a, l
jr .PlaceDigit
.OneByteParam:
call .FindParamPlaceholder
inc de
jr .PlaceByte
.TwoByteParam:
call .FindParamPlaceholder
inc de
inc de
inc de
call .PlaceByte
.PlaceByte
ld a, [hli]
ld b, a
call .PlaceDigit
ld a, b
swap a
.PlaceDigit
and $f
add "0"
or $80
ld [de], a
dec de
ret
.FindParamPlaceholder:
push hl
ld hl, wStringBuffer1
.find_loop
ld a, [hli]
cp $f5
jr nz, .find_loop
ld d, h
ld e, l
pop hl
ret
.Opcodes:
const_def
const NO_PARAM
const ONE_BYTE_PARAM
const TWO_BYTE_PARAM
const RELATIVE_PARAM
const EXTENDED_OP
dbw NO_PARAM, .nop_string
dbw TWO_BYTE_PARAM, .ld_bc_xxxx_string
dbw NO_PARAM, .ld_bc_a_string
dbw NO_PARAM, .inc_bc_string
dbw NO_PARAM, .inc_b_string
dbw NO_PARAM, .dec_b_string
dbw ONE_BYTE_PARAM, .ld_b_xxxx_string
dbw NO_PARAM, .rlca_string
dbw TWO_BYTE_PARAM, .ld_xxxx_sp_string
dbw NO_PARAM, .add_hl_bc_string
dbw NO_PARAM, .ld_a_bc_string
dbw NO_PARAM, .dec_bc_string
dbw NO_PARAM, .inc_c_string
dbw NO_PARAM, .dec_c_string
dbw ONE_BYTE_PARAM, .ld_c_xxxx_string
dbw NO_PARAM, .rrca_string
dbw NO_PARAM, .stop_string
dbw TWO_BYTE_PARAM, .ld_de_xxxx_string
dbw NO_PARAM, .ld_de_a_string
dbw NO_PARAM, .inc_de_string
dbw NO_PARAM, .inc_d_string
dbw NO_PARAM, .dec_d_string
dbw ONE_BYTE_PARAM, .ld_d_xxxx_string
dbw NO_PARAM, .rla_string
dbw RELATIVE_PARAM, .jr_xxxx_string
dbw NO_PARAM, .add_hl_de_string
dbw NO_PARAM, .ld_a_de_string
dbw NO_PARAM, .dec_de_string
dbw NO_PARAM, .inc_e_string
dbw NO_PARAM, .dec_e_string
dbw ONE_BYTE_PARAM, .ld_e_xxxx_string
dbw NO_PARAM, .rra_string
dbw RELATIVE_PARAM, .jr_nz_xxxx_string
dbw TWO_BYTE_PARAM, .ld_hl_xxxx_string
dbw NO_PARAM, .ld_hli_a_string
dbw NO_PARAM, .inc_hl_string
dbw NO_PARAM, .inc_h_string
dbw NO_PARAM, .dec_h_string
dbw ONE_BYTE_PARAM, .ld_h_xxxx_string
dbw NO_PARAM, .daa_string
dbw RELATIVE_PARAM, .jr_z_xxxx_string
dbw NO_PARAM, .add_hl_hl_string
dbw NO_PARAM, .ld_a_hli_string
dbw NO_PARAM, .dec_hl_string
dbw NO_PARAM, .inc_l_string
dbw NO_PARAM, .dec_l_string
dbw ONE_BYTE_PARAM, .ld_l_xxxx_string
dbw NO_PARAM, .cpl_string
dbw RELATIVE_PARAM, .jr_nc_xxxx_string
dbw TWO_BYTE_PARAM, .ld_sp_xxxx_string
dbw NO_PARAM, .ld_hld_a_string
dbw NO_PARAM, .inc_sp_string
dbw NO_PARAM, .inc_hl_string
dbw NO_PARAM, .dec_hl_string
dbw ONE_BYTE_PARAM, .ld_hl_xxxx_string
dbw NO_PARAM, .scf_string
dbw RELATIVE_PARAM, .jr_c_xxxx_string
dbw NO_PARAM, .add_hl_sp_string
dbw NO_PARAM, .ld_a_hld_string
dbw NO_PARAM, .dec_sp_string
dbw NO_PARAM, .inc_a_string
dbw NO_PARAM, .dec_a_string
dbw ONE_BYTE_PARAM, .ld_a_xxxx_string
dbw NO_PARAM, .ccf_string
dbw NO_PARAM, .ld_b_b_string
dbw NO_PARAM, .ld_b_c_string
dbw NO_PARAM, .ld_b_d_string
dbw NO_PARAM, .ld_b_e_string
dbw NO_PARAM, .ld_b_h_string
dbw NO_PARAM, .ld_b_l_string
dbw NO_PARAM, .ld_b_hl_string
dbw NO_PARAM, .ld_b_a_string
dbw NO_PARAM, .ld_c_b_string
dbw NO_PARAM, .ld_c_c_string
dbw NO_PARAM, .ld_c_d_string
dbw NO_PARAM, .ld_c_e_string
dbw NO_PARAM, .ld_c_h_string
dbw NO_PARAM, .ld_c_l_string
dbw NO_PARAM, .ld_c_hl_string
dbw NO_PARAM, .ld_c_a_string
dbw NO_PARAM, .ld_d_b_string
dbw NO_PARAM, .ld_d_c_string
dbw NO_PARAM, .ld_d_d_string
dbw NO_PARAM, .ld_d_e_string
dbw NO_PARAM, .ld_d_h_string
dbw NO_PARAM, .ld_d_l_string
dbw NO_PARAM, .ld_d_hl_string
dbw NO_PARAM, .ld_d_a_string
dbw NO_PARAM, .ld_e_b_string
dbw NO_PARAM, .ld_e_c_string
dbw NO_PARAM, .ld_e_d_string
dbw NO_PARAM, .ld_e_e_string
dbw NO_PARAM, .ld_e_h_string
dbw NO_PARAM, .ld_e_l_string
dbw NO_PARAM, .ld_e_hl_string
dbw NO_PARAM, .ld_e_a_string
dbw NO_PARAM, .ld_h_b_string
dbw NO_PARAM, .ld_h_c_string
dbw NO_PARAM, .ld_h_d_string
dbw NO_PARAM, .ld_h_e_string
dbw NO_PARAM, .ld_h_h_string
dbw NO_PARAM, .ld_h_l_string
dbw NO_PARAM, .ld_h_hl_string
dbw NO_PARAM, .ld_h_a_string
dbw NO_PARAM, .ld_l_b_string
dbw NO_PARAM, .ld_l_c_string
dbw NO_PARAM, .ld_l_d_string
dbw NO_PARAM, .ld_l_e_string
dbw NO_PARAM, .ld_l_h_string
dbw NO_PARAM, .ld_l_l_string
dbw NO_PARAM, .ld_l_hl_string
dbw NO_PARAM, .ld_l_a_string
dbw NO_PARAM, .ld_hl_b_string
dbw NO_PARAM, .ld_hl_c_string
dbw NO_PARAM, .ld_hl_d_string
dbw NO_PARAM, .ld_hl_e_string
dbw NO_PARAM, .ld_hl_h_string
dbw NO_PARAM, .ld_hl_l_string
dbw NO_PARAM, .halt_string
dbw NO_PARAM, .ld_hl_a_string
dbw NO_PARAM, .ld_a_b_string
dbw NO_PARAM, .ld_a_c_string
dbw NO_PARAM, .ld_a_d_string
dbw NO_PARAM, .ld_a_e_string
dbw NO_PARAM, .ld_a_h_string
dbw NO_PARAM, .ld_a_l_string
dbw NO_PARAM, .ld_a_hl_string
dbw NO_PARAM, .ld_a_a_string
dbw NO_PARAM, .add_b_string
dbw NO_PARAM, .add_c_string
dbw NO_PARAM, .add_d_string
dbw NO_PARAM, .add_e_string
dbw NO_PARAM, .add_h_string
dbw NO_PARAM, .add_l_string
dbw NO_PARAM, .add_hl_string
dbw NO_PARAM, .add_a_string
dbw NO_PARAM, .adc_b_string
dbw NO_PARAM, .adc_c_string
dbw NO_PARAM, .adc_d_string
dbw NO_PARAM, .adc_e_string
dbw NO_PARAM, .adc_h_string
dbw NO_PARAM, .adc_l_string
dbw NO_PARAM, .adc_hl_string
dbw NO_PARAM, .adc_a_string
dbw NO_PARAM, .sub_b_string
dbw NO_PARAM, .sub_c_string
dbw NO_PARAM, .sub_d_string
dbw NO_PARAM, .sub_e_string
dbw NO_PARAM, .sub_h_string
dbw NO_PARAM, .sub_l_string
dbw NO_PARAM, .sub_hl_string
dbw NO_PARAM, .sub_a_string
dbw NO_PARAM, .sbc_b_string
dbw NO_PARAM, .sbc_c_string
dbw NO_PARAM, .sbc_d_string
dbw NO_PARAM, .sbc_e_string
dbw NO_PARAM, .sbc_h_string
dbw NO_PARAM, .sbc_l_string
dbw NO_PARAM, .sbc_hl_string
dbw NO_PARAM, .sbc_a_string
dbw NO_PARAM, .and_b_string
dbw NO_PARAM, .and_c_string
dbw NO_PARAM, .and_d_string
dbw NO_PARAM, .and_e_string
dbw NO_PARAM, .and_h_string
dbw NO_PARAM, .and_l_string
dbw NO_PARAM, .and_hl_string
dbw NO_PARAM, .and_a_string
dbw NO_PARAM, .xor_b_string
dbw NO_PARAM, .xor_c_string
dbw NO_PARAM, .xor_d_string
dbw NO_PARAM, .xor_e_string
dbw NO_PARAM, .xor_h_string
dbw NO_PARAM, .xor_l_string
dbw NO_PARAM, .xor_hl_string
dbw NO_PARAM, .xor_a_string
dbw NO_PARAM, .or_b_string
dbw NO_PARAM, .or_c_string
dbw NO_PARAM, .or_d_string
dbw NO_PARAM, .or_e_string
dbw NO_PARAM, .or_h_string
dbw NO_PARAM, .or_l_string
dbw NO_PARAM, .or_hl_string
dbw NO_PARAM, .or_a_string
dbw NO_PARAM, .cp_b_string
dbw NO_PARAM, .cp_c_string
dbw NO_PARAM, .cp_d_string
dbw NO_PARAM, .cp_e_string
dbw NO_PARAM, .cp_h_string
dbw NO_PARAM, .cp_l_string
dbw NO_PARAM, .cp_hl_string
dbw NO_PARAM, .cp_a_string
dbw NO_PARAM, .ret_nz_string
dbw NO_PARAM, .pop_bc_string
dbw TWO_BYTE_PARAM, .jp_nz_xxxx_string
dbw TWO_BYTE_PARAM, .jp_xxxx_string
dbw TWO_BYTE_PARAM, .call_nz_xxxx_string
dbw NO_PARAM, .push_bc_string
dbw ONE_BYTE_PARAM, .add_xxxx_string
dbw NO_PARAM, .rst_0_string
dbw NO_PARAM, .ret_z_string
dbw NO_PARAM, .ret_string
dbw TWO_BYTE_PARAM, .jp_z_xxxx_string
dbw EXTENDED_OP, .extd_string
dbw TWO_BYTE_PARAM, .call_z_xxxx_string
dbw TWO_BYTE_PARAM, .call_xxxx_string
dbw ONE_BYTE_PARAM, .adc_xxxx_string
dbw NO_PARAM, .rst_08_string
dbw NO_PARAM, .ret_nc_string
dbw NO_PARAM, .pop_de_string
dbw TWO_BYTE_PARAM, .jp_nc_xxxx_string
dbw NO_PARAM, .db_d3_string
dbw TWO_BYTE_PARAM, .call_nc_xxxx_string
dbw NO_PARAM, .push_de_string
dbw ONE_BYTE_PARAM, .sub_xxxx_string
dbw NO_PARAM, .rst_10_string
dbw NO_PARAM, .ret_c_string
dbw NO_PARAM, .reti_string
dbw TWO_BYTE_PARAM, .jp_c_xxxx_string
dbw NO_PARAM, .db_db_string
dbw TWO_BYTE_PARAM, .call_c_xxxx_string
dbw NO_PARAM, .db_dd_string
dbw ONE_BYTE_PARAM, .sbc_xxxx_string
dbw NO_PARAM, .rst_18_string
dbw ONE_BYTE_PARAM, .ld_ffxxxx_a_string
dbw NO_PARAM, .pop_hl_string
dbw NO_PARAM, .ld_ff00_plus_c_a_string
dbw NO_PARAM, .db_e3_string
dbw NO_PARAM, .db_e4_string
dbw NO_PARAM, .push_hl_string
dbw ONE_BYTE_PARAM, .and_xxxx_string
dbw NO_PARAM, .rst_20_string
dbw ONE_BYTE_PARAM, .add_sp_xxxx_string
dbw NO_PARAM, .jp_hl_string
dbw TWO_BYTE_PARAM, .ld_xxxx_a_string
dbw NO_PARAM, .db_eb_string
dbw NO_PARAM, .db_ec_string
dbw NO_PARAM, .db_ed_string
dbw ONE_BYTE_PARAM, .xor_xxxx_string
dbw NO_PARAM, .rst_28_string
dbw ONE_BYTE_PARAM, .ld_a_ffxxxx_string
dbw NO_PARAM, .pop_af_string
dbw NO_PARAM, .ld_a_ff00_plus_c_string
dbw NO_PARAM, .di_string
dbw NO_PARAM, .db_f4_string
dbw NO_PARAM, .push_af_string
dbw ONE_BYTE_PARAM, .or_xxxx_string
dbw NO_PARAM, .rst_30_string
dbw ONE_BYTE_PARAM, .ld_hl_sp_plus_xxxx_string
dbw NO_PARAM, .ld_sp_hl_string
dbw TWO_BYTE_PARAM, .ld_a_xxxx_string
dbw NO_PARAM, .ei_string
dbw NO_PARAM, .db_fc_string
dbw NO_PARAM, .db_fd_string
dbw ONE_BYTE_PARAM, .cp_xxxx_string
dbw NO_PARAM, .rst_38_string
.nop_string db "nop@"
.ld_bc_xxxx_string db "ld bc, $", $f5, $f5, $f5, $f5, "@"
.ld_bc_a_string db "ld [bc], a@"
.inc_bc_string db "inc bc@"
.inc_b_string db "inc b@"
.dec_b_string db "dec b@"
.ld_b_xxxx_string db "ld b, $", $f5, $f5, "@"
.rlca_string db "rlca@"
.ld_xxxx_sp_string db "ld [$", $f5, $f5, $f5, $f5, "], sp@"
.add_hl_bc_string db "add hl, bc@"
.ld_a_bc_string db "ld a, [bc]@"
.dec_bc_string db "dec bc@"
.inc_c_string db "inc c@"
.dec_c_string db "dec c@"
.ld_c_xxxx_string db "ld c, $", $f5, $f5, "@"
.rrca_string db "rrca@"
.stop_string db "stop@"
.ld_de_xxxx_string db "ld de, $", $f5, $f5, $f5, $f5, "@"
.ld_de_a_string db "ld [de], a@"
.inc_de_string db "inc de@"
.inc_d_string db "inc d@"
.dec_d_string db "dec d@"
.ld_d_xxxx_string db "ld d, $", $f5, $f5, "@"
.rla_string db "rla@"
.jr_xxxx_string db "jr $", $f5, $f5, $f5, $f5, "@"
.add_hl_de_string db "add hl, de@"
.ld_a_de_string db "ld a, [de]@"
.dec_de_string db "dec de@"
.inc_e_string db "inc e@"
.dec_e_string db "dec e@"
.ld_e_xxxx_string db "ld e, $", $f5, $f5, "@"
.rra_string db "rra@"
.jr_nz_xxxx_string db "jr nz, $", $f5, $f5, $f5, $f5, "@"
.ld_hl_xxxx_string db "ld hl, $", $f5, $f5, $f5, $f5, "@"
.ld_hli_a_string db "ld [hli], a@"
.inc_hl_string db "inc hl@"
.inc_h_string db "inc h@"
.dec_h_string db "dec h@"
.ld_h_xxxx_string db "ld h, $", $f5, $f5, "@"
.daa_string db "daa@"
.jr_z_xxxx_string db "jr z, $", $f5, $f5, $f5, $f5, "@"
.add_hl_hl_string db "add hl, hl@"
.ld_a_hli_string db "ld a, [hli]@"
.dec_hl_string db "dec hl@"
.inc_l_string db "inc l@"
.dec_l_string db "dec l@"
.ld_l_xxxx_string db "ld l, $", $f5, $f5, "@"
.cpl_string db "cpl@"
.jr_nc_xxxx_string db "jr nc, $", $f5, $f5, $f5, $f5, "@"
.ld_sp_xxxx_string db "ld sp, $", $f5, $f5, $f5, $f5, "@"
.ld_hld_a_string db "ld [hld], a@"
.inc_sp_string db "inc sp@"
.inc_hl_string db "inc [hl]@"
.dec_hl_string db "dec [hl]@"
.ld_hl_xxxx_string db "ld [hl], $", $f5, $f5, "@"
.scf_string db "scf@"
.jr_c_xxxx_string db "jr c, $", $f5, $f5, $f5, $f5, "@"
.add_hl_sp_string db "add hl, sp@"
.ld_a_hld_string db "ld a, [hld]@"
.dec_sp_string db "dec sp@"
.inc_a_string db "inc a@"
.dec_a_string db "dec a@"
.ld_a_xxxx_string db "ld a, $", $f5, $f5, "@"
.ccf_string db "ccf@"
.ld_b_b_string db "ld b, b@"
.ld_b_c_string db "ld b, c@"
.ld_b_d_string db "ld b, d@"
.ld_b_e_string db "ld b, e@"
.ld_b_h_string db "ld b, h@"
.ld_b_l_string db "ld b, l@"
.ld_b_hl_string db "ld b, [hl]@"
.ld_b_a_string db "ld b, a@"
.ld_c_b_string db "ld c, b@"
.ld_c_c_string db "ld c, c@"
.ld_c_d_string db "ld c, d@"
.ld_c_e_string db "ld c, e@"
.ld_c_h_string db "ld c, h@"
.ld_c_l_string db "ld c, l@"
.ld_c_hl_string db "ld c, [hl]@"
.ld_c_a_string db "ld c, a@"
.ld_d_b_string db "ld d, b@"
.ld_d_c_string db "ld d, c@"
.ld_d_d_string db "ld d, d@"
.ld_d_e_string db "ld d, e@"
.ld_d_h_string db "ld d, h@"
.ld_d_l_string db "ld d, l@"
.ld_d_hl_string db "ld d, [hl]@"
.ld_d_a_string db "ld d, a@"
.ld_e_b_string db "ld e, b@"
.ld_e_c_string db "ld e, c@"
.ld_e_d_string db "ld e, d@"
.ld_e_e_string db "ld e, e@"
.ld_e_h_string db "ld e, h@"
.ld_e_l_string db "ld e, l@"
.ld_e_hl_string db "ld e, [hl]@"
.ld_e_a_string db "ld e, a@"
.ld_h_b_string db "ld h, b@"
.ld_h_c_string db "ld h, c@"
.ld_h_d_string db "ld h, d@"
.ld_h_e_string db "ld h, e@"
.ld_h_h_string db "ld h, h@"
.ld_h_l_string db "ld h, l@"
.ld_h_hl_string db "ld h, [hl]@"
.ld_h_a_string db "ld h, a@"
.ld_l_b_string db "ld l, b@"
.ld_l_c_string db "ld l, c@"
.ld_l_d_string db "ld l, d@"
.ld_l_e_string db "ld l, e@"
.ld_l_h_string db "ld l, h@"
.ld_l_l_string db "ld l, l@"
.ld_l_hl_string db "ld l, [hl]@"
.ld_l_a_string db "ld l, a@"
.ld_hl_b_string db "ld [hl], b@"
.ld_hl_c_string db "ld [hl], c@"
.ld_hl_d_string db "ld [hl], d@"
.ld_hl_e_string db "ld [hl], e@"
.ld_hl_h_string db "ld [hl], h@"
.ld_hl_l_string db "ld [hl], l@"
.halt_string db "halt@"
.ld_hl_a_string db "ld [hl], a@"
.ld_a_b_string db "ld a, b@"
.ld_a_c_string db "ld a, c@"
.ld_a_d_string db "ld a, d@"
.ld_a_e_string db "ld a, e@"
.ld_a_h_string db "ld a, h@"
.ld_a_l_string db "ld a, l@"
.ld_a_hl_string db "ld a, [hl]@"
.ld_a_a_string db "ld a, a@"
.add_b_string db "add b@"
.add_c_string db "add c@"
.add_d_string db "add d@"
.add_e_string db "add e@"
.add_h_string db "add h@"
.add_l_string db "add l@"
.add_hl_string db "add [hl]@"
.add_a_string db "add a@"
.adc_b_string db "adc b@"
.adc_c_string db "adc c@"
.adc_d_string db "adc d@"
.adc_e_string db "adc e@"
.adc_h_string db "adc h@"
.adc_l_string db "adc l@"
.adc_hl_string db "adc [hl]@"
.adc_a_string db "adc a@"
.sub_b_string db "sub b@"
.sub_c_string db "sub c@"
.sub_d_string db "sub d@"
.sub_e_string db "sub e@"
.sub_h_string db "sub h@"
.sub_l_string db "sub l@"
.sub_hl_string db "sub [hl]@"
.sub_a_string db "sub a@"
.sbc_b_string db "sbc b@"
.sbc_c_string db "sbc c@"
.sbc_d_string db "sbc d@"
.sbc_e_string db "sbc e@"
.sbc_h_string db "sbc h@"
.sbc_l_string db "sbc l@"
.sbc_hl_string db "sbc [hl]@"
.sbc_a_string db "sbc a@"
.and_b_string db "and b@"
.and_c_string db "and c@"
.and_d_string db "and d@"
.and_e_string db "and e@"
.and_h_string db "and h@"
.and_l_string db "and l@"
.and_hl_string db "and [hl]@"
.and_a_string db "and a@"
.xor_b_string db "xor b@"
.xor_c_string db "xor c@"
.xor_d_string db "xor d@"
.xor_e_string db "xor e@"
.xor_h_string db "xor h@"
.xor_l_string db "xor l@"
.xor_hl_string db "xor [hl]@"
.xor_a_string db "xor a@"
.or_b_string db "or b@"
.or_c_string db "or c@"
.or_d_string db "or d@"
.or_e_string db "or e@"
.or_h_string db "or h@"
.or_l_string db "or l@"
.or_hl_string db "or [hl]@"
.or_a_string db "or a@"
.cp_b_string db "cp b@"
.cp_c_string db "cp c@"
.cp_d_string db "cp d@"
.cp_e_string db "cp e@"
.cp_h_string db "cp h@"
.cp_l_string db "cp l@"
.cp_hl_string db "cp [hl]@"
.cp_a_string db "cp a@"
.ret_nz_string db "ret nz@"
.pop_bc_string db "pop bc@"
.jp_nz_xxxx_string db "jp nz, $", $f5, $f5, $f5, $f5, "@"
.jp_xxxx_string db "jp $", $f5, $f5, $f5, $f5, "@"
.call_nz_xxxx_string db "call nz, $", $f5, $f5, $f5, $f5, "@"
.push_bc_string db "push bc@"
.add_xxxx_string db "add $", $f5, $f5, "@"
.rst_0_string db "rst $0@"
.ret_z_string db "ret z@"
.ret_string db "ret@"
.jp_z_xxxx_string db "jp z, $", $f5, $f5, $f5, $f5, "@"
.extd_string db "@"
.call_z_xxxx_string db "call z, $", $f5, $f5, $f5, $f5, "@"
.call_xxxx_string db "call $", $f5, $f5, $f5, $f5, "@"
.adc_xxxx_string db "adc $", $f5, $f5, "@"
.rst_08_string db "rst $08@"
.ret_nc_string db "ret nc@"
.pop_de_string db "pop de@"
.jp_nc_xxxx_string db "jp nc, $", $f5, $f5, $f5, $f5, "@"
.db_d3_string db "db $d3@"
.call_nc_xxxx_string db "call nc, $", $f5, $f5, $f5, $f5, "@"
.push_de_string db "push de@"
.sub_xxxx_string db "sub $", $f5, $f5, "@"
.rst_10_string db "rst $10@"
.ret_c_string db "ret c@"
.reti_string db "reti@"
.jp_c_xxxx_string db "jp c, $", $f5, $f5, $f5, $f5, "@"
.db_db_string db "db $db@"
.call_c_xxxx_string db "call c, $", $f5, $f5, $f5, $f5, "@"
.db_dd_string db "db $dd@"
.sbc_xxxx_string db "sbc $", $f5, $f5, "@"
.rst_18_string db "rst $18@"
.ld_ffxxxx_a_string db "ld [$ff", $f5, $f5, "], a@"
.pop_hl_string db "pop hl@"
.ld_ff00_plus_c_a_string db "ld [$ff00+c], a@"
.db_e3_string db "db $e3@"
.db_e4_string db "db $e4@"
.push_hl_string db "push hl@"
.and_xxxx_string db "and $", $f5, $f5, "@"
.rst_20_string db "rst $20@"
.add_sp_xxxx_string db "add sp, $", $f5, $f5, $f5, $f5, "@"
.jp_hl_string db "jp [hl]@"
.ld_xxxx_a_string db "ld [$", $f5, $f5, $f5, $f5, "], a@"
.db_eb_string db "db $eb@"
.db_ec_string db "db $ec@"
.db_ed_string db "db $ed@"
.xor_xxxx_string db "xor $", $f5, $f5, "@"
.rst_28_string db "rst $28@"
.ld_a_ffxxxx_string db "ld a, [$ff", $f5, $f5, "]@"
.pop_af_string db "pop af@"
.ld_a_ff00_plus_c_string db "ld a, [$ff00+c]@"
.di_string db "di@"
.db_f4_string db "db $f4@"
.push_af_string db "push af@"
.or_xxxx_string db "or $", $f5, $f5, "@"
.rst_30_string db "rst $30@"
.ld_hl_sp_plus_xxxx_string db "ld hl, sp+$", $f5, $f5, $f5, $f5, "@"
.ld_sp_hl_string db "ld sp, hl@"
.ld_a_xxxx_string db "ld a, [$", $f5, $f5, "]@"
.ei_string db "ei@"
.db_fc_string db "db $fc@"
.db_fd_string db "db $fd@"
.cp_xxxx_string db "cp $", $f5, $f5, "@"
.rst_38_string db "rst $38"
.ExtendedOpcodes:
db "rlc b@"
db "rlc c@"
db "rlc d@"
db "rlc e@"
db "rlc h@"
db "rlc l@"
db "rlc [hl]@"
db "rlc a@",
db "rrc b@"
db "rrc c@"
db "rrc d@"
db "rrc e@"
db "rrc h@"
db "rrc l@"
db "rrc [hl]@"
db "rrc a@",
db "rl b@"
db "rl c@"
db "rl d@"
db "rl e@"
db "rl h@"
db "rl l@"
db "rl [hl]@"
db "rl a@",
db "rr b@"
db "rr c@"
db "rr d@"
db "rr e@"
db "rr h@"
db "rr l@"
db "rr [hl]@"
db "rr a@",
db "sla b@"
db "sla c@"
db "sla d@"
db "sla e@"
db "sla h@"
db "sla l@"
db "sla [hl]@"
db "sla a@",
db "sra b@"
db "sra c@"
db "sra d@"
db "sra e@"
db "sra h@"
db "sra l@"
db "sra [hl]@"
db "sra a@",
db "swap b@"
db "swap c@"
db "swap d@"
db "swap e@"
db "swap h@"
db "swap l@"
db "swap [hl]@"
db "swap a@",
db "srl b@"
db "srl c@"
db "srl d@"
db "srl e@"
db "srl h@"
db "srl l@"
db "srl [hl]@"
db "srl a@",
db "bit 0, b@"
db "bit 0, c@"
db "bit 0, d@"
db "bit 0, e@"
db "bit 0, h@"
db "bit 0, l@"
db "bit 0, [hl]@"
db "bit 0, a@",
db "bit 1, b@"
db "bit 1, c@"
db "bit 1, d@"
db "bit 1, e@"
db "bit 1, h@"
db "bit 1, l@"
db "bit 1, [hl]@"
db "bit 1, a@",
db "bit 2, b@"
db "bit 2, c@"
db "bit 2, d@"
db "bit 2, e@"
db "bit 2, h@"
db "bit 2, l@"
db "bit 2, [hl]@"
db "bit 2, a@",
db "bit 3, b@"
db "bit 3, c@"
db "bit 3, d@"
db "bit 3, e@"
db "bit 3, h@"
db "bit 3, l@"
db "bit 3, [hl]@"
db "bit 3, a@",
db "bit 4, b@"
db "bit 4, c@"
db "bit 4, d@"
db "bit 4, e@"
db "bit 4, h@"
db "bit 4, l@"
db "bit 4, [hl]@"
db "bit 4, a@",
db "bit 5, b@"
db "bit 5, c@"
db "bit 5, d@"
db "bit 5, e@"
db "bit 5, h@"
db "bit 5, l@"
db "bit 5, [hl]@"
db "bit 5, a@",
db "bit 6, b@"
db "bit 6, c@"
db "bit 6, d@"
db "bit 6, e@"
db "bit 6, h@"
db "bit 6, l@"
db "bit 6, [hl]@"
db "bit 6, a@",
db "bit 7, b@"
db "bit 7, c@"
db "bit 7, d@"
db "bit 7, e@"
db "bit 7, h@"
db "bit 7, l@"
db "bit 7, [hl]@"
db "bit 7, a@",
db "res 0, b@"
db "res 0, c@"
db "res 0, d@"
db "res 0, e@"
db "res 0, h@"
db "res 0, l@"
db "res 0, [hl]@"
db "res 0, a@",
db "res 1, b@"
db "res 1, c@"
db "res 1, d@"
db "res 1, e@"
db "res 1, h@"
db "res 1, l@"
db "res 1, [hl]@"
db "res 1, a@",
db "res 2, b@"
db "res 2, c@"
db "res 2, d@"
db "res 2, e@"
db "res 2, h@"
db "res 2, l@"
db "res 2, [hl]@"
db "res 2, a@",
db "res 3, b@"
db "res 3, c@"
db "res 3, d@"
db "res 3, e@"
db "res 3, h@"
db "res 3, l@"
db "res 3, [hl]@"
db "res 3, a@",
db "res 4, b@"
db "res 4, c@"
db "res 4, d@"
db "res 4, e@"
db "res 4, h@"
db "res 4, l@"
db "res 4, [hl]@"
db "res 4, a@",
db "res 5, b@"
db "res 5, c@"
db "res 5, d@"
db "res 5, e@"
db "res 5, h@"
db "res 5, l@"
db "res 5, [hl]@"
db "res 5, a@",
db "res 6, b@"
db "res 6, c@"
db "res 6, d@"
db "res 6, e@"
db "res 6, h@"
db "res 6, l@"
db "res 6, [hl]@"
db "res 6, a@",
db "res 7, b@"
db "res 7, c@"
db "res 7, d@"
db "res 7, e@"
db "res 7, h@"
db "res 7, l@"
db "res 7, [hl]@"
db "res 7, a@",
db "set 0, b@"
db "set 0, c@"
db "set 0, d@"
db "set 0, e@"
db "set 0, h@"
db "set 0, l@"
db "set 0, [hl]@"
db "set 0, a@",
db "set 1, b@"
db "set 1, c@"
db "set 1, d@"
db "set 1, e@"
db "set 1, h@"
db "set 1, l@"
db "set 1, [hl]@"
db "set 1, a@",
db "set 2, b@"
db "set 2, c@"
db "set 2, d@"
db "set 2, e@"
db "set 2, h@"
db "set 2, l@"
db "set 2, [hl]@"
db "set 2, a@",
db "set 3, b@"
db "set 3, c@"
db "set 3, d@"
db "set 3, e@"
db "set 3, h@"
db "set 3, l@"
db "set 3, [hl]@"
db "set 3, a@",
db "set 4, b@"
db "set 4, c@"
db "set 4, d@"
db "set 4, e@"
db "set 4, h@"
db "set 4, l@"
db "set 4, [hl]@"
db "set 4, a@",
db "set 5, b@"
db "set 5, c@"
db "set 5, d@"
db "set 5, e@"
db "set 5, h@"
db "set 5, l@"
db "set 5, [hl]@"
db "set 5, a@",
db "set 6, b@"
db "set 6, c@"
db "set 6, d@"
db "set 6, e@"
db "set 6, h@"
db "set 6, l@"
db "set 6, [hl]@"
db "set 6, a@",
db "set 7, b@"
db "set 7, c@"
db "set 7, d@"
db "set 7, e@"
db "set 7, h@"
db "set 7, l@"
db "set 7, [hl]@"
db "set 7, a@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment