home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
new
/
misc
/
emu
/
z80
/
distant.i
< prev
next >
Wrap
Text File
|
1993-12-21
|
8KB
|
466 lines
** Z80 instruction routines that reside outside the 0-7FFF range of
** offsets from InstrBase.
** The labels are formed from prepending a "d_" to the actual instruction
** label, from which a direct jump is made (absolute long) to the
** d_<instr> label.
IFD VERBOSE
LIST
** Compiling the distant.i file.
NOLIST
ENDC
** ----------------------------------------------------------------------
;First, any standard instructions (but preferably they
;will all be within the offset range).
;(None, for the moment).
** ----------------------------------------------------------------------
;Then, "undocumented" instructions. More particularly,
;those that are slow and take up a lot of space.
;They should only be compiled if undocumented instructions
;actually are used, i.e. UNDOCINSTR_UNDEF is not set.
IFND UNDOCINSTR_UNDEF
IFD VERBOSE
LIST
** Compiling routines for "undocumented" distant instructions.
NOLIST
ENDC
d_rlxyr_r_1xy1 MACRO
d_Rl_\1_1I\2_d1 opcode_3_bytes
index \2
getz d7,\1 ;bits 15-8 already clear
lsr.w #1,d6
roxl.b #1,\1
putsr d6
parity \1
putz \1,d7
skip 3
next
ENDM
d_rlxyr_H_1xy1 MACRO
d_Rl_H_1I\1_d1 opcode_3_bytes
index \1
move.w A,2(Work)
getz d7,A ;bits 15-8 already clear
lsr.w #1,d6
roxl.b #1,A
putsr d6
parity A
putz A,d7
move.w HL,(Work)
move.b A,(Work)
move.w (Work),HL
move.w 2(Work),A
skip 3
next
ENDM
d_rlxyr_1xy1 MACRO
d_rlxyr_r_1xy1 A,\1
d_rlxyr_r_1xy1 B,\1
d_rlxyr_r_1xy1 C,\1
d_rlxyr_r_1xy1 D,\1
d_rlxyr_r_1xy1 E,\1
d_rlxyr_r_1xy1 L,\1
d_rlxyr_H_1xy1 \1
ENDM
do_xy d_rlxyr_1xy1
** --
d_rlcxyr_r_1xy1 MACRO
d_Rlc_\1_1I\2_d1
opcode_3_bytes
index \2
getz d7,\1
rol.b #1,\1
putsr d6
parity \1
putz \1,d7
skip 3
next
ENDM
d_rlcxyr_H_1xy1 MACRO
d_Rlc_H_1I\1_d1 opcode_3_bytes
index \1
move.w A,2(Work)
getz d7,A
rol.b #1,A
putsr d6
parity A
putz A,d7
move.w HL,(Work)
move.b A,(Work)
move.w (Work),HL
move.w 2(Work),A
skip 3
next
ENDM
d_rlcxyr_1xy1 MACRO
d_rlcxyr_r_1xy1 A,\1
d_rlcxyr_r_1xy1 B,\1
d_rlcxyr_r_1xy1 C,\1
d_rlcxyr_r_1xy1 D,\1
d_rlcxyr_r_1xy1 E,\1
d_rlcxyr_r_1xy1 L,\1
d_rlcxyr_H_1xy1 \1
ENDM
do_xy d_rlcxyr_1xy1
** --
d_rrxyr_r_1xy1 MACRO
d_Rr_\1_1I\2_d1 opcode_3_bytes
index \2
getz d7,\1
lsr.w #1,d6
roxr.b #1,\1
putsr d6
parity \1
putz \1,d7
skip 3
next
ENDM
d_rrxyr_H_1xy1 MACRO
d_Rr_H_1I\1_d1 opcode_3_bytes
index \1
move.w A,2(Work)
getz d7,A
lsr.w #1,d6
roxr.b #1,A
putsr d6
parity A
putz A,d7
move.w HL,(Work)
move.b A,(Work)
move.w (Work),HL
move.w 2(Work),A
skip 3
next
ENDM
d_rrxyr_1xy1 MACRO
d_rrxyr_r_1xy1 A,\1
d_rrxyr_r_1xy1 B,\1
d_rrxyr_r_1xy1 C,\1
d_rrxyr_r_1xy1 D,\1
d_rrxyr_r_1xy1 E,\1
d_rrxyr_r_1xy1 L,\1
d_rrxyr_H_1xy1 \1
ENDM
do_xy d_rrxyr_1xy1
** --
d_rrcxyr_r_1xy1 MACRO
d_Rrc_\1_1I\2_d1
opcode_3_bytes
index \2
getz d7,\1
ror.b #1,\1
putsr d6
parity \1
putz \1,d7
skip 3
next
ENDM
d_rrcxyr_H_1xy1 MACRO
d_Rrc_H_1I\1_d1 opcode_3_bytes
index \1
move.w A,2(Work)
getz d7,A
ror.b #1,A
putsr d6
parity A
putz A,d7
move.w HL,(Work)
move.b A,(Work)
move.w (Work),HL
move.w 2(Work),A
skip 3
next
ENDM
d_rrcxyr_1xy1 MACRO
d_rrcxyr_r_1xy1 A,\1
d_rrcxyr_r_1xy1 B,\1
d_rrcxyr_r_1xy1 C,\1
d_rrcxyr_r_1xy1 D,\1
d_rrcxyr_r_1xy1 E,\1
d_rrcxyr_r_1xy1 L,\1
d_rrcxyr_H_1xy1 \1
ENDM
do_xy d_rrcxyr_1xy1
** --
d_slaxyr_r_1xy1 MACRO
d_Sla_\1_1I\2_d1
opcode_3_bytes
index \2
getz d7,\1
lsl.b #1,\1
putsr d6
parity \1
putz \1,d7
skip 3
next
ENDM
d_slaxyr_H_1xy1 MACRO
d_Sla_H_1I\1_d1 opcode_3_bytes
index \1
move.w A,2(Work)
getz d7,A
lsl.b #1,A
putsr d6
parity A
putz A,d7
move.w HL,(Work)
move.b A,(Work)
move.w (Work),HL
move.w 2(Work),A
skip 3
next
ENDM
d_slaxyr_1xy1 MACRO
d_slaxyr_r_1xy1 A,\1
d_slaxyr_r_1xy1 B,\1
d_slaxyr_r_1xy1 C,\1
d_slaxyr_r_1xy1 D,\1
d_slaxyr_r_1xy1 E,\1
d_slaxyr_r_1xy1 L,\1
d_slaxyr_H_1xy1 \1
ENDM
do_xy d_slaxyr_1xy1
** --
d_sllxyr_r_1xy1 MACRO
d_Sll_\1_1I\2_d1
opcode_3_bytes
index \2
getz d7,\1
lsl.b #1,\1
putsr d6
incb \1
parity \1
putz \1,d7
skip 3
next
ENDM
d_sllxyr_H_1xy1 MACRO
d_Sll_H_1I\1_d1 opcode_3_bytes
index \1
move.w A,2(Work)
getz d7,A
lsl.b #1,A
putsr d6
incb A
parity A
putz A,d7
move.w HL,(Work)
move.b A,(Work)
move.w (Work),HL
move.w 2(Work),A
skip 3
next
ENDM
d_sllxyr_1xy1 MACRO
d_sllxyr_r_1xy1 A,\1
d_sllxyr_r_1xy1 B,\1
d_sllxyr_r_1xy1 C,\1
d_sllxyr_r_1xy1 D,\1
d_sllxyr_r_1xy1 E,\1
d_sllxyr_r_1xy1 L,\1
d_sllxyr_H_1xy1 \1
ENDM
do_xy d_sllxyr_1xy1
** --
d_sraxyr_r_1xy1 MACRO
d_Sra_\1_1I\2_d1
opcode_3_bytes
index \2
getz d7,\1
asr.b #1,\1
putsr d6
parity \1
putz \1,d7
skip 3
next
ENDM
d_sraxyr_H_1xy1 MACRO
d_Sra_H_1I\1_d1 opcode_3_bytes
index \1
move.w A,2(Work)
getz d7,A
asr.b #1,A
putsr d6
parity A
putz A,d7
move.w HL,(Work)
move.b A,(Work)
move.w (Work),HL
move.w 2(Work),A
skip 3
next
ENDM
d_sraxyr_1xy1 MACRO
d_sraxyr_r_1xy1 A,\1
d_sraxyr_r_1xy1 B,\1
d_sraxyr_r_1xy1 C,\1
d_sraxyr_r_1xy1 D,\1
d_sraxyr_r_1xy1 E,\1
d_sraxyr_r_1xy1 L,\1
d_sraxyr_H_1xy1 \1
ENDM
do_xy d_sraxyr_1xy1
** --
d_srlxyr_r_1xy1 MACRO
d_Srl_\1_1I\2_d1
opcode_3_bytes
index \2
getz d7,\1
lsr.b #1,\1
putsr d6
parity \1
putz \1,d7
skip 3
next
ENDM
d_srlxyr_H_1xy1 MACRO
d_Srl_H_1I\1_d1 opcode_3_bytes
index \1
move.w A,2(Work)
getz d7,A
lsr.b #1,A
putsr d6
parity A
putz A,d7
move.w HL,(Work)
move.b A,(Work)
move.w (Work),HL
move.w 2(Work),A
skip 3
next
ENDM
d_srlxyr_1xy1 MACRO
d_srlxyr_r_1xy1 A,\1
d_srlxyr_r_1xy1 B,\1
d_srlxyr_r_1xy1 C,\1
d_srlxyr_r_1xy1 D,\1
d_srlxyr_r_1xy1 E,\1
d_srlxyr_r_1xy1 L,\1
d_srlxyr_H_1xy1 \1
ENDM
do_xy d_srlxyr_1xy1
** --
d_resrbxy_r_b_1xy1 MACRO
d_Res_\1_\2_1I\3_d1
opcode_3_bytes
index \3
getz d7,\1
bclr #\2,\1
putz \1,d7
skip 3
next
ENDM
d_resrbxy_H_b_1xy1 MACRO
d_Res_H_\1_1I\2_d1
opcode_3_bytes
index \2
move.w HL,(Work)
getz d7,(Work)
bclr #\1,(Work)
putz (Work),d7
move.w (Work),HL
skip 3
next
ENDM
d_resrbxy_b_1xy1 MACRO
d_resrbxy_r_b_1xy1 A,\1,\2
d_resrbxy_r_b_1xy1 B,\1,\2
d_resrbxy_r_b_1xy1 C,\1,\2
d_resrbxy_r_b_1xy1 D,\1,\2
d_resrbxy_r_b_1xy1 E,\1,\2
d_resrbxy_r_b_1xy1 L,\1,\2
d_resrbxy_H_b_1xy1 \1,\2
ENDM
d_resrbxy_1xy1 MACRO
d_resrbxy_b_1xy1 0,\1
d_resrbxy_b_1xy1 1,\1
d_resrbxy_b_1xy1 2,\1
d_resrbxy_b_1xy1 3,\1
d_resrbxy_b_1xy1 4,\1
d_resrbxy_b_1xy1 5,\1
d_resrbxy_b_1xy1 6,\1
d_resrbxy_b_1xy1 7,\1
ENDM
do_xy d_resrbxy_1xy1
** --
d_setrbxy_r_b_1xy1 MACRO
d_Set_\1_\2_1I\3_d1
opcode_3_bytes
index \3
getz d7,\1
bset #\2,\1
putz \1,d7
skip 3
next
ENDM
d_setrbxy_H_b_1xy1 MACRO
d_Set_H_\1_1I\2_d1
opcode_3_bytes
index \2
move.w HL,(Work)
getz d7,(Work)
bset #\1,(Work)
putz (Work),d7
move.w (Work),HL
skip 3
next
ENDM
d_setrbxy_b_1xy1 MACRO
d_setrbxy_r_b_1xy1 A,\1,\2
d_setrbxy_r_b_1xy1 B,\1,\2
d_setrbxy_r_b_1xy1 C,\1,\2
d_setrbxy_r_b_1xy1 D,\1,\2
d_setrbxy_r_b_1xy1 E,\1,\2
d_setrbxy_r_b_1xy1 L,\1,\2
d_setrbxy_H_b_1xy1 \1,\2
ENDM
d_setrbxy_1xy1 MACRO
d_setrbxy_b_1xy1 0,\1
d_setrbxy_b_1xy1 1,\1
d_setrbxy_b_1xy1 2,\1
d_setrbxy_b_1xy1 3,\1
d_setrbxy_b_1xy1 4,\1
d_setrbxy_b_1xy1 5,\1
d_setrbxy_b_1xy1 6,\1
d_setrbxy_b_1xy1 7,\1
ENDM
do_xy d_setrbxy_1xy1
** --
ENDC ;IFND UNDOCINSTR_UNDEF
** =====================================================================