Don't do an "or" operation of the return IDs with TAGBASE_NATMEG
[AROS-Contrib.git] / Misc / berger / m68k.h
blobd31eb5b9937cee49f09d921337c155d1126ba6f9
1 #include <exec/types.h>
2 #include "endianess.h"
4 struct M68k
6 ULONG D[8]; // maintain this order of D before A for MOVEM!!! */
7 ULONG A[8];
8 ULONG PC;
9 UWORD SR;
11 ULONG oldvalue;
12 ULONG lastresult; // the result of the last operation
13 ULONG subvalue;
14 ULONG addvalue;
15 ULONG lastop; // the last operation
16 ULONG instsize;
19 #define CPUFLAG_X 0x10
20 #define CPUFLAG_N 0x08
21 #define CPUFLAG_Z 0x04
22 #define CPUFLAG_V 0x02
23 #define CPUFLAG_C 0x01
25 #define CPUFLAG_MASTER (0x01 << 12)
26 #define CPUFLAG_USER (0x01 << 13)
28 #define OP_SIZE_BYTE 0x00
29 #define OP_SIZE_WORD 0x01
30 #define OP_SIZE_LONG 0x02
31 #define OP_SIZE_MASK 0x03
33 #define OP_TYPE1 0x04 /* copy X, calculate N,Z, set V,C to zero */
34 #define OP_TYPE2 0x08 /* copy X,C calculate V,Z & N (add) */
35 #define OP_TYPE3 0x0c /* calculate X,V,C,Z & N */
36 #define OP_TYPE4 0x10 /* copy X,C calculate V,Z & N (sub) */
37 #define OP_TYPE5 0x14 /* copy X, calculate V,C,Z,N (cmp) */
38 #define OP_TYPE6 0x18 /* unimplemented!!!!!! */
39 #define OP_TYPE_MASK 0x1c
41 #define OP_DONTCALCFLAGZ 0x20
43 #define OP_DONTCARE 0x00
44 #define OP_UPTODATE OP_DONTCARE
46 #define OP_MOVE_BYTE OP_TYPE1|OP_SIZE_BYTE
47 #define OP_MOVE_WORD OP_TYPE1|OP_SIZE_WORD
48 #define OP_MOVE_LONG OP_TYPE1|OP_SIZE_LONG
50 #define OP_NOT_BYTE OP_TYPE1|OP_SIZE_BYTE
51 #define OP_NOT_WORD OP_TYPE1|OP_SIZE_WORD
52 #define OP_NOT_LONG OP_TYPE1|OP_SIZE_LONG
54 #define OP_AND_BYTE OP_TYPE1|OP_SIZE_BYTE
55 #define OP_AND_WORD OP_TYPE1|OP_SIZE_WORD
56 #define OP_AND_LONG OP_TYPE1|OP_SIZE_LONG
58 #define OP_EOR_BYTE OP_TYPE1|OP_SIZE_BYTE
59 #define OP_EOR_WORD OP_TYPE1|OP_SIZE_WORD
60 #define OP_EOR_LONG OP_TYPE1|OP_SIZE_LONG
62 #define OP_OR_BYTE OP_TYPE1|OP_SIZE_BYTE
63 #define OP_OR_WORD OP_TYPE1|OP_SIZE_WORD
64 #define OP_OR_LONG OP_TYPE1|OP_SIZE_LONG
66 #define OP_MULS_LONG OP_TYPE1|OP_SIZE_LONG
67 #define OP_MULU_LONG OP_TYPE1|OP_SIZE_LONG
69 /* correct the following!!! */
70 #define OP_DIVS_WORD OP_TYPE1|OP_SIZE_LONG
72 #define OP_EXT OP_TYPE1|OP_SIZE_LONG
73 #define OP_SWAP OP_TYPE1|OP_SIZE_LONG
75 #define OP_ADD_BYTE OP_TYPE2|OP_SIZE_BYTE
76 #define OP_ADD_WORD OP_TYPE2|OP_SIZE_WORD
77 #define OP_ADD_LONG OP_TYPE2|OP_SIZE_LONG
79 #define OP_NEG_BYTE OP_TYPE3|OP_SIZE_BYTE
80 #define OP_NEG_WORD OP_TYPE3|OP_SIZE_WORD
81 #define OP_NEG_LONG OP_TYPE3|OP_SIZE_LONG
83 #define OP_NEGX_BYTE OP_TYPE3|OP_SIZE_BYTE
84 #define OP_NEGX_WORD OP_TYPE3|OP_SIZE_WORD
85 #define OP_NEGX_LONG OP_TYPE3|OP_SIZE_LONG
87 #define OP_CMP_BYTE OP_TYPE5|OP_SIZE_BYTE
88 #define OP_CMP_WORD OP_TYPE5|OP_SIZE_WORD
89 #define OP_CMP_LONG OP_TYPE5|OP_SIZE_LONG
91 #define OP_SUB_BYTE OP_TYPE4|OP_SIZE_BYTE
92 #define OP_SUB_WORD OP_TYPE4|OP_SIZE_WORD
93 #define OP_SUB_LONG OP_TYPE4|OP_SIZE_LONG
95 #define OP_CMP_BYTE OP_TYPE5|OP_SIZE_BYTE
96 #define OP_CMP_WORD OP_TYPE5|OP_SIZE_WORD
97 #define OP_CMP_LONG OP_TYPE5|OP_SIZE_LONG
100 #define OP_ASL_BYTE OP_TYPE6|OP_SIZE_BYTE
101 #define OP_ASL_WORD OP_TYPE6|OP_SIZE_WORD
102 #define OP_ASL_LONG OP_TYPE6|OP_SIZE_LONG
104 #define OP_LSL_BYTE OP_TYPE6|OP_SIZE_BYTE
105 #define OP_LSL_WORD OP_TYPE6|OP_SIZE_WORD
106 #define OP_LSL_LONG OP_TYPE6|OP_SIZE_LONG
108 #define OP_ROL_BYTE OP_TYPE6|OP_SIZE_BYTE
109 #define OP_ROL_WORD OP_TYPE6|OP_SIZE_WORD
110 #define OP_ROL_LONG OP_TYPE6|OP_SIZE_LONG
112 #define OP_ROXL_BYTE OP_TYPE6|OP_SIZE_BYTE
113 #define OP_ROXL_WORD OP_TYPE6|OP_SIZE_WORD
114 #define OP_ROXL_LONG OP_TYPE6|OP_SIZE_LONG
116 #define OP_ASR_BYTE OP_TYPE6|OP_SIZE_BYTE
117 #define OP_ASR_WORD OP_TYPE6|OP_SIZE_WORD
118 #define OP_ASR_LONG OP_TYPE6|OP_SIZE_LONG
120 #define OP_LSR_BYTE OP_TYPE6|OP_SIZE_BYTE
121 #define OP_LSR_WORD OP_TYPE6|OP_SIZE_WORD
122 #define OP_LSR_LONG OP_TYPE6|OP_SIZE_LONG
124 #define OP_ROR_BYTE OP_TYPE6|OP_SIZE_BYTE
125 #define OP_ROR_WORD OP_TYPE6|OP_SIZE_WORD
126 #define OP_ROR_LONG OP_TYPE6|OP_SIZE_LONG
128 #define OP_ROXR_BYTE OP_TYPE6|OP_SIZE_BYTE
129 #define OP_ROXR_WORD OP_TYPE6|OP_SIZE_WORD
130 #define OP_ROXR_LONG OP_TYPE6|OP_SIZE_LONG