1 /*** t11: Portable DEC T-11 emulator ******************************************
2
3 Copyright (C) Aaron Giles 1998
4
5 Actual opcode implementation. Excuse the excessive use of macros, it
6 was the only way I could bear to type all this in!
7
8 *****************************************************************************/
9
10
11 /* given a register index 'r', this computes the effective address for a byte-sized operation
12 and puts the result in 'ea' */
13 #define MAKE_EAB_RGD(r) ea = REGD(r)
14 #define MAKE_EAB_IN(r) ea = REGD(r); REGW(r) += ((r) < 6 ? 1 : 2)
15 #define MAKE_EAB_INS(r) ea = REGD(r); REGW(r) += ((r) < 6 ? 1 : 2)
16 #define MAKE_EAB_IND(r) ea = REGD(r); REGW(r) += 2; ea = RWORD(ea)
17 #define MAKE_EAB_DE(r) REGW(r) -= ((r) < 6 ? 1 : 2); ea = REGD(r)
18 #define MAKE_EAB_DED(r) REGW(r) -= 2; ea = REGD(r); ea = RWORD(ea)
19 #define MAKE_EAB_IX(r) ea = ROPCODE(); ea = (ea + REGD(r)) & 0xffff
20 #define MAKE_EAB_IXD(r) ea = ROPCODE(); ea = (ea + REGD(r)) & 0xffff; ea = RWORD(ea)
21
22 /* given a register index 'r', this computes the effective address for a word-sized operation
23 and puts the result in 'ea' */
24 /* note that word accesses ignore the low bit!! this fixes APB! */
25 #define MAKE_EAW_RGD(r) MAKE_EAB_RGD(r)
26 #define MAKE_EAW_IN(r) ea = REGD(r); REGW(r) += 2
27 #define MAKE_EAW_IND(r) MAKE_EAB_IND(r)
28 #define MAKE_EAW_DE(r) REGW(r) -= 2; ea = REGD(r)
29 #define MAKE_EAW_DED(r) MAKE_EAB_DED(r)
30 #define MAKE_EAW_IX(r) MAKE_EAB_IX(r)
31 #define MAKE_EAW_IXD(r) MAKE_EAB_IXD(r)
32
33 /* extracts the source/destination register index from the opcode into 'sreg' or 'dreg' */
34 #define GET_SREG sreg = (t11.op >> 6) & 7
35 #define GET_DREG dreg = t11.op & 7
36
37 /* for a byte-sized source operand: extracts 'sreg', computes 'ea', and loads the value into 'source' */
38 #define GET_SB_RG GET_SREG; source = REGB(sreg)
39 #define GET_SB_RGD GET_SREG; MAKE_EAB_RGD(sreg); source = RBYTE(ea)
40 #define GET_SB_IN GET_SREG; if (sreg == 7) { source = ROPCODE(); } else { MAKE_EAB_IN(sreg); source = RBYTE(ea); }
41 #define GET_SB_IND GET_SREG; if (sreg == 7) { ea = ROPCODE(); } else { MAKE_EAB_IND(sreg); } source = RBYTE(ea)
42 #define GET_SB_DE GET_SREG; MAKE_EAB_DE(sreg); source = RBYTE(ea)
43 #define GET_SB_DED GET_SREG; MAKE_EAB_DED(sreg); source = RBYTE(ea)
44 #define GET_SB_IX GET_SREG; MAKE_EAB_IX(sreg); source = RBYTE(ea)
45 #define GET_SB_IXD GET_SREG; MAKE_EAB_IXD(sreg); source = RBYTE(ea)
46
47 /* for a word-sized source operand: extracts 'sreg', computes 'ea', and loads the value into 'source' */
48 #define GET_SW_RG GET_SREG; source = REGD(sreg)
49 #define GET_SW_RGD GET_SREG; MAKE_EAW_RGD(sreg); source = RWORD(ea)
50 #define GET_SW_IN GET_SREG; if (sreg == 7) { source = ROPCODE(); } else { MAKE_EAW_IN(sreg); source = RWORD(ea); }
51 #define GET_SW_IND GET_SREG; if (sreg == 7) { ea = ROPCODE(); } else { MAKE_EAW_IND(sreg); } source = RWORD(ea)
52 #define GET_SW_DE GET_SREG; MAKE_EAW_DE(sreg); source = RWORD(ea)
53 #define GET_SW_DED GET_SREG; MAKE_EAW_DED(sreg); source = RWORD(ea)
54 #define GET_SW_IX GET_SREG; MAKE_EAW_IX(sreg); source = RWORD(ea)
55 #define GET_SW_IXD GET_SREG; MAKE_EAW_IXD(sreg); source = RWORD(ea)
56
57 /* for a byte-sized destination operand: extracts 'dreg', computes 'ea', and loads the value into 'dest' */
58 #define GET_DB_RG GET_DREG; dest = REGB(dreg)
59 #define GET_DB_RGD GET_DREG; MAKE_EAB_RGD(dreg); dest = RBYTE(ea)
60 #define GET_DB_IN GET_DREG; MAKE_EAB_IN(dreg); dest = RBYTE(ea)
61 #define GET_DB_IND GET_DREG; if (dreg == 7) { ea = ROPCODE(); } else { MAKE_EAB_IND(dreg); } dest = RBYTE(ea)
62 #define GET_DB_DE GET_DREG; MAKE_EAB_DE(dreg); dest = RBYTE(ea)
63 #define GET_DB_DED GET_DREG; MAKE_EAB_DED(dreg); dest = RBYTE(ea)
64 #define GET_DB_IX GET_DREG; MAKE_EAB_IX(dreg); dest = RBYTE(ea)
65 #define GET_DB_IXD GET_DREG; MAKE_EAB_IXD(dreg); dest = RBYTE(ea)
66
67 /* for a word-sized destination operand: extracts 'dreg', computes 'ea', and loads the value into 'dest' */
68 #define GET_DW_RG GET_DREG; dest = REGD(dreg)
69 #define GET_DW_RGD GET_DREG; MAKE_EAW_RGD(dreg); dest = RWORD(ea)
70 #define GET_DW_IN GET_DREG; MAKE_EAW_IN(dreg); dest = RWORD(ea)
71 #define GET_DW_IND GET_DREG; if (dreg == 7) { ea = ROPCODE(); } else { MAKE_EAW_IND(dreg); } dest = RWORD(ea)
72 #define GET_DW_DE GET_DREG; MAKE_EAW_DE(dreg); dest = RWORD(ea)
73 #define GET_DW_DED GET_DREG; MAKE_EAW_DED(dreg); dest = RWORD(ea)
74 #define GET_DW_IX GET_DREG; MAKE_EAW_IX(dreg); dest = RWORD(ea)
75 #define GET_DW_IXD GET_DREG; MAKE_EAW_IXD(dreg); dest = RWORD(ea)
76
77 /* writes a value to a previously computed 'ea' */
78 #define PUT_DB_EA(v) WBYTE(ea, (v))
79 #define PUT_DW_EA(v) WWORD(ea, (v))
80
81 /* writes a value to a previously computed 'dreg' register */
82 #define PUT_DB_DREG(v) REGB(dreg) = (v)
83 #define PUT_DW_DREG(v) REGW(dreg) = (v)
84
85 /* for a byte-sized destination operand: extracts 'dreg', computes 'ea', and writes 'v' to it */
86 #define PUT_DB_RG(v) GET_DREG; REGB(dreg) = (v)
87 #define PUT_DB_RGD(v) GET_DREG; MAKE_EAB_RGD(dreg); WBYTE(ea, (v))
88 #define PUT_DB_IN(v) GET_DREG; MAKE_EAB_IN(dreg); WBYTE(ea, (v))
89 #define PUT_DB_IND(v) GET_DREG; if (dreg == 7) { ea = ROPCODE(); } else { MAKE_EAB_IND(dreg); } WBYTE(ea, (v))
90 #define PUT_DB_DE(v) GET_DREG; MAKE_EAB_DE(dreg); WBYTE(ea, (v))
91 #define PUT_DB_DED(v) GET_DREG; MAKE_EAB_DED(dreg); WBYTE(ea, (v))
92 #define PUT_DB_IX(v) GET_DREG; MAKE_EAB_IX(dreg); WBYTE(ea, (v))
93 #define PUT_DB_IXD(v) GET_DREG; MAKE_EAB_IXD(dreg); WBYTE(ea, (v))
94
95 /* for a word-sized destination operand: extracts 'dreg', computes 'ea', and writes 'v' to it */
96 #define PUT_DW_RG(v) GET_DREG; REGW(dreg) = (v)
97 #define PUT_DW_RGD(v) GET_DREG; MAKE_EAW_RGD(dreg); WWORD(ea, (v))
98 #define PUT_DW_IN(v) GET_DREG; MAKE_EAW_IN(dreg); WWORD(ea, (v))
99 #define PUT_DW_IND(v) GET_DREG; if (dreg == 7) { ea = ROPCODE(); } else { MAKE_EAW_IND(dreg); } WWORD(ea, (v))
100 #define PUT_DW_DE(v) GET_DREG; MAKE_EAW_DE(dreg); WWORD(ea, (v))
101 #define PUT_DW_DED(v) GET_DREG; MAKE_EAW_DED(dreg); WWORD(ea, (v))
102 #define PUT_DW_IX(v) GET_DREG; MAKE_EAW_IX(dreg); WWORD(ea, (v))
103 #define PUT_DW_IXD(v) GET_DREG; MAKE_EAW_IXD(dreg); WWORD(ea, (v))
104
105 /* flag clearing; must be done before setting */
106 #define CLR_ZV (PSW &= ~(ZFLAG | VFLAG))
107 #define CLR_NZV (PSW &= ~(NFLAG | ZFLAG | VFLAG))
108 #define CLR_NZVC (PSW &= ~(NFLAG | ZFLAG | VFLAG | CFLAG))
109
110 /* set individual flags byte-sized */
111 #define SETB_N (PSW |= (result >> 4) & 0x08)
112 #define SETB_Z (PSW |= ((result & 0xff) == 0) << 2)
113 #define SETB_V (PSW |= ((source ^ dest ^ result ^ (result >> 1)) >> 6) & 0x02)
114 #define SETB_C (PSW |= (result >> 8) & 0x01)
115 #define SETB_NZ SETB_N; SETB_Z
116 #define SETB_NZV SETB_N; SETB_Z; SETB_V
117 #define SETB_NZVC SETB_N; SETB_Z; SETB_V; SETB_C
118
119 /* set individual flags word-sized */
120 #define SETW_N (PSW |= (result >> 12) & 0x08)
121 #define SETW_Z (PSW |= ((result & 0xffff) == 0) << 2)
122 #define SETW_V (PSW |= ((source ^ dest ^ result ^ (result >> 1)) >> 14) & 0x02)
123 #define SETW_C (PSW |= (result >> 16) & 0x01)
124 #define SETW_NZ SETW_N; SETW_Z
125 #define SETW_NZV SETW_N; SETW_Z; SETW_V
126 #define SETW_NZVC SETW_N; SETW_Z; SETW_V; SETW_C
127
128 /* operations */
129 /* ADC: dst += C */
130 #define ADC_R(d) int dreg, source, dest, result; source = GET_C; GET_DW_##d; CLR_NZVC; result = dest + source; SETW_NZVC; PUT_DW_DREG(result)
131 #define ADC_M(d) int dreg, source, dest, result, ea; source = GET_C; GET_DW_##d; CLR_NZVC; result = dest + source; SETW_NZVC; PUT_DW_EA(result)
132 #define ADCB_R(d) int dreg, source, dest, result; source = GET_C; GET_DB_##d; CLR_NZVC; result = dest + source; SETB_NZVC; PUT_DB_DREG(result)
133 #define ADCB_M(d) int dreg, source, dest, result, ea; source = GET_C; GET_DB_##d; CLR_NZVC; result = dest + source; SETB_NZVC; PUT_DB_EA(result)
134 /* ADD: dst += src */
135 #define ADD_R(s,d) int sreg, dreg, source, dest, result; GET_SW_##s; GET_DW_##d; CLR_NZVC; result = dest + source; SETW_NZVC; PUT_DW_DREG(result)
136 #define ADD_X(s,d) int sreg, dreg, source, dest, result, ea; GET_SW_##s; GET_DW_##d; CLR_NZVC; result = dest + source; SETW_NZVC; PUT_DW_DREG(result)
137 #define ADD_M(s,d) int sreg, dreg, source, dest, result, ea; GET_SW_##s; GET_DW_##d; CLR_NZVC; result = dest + source; SETW_NZVC; PUT_DW_EA(result)
138 /* ASL: dst = (dst << 1); C = (dst >> 7) */
139 #define ASL_R(d) int dreg, dest, result; GET_DW_##d; CLR_NZVC; result = dest << 1; SETW_NZ; PSW |= (dest >> 15) & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DW_DREG(result)
140 #define ASL_M(d) int dreg, dest, result, ea; GET_DW_##d; CLR_NZVC; result = dest << 1; SETW_NZ; PSW |= (dest >> 15) & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DW_EA(result)
141 #define ASLB_R(d) int dreg, dest, result; GET_DB_##d; CLR_NZVC; result = dest << 1; SETB_NZ; PSW |= (dest >> 7) & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DB_DREG(result)
142 #define ASLB_M(d) int dreg, dest, result, ea; GET_DB_##d; CLR_NZVC; result = dest << 1; SETB_NZ; PSW |= (dest >> 7) & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DB_EA(result)
143 /* ASR: dst = (dst << 1); C = (dst >> 7) */
144 #define ASR_R(d) int dreg, dest, result; GET_DW_##d; CLR_NZVC; result = (dest >> 1) | (dest & 0x8000); SETW_NZ; PSW |= dest & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DW_DREG(result)
145 #define ASR_M(d) int dreg, dest, result, ea; GET_DW_##d; CLR_NZVC; result = (dest >> 1) | (dest & 0x8000); SETW_NZ; PSW |= dest & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DW_EA(result)
146 #define ASRB_R(d) int dreg, dest, result; GET_DB_##d; CLR_NZVC; result = (dest >> 1) | (dest & 0x80); SETB_NZ; PSW |= dest & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DB_DREG(result)
147 #define ASRB_M(d) int dreg, dest, result, ea; GET_DB_##d; CLR_NZVC; result = (dest >> 1) | (dest & 0x80); SETB_NZ; PSW |= dest & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DB_EA(result)
148 /* BIC: dst &= ~src */
149 #define BIC_R(s,d) int sreg, dreg, source, dest, result; GET_SW_##s; GET_DW_##d; CLR_NZV; result = dest & ~source; SETW_NZ; PUT_DW_DREG(result)
150 #define BIC_X(s,d) int sreg, dreg, source, dest, result, ea; GET_SW_##s; GET_DW_##d; CLR_NZV; result = dest & ~source; SETW_NZ; PUT_DW_DREG(result)
151 #define BIC_M(s,d) int sreg, dreg, source, dest, result, ea; GET_SW_##s; GET_DW_##d; CLR_NZV; result = dest & ~source; SETW_NZ; PUT_DW_EA(result)
152 #define BICB_R(s,d) int sreg, dreg, source, dest, result; GET_SB_##s; GET_DB_##d; CLR_NZV; result = dest & ~source; SETB_NZ; PUT_DB_DREG(result)
153 #define BICB_X(s,d) int sreg, dreg, source, dest, result, ea; GET_SB_##s; GET_DB_##d; CLR_NZV; result = dest & ~source; SETB_NZ; PUT_DB_DREG(result)
154 #define BICB_M(s,d) int sreg, dreg, source, dest, result, ea; GET_SB_##s; GET_DB_##d; CLR_NZV; result = dest & ~source; SETB_NZ; PUT_DB_EA(result)
155 /* BIS: dst |= src */
156 #define BIS_R(s,d) int sreg, dreg, source, dest, result; GET_SW_##s; GET_DW_##d; CLR_NZV; result = dest | source; SETW_NZ; PUT_DW_DREG(result)
157 #define BIS_X(s,d) int sreg, dreg, source, dest, result, ea; GET_SW_##s; GET_DW_##d; CLR_NZV; result = dest | source; SETW_NZ; PUT_DW_DREG(result)
158 #define BIS_M(s,d) int sreg, dreg, source, dest, result, ea; GET_SW_##s; GET_DW_##d; CLR_NZV; result = dest | source; SETW_NZ; PUT_DW_EA(result)
159 #define BISB_R(s,d) int sreg, dreg, source, dest, result; GET_SB_##s; GET_DB_##d; CLR_NZV; result = dest | source; SETB_NZ; PUT_DB_DREG(result)
160 #define BISB_X(s,d) int sreg, dreg, source, dest, result, ea; GET_SB_##s; GET_DB_##d; CLR_NZV; result = dest | source; SETB_NZ; PUT_DB_DREG(result)
161 #define BISB_M(s,d) int sreg, dreg, source, dest, result, ea; GET_SB_##s; GET_DB_##d; CLR_NZV; result = dest | source; SETB_NZ; PUT_DB_EA(result)
162 /* BIT: flags = dst & src */
163 #define BIT_R(s,d) int sreg, dreg, source, dest, result; GET_SW_##s; GET_DW_##d; CLR_NZV; result = dest & source; SETW_NZ;
164 #define BIT_M(s,d) int sreg, dreg, source, dest, result, ea; GET_SW_##s; GET_DW_##d; CLR_NZV; result = dest & source; SETW_NZ;
165 #define BITB_R(s,d) int sreg, dreg, source, dest, result; GET_SB_##s; GET_DB_##d; CLR_NZV; result = dest & source; SETB_NZ;
166 #define BITB_M(s,d) int sreg, dreg, source, dest, result, ea; GET_SB_##s; GET_DB_##d; CLR_NZV; result = dest & source; SETB_NZ;
167 /* BR: if (condition) branch */
168 #define BR(c) if (c) { PC += 2 * (signed char)(t11.op & 0xff); }
169 /* CLR: dst = 0 */
170 #define CLR_R(d) int dreg; PUT_DW_##d(0); CLR_NZVC; SET_Z
171 #define CLR_M(d) int dreg, ea; PUT_DW_##d(0); CLR_NZVC; SET_Z
172 #define CLRB_R(d) int dreg; PUT_DB_##d(0); CLR_NZVC; SET_Z
173 #define CLRB_M(d) int dreg, ea; PUT_DB_##d(0); CLR_NZVC; SET_Z
174 /* CMP: flags = src - dst */
175 #define CMP_R(s,d) int sreg, dreg, source, dest, result; GET_SW_##s; GET_DW_##d; CLR_NZVC; result = source - dest; SETW_NZVC;
176 #define CMP_M(s,d) int sreg, dreg, source, dest, result, ea; GET_SW_##s; GET_DW_##d; CLR_NZVC; result = source - dest; SETW_NZVC;
177 #define CMPB_R(s,d) int sreg, dreg, source, dest, result; GET_SB_##s; GET_DB_##d; CLR_NZVC; result = source - dest; SETB_NZVC;
178 #define CMPB_M(s,d) int sreg, dreg, source, dest, result, ea; GET_SB_##s; GET_DB_##d; CLR_NZVC; result = source - dest; SETB_NZVC;
179 /* COM: dst = ~dst */
180 #define COM_R(d) int dreg, dest, result; GET_DW_##d; CLR_NZVC; result = ~dest; SETW_NZ; SET_C; PUT_DW_DREG(result)
181 #define COM_M(d) int dreg, dest, result, ea; GET_DW_##d; CLR_NZVC; result = ~dest; SETW_NZ; SET_C; PUT_DW_EA(result)
182 #define COMB_R(d) int dreg, dest, result; GET_DB_##d; CLR_NZVC; result = ~dest; SETB_NZ; SET_C; PUT_DB_DREG(result)
183 #define COMB_M(d) int dreg, dest, result, ea; GET_DB_##d; CLR_NZVC; result = ~dest; SETB_NZ; SET_C; PUT_DB_EA(result)
184 /* DEC: dst -= 1 */
185 #define DEC_R(d) int dreg, dest, result; GET_DW_##d; CLR_NZV; result = dest - 1; SETW_NZ; if (dest == 0x8000) SET_V; PUT_DW_DREG(result)
186 #define DEC_M(d) int dreg, dest, result, ea; GET_DW_##d; CLR_NZV; result = dest - 1; SETW_NZ; if (dest == 0x8000) SET_V; PUT_DW_EA(result)
187 #define DECB_R(d) int dreg, dest, result; GET_DB_##d; CLR_NZV; result = dest - 1; SETB_NZ; if (dest == 0x80) SET_V; PUT_DB_DREG(result)
188 #define DECB_M(d) int dreg, dest, result, ea; GET_DB_##d; CLR_NZV; result = dest - 1; SETB_NZ; if (dest == 0x80) SET_V; PUT_DB_EA(result)
189 /* INC: dst += 1 */
190 #define INC_R(d) int dreg, dest, result; GET_DW_##d; CLR_NZV; result = dest + 1; SETW_NZ; if (dest == 0x7fff) SET_V; PUT_DW_DREG(result)
191 #define INC_M(d) int dreg, dest, result, ea; GET_DW_##d; CLR_NZV; result = dest + 1; SETW_NZ; if (dest == 0x7fff) SET_V; PUT_DW_EA(result)
192 #define INCB_R(d) int dreg, dest, result; GET_DB_##d; CLR_NZV; result = dest + 1; SETB_NZ; if (dest == 0x7f) SET_V; PUT_DB_DREG(result)
193 #define INCB_M(d) int dreg, dest, result, ea; GET_DB_##d; CLR_NZV; result = dest + 1; SETB_NZ; if (dest == 0x7f) SET_V; PUT_DB_EA(result)
194 /* JMP: PC = ea */
195 #define JMP(d) int dreg, ea; GET_DREG; MAKE_EAW_##d(dreg); PC = ea
196 /* JSR: PUSH src, src = PC, PC = ea */
197 #define JSR(d) int sreg, dreg, ea; GET_SREG; GET_DREG; MAKE_EAW_##d(dreg); PUSH(REGW(sreg)); REGW(sreg) = PC; PC = ea
198 /* MFPS: dst = flags */
199 #define MFPS_R(d) int dreg, result; result = PSW; CLR_NZV; SETB_NZ; PUT_DW_##d((signed char)result)
200 #define MFPS_M(d) int dreg, result, ea; result = PSW; CLR_NZV; SETB_NZ; PUT_DB_##d(result)
201 /* MOV: dst = src */
202 #define MOV_R(s,d) int sreg, dreg, source, result; GET_SW_##s; CLR_NZV; result = source; SETW_NZ; PUT_DW_##d(result)
203 #define MOV_M(s,d) int sreg, dreg, source, result, ea; GET_SW_##s; CLR_NZV; result = source; SETW_NZ; PUT_DW_##d(result)
204 #define MOVB_R(s,d) int sreg, dreg, source, result; GET_SB_##s; CLR_NZV; result = source; SETB_NZ; PUT_DW_##d((signed char)result)
205 #define MOVB_X(s,d) int sreg, dreg, source, result, ea; GET_SB_##s; CLR_NZV; result = source; SETB_NZ; PUT_DW_##d((signed char)result)
206 #define MOVB_M(s,d) int sreg, dreg, source, result, ea; GET_SB_##s; CLR_NZV; result = source; SETB_NZ; PUT_DB_##d(result)
207 /* MTPS: flags = src */
208 #define MTPS_R(d) int dreg, dest; GET_DW_##d; PSW = (PSW & ~0xef) | (dest & 0xef); t11_check_irqs()
209 #define MTPS_M(d) int dreg, dest, ea; GET_DW_##d; PSW = (PSW & ~0xef) | (dest & 0xef); t11_check_irqs()
210 /* NEG: dst = -dst */
211 #define NEG_R(d) int dreg, dest, result; GET_DW_##d; CLR_NZVC; result = -dest; SETW_NZ; if (dest == 0x8000) SET_V; if (result) SET_C; PUT_DW_DREG(result)
212 #define NEG_M(d) int dreg, dest, result, ea; GET_DW_##d; CLR_NZVC; result = -dest; SETW_NZ; if (dest == 0x8000) SET_V; if (result) SET_C; PUT_DW_EA(result)
213 #define NEGB_R(d) int dreg, dest, result; GET_DB_##d; CLR_NZVC; result = -dest; SETB_NZ; if (dest == 0x80) SET_V; if (result) SET_C; PUT_DB_DREG(result)
214 #define NEGB_M(d) int dreg, dest, result, ea; GET_DB_##d; CLR_NZVC; result = -dest; SETB_NZ; if (dest == 0x80) SET_V; if (result) SET_C; PUT_DB_EA(result)
215 /* ROL: dst = (dst << 1) | C; C = (dst >> 7) */
216 #define ROL_R(d) int dreg, dest, result; GET_DW_##d; result = (dest << 1) | GET_C; CLR_NZVC; SETW_NZ; PSW |= (dest >> 15) & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DW_DREG(result)
217 #define ROL_M(d) int dreg, dest, result, ea; GET_DW_##d; result = (dest << 1) | GET_C; CLR_NZVC; SETW_NZ; PSW |= (dest >> 15) & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DW_EA(result)
218 #define ROLB_R(d) int dreg, dest, result; GET_DB_##d; result = (dest << 1) | GET_C; CLR_NZVC; SETB_NZ; PSW |= (dest >> 7) & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DB_DREG(result)
219 #define ROLB_M(d) int dreg, dest, result, ea; GET_DB_##d; result = (dest << 1) | GET_C; CLR_NZVC; SETB_NZ; PSW |= (dest >> 7) & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DB_EA(result)
220 /* ROR: dst = (dst >> 1) | (C << 7); C = dst & 1 */
221 #define ROR_R(d) int dreg, dest, result; GET_DW_##d; result = (dest >> 1) | (GET_C << 15); CLR_NZVC; SETW_NZ; PSW |= dest & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DW_DREG(result)
222 #define ROR_M(d) int dreg, dest, result, ea; GET_DW_##d; result = (dest >> 1) | (GET_C << 15); CLR_NZVC; SETW_NZ; PSW |= dest & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DW_EA(result)
223 #define RORB_R(d) int dreg, dest, result; GET_DB_##d; result = (dest >> 1) | (GET_C << 7); CLR_NZVC; SETB_NZ; PSW |= dest & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DB_DREG(result)
224 #define RORB_M(d) int dreg, dest, result, ea; GET_DB_##d; result = (dest >> 1) | (GET_C << 7); CLR_NZVC; SETB_NZ; PSW |= dest & 1; PSW |= ((PSW << 1) ^ (PSW >> 2)) & 2; PUT_DB_EA(result)
225 /* SBC: dst -= C */
226 #define SBC_R(d) int dreg, source, dest, result; source = GET_C; GET_DW_##d; CLR_NZVC; result = dest - source; SETW_NZVC; PUT_DW_DREG(result)
227 #define SBC_M(d) int dreg, source, dest, result, ea; source = GET_C; GET_DW_##d; CLR_NZVC; result = dest - source; SETW_NZVC; PUT_DW_EA(result)
228 #define SBCB_R(d) int dreg, source, dest, result; source = GET_C; GET_DB_##d; CLR_NZVC; result = dest - source; SETB_NZVC; PUT_DB_DREG(result)
229 #define SBCB_M(d) int dreg, source, dest, result, ea; source = GET_C; GET_DB_##d; CLR_NZVC; result = dest - source; SETB_NZVC; PUT_DB_EA(result)
230 /* SUB: dst -= src */
231 #define SUB_R(s,d) int sreg, dreg, source, dest, result; GET_SW_##s; GET_DW_##d; CLR_NZVC; result = dest - source; SETW_NZVC; PUT_DW_DREG(result)
232 #define SUB_X(s,d) int sreg, dreg, source, dest, result, ea; GET_SW_##s; GET_DW_##d; CLR_NZVC; result = dest - source; SETW_NZVC; PUT_DW_DREG(result)
233 #define SUB_M(s,d) int sreg, dreg, source, dest, result, ea; GET_SW_##s; GET_DW_##d; CLR_NZVC; result = dest - source; SETW_NZVC; PUT_DW_EA(result)
234 #define SUBB_R(s,d) int sreg, dreg, source, dest, result; GET_SB_##s; GET_DB_##d; CLR_NZVC; result = dest - source; SETB_NZVC; PUT_DB_DREG(result)
235 #define SUBB_X(s,d) int sreg, dreg, source, dest, result, ea; GET_SB_##s; GET_DB_##d; CLR_NZVC; result = dest - source; SETB_NZVC; PUT_DB_DREG(result)
236 #define SUBB_M(s,d) int sreg, dreg, source, dest, result, ea; GET_SB_##s; GET_DB_##d; CLR_NZVC; result = dest - source; SETB_NZVC; PUT_DB_EA(result)
237 /* SWAB: dst = (dst >> 8) + (dst << 8) */
238 #define SWAB_R(d) int dreg, dest, result; GET_DW_##d; CLR_NZVC; result = ((dest >> 8) & 0xff) + (dest << 8); SETB_NZ; PUT_DW_DREG(result)
239 #define SWAB_M(d) int dreg, dest, result, ea; GET_DW_##d; CLR_NZVC; result = ((dest >> 8) & 0xff) + (dest << 8); SETB_NZ; PUT_DW_EA(result)
240 /* SXT: dst = sign-extend dst */
241 #define SXT_R(d) int dreg, result; CLR_ZV; if (GET_N) result = -1; else { result = 0; SET_Z; } PUT_DW_##d(result)
242 #define SXT_M(d) int dreg, result, ea; CLR_ZV; if (GET_N) result = -1; else { result = 0; SET_Z; } PUT_DW_##d(result)
243 /* TST: dst = ~dst */
244 #define TST_R(d) int dreg, dest, result; GET_DW_##d; CLR_NZVC; result = dest; SETW_NZ;
245 #define TST_M(d) int dreg, dest, result, ea; GET_DW_##d; CLR_NZVC; result = dest; SETW_NZ;
246 #define TSTB_R(d) int dreg, dest, result; GET_DB_##d; CLR_NZVC; result = dest; SETB_NZ;
247 #define TSTB_M(d) int dreg, dest, result, ea; GET_DB_##d; CLR_NZVC; result = dest; SETB_NZ;
248 /* XOR: dst ^= src */
249 #define XOR_R(d) int sreg, dreg, source, dest, result; GET_SREG; source = REGW(sreg); GET_DW_##d; CLR_NZV; result = dest ^ source; SETW_NZ; PUT_DW_DREG(result)
250 #define XOR_M(d) int sreg, dreg, source, dest, result, ea; GET_SREG; source = REGW(sreg); GET_DW_##d; CLR_NZV; result = dest ^ source; SETW_NZ; PUT_DW_EA(result)
251
252
253
op_0000(void)254 static void op_0000(void)
255 {
256 switch (t11.op & 0x3f)
257 {
258 case 0x00: /* HALT */ t11_ICount = 0; break;
259 case 0x01: /* WAIT */ t11.wait_state = 1; t11_ICount = 0; break;
260 case 0x02: /* RTI */ PC = POP(); PSW = POP(); t11_check_irqs(); break;
261 case 0x03: /* BPT */ PUSH(PSW); PUSH(PC); PC = RWORD(0x0c); PSW = RWORD(0x0e); t11_check_irqs(); break;
262 case 0x04: /* IOT */ PUSH(PSW); PUSH(PC); PC = RWORD(0x10); PSW = RWORD(0x12); t11_check_irqs(); break;
263 case 0x05: /* RESET */ break;
264 case 0x06: /* RTT */ PC = POP(); PSW = POP(); t11_check_irqs(); break;
265 default: illegal(); break;
266 }
267 }
268
illegal(void)269 static void illegal(void)
270 {
271 PUSH(PSW);
272 PUSH(PC);
273 PC = RWORD(0x08);
274 PSW = RWORD(0x0a);
275 t11_check_irqs();
276 PC = 0;
277 }
278
jmp_rgd(void)279 static void jmp_rgd(void) { JMP(RGD); }
jmp_in(void)280 static void jmp_in(void) { JMP(IN); }
jmp_ind(void)281 static void jmp_ind(void) { JMP(IND); }
jmp_de(void)282 static void jmp_de(void) { JMP(DE); }
jmp_ded(void)283 static void jmp_ded(void) { JMP(DED); }
jmp_ix(void)284 static void jmp_ix(void) { JMP(IX); }
jmp_ixd(void)285 static void jmp_ixd(void) { JMP(IXD); }
286
rts(void)287 static void rts(void)
288 {
289 int dreg;
290 GET_DREG;
291 PC = REGD(dreg);
292 REGW(dreg) = POP();
293 }
294
ccc(void)295 static void ccc(void) { PSW &= ~(t11.op & 15); }
scc(void)296 static void scc(void) { PSW |= (t11.op & 15); }
297
swab_rg(void)298 static void swab_rg(void) { SWAB_R(RG); }
swab_rgd(void)299 static void swab_rgd(void) { SWAB_M(RGD); }
swab_in(void)300 static void swab_in(void) { SWAB_M(IN); }
swab_ind(void)301 static void swab_ind(void) { SWAB_M(IND); }
swab_de(void)302 static void swab_de(void) { SWAB_M(DE); }
swab_ded(void)303 static void swab_ded(void) { SWAB_M(DED); }
swab_ix(void)304 static void swab_ix(void) { SWAB_M(IX); }
swab_ixd(void)305 static void swab_ixd(void) { SWAB_M(IXD); }
306
br(void)307 static void br(void) { BR(1); }
bne(void)308 static void bne(void) { BR(!GET_Z); }
beq(void)309 static void beq(void) { BR( GET_Z); }
bge(void)310 static void bge(void) { BR(!((GET_N >> 2) ^ GET_V)); }
blt(void)311 static void blt(void) { BR(((GET_N >> 2) ^ GET_V)); }
bgt(void)312 static void bgt(void) { BR(!GET_Z && !((GET_N >> 2) ^ GET_V)); }
ble(void)313 static void ble(void) { BR( GET_Z || ((GET_N >> 2) ^ GET_V)); }
314
jsr_rgd(void)315 static void jsr_rgd(void) { JSR(RGD); }
jsr_in(void)316 static void jsr_in(void) { JSR(IN); }
jsr_ind(void)317 static void jsr_ind(void) { JSR(IND); }
jsr_de(void)318 static void jsr_de(void) { JSR(DE); }
jsr_ded(void)319 static void jsr_ded(void) { JSR(DED); }
jsr_ix(void)320 static void jsr_ix(void) { JSR(IX); }
jsr_ixd(void)321 static void jsr_ixd(void) { JSR(IXD); }
322
clr_rg(void)323 static void clr_rg(void) { CLR_R(RG); }
clr_rgd(void)324 static void clr_rgd(void) { CLR_M(RGD); }
clr_in(void)325 static void clr_in(void) { CLR_M(IN); }
clr_ind(void)326 static void clr_ind(void) { CLR_M(IND); }
clr_de(void)327 static void clr_de(void) { CLR_M(DE); }
clr_ded(void)328 static void clr_ded(void) { CLR_M(DED); }
clr_ix(void)329 static void clr_ix(void) { CLR_M(IX); }
clr_ixd(void)330 static void clr_ixd(void) { CLR_M(IXD); }
331
com_rg(void)332 static void com_rg(void) { COM_R(RG); }
com_rgd(void)333 static void com_rgd(void) { COM_M(RGD); }
com_in(void)334 static void com_in(void) { COM_M(IN); }
com_ind(void)335 static void com_ind(void) { COM_M(IND); }
com_de(void)336 static void com_de(void) { COM_M(DE); }
com_ded(void)337 static void com_ded(void) { COM_M(DED); }
com_ix(void)338 static void com_ix(void) { COM_M(IX); }
com_ixd(void)339 static void com_ixd(void) { COM_M(IXD); }
340
inc_rg(void)341 static void inc_rg(void) { INC_R(RG); }
inc_rgd(void)342 static void inc_rgd(void) { INC_M(RGD); }
inc_in(void)343 static void inc_in(void) { INC_M(IN); }
inc_ind(void)344 static void inc_ind(void) { INC_M(IND); }
inc_de(void)345 static void inc_de(void) { INC_M(DE); }
inc_ded(void)346 static void inc_ded(void) { INC_M(DED); }
inc_ix(void)347 static void inc_ix(void) { INC_M(IX); }
inc_ixd(void)348 static void inc_ixd(void) { INC_M(IXD); }
349
dec_rg(void)350 static void dec_rg(void) { DEC_R(RG); }
dec_rgd(void)351 static void dec_rgd(void) { DEC_M(RGD); }
dec_in(void)352 static void dec_in(void) { DEC_M(IN); }
dec_ind(void)353 static void dec_ind(void) { DEC_M(IND); }
dec_de(void)354 static void dec_de(void) { DEC_M(DE); }
dec_ded(void)355 static void dec_ded(void) { DEC_M(DED); }
dec_ix(void)356 static void dec_ix(void) { DEC_M(IX); }
dec_ixd(void)357 static void dec_ixd(void) { DEC_M(IXD); }
358
neg_rg(void)359 static void neg_rg(void) { NEG_R(RG); }
neg_rgd(void)360 static void neg_rgd(void) { NEG_M(RGD); }
neg_in(void)361 static void neg_in(void) { NEG_M(IN); }
neg_ind(void)362 static void neg_ind(void) { NEG_M(IND); }
neg_de(void)363 static void neg_de(void) { NEG_M(DE); }
neg_ded(void)364 static void neg_ded(void) { NEG_M(DED); }
neg_ix(void)365 static void neg_ix(void) { NEG_M(IX); }
neg_ixd(void)366 static void neg_ixd(void) { NEG_M(IXD); }
367
adc_rg(void)368 static void adc_rg(void) { ADC_R(RG); }
adc_rgd(void)369 static void adc_rgd(void) { ADC_M(RGD); }
adc_in(void)370 static void adc_in(void) { ADC_M(IN); }
adc_ind(void)371 static void adc_ind(void) { ADC_M(IND); }
adc_de(void)372 static void adc_de(void) { ADC_M(DE); }
adc_ded(void)373 static void adc_ded(void) { ADC_M(DED); }
adc_ix(void)374 static void adc_ix(void) { ADC_M(IX); }
adc_ixd(void)375 static void adc_ixd(void) { ADC_M(IXD); }
376
sbc_rg(void)377 static void sbc_rg(void) { SBC_R(RG); }
sbc_rgd(void)378 static void sbc_rgd(void) { SBC_M(RGD); }
sbc_in(void)379 static void sbc_in(void) { SBC_M(IN); }
sbc_ind(void)380 static void sbc_ind(void) { SBC_M(IND); }
sbc_de(void)381 static void sbc_de(void) { SBC_M(DE); }
sbc_ded(void)382 static void sbc_ded(void) { SBC_M(DED); }
sbc_ix(void)383 static void sbc_ix(void) { SBC_M(IX); }
sbc_ixd(void)384 static void sbc_ixd(void) { SBC_M(IXD); }
385
tst_rg(void)386 static void tst_rg(void) { TST_R(RG); }
tst_rgd(void)387 static void tst_rgd(void) { TST_M(RGD); }
tst_in(void)388 static void tst_in(void) { TST_M(IN); }
tst_ind(void)389 static void tst_ind(void) { TST_M(IND); }
tst_de(void)390 static void tst_de(void) { TST_M(DE); }
tst_ded(void)391 static void tst_ded(void) { TST_M(DED); }
tst_ix(void)392 static void tst_ix(void) { TST_M(IX); }
tst_ixd(void)393 static void tst_ixd(void) { TST_M(IXD); }
394
ror_rg(void)395 static void ror_rg(void) { ROR_R(RG); }
ror_rgd(void)396 static void ror_rgd(void) { ROR_M(RGD); }
ror_in(void)397 static void ror_in(void) { ROR_M(IN); }
ror_ind(void)398 static void ror_ind(void) { ROR_M(IND); }
ror_de(void)399 static void ror_de(void) { ROR_M(DE); }
ror_ded(void)400 static void ror_ded(void) { ROR_M(DED); }
ror_ix(void)401 static void ror_ix(void) { ROR_M(IX); }
ror_ixd(void)402 static void ror_ixd(void) { ROR_M(IXD); }
403
rol_rg(void)404 static void rol_rg(void) { ROL_R(RG); }
rol_rgd(void)405 static void rol_rgd(void) { ROL_M(RGD); }
rol_in(void)406 static void rol_in(void) { ROL_M(IN); }
rol_ind(void)407 static void rol_ind(void) { ROL_M(IND); }
rol_de(void)408 static void rol_de(void) { ROL_M(DE); }
rol_ded(void)409 static void rol_ded(void) { ROL_M(DED); }
rol_ix(void)410 static void rol_ix(void) { ROL_M(IX); }
rol_ixd(void)411 static void rol_ixd(void) { ROL_M(IXD); }
412
asr_rg(void)413 static void asr_rg(void) { ASR_R(RG); }
asr_rgd(void)414 static void asr_rgd(void) { ASR_M(RGD); }
asr_in(void)415 static void asr_in(void) { ASR_M(IN); }
asr_ind(void)416 static void asr_ind(void) { ASR_M(IND); }
asr_de(void)417 static void asr_de(void) { ASR_M(DE); }
asr_ded(void)418 static void asr_ded(void) { ASR_M(DED); }
asr_ix(void)419 static void asr_ix(void) { ASR_M(IX); }
asr_ixd(void)420 static void asr_ixd(void) { ASR_M(IXD); }
421
asl_rg(void)422 static void asl_rg(void) { ASL_R(RG); }
asl_rgd(void)423 static void asl_rgd(void) { ASL_M(RGD); }
asl_in(void)424 static void asl_in(void) { ASL_M(IN); }
asl_ind(void)425 static void asl_ind(void) { ASL_M(IND); }
asl_de(void)426 static void asl_de(void) { ASL_M(DE); }
asl_ded(void)427 static void asl_ded(void) { ASL_M(DED); }
asl_ix(void)428 static void asl_ix(void) { ASL_M(IX); }
asl_ixd(void)429 static void asl_ixd(void) { ASL_M(IXD); }
430
sxt_rg(void)431 static void sxt_rg(void) { SXT_R(RG); }
sxt_rgd(void)432 static void sxt_rgd(void) { SXT_M(RGD); }
sxt_in(void)433 static void sxt_in(void) { SXT_M(IN); }
sxt_ind(void)434 static void sxt_ind(void) { SXT_M(IND); }
sxt_de(void)435 static void sxt_de(void) { SXT_M(DE); }
sxt_ded(void)436 static void sxt_ded(void) { SXT_M(DED); }
sxt_ix(void)437 static void sxt_ix(void) { SXT_M(IX); }
sxt_ixd(void)438 static void sxt_ixd(void) { SXT_M(IXD); }
439
mov_rg_rg(void)440 static void mov_rg_rg(void) { MOV_R(RG,RG); }
mov_rg_rgd(void)441 static void mov_rg_rgd(void) { MOV_M(RG,RGD); }
mov_rg_in(void)442 static void mov_rg_in(void) { MOV_M(RG,IN); }
mov_rg_ind(void)443 static void mov_rg_ind(void) { MOV_M(RG,IND); }
mov_rg_de(void)444 static void mov_rg_de(void) { MOV_M(RG,DE); }
mov_rg_ded(void)445 static void mov_rg_ded(void) { MOV_M(RG,DED); }
mov_rg_ix(void)446 static void mov_rg_ix(void) { MOV_M(RG,IX); }
mov_rg_ixd(void)447 static void mov_rg_ixd(void) { MOV_M(RG,IXD); }
mov_rgd_rg(void)448 static void mov_rgd_rg(void) { MOV_M(RGD,RG); }
mov_rgd_rgd(void)449 static void mov_rgd_rgd(void) { MOV_M(RGD,RGD); }
mov_rgd_in(void)450 static void mov_rgd_in(void) { MOV_M(RGD,IN); }
mov_rgd_ind(void)451 static void mov_rgd_ind(void) { MOV_M(RGD,IND); }
mov_rgd_de(void)452 static void mov_rgd_de(void) { MOV_M(RGD,DE); }
mov_rgd_ded(void)453 static void mov_rgd_ded(void) { MOV_M(RGD,DED); }
mov_rgd_ix(void)454 static void mov_rgd_ix(void) { MOV_M(RGD,IX); }
mov_rgd_ixd(void)455 static void mov_rgd_ixd(void) { MOV_M(RGD,IXD); }
mov_in_rg(void)456 static void mov_in_rg(void) { MOV_M(IN,RG); }
mov_in_rgd(void)457 static void mov_in_rgd(void) { MOV_M(IN,RGD); }
mov_in_in(void)458 static void mov_in_in(void) { MOV_M(IN,IN); }
mov_in_ind(void)459 static void mov_in_ind(void) { MOV_M(IN,IND); }
mov_in_de(void)460 static void mov_in_de(void) { MOV_M(IN,DE); }
mov_in_ded(void)461 static void mov_in_ded(void) { MOV_M(IN,DED); }
mov_in_ix(void)462 static void mov_in_ix(void) { MOV_M(IN,IX); }
mov_in_ixd(void)463 static void mov_in_ixd(void) { MOV_M(IN,IXD); }
mov_ind_rg(void)464 static void mov_ind_rg(void) { MOV_M(IND,RG); }
mov_ind_rgd(void)465 static void mov_ind_rgd(void) { MOV_M(IND,RGD); }
mov_ind_in(void)466 static void mov_ind_in(void) { MOV_M(IND,IN); }
mov_ind_ind(void)467 static void mov_ind_ind(void) { MOV_M(IND,IND); }
mov_ind_de(void)468 static void mov_ind_de(void) { MOV_M(IND,DE); }
mov_ind_ded(void)469 static void mov_ind_ded(void) { MOV_M(IND,DED); }
mov_ind_ix(void)470 static void mov_ind_ix(void) { MOV_M(IND,IX); }
mov_ind_ixd(void)471 static void mov_ind_ixd(void) { MOV_M(IND,IXD); }
mov_de_rg(void)472 static void mov_de_rg(void) { MOV_M(DE,RG); }
mov_de_rgd(void)473 static void mov_de_rgd(void) { MOV_M(DE,RGD); }
mov_de_in(void)474 static void mov_de_in(void) { MOV_M(DE,IN); }
mov_de_ind(void)475 static void mov_de_ind(void) { MOV_M(DE,IND); }
mov_de_de(void)476 static void mov_de_de(void) { MOV_M(DE,DE); }
mov_de_ded(void)477 static void mov_de_ded(void) { MOV_M(DE,DED); }
mov_de_ix(void)478 static void mov_de_ix(void) { MOV_M(DE,IX); }
mov_de_ixd(void)479 static void mov_de_ixd(void) { MOV_M(DE,IXD); }
mov_ded_rg(void)480 static void mov_ded_rg(void) { MOV_M(DED,RG); }
mov_ded_rgd(void)481 static void mov_ded_rgd(void) { MOV_M(DED,RGD); }
mov_ded_in(void)482 static void mov_ded_in(void) { MOV_M(DED,IN); }
mov_ded_ind(void)483 static void mov_ded_ind(void) { MOV_M(DED,IND); }
mov_ded_de(void)484 static void mov_ded_de(void) { MOV_M(DED,DE); }
mov_ded_ded(void)485 static void mov_ded_ded(void) { MOV_M(DED,DED); }
mov_ded_ix(void)486 static void mov_ded_ix(void) { MOV_M(DED,IX); }
mov_ded_ixd(void)487 static void mov_ded_ixd(void) { MOV_M(DED,IXD); }
mov_ix_rg(void)488 static void mov_ix_rg(void) { MOV_M(IX,RG); }
mov_ix_rgd(void)489 static void mov_ix_rgd(void) { MOV_M(IX,RGD); }
mov_ix_in(void)490 static void mov_ix_in(void) { MOV_M(IX,IN); }
mov_ix_ind(void)491 static void mov_ix_ind(void) { MOV_M(IX,IND); }
mov_ix_de(void)492 static void mov_ix_de(void) { MOV_M(IX,DE); }
mov_ix_ded(void)493 static void mov_ix_ded(void) { MOV_M(IX,DED); }
mov_ix_ix(void)494 static void mov_ix_ix(void) { MOV_M(IX,IX); }
mov_ix_ixd(void)495 static void mov_ix_ixd(void) { MOV_M(IX,IXD); }
mov_ixd_rg(void)496 static void mov_ixd_rg(void) { MOV_M(IXD,RG); }
mov_ixd_rgd(void)497 static void mov_ixd_rgd(void) { MOV_M(IXD,RGD); }
mov_ixd_in(void)498 static void mov_ixd_in(void) { MOV_M(IXD,IN); }
mov_ixd_ind(void)499 static void mov_ixd_ind(void) { MOV_M(IXD,IND); }
mov_ixd_de(void)500 static void mov_ixd_de(void) { MOV_M(IXD,DE); }
mov_ixd_ded(void)501 static void mov_ixd_ded(void) { MOV_M(IXD,DED); }
mov_ixd_ix(void)502 static void mov_ixd_ix(void) { MOV_M(IXD,IX); }
mov_ixd_ixd(void)503 static void mov_ixd_ixd(void) { MOV_M(IXD,IXD); }
504
cmp_rg_rg(void)505 static void cmp_rg_rg(void) { CMP_R(RG,RG); }
cmp_rg_rgd(void)506 static void cmp_rg_rgd(void) { CMP_M(RG,RGD); }
cmp_rg_in(void)507 static void cmp_rg_in(void) { CMP_M(RG,IN); }
cmp_rg_ind(void)508 static void cmp_rg_ind(void) { CMP_M(RG,IND); }
cmp_rg_de(void)509 static void cmp_rg_de(void) { CMP_M(RG,DE); }
cmp_rg_ded(void)510 static void cmp_rg_ded(void) { CMP_M(RG,DED); }
cmp_rg_ix(void)511 static void cmp_rg_ix(void) { CMP_M(RG,IX); }
cmp_rg_ixd(void)512 static void cmp_rg_ixd(void) { CMP_M(RG,IXD); }
cmp_rgd_rg(void)513 static void cmp_rgd_rg(void) { CMP_M(RGD,RG); }
cmp_rgd_rgd(void)514 static void cmp_rgd_rgd(void) { CMP_M(RGD,RGD); }
cmp_rgd_in(void)515 static void cmp_rgd_in(void) { CMP_M(RGD,IN); }
cmp_rgd_ind(void)516 static void cmp_rgd_ind(void) { CMP_M(RGD,IND); }
cmp_rgd_de(void)517 static void cmp_rgd_de(void) { CMP_M(RGD,DE); }
cmp_rgd_ded(void)518 static void cmp_rgd_ded(void) { CMP_M(RGD,DED); }
cmp_rgd_ix(void)519 static void cmp_rgd_ix(void) { CMP_M(RGD,IX); }
cmp_rgd_ixd(void)520 static void cmp_rgd_ixd(void) { CMP_M(RGD,IXD); }
cmp_in_rg(void)521 static void cmp_in_rg(void) { CMP_M(IN,RG); }
cmp_in_rgd(void)522 static void cmp_in_rgd(void) { CMP_M(IN,RGD); }
cmp_in_in(void)523 static void cmp_in_in(void) { CMP_M(IN,IN); }
cmp_in_ind(void)524 static void cmp_in_ind(void) { CMP_M(IN,IND); }
cmp_in_de(void)525 static void cmp_in_de(void) { CMP_M(IN,DE); }
cmp_in_ded(void)526 static void cmp_in_ded(void) { CMP_M(IN,DED); }
cmp_in_ix(void)527 static void cmp_in_ix(void) { CMP_M(IN,IX); }
cmp_in_ixd(void)528 static void cmp_in_ixd(void) { CMP_M(IN,IXD); }
cmp_ind_rg(void)529 static void cmp_ind_rg(void) { CMP_M(IND,RG); }
cmp_ind_rgd(void)530 static void cmp_ind_rgd(void) { CMP_M(IND,RGD); }
cmp_ind_in(void)531 static void cmp_ind_in(void) { CMP_M(IND,IN); }
cmp_ind_ind(void)532 static void cmp_ind_ind(void) { CMP_M(IND,IND); }
cmp_ind_de(void)533 static void cmp_ind_de(void) { CMP_M(IND,DE); }
cmp_ind_ded(void)534 static void cmp_ind_ded(void) { CMP_M(IND,DED); }
cmp_ind_ix(void)535 static void cmp_ind_ix(void) { CMP_M(IND,IX); }
cmp_ind_ixd(void)536 static void cmp_ind_ixd(void) { CMP_M(IND,IXD); }
cmp_de_rg(void)537 static void cmp_de_rg(void) { CMP_M(DE,RG); }
cmp_de_rgd(void)538 static void cmp_de_rgd(void) { CMP_M(DE,RGD); }
cmp_de_in(void)539 static void cmp_de_in(void) { CMP_M(DE,IN); }
cmp_de_ind(void)540 static void cmp_de_ind(void) { CMP_M(DE,IND); }
cmp_de_de(void)541 static void cmp_de_de(void) { CMP_M(DE,DE); }
cmp_de_ded(void)542 static void cmp_de_ded(void) { CMP_M(DE,DED); }
cmp_de_ix(void)543 static void cmp_de_ix(void) { CMP_M(DE,IX); }
cmp_de_ixd(void)544 static void cmp_de_ixd(void) { CMP_M(DE,IXD); }
cmp_ded_rg(void)545 static void cmp_ded_rg(void) { CMP_M(DED,RG); }
cmp_ded_rgd(void)546 static void cmp_ded_rgd(void) { CMP_M(DED,RGD); }
cmp_ded_in(void)547 static void cmp_ded_in(void) { CMP_M(DED,IN); }
cmp_ded_ind(void)548 static void cmp_ded_ind(void) { CMP_M(DED,IND); }
cmp_ded_de(void)549 static void cmp_ded_de(void) { CMP_M(DED,DE); }
cmp_ded_ded(void)550 static void cmp_ded_ded(void) { CMP_M(DED,DED); }
cmp_ded_ix(void)551 static void cmp_ded_ix(void) { CMP_M(DED,IX); }
cmp_ded_ixd(void)552 static void cmp_ded_ixd(void) { CMP_M(DED,IXD); }
cmp_ix_rg(void)553 static void cmp_ix_rg(void) { CMP_M(IX,RG); }
cmp_ix_rgd(void)554 static void cmp_ix_rgd(void) { CMP_M(IX,RGD); }
cmp_ix_in(void)555 static void cmp_ix_in(void) { CMP_M(IX,IN); }
cmp_ix_ind(void)556 static void cmp_ix_ind(void) { CMP_M(IX,IND); }
cmp_ix_de(void)557 static void cmp_ix_de(void) { CMP_M(IX,DE); }
cmp_ix_ded(void)558 static void cmp_ix_ded(void) { CMP_M(IX,DED); }
cmp_ix_ix(void)559 static void cmp_ix_ix(void) { CMP_M(IX,IX); }
cmp_ix_ixd(void)560 static void cmp_ix_ixd(void) { CMP_M(IX,IXD); }
cmp_ixd_rg(void)561 static void cmp_ixd_rg(void) { CMP_M(IXD,RG); }
cmp_ixd_rgd(void)562 static void cmp_ixd_rgd(void) { CMP_M(IXD,RGD); }
cmp_ixd_in(void)563 static void cmp_ixd_in(void) { CMP_M(IXD,IN); }
cmp_ixd_ind(void)564 static void cmp_ixd_ind(void) { CMP_M(IXD,IND); }
cmp_ixd_de(void)565 static void cmp_ixd_de(void) { CMP_M(IXD,DE); }
cmp_ixd_ded(void)566 static void cmp_ixd_ded(void) { CMP_M(IXD,DED); }
cmp_ixd_ix(void)567 static void cmp_ixd_ix(void) { CMP_M(IXD,IX); }
cmp_ixd_ixd(void)568 static void cmp_ixd_ixd(void) { CMP_M(IXD,IXD); }
569
bit_rg_rg(void)570 static void bit_rg_rg(void) { BIT_R(RG,RG); }
bit_rg_rgd(void)571 static void bit_rg_rgd(void) { BIT_M(RG,RGD); }
bit_rg_in(void)572 static void bit_rg_in(void) { BIT_M(RG,IN); }
bit_rg_ind(void)573 static void bit_rg_ind(void) { BIT_M(RG,IND); }
bit_rg_de(void)574 static void bit_rg_de(void) { BIT_M(RG,DE); }
bit_rg_ded(void)575 static void bit_rg_ded(void) { BIT_M(RG,DED); }
bit_rg_ix(void)576