home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
new
/
misc
/
emu
/
z80
/
prefix_offsets.i
< prev
next >
Wrap
Text File
|
1993-12-21
|
37KB
|
1,687 lines
** The offset tables and decoding routines for the prefixed Z80
** instructions
** See the file "cache.txt" for details on the decoding.
** All Z80 opcodes exactly follow Zaks' "Programming the Z80"
** n = 8-bit number
** nn = 16-bit number
** e = 8-bit relative jump offset
** d = 8-bit displacement
** pq = 16-bit address
** p = 8-bit address
** Label notation: Underscore used for SPACE, comma and +
** 1 (one) used for ( and )
** =====================================================================
IFD VERBOSE
LIST
** Compiling the prefix_offsets.i file.
NOLIST
ENDC
** If a CB-prefix has been found:
CBdecode cmp.w #out_of_bounds,(PPC) ;test 2nd word
bne.s .not_oob
jmp go_low_buf(InstrB)
.not_oob
getRPC
getz d7,d7 ;get second byte
and.w #$00ff,d7
add.w d7,d7
move.w CBoffsets(PC,d7.w),d7
move.w d7,-2(PPC)
move.w #unchanged,(PPC)
jmp (InstrB,d7.w)
CBoffsets
dc.w Rlc_B-base
dc.w Rlc_C-base
dc.w Rlc_D-base
dc.w Rlc_E-base
dc.w Rlc_H-base
dc.w Rlc_L-base
dc.w Rlc_1HL1-base
dc.w Rlc_A-base
dc.w Rrc_B-base
dc.w Rrc_C-base
dc.w Rrc_D-base
dc.w Rrc_E-base
dc.w Rrc_H-base
dc.w Rrc_L-base
dc.w Rrc_1HL1-base
dc.w Rrc_A-base
.10 dc.w Rl_B-base
dc.w Rl_C-base
dc.w Rl_D-base
dc.w Rl_E-base
dc.w Rl_H-base
dc.w Rl_L-base
dc.w Rl_1HL1-base
dc.w Rl_A-base
dc.w Rr_B-base
dc.w Rr_C-base
dc.w Rr_D-base
dc.w Rr_E-base
dc.w Rr_H-base
dc.w Rr_L-base
dc.w Rr_1HL1-base
dc.w Rr_A-base
.20 dc.w Sla_B-base
dc.w Sla_C-base
dc.w Sla_D-base
dc.w Sla_E-base
dc.w Sla_H-base
dc.w Sla_L-base
dc.w Sla_1HL1-base
dc.w Sla_A-base
dc.w Sra_B-base
dc.w Sra_C-base
dc.w Sra_D-base
dc.w Sra_E-base
dc.w Sra_H-base
dc.w Sra_L-base
dc.w Sra_1HL1-base
dc.w Sra_A-base
.30 dc.w Sll_B-base ;undocumented
dc.w Sll_C-base ;undocumented
dc.w Sll_D-base ;undocumented
dc.w Sll_E-base ;undocumented
dc.w Sll_H-base ;undocumented
dc.w Sll_L-base ;undocumented
dc.w Sll_1HL1-base ;undocumented
dc.w Sll_A-base ;undocumented
dc.w Srl_B-base
dc.w Srl_C-base
dc.w Srl_D-base
dc.w Srl_E-base
dc.w Srl_H-base
dc.w Srl_L-base
dc.w Srl_1HL1-base
dc.w Srl_A-base
.40 dc.w Bit_0_B-base
dc.w Bit_0_C-base
dc.w Bit_0_D-base
dc.w Bit_0_E-base
dc.w Bit_0_H-base
dc.w Bit_0_L-base
dc.w Bit_0_1HL1-base
dc.w Bit_0_A-base
dc.w Bit_1_B-base
dc.w Bit_1_C-base
dc.w Bit_1_D-base
dc.w Bit_1_E-base
dc.w Bit_1_H-base
dc.w Bit_1_L-base
dc.w Bit_1_1HL1-base
dc.w Bit_1_A-base
.50 dc.w Bit_2_B-base
dc.w Bit_2_C-base
dc.w Bit_2_D-base
dc.w Bit_2_E-base
dc.w Bit_2_H-base
dc.w Bit_2_L-base
dc.w Bit_2_1HL1-base
dc.w Bit_2_A-base
dc.w Bit_3_B-base
dc.w Bit_3_C-base
dc.w Bit_3_D-base
dc.w Bit_3_E-base
dc.w Bit_3_H-base
dc.w Bit_3_L-base
dc.w Bit_3_1HL1-base
dc.w Bit_3_A-base
.60 dc.w Bit_4_B-base
dc.w Bit_4_C-base
dc.w Bit_4_D-base
dc.w Bit_4_E-base
dc.w Bit_4_H-base
dc.w Bit_4_L-base
dc.w Bit_4_1HL1-base
dc.w Bit_4_A-base
dc.w Bit_5_B-base
dc.w Bit_5_C-base
dc.w Bit_5_D-base
dc.w Bit_5_E-base
dc.w Bit_5_H-base
dc.w Bit_5_L-base
dc.w Bit_5_1HL1-base
dc.w Bit_5_A-base
.70 dc.w Bit_6_B-base
dc.w Bit_6_C-base
dc.w Bit_6_D-base
dc.w Bit_6_E-base
dc.w Bit_6_H-base
dc.w Bit_6_L-base
dc.w Bit_6_1HL1-base
dc.w Bit_6_A-base
dc.w Bit_7_B-base
dc.w Bit_7_C-base
dc.w Bit_7_D-base
dc.w Bit_7_E-base
dc.w Bit_7_H-base
dc.w Bit_7_L-base
dc.w Bit_7_1HL1-base
dc.w Bit_7_A-base
.80 dc.w Res_0_B-base
dc.w Res_0_C-base
dc.w Res_0_D-base
dc.w Res_0_E-base
dc.w Res_0_H-base
dc.w Res_0_L-base
dc.w Res_0_1HL1-base
dc.w Res_0_A-base
dc.w Res_1_B-base
dc.w Res_1_C-base
dc.w Res_1_D-base
dc.w Res_1_E-base
dc.w Res_1_H-base
dc.w Res_1_L-base
dc.w Res_1_1HL1-base
dc.w Res_1_A-base
.90 dc.w Res_2_B-base
dc.w Res_2_C-base
dc.w Res_2_D-base
dc.w Res_2_E-base
dc.w Res_2_H-base
dc.w Res_2_L-base
dc.w Res_2_1HL1-base
dc.w Res_2_A-base
dc.w Res_3_B-base
dc.w Res_3_C-base
dc.w Res_3_D-base
dc.w Res_3_E-base
dc.w Res_3_H-base
dc.w Res_3_L-base
dc.w Res_3_1HL1-base
dc.w Res_3_A-base
.A0 dc.w Res_4_B-base
dc.w Res_4_C-base
dc.w Res_4_D-base
dc.w Res_4_E-base
dc.w Res_4_H-base
dc.w Res_4_L-base
dc.w Res_4_1HL1-base
dc.w Res_4_A-base
dc.w Res_5_B-base
dc.w Res_5_C-base
dc.w Res_5_D-base
dc.w Res_5_E-base
dc.w Res_5_H-base
dc.w Res_5_L-base
dc.w Res_5_1HL1-base
dc.w Res_5_A-base
.B0 dc.w Res_6_B-base
dc.w Res_6_C-base
dc.w Res_6_D-base
dc.w Res_6_E-base
dc.w Res_6_H-base
dc.w Res_6_L-base
dc.w Res_6_1HL1-base
dc.w Res_6_A-base
dc.w Res_7_B-base
dc.w Res_7_C-base
dc.w Res_7_D-base
dc.w Res_7_E-base
dc.w Res_7_H-base
dc.w Res_7_L-base
dc.w Res_7_1HL1-base
dc.w Res_7_A-base
.C0 dc.w Set_0_B-base
dc.w Set_0_C-base
dc.w Set_0_D-base
dc.w Set_0_E-base
dc.w Set_0_H-base
dc.w Set_0_L-base
dc.w Set_0_1HL1-base
dc.w Set_0_A-base
dc.w Set_1_B-base
dc.w Set_1_C-base
dc.w Set_1_D-base
dc.w Set_1_E-base
dc.w Set_1_H-base
dc.w Set_1_L-base
dc.w Set_1_1HL1-base
dc.w Set_1_A-base
.D0 dc.w Set_2_B-base
dc.w Set_2_C-base
dc.w Set_2_D-base
dc.w Set_2_E-base
dc.w Set_2_H-base
dc.w Set_2_L-base
dc.w Set_2_1HL1-base
dc.w Set_2_A-base
dc.w Set_3_B-base
dc.w Set_3_C-base
dc.w Set_3_D-base
dc.w Set_3_E-base
dc.w Set_3_H-base
dc.w Set_3_L-base
dc.w Set_3_1HL1-base
dc.w Set_3_A-base
.E0 dc.w Set_4_B-base
dc.w Set_4_C-base
dc.w Set_4_D-base
dc.w Set_4_E-base
dc.w Set_4_H-base
dc.w Set_4_L-base
dc.w Set_4_1HL1-base
dc.w Set_4_A-base
dc.w Set_5_B-base
dc.w Set_5_C-base
dc.w Set_5_D-base
dc.w Set_5_E-base
dc.w Set_5_H-base
dc.w Set_5_L-base
dc.w Set_5_1HL1-base
dc.w Set_5_A-base
.F0 dc.w Set_6_B-base
dc.w Set_6_C-base
dc.w Set_6_D-base
dc.w Set_6_E-base
dc.w Set_6_H-base
dc.w Set_6_L-base
dc.w Set_6_1HL1-base
dc.w Set_6_A-base
dc.w Set_7_B-base
dc.w Set_7_C-base
dc.w Set_7_D-base
dc.w Set_7_E-base
dc.w Set_7_H-base
dc.w Set_7_L-base
dc.w Set_7_1HL1-base
dc.w Set_7_A-base
** -------------------------------
** If an ED-prefix has been found:
EDdecode cmp.w #out_of_bounds,(PPC) ;test 2nd word
bne.s .not_oob
jmp go_low_buf(InstrB)
.not_oob
getRPC
getz d7,d7 ;get 2nd byte
and.w #$00ff,d7
add.w d7,d7
move.w EDoffsets(PC,d7.w),d7
move.w d7,-2(PPC)
move.w #unchanged,(PPC)
jmp (InstrB,d7.w)
EDoffsets
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
.10 dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
.20 dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
.30 dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
dc.w undef
.40 dc.w In_B_1C1-base
dc.w Out_1C1_B-base
dc.w Sbc_HL_BC-base
dc.w Ld_1nn1_BC-base
dc.w Neg-base
dc.w Retn-base
dc.w Im_0-base
dc.w Ld_I_A-base
dc.w In_C_1C1-base
dc.w Out_1C1_C-base
dc.w Adc_HL_BC-base
dc.w Ld_BC_1nn1-base
dc.w undoc_neg ;undocumented
dc.w Reti-base
dc.w undef
dc.w Ld_R_A-base
.50 dc.w In_D_1C1-base
dc.w Out_1C1_D-base
dc.w Sbc_HL_DE-base
dc.w Ld_1nn1_DE-base
dc.w undoc_neg ;undocumented
dc.w undoc_retn ;undocumented
dc.w Im_1-base
dc.w Ld_A_I-base
dc.w In_E_1C1-base
dc.w Out_1C1_E-base
dc.w Adc_HL_DE-base
dc.w Ld_DE_1nn1-base
dc.w undoc_neg ;undocumented
dc.w undoc_retn ;undocumented
dc.w Im_2-base
dc.w Ld_A_R-base
.60 dc.w In_H_1C1-base
dc.w Out_1C1_H-base
dc.w Sbc_HL_HL-base
dc.w ED_Ld_1nn1_HL-base ;"ED_" to separate from unprefixed
dc.w undoc_neg ;undocumented
dc.w undoc_retn ;undocumented
dc.w undef
dc.w Rrd-base
dc.w In_L_1C1-base
dc.w Out_1C1_L-base
dc.w Adc_HL_HL-base
dc.w ED_Ld_HL_1nn1-base ;"ED_" to separate from unprefixed
dc.w undoc_neg ;undocumented
dc.w undoc_retn ;undocumented
dc.w undef
dc.w Rld-base
.70 dc.w In_xx_1C1-base ;undocumented. Reads, but never stores.
dc.w Out_1C1