home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 55
/
Amiga_Dream_55.iso
/
RISCOS
/
MAGAZINE
/
NEWS
/
PCE021.ZIP
/
Pce021
/
Src
/
cpu
/
hdr
/
common
< prev
next >
Wrap
Text File
|
1998-07-24
|
2KB
|
78 lines
; common.hdr
; ----------
; Common header shared between all Hu6280 opcode emulations
GET hdr.TempRegs
GET ^.hdr.defines
GET hdr.workspace
TEMPORARY r0
TEMPORARY r1
TEMPORARY r2
TEMPORARY r3
TEMPORARY r14
GBLS op_byte
GBLS current_opcode
GBLS area_name
C_FLAG * 0x01 ; carry flag
Z_FLAG * 0x02 ; zero flag
I_FLAG * 0x04 ; interrupt disable
D_FLAG * 0x08 ; decimal mode
B_FLAG * 0x10 ; break
T_FLAG * 0x20 ; memory flag
V_FLAG * 0x40 ; overflow
N_FLAG * 0x80 ; negative
MACRO
DEF_OPCODE $opcode
;area_name SETS ("$opcode.xxxxxxxx":LEFT:8)
;current_opcode SETS "AREA |cpu$$"
;current_opcode SETS "$current_opcode.$area_name|, CODE, READONLY, ALIGN=8"
; $current_opcode
$opcode
EXPORT $opcode
current_opcode SETS "$opcode"
MEND
MACRO
END_OPCODE
b Next_Opcode
ASSERT (. - $current_opcode) < 256
current_opcode SETS ""
MEND
MACRO
OPCODE_R $name, $mode, $instruction
;area_name SETS ("$name._$mode.xxxxxxx":LEFT:8)
;current_opcode SETS "AREA |cpu$$"
;current_opcode SETS "$current_opcode.$area_name|, CODE, READONLY, ALIGN=8"
; $current_opcode
$name._$mode
EXPORT $name._$mode
NEW op_byte
mr_$mode $op_byte
$instruction $op_byte
DELETE op_byte
b Next_Opcode
MEND
MACRO
OPCODE_RW $name, $mode, $instruction
;area_name SETS ("$name._$mode.xxxxxxx":LEFT:8)
;current_opcode SETS "AREA |cpu$$"
;current_opcode SETS "$current_opcode.$area_name|, CODE, READONLY, ALIGN=8"
; $current_opcode
$name._$mode
EXPORT $name._$mode
mm_$mode "$instruction"
b Next_Opcode
MEND
END