1 |
2 |
mihal |
// update all flags from alu8 for logic operations pv <= parity else ofl
|
2 |
|
|
ADCsA_A = 'h8F,// ADC A,A ; 8F
|
3 |
|
|
ADCsA_B = 'h88,// ADC A,B ; 88
|
4 |
|
|
ADCsA_C = 'h89,// ADC A,C ; 89
|
5 |
|
|
ADCsA_D = 'h8A,// ADC A,D ; 8A
|
6 |
|
|
ADCsA_E = 'h8B,// ADC A,E ; 8B
|
7 |
|
|
ADCsA_H = 'h8C,// ADC A,H ; 8C
|
8 |
|
|
ADCsA_L = 'h8D,// ADC A,L ; 8D
|
9 |
|
|
ADCsA_N = 'hCE,// ADC A,N ; CE XX
|
10 |
|
|
ADDsA_A = 'h87,// ADD A,A ; 87
|
11 |
|
|
ADDsA_B = 'h80,// ADD A,B ; 80
|
12 |
|
|
ADDsA_C = 'h81,// ADD A,C ; 81
|
13 |
|
|
ADDsA_D = 'h82,// ADD A,D ; 82
|
14 |
|
|
ADDsA_E = 'h83,// ADD A,E ; 83
|
15 |
|
|
ADDsA_H = 'h84,// ADD A,H ; 84
|
16 |
|
|
ADDsA_L = 'h85,// ADD A,L ; 85
|
17 |
|
|
ADDsA_N = 'hC6,// ADD A,N ; C6 XX
|
18 |
|
|
ANDsA = 'hA7,// AND A ; A7
|
19 |
|
|
ANDsB = 'hA0,// AND B ; A0
|
20 |
|
|
ANDsC = 'hA1,// AND C ; A1
|
21 |
|
|
ANDsD = 'hA2,// AND D ; A2
|
22 |
|
|
ANDsE = 'hA3,// AND E ; A3
|
23 |
|
|
ANDsH = 'hA4,// AND H ; A4
|
24 |
|
|
ANDsL = 'hA5,// AND L ; A5
|
25 |
|
|
ANDsN = 'hE6,// AND N ; E6 XX
|
26 |
|
|
CPsA = 'hBF,// CP A ; BF
|
27 |
|
|
CPsB = 'hB8,// CP B ; B8
|
28 |
|
|
CPsC = 'hB9,// CP C ; B9
|
29 |
|
|
CPsD = 'hBA,// CP D ; BA
|
30 |
|
|
CPsE = 'hBB,// CP E ; BB
|
31 |
|
|
CPsH = 'hBC,// CP H ; BC
|
32 |
|
|
CPsL = 'hBD,// CP L ; BD
|
33 |
|
|
CPsN = 'hFE,// CP N ; FE XX
|
34 |
|
|
ORsA = 'hB7,// OR A ; B7
|
35 |
|
|
ORsB = 'hB0,// OR B ; B0
|
36 |
|
|
ORsC = 'hB1,// OR C ; B1
|
37 |
|
|
ORsD = 'hB2,// OR D ; B2
|
38 |
|
|
ORsE = 'hB3,// OR E ; B3
|
39 |
|
|
ORsH = 'hB4,// OR H ; B4
|
40 |
|
|
ORsL = 'hB5,// OR L ; B5
|
41 |
|
|
ORsN = 'hF6,// OR N ; F6 XX
|
42 |
|
|
SBCsA = 'h9F,// SBC A ; 9F
|
43 |
|
|
SBCsA_N = 'hDE,// SBC A,N ; DE XX
|
44 |
|
|
SBCsB = 'h98,// SBC B ; 98
|
45 |
|
|
SBCsC = 'h99,// SBC C ; 99
|
46 |
|
|
SBCsD = 'h9A,// SBC D ; 9A
|
47 |
|
|
SBCsE = 'h9B,// SBC E ; 9B
|
48 |
|
|
SBCsH = 'h9C,// SBC H ; 9C
|
49 |
|
|
SBCsL = 'h9D,// SBC L ; 9D
|
50 |
|
|
SUBsA = 'h97,// SUB A ; 97
|
51 |
|
|
SUBsB = 'h90,// SUB B ; 90
|
52 |
|
|
SUBsC = 'h91,// SUB C ; 91
|
53 |
|
|
SUBsD = 'h92,// SUB D ; 92
|
54 |
|
|
SUBsE = 'h93,// SUB E ; 93
|
55 |
|
|
SUBsH = 'h94,// SUB H ; 94
|
56 |
|
|
SUBsL = 'h95,// SUB L ; 95
|
57 |
|
|
SUBsN = 'hD6,// SUB N ; D6 XX
|
58 |
|
|
XORsA = 'hAF,// XOR A ; AF
|
59 |
|
|
XORsB = 'hA8,// XOR B ; A8
|
60 |
|
|
XORsC = 'hA9,// XOR C ; A9
|
61 |
|
|
XORsD = 'hAA,// XOR D ; AA
|
62 |
|
|
XORsE = 'hAB,// XOR E ; AB
|
63 |
|
|
XORsH = 'hAC,// XOR H ; AC
|
64 |
|
|
XORsL = 'hAD,// XOR L ; AD
|
65 |
|
|
XORsN = 'hEE,// XOR N ; EE XX
|
66 |
|
|
|
67 |
|
|
// same as above but no cf change oh my god why?
|
68 |
|
|
DECsA = 'h3D,// DEC A ; 3D
|
69 |
|
|
DECsB = 'h05,// DEC B ; 05
|
70 |
|
|
DECsC = 'h0D,// DEC C ; 0D
|
71 |
|
|
DECsD = 'h15,// DEC D ; 15
|
72 |
|
|
DECsE = 'h1D,// DEC E ; 1D
|
73 |
|
|
DECsH = 'h25,// DEC H ; 25
|
74 |
|
|
DECsL = 'h2D,// DEC L ; 2D
|
75 |
|
|
INCsA = 'h3C,// INC A ; 3C
|
76 |
|
|
INCsB = 'h04,// INC B ; 04
|
77 |
|
|
INCsC = 'h0C,// INC C ; 0C
|
78 |
|
|
INCsD = 'h14,// INC D ; 14
|
79 |
|
|
INCsE = 'h1C,// INC E ; 1C
|
80 |
|
|
INCsH = 'h24,// INC H ; 24
|
81 |
|
|
INCsL = 'h2C,// INC L ; 2C
|
82 |
|
|
|
83 |
|
|
// update h n c (f5, f3) from alu16
|
84 |
|
|
ADDsHL_BC = 'h09,// ADD HL,BC ; 09
|
85 |
|
|
ADDsHL_DE = 'h19,// ADD HL,DE ; 19
|
86 |
|
|
ADDsHL_HL = 'h29,// ADD HL,HL ; 29
|
87 |
|
|
ADDsHL_SP = 'h39,// ADD HL,SP ; 39
|
88 |
|
|
INCsBC = 'h03,// INC BC ; 03
|
89 |
|
|
INCsDE = 'h13,// INC DE ; 13
|
90 |
|
|
INCsHL = 'h23,// INC HL ; 23
|
91 |
|
|
INCsSP = 'h33,// INC SP ; 33
|
92 |
|
|
// update all flags from alu16
|
93 |
|
|
ED_SBCsHL_REG = 6'b01__0010, // compair with {ir[7:6],ir[3:0]}
|
94 |
|
|
ED_ADCsHL_REG = 6'b01__1010, // compair with {ir[7:6],ir[3:0]}
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
// the shifts probably muck with all flags (some operations are
|
98 |
|
|
// guarenteed not to change certain flags )
|
99 |
|
|
// crap docs say sf and zf never change for these ops.
|
100 |
|
|
RLA = 'h17,// RLA ; 17
|
101 |
|
|
RLCA = 'h07,// RLCA ; 07
|
102 |
|
|
RRA = 'h1F,// RRA ; 1F
|
103 |
|
|
RRCA = 'h0F,// RRCA ; 0F
|
104 |
|
|
// sf and zf do change for theses
|
105 |
|
|
CB_RLC = 5'b00_000, // these must be compaired with ir[7:3]
|
106 |
|
|
CB_RRC = 5'b00_001, // these must be compaired with ir[7:3]
|
107 |
|
|
CB_RL = 5'b00_010, // these must be compaired with ir[7:3]
|
108 |
|
|
CB_RR = 5'b00_011, // these must be compaired with ir[7:3]
|
109 |
|
|
CB_SLA = 5'b00_100, // these must be compaired with ir[7:3]
|
110 |
|
|
CB_SRA = 5'b00_101, // these must be compaired with ir[7:3]
|
111 |
|
|
CB_SLL = 5'b00_110, // these must be compaired with ir[7:3]
|
112 |
|
|
CB_SRL = 5'b00_111, // these must be compaired with ir[7:3]
|
113 |
|
|
|
114 |
|
|
// pretty nomal stuff here
|
115 |
|
|
CB_BIT = 2'b01, // these must be compaired with ir[7:6]
|
116 |
|
|
// which alu? --
|
117 |
|
|
ED_NEG = 5'b01___100, // compair with {ir[7:6],ir[2:0]} all A<= -A
|
118 |
|
|
// rmw 8 types
|
119 |
|
|
INCs6HL7 = 'h34,// INC (HL) ; 34
|
120 |
|
|
DECs6HL7 = 'h35,// DEC (HL) ; 35
|
121 |
|
|
|
122 |
|
|
// ED Block Move messyness
|
123 |
|
|
// hf and nf <= 0 pnf<= BC==0
|
124 |
|
|
ED_LDI = 'hA0// LDI ; ED A0 (DE++) <= (HL++) , BC--
|
125 |
|
|
ED_LDD = 'hA8// LDD ; ED A8 (DE--) <= (HL--) , BC--
|
126 |
|
|
ED_LDIR = 'hB0// LDIR ; ED B0 (DE++) <= (HL++) , BC-- Repeat til BC==0
|
127 |
|
|
ED_LDDR = 'hB8// LDDR ; ED B8 (DE--) <= (HL--) , BC-- Repeat til BC==0
|
128 |
|
|
// only c not affected - nf<=1 ?
|
129 |
|
|
ED_CPI = 'hA1// CPI ; ED A1 A - (HL++) , BC--
|
130 |
|
|
ED_CPD = 'hA9// CPD ; ED A9 A - (HL--) , BC--
|
131 |
|
|
ED_CPIR = 'hB1// CPIR ; ED B1 A - (HL++) , BC-- repeat if(|B
|
132 |
|
|
ED_CPDR = 'hB9// CPDR ; ED B9 A - (HL--) , BC-- repeat if(|B
|
133 |
|
|
|
134 |
|
|
// all the ed i/o muck with all flags -- wonderful cf?
|
135 |
|
|
// use the aluoutput for the b-1 computation.
|
136 |
|
|
ED_INI = 'hA2// INI ; ED A2 (HL++) <- (Cio) , B--
|
137 |
|
|
ED_IND = 'hAA// IND ; ED AA (HL--) <- (Cio) , B--
|
138 |
|
|
ED_INIR = 'hB2// INIR ; ED B2 (HL++) <- (Cio) , B-- repeat if(|B)
|
139 |
|
|
ED_INDR = 'hBA// INDR ; ED BA (HL--) <- (Cio) , B-- repeat if(|B)
|
140 |
|
|
ED_OUTI = 'hA3// OUTI ; ED A3 (Cio) <-(HL++) , B--
|
141 |
|
|
ED_OUTD = 'hAB// OUTD ; ED AB (Cio) <-(HL--) , B--
|
142 |
|
|
ED_OTIR = 'hB3// OTIR ; ED B3 (Cio) <-(HL++) , B-- rpt if(|B)
|
143 |
|
|
ED_OTDR = 'hBB// OTDR ; ED BB (Cio) <-(HL--) , B-- rpt if(|B)
|
144 |
|
|
|
145 |
|
|
ED_INsREG_6C7 = 5'b01___000,// compair with {ir[7:6],ir[2:0]} really (BCio)
|
146 |
|
|
ED_OUTs6C7_REG = 5'b01___001,// compair with {ir[7:6],ir[2:0]}
|
147 |
|
|
|
148 |
|
|
|
149 |
|
|
|
150 |
|
|
// special problems
|
151 |
|
|
CCF = 'h3F,// CCF ; 3F // h<=c c<=1C N<=0 F3,F5?
|
152 |
|
|
CPL = 'h2F,// CPL ; 2F // H<=1 N<=1 F3,F5?
|
153 |
|
|
DAA = 'h27,// DAA ; 27 // H<=0???
|
154 |
|
|
SCF = 'h37,// SCF ; 37
|
155 |
|
|
ED_RRD = 'h67// RRD ; ED 67 nibble roates A HL
|
156 |
|
|
ED_RLD = 'h6F// RLD ; ED 6F nibble roates A HL
|
157 |
|
|
ED_LDsA_I = 'h57// LD A,I ; ED 57 move I to A
|
158 |
|
|
|
159 |
|
|
|
160 |
|
|
|
161 |
|
|
// no changes
|
162 |
|
|
CB_RES = 2'b10, // these must be compaired with ir[7:6]
|
163 |
|
|
CB_SET = 2'b11, // these must be compaired with ir[7:6]
|
164 |
|
|
DECsBC = 'h0B,// DEC BC ; 0B
|
165 |
|
|
DECsDE = 'h1B,// DEC DE ; 1B
|
166 |
|
|
DECsHL = 'h2B,// DEC HL ; 2B
|
167 |
|
|
DECsSP = 'h3B,// DEC SP ; 3B
|
168 |
|
|
DI = 'hF3,// DI ; F3
|
169 |
|
|
EI = 'hFB,// EI ; FB
|
170 |
|
|
EXX = 'hD9,// EXX ; D9
|
171 |
|
|
EXsAF_AFp = 'h08,// EX AF,AF' ; 08
|
172 |
|
|
EXsDE_HL = 'hEB,// EX DE,HL ; EB
|
173 |
|
|
HALT = 'h76,// HALT ; 76
|
174 |
|
|
LDsA_A = 'h7F,// LD A,A ; 7F
|
175 |
|
|
LDsA_B = 'h78,// LD A,B ; 78
|
176 |
|
|
LDsA_C = 'h79,// LD A,C ; 79
|
177 |
|
|
LDsA_D = 'h7A,// LD A,D ; 7A
|
178 |
|
|
LDsA_E = 'h7B,// LD A,E ; 7B
|
179 |
|
|
LDsA_H = 'h7C,// LD A,H ; 7C
|
180 |
|
|
LDsA_L = 'h7D,// LD A,L ; 7D
|
181 |
|
|
LDsA_N = 'h3E,// LD A,N ; 3E XX
|
182 |
|
|
LDsBC_nn = 'h01,// LD BC,NN ; 01 XX XX
|
183 |
|
|
LDsB_A = 'h47,// LD B,A ; 47
|
184 |
|
|
LDsB_B = 'h40,// LD B,B ; 40
|
185 |
|
|
LDsB_C = 'h41,// LD B,C ; 41
|
186 |
|
|
LDsB_D = 'h42,// LD B,D ; 42
|
187 |
|
|
LDsB_E = 'h43,// LD B,E ; 43
|
188 |
|
|
LDsB_H = 'h44,// LD B,H ; 44
|
189 |
|
|
LDsB_L = 'h45,// LD B,L ; 45
|
190 |
|
|
LDsB_N = 'h06,// LD B,N ; 06 XX
|
191 |
|
|
LDsC_A = 'h4F,// LD C,A ; 4F
|
192 |
|
|
LDsC_B = 'h48,// LD C,B ; 48
|
193 |
|
|
LDsC_C = 'h49,// LD C,C ; 49
|
194 |
|
|
LDsC_D = 'h4A,// LD C,D ; 4A
|
195 |
|
|
LDsC_E = 'h4B,// LD C,E ; 4B
|
196 |
|
|
LDsC_H = 'h4C,// LD C,H ; 4C
|
197 |
|
|
LDsC_L = 'h4D,// LD C,L ; 4D
|
198 |
|
|
LDsC_N = 'h0E,// LD C,N ; 0E XX
|
199 |
|
|
LDsDE_NN = 'h11,// LD DE,NN ; 11 XX XX
|
200 |
|
|
LDsD_A = 'h57,// LD D,A ; 57
|
201 |
|
|
LDsD_B = 'h50,// LD D,B ; 50
|
202 |
|
|
LDsD_C = 'h51,// LD D,C ; 51
|
203 |
|
|
LDsD_D = 'h52,// LD D,D ; 52
|
204 |
|
|
LDsD_E = 'h53,// LD D,E ; 53
|
205 |
|
|
LDsD_H = 'h54,// LD D,H ; 54
|
206 |
|
|
LDsD_L = 'h55,// LD D,L ; 55
|
207 |
|
|
LDsD_N = 'h16,// LD D,N ; 16 XX
|
208 |
|
|
LDsE_A = 'h5F,// LD E,A ; 5F
|
209 |
|
|
LDsE_B = 'h58,// LD E,B ; 58
|
210 |
|
|
LDsE_C = 'h59,// LD E,C ; 59
|
211 |
|
|
LDsE_D = 'h5A,// LD E,D ; 5A
|
212 |
|
|
LDsE_E = 'h5B,// LD E,E ; 5B
|
213 |
|
|
LDsE_H = 'h5C,// LD E,H ; 5C
|
214 |
|
|
LDsE_L = 'h5D,// LD E,L ; 5D
|
215 |
|
|
LDsE_N = 'h1E,// LD E,N ; 1E XX
|
216 |
|
|
LDsHL_NN = 'h21,// LD HL,NN ; 21 XX XX
|
217 |
|
|
LDsH_A = 'h67,// LD H,A ; 67
|
218 |
|
|
LDsH_B = 'h60,// LD H,B ; 60
|
219 |
|
|
LDsH_C = 'h61,// LD H,C ; 61
|
220 |
|
|
LDsH_D = 'h62,// LD H,D ; 62
|
221 |
|
|
LDsH_E = 'h63,// LD H,E ; 63
|
222 |
|
|
LDsH_H = 'h64,// LD H,H ; 64
|
223 |
|
|
LDsH_L = 'h65,// LD H,L ; 65
|
224 |
|
|
LDsH_N = 'h26,// LD H,N ; 26 XX
|
225 |
|
|
LDsL_A = 'h6F,// LD L,A ; 6F
|
226 |
|
|
LDsL_B = 'h68,// LD L,B ; 68
|
227 |
|
|
LDsL_C = 'h69,// LD L,C ; 69
|
228 |
|
|
LDsL_D = 'h6A,// LD L,D ; 6A
|
229 |
|
|
LDsL_E = 'h6B,// LD L,E ; 6B
|
230 |
|
|
LDsL_H = 'h6C,// LD L,H ; 6C
|
231 |
|
|
LDsL_L = 'h6D,// LD L,L ; 6D
|
232 |
|
|
LDsL_N = 'h2E,// LD L,N ; 2E XX
|
233 |
|
|
LDsSP_HL = 'hF9,// LD SP,HL ; F9
|
234 |
|
|
LDsSP_NN = 'h31,// LD SP,NN ; 31 XX XX
|
235 |
|
|
NOP = 'h00,// NOP ; 00
|
236 |
|
|
ED_IMs0 = 'h46// IM 0 ; ED 46 set IM0
|
237 |
|
|
ED_LDsI_A = 'h47// LD I,A ; ED 47 move a to I
|
238 |
|
|
ED_IMs1 = 'h56// IM 1 ; ED 56 set IM1
|
239 |
|
|
ED_IMs2 = 'h5E// IM 2 ; ED 5E set IM2
|
240 |
|
|
// load 8 types
|
241 |
|
|
LDsA_6BC7 = 'h0A,// LD A,(BC) ; 0A
|
242 |
|
|
LDsA_6DE7 = 'h1A,// LD A,(DE) ; 1A
|
243 |
|
|
LDsB_6HL7 = 'h46,// LD B,(HL) ; 46
|
244 |
|
|
LDsD_6HL7 = 'h56,// LD D,(HL) ; 56
|
245 |
|
|
LDsH_6HL7 = 'h66,// LD H,(HL) ; 66
|
246 |
|
|
ADDsA_6HL7 = 'h86,// ADD A,(HL) ; 86
|
247 |
|
|
SUBs6HL7 = 'h96,// SUB (HL) ; 96
|
248 |
|
|
ANDs6HL7 = 'hA6,// AND (HL) ; A6
|
249 |
|
|
ORs6HL7 = 'hB6,// OR (HL) ; B6
|
250 |
|
|
LDsC_6HL7 = 'h4E,// LD C,(HL) ; 4E
|
251 |
|
|
LDsE_6HL7 = 'h5E,// LD E,(HL) ; 5E
|
252 |
|
|
LDsL_6HL7 = 'h6E,// LD L,(HL) ; 6E
|
253 |
|
|
LDsA_6HL7 = 'h7E,// LD A,(HL) ; 7E
|
254 |
|
|
ADCsA_6HL7 = 'h8E,// ADC A,(HL) ; 8E
|
255 |
|
|
SBCs6HL7 = 'h9E,// SBC (HL) ; 9E
|
256 |
|
|
XORs6HL7 = 'hAE,// XOR (HL) ; AE
|
257 |
|
|
CPs6HL7 = 'hBE,// CP (HL) ; BE
|
258 |
|
|
LDsA_6NN7 = 'h3A,// LD A,(NN) ; 3A XX XX
|
259 |
|
|
CB_MEM & CB_BIT = 2'b01, // (HL) these must be compaired with ir[7:6]
|
260 |
|
|
// load 16 types
|
261 |
|
|
LDsHL_6NN7 = 'h2A,// LD HL,(NN) ; 2A XX XX
|
262 |
|
|
POPsAF = 'hF1,// POP AF ; F1 AF<- (SP++ ++)
|
263 |
|
|
POPsBC = 'hC1,// POP BC ; C1 BC<- (SP++ ++)
|
264 |
|
|
POPsDE = 'hD1,// POP DE ; D1 DE<- (SP++ ++)
|
265 |
|
|
POPsHL = 'hE1,// POP HL ; E1 HL<- (SP++ ++)
|
266 |
|
|
ED_LDsREG_6NN7 = 6'b01__1011, // compair with {ir[7:6],ir[3:0]} REG = BC,DE,HL,SP
|
267 |
|
|
// store 8 types
|
268 |
|
|
LDs6HL7_N = 'h36,// LD (HL),N ; 36 XX
|
269 |
|
|
LDs6BC7_A = 'h02,// LD (BC),A ; 02
|
270 |
|
|
LDs6DE7_A = 'h12,// LD (DE),A ; 12
|
271 |
|
|
LDs6HL7_A = 'h77,// LD (HL),A ; 77
|
272 |
|
|
LDs6HL7_B = 'h70,// LD (HL),B ; 70
|
273 |
|
|
LDs6HL7_C = 'h71,// LD (HL),C ; 71
|
274 |
|
|
LDs6HL7_D = 'h72,// LD (HL),D ; 72
|
275 |
|
|
LDs6HL7_E = 'h73,// LD (HL),E ; 73
|
276 |
|
|
LDs6HL7_H = 'h74,// LD (HL),H ; 74
|
277 |
|
|
LDs6HL7_L = 'h75,// LD (HL),L ; 75
|
278 |
|
|
LDs6NN7_A = 'h32,// LD (NN),A ; 32 XX XX
|
279 |
|
|
// store 16 types
|
280 |
|
|
PUSHsAF = 'hF5,// PUSH AF ; F5 (-- --SP) <- AF
|
281 |
|
|
PUSHsBC = 'hC5,// PUSH BC ; C5 (-- --SP) <- BC
|
282 |
|
|
PUSHsDE = 'hD5,// PUSH DE ; D5 (-- --SP) <- DE
|
283 |
|
|
PUSHsHL = 'hE5,// PUSH HL ; E5 (-- --SP) <- HL
|
284 |
|
|
LDs6NN7_HL = 'h22,// LD (NN),HL ; 22 XX XX
|
285 |
|
|
ED_LDs6NN7_REG = 6'b01__0011,// XX XX compair with {ir[7:6],ir[3:0]} REG = BC,DE,HL,SP
|
286 |
|
|
|
287 |
|
|
|
288 |
|
|
|
289 |
|
|
|
290 |
|
|
// rmw 16 types
|
291 |
|
|
EXs6SP7_HL = 'hE3,// EX (SP),HL ; E3
|
292 |
|
|
|
293 |
|
|
// Jumps only trick here is that next inst is not valid - ignore it
|
294 |
|
|
JRs$t2 = 'h18,// JR $+2 ; 18 XX
|
295 |
|
|
JRsC_$t2 = 'h38,// JR C,$+2 ; 38
|
296 |
|
|
JRsNC_$t2 = 'h30,// JR NC,$+2 ; 30
|
297 |
|
|
JRsNZ_$t2 = 'h20,// JR NZ,$+2 ; 20
|
298 |
|
|
JRsZ_$t2 = 'h28,// JR Z,$+2 ; 28
|
299 |
|
|
DJNZs$t2 = 'h10,// DJNZ $+2 ; 10 XX XX
|
300 |
|
|
JPs = 'hC3,// JP $+3 ; C3 XX XX
|
301 |
|
|
JPsC = 'hDA,// JP C,$+3 ; DA XX XX
|
302 |
|
|
JPsHL = 'hE9,// JP HL ; E9 // documented as indirect IS NOT
|
303 |
|
|
JPsM = 'hFA,// JP M,$+3 ; FA XX XX
|
304 |
|
|
JPsNC = 'hD2,// JP NC,$+3 ; D2 XX XX
|
305 |
|
|
JPsNZ = 'hC2,// JP NZ,$+3 ; C2 XX XX
|
306 |
|
|
JPsPE = 'hEA,// JP PE,$+3 ; EA XX XX
|
307 |
|
|
JPsPO = 'hE2,// JP PO,$+3 ; E2 XX XX
|
308 |
|
|
JPsP = 'hF2,// JP P,$+3 ; F2 XX XX
|
309 |
|
|
JPsZ = 'hCA,// JP Z,$+3 ; CA XX XX
|
310 |
|
|
RSTs0 = 'hC7,// RST 0 ; C7
|
311 |
|
|
RSTs8H = 'hCF,// RST 8H ; CF
|
312 |
|
|
RSTs10H = 'hD7,// RST 10H ; D7
|
313 |
|
|
RSTs18H = 'hDF,// RST 18H ; DF
|
314 |
|
|
RSTs20H = 'hE7,// RST 20H ; E7
|
315 |
|
|
RSTs28H = 'hEF,// RST 28H ; EF
|
316 |
|
|
RSTs30H = 'hF7,// RST 30H ; F7
|
317 |
|
|
RSTs38H = 'hFF,// RST 38H ; FF
|
318 |
|
|
|
319 |
|
|
|
320 |
|
|
// calls
|
321 |
|
|
CALLsC_NN = 'hDC,// CALL C,NN ; DC XX XX (-- --SP) <- PC, PC<-NN
|
322 |
|
|
CALLsM_NN = 'hFC,// CALL M,NN ; FC XX XX (-- --SP) <- PC, PC<-NN
|
323 |
|
|
CALLsNC_NN = 'hD4,// CALL NC,NN ; D4 XX XX (-- --SP) <- PC, PC<-NN
|
324 |
|
|
CALLsNN = 'hCD,// CALL NN ; CD XX XX (-- --SP) <- PC, PC<-NN
|
325 |
|
|
CALLsNZ_NN = 'hC4,// CALL NZ,NN ; C4 XX XX (-- --SP) <- PC, PC<-NN
|
326 |
|
|
CALLsPE_NN = 'hEC,// CALL PE,NN ; EC XX XX (-- --SP) <- PC, PC<-NN
|
327 |
|
|
CALLsPO_NN = 'hE4,// CALL PO,NN ; E4 XX XX (-- --SP) <- PC, PC<-NN
|
328 |
|
|
CALLsP_NN = 'hF4,// CALL P,NN ; F4 XX XX (-- --SP) <- PC, PC<-NN
|
329 |
|
|
CALLsZ_NN = 'hCC,// CALL Z,NN ; CC XX XX (-- --SP) <- PC, PC<-NN
|
330 |
|
|
|
331 |
|
|
//returns
|
332 |
|
|
RET = 'hC9,// RET ; C9 PC <- (SP++ ++)
|
333 |
|
|
RETsC = 'hD8,// RET C ; D8 PC <- (SP++ ++)
|
334 |
|
|
RETsM = 'hF8,// RET M ; F8 PC <- (SP++ ++)
|
335 |
|
|
RETsNC = 'hD0,// RET NC ; D0 PC <- (SP++ ++)
|
336 |
|
|
RETsNZ = 'hC0,// RET NZ ; C0 PC <- (SP++ ++)
|
337 |
|
|
RETsP = 'hF0,// RET P ; F0 PC <- (SP++ ++)
|
338 |
|
|
RETsPE = 'hE8,// RET PE ; E8 PC <- (SP++ ++)
|
339 |
|
|
RETsPO = 'hE0,// RET PO ; E0 PC <- (SP++ ++)
|
340 |
|
|
RETsZ = 'hC8,// RET Z ; C8 PC <- (SP++ ++)
|
341 |
|
|
ED_RETN = 5'b01___101; // compair with {ir[7:6],ir[2:0]} and !reti
|
342 |
|
|
|
343 |
|
|
|
344 |
|
|
//io input no flag chnges for this one
|
345 |
|
|
INsA_6N7 = 'hDB,// IN A,(N) ; DB XX A<-(Nio)//silly
|
346 |
|
|
|
347 |
|
|
//io output
|
348 |
|
|
OUTs6N7_A = 'hD3,// OUT (N),A ; D3 XX A-> (Nio)
|
349 |
|
|
|
350 |
|
|
|
351 |
|
|
|
352 |
|
|
|
353 |
|
|
|
354 |
|
|
|
355 |
|
|
CBgrp = 'hCB,// CBgrp is rotates and bit munging below
|
356 |
|
|
EDgrp = 'hED,// EDgrp ED
|
357 |
|
|
FDgrp = 'hFD,// FDgrp FD
|
358 |
|
|
DDgrp = 'hDD,// DDgrp
|