summaryrefslogtreecommitdiff
path: root/opcodes.inc.m4
blob: 80a906477f48ceb8b04e0e16b471d2f2ef8512d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
dnl # change the comments to match the assembler.  Prevents/reduces
dnl # confusion.
changecom(;)dnl
dnl # I'm using these, in this direction, specifically to confuse Germans.
changequote(`«', `»')dnl
dnl #
dnl # OPCODE takes up to five arguments:
dnl # 1. Instruction opcode
dnl # 2. 68k code
dnl # 3. Tstates for the native instruction
dnl # 4. Cycles the emulator takes
dnl # 5. Bytes of emulator code for this instruction
dnl #
define(«OPCODE»,«	START
dnl # This little bit of trickery lets me define a local label.
dnl # Calling local(end) inside of OPCODE(10, ...) will expand to
dnl # end_10, and is undefined everywhere else.
define(«local»,$«»1_««$1»»)dnl
«emu_op_»$1«:»
$2
	TIME	$3 ifelse(«,$4»,  «,»,  «»,  «,$4»)
undefine(«label»)dnl
	DONE»)dnl
dnl
define(«OP_DD»,«	START_DD
define(«local»,$«»1_dd««$1»»)dnl
«emu_op_dd»$1«:»
$2
	TIME	$3 ifelse(«,$4»,  «,»,  «»,  «,$4»)
undefine(«label»)dnl
	DONE»)dnl
dnl
define(«OP_CB»,«	START_CB
define(«local»,$«»1_cb««$1»»)dnl
«emu_op_cb»$1«:»
$2
	TIME	$3 ifelse(«,$4»,  «,»,  «»,  «,$4»)
undefine(«label»)dnl
	DONE»)dnl
dnl
define(«OP_DDCB»,«	START_DDCB
define(«local»,$«»1_ddcb««$1»»)dnl
«emu_op_ddcb»$1«:»
$2
	TIME	$3 ifelse(«,$4»,  «,»,  «»,  «,$4»)
undefine(«label»)dnl
	DONE»)dnl
dnl
define(«OP_FD»,«	START_FD
define(«local»,$«»1_fd««$1»»)dnl
«emu_op_fd»$1«:»
$2
	TIME	$3 ifelse(«,$4»,  «,»,  «»,  «,$4»)
undefine(«label»)dnl
	DONE»)dnl
dnl
define(«OP_FDCB»,«	START_FDCB
define(«local»,$«»1_fdcb««$1»»)dnl
«emu_op_fdcb»$1«:»
$2
	TIME	$3 ifelse(«,$4»,  «,»,  «»,  «,$4»)
undefine(«label»)dnl
	DONE»)dnl
dnl
define(«OP_ED»,«	START_ED
define(«local»,$«»1_ed««$1»»)dnl
«emu_op_ed»$1«:»
$2
	TIME	$3 ifelse(«,$4»,  «,»,  «»,  «,$4»)
undefine(«label»)dnl
	DONE»)dnl
dnl
define(«INT_OFFSET», 4)dnl