1 |
2 |
bporcella |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// //
|
3 |
|
|
// file name: work_updr.v //
|
4 |
|
|
// description: opcode parameters for z80 //
|
5 |
|
|
// project: wb_z80 //
|
6 |
|
|
// //
|
7 |
|
|
// Author: B.J. Porcella //
|
8 |
|
|
// e-mail: bporcella@sbcglobal.net //
|
9 |
|
|
// //
|
10 |
|
|
// //
|
11 |
|
|
// //
|
12 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
13 |
|
|
// //
|
14 |
|
|
// Copyright (C) 2000-2002 B.J. Porcella //
|
15 |
|
|
// Real Time Solutions //
|
16 |
|
|
// //
|
17 |
|
|
// //
|
18 |
|
|
// This source file may be used and distributed without //
|
19 |
|
|
// restriction provided that this copyright statement is not //
|
20 |
|
|
// removed from the file and that any derivative work contains //
|
21 |
|
|
// the original copyright notice and the associated disclaimer. //
|
22 |
|
|
// //
|
23 |
|
|
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY //
|
24 |
|
|
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED //
|
25 |
|
|
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS //
|
26 |
|
|
// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR //
|
27 |
|
|
// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, //
|
28 |
|
|
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES //
|
29 |
|
|
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE //
|
30 |
|
|
// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR //
|
31 |
|
|
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF //
|
32 |
|
|
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT //
|
33 |
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT //
|
34 |
|
|
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //
|
35 |
|
|
// POSSIBILITY OF SUCH DAMAGE. //
|
36 |
|
|
// //
|
37 |
|
|
//-------1---------2---------3--------Comments on file -------------7---------8---------9--------0
|
38 |
|
|
//
|
39 |
|
|
// not really a source file -- more of a work file -- as named.
|
40 |
|
|
// but I probably will keep it around.
|
41 |
|
|
//
|
42 |
|
|
// dice up all defined instructions for updating each register.
|
43 |
|
|
//
|
44 |
|
|
//
|
45 |
|
|
//
|
46 |
|
|
//-------1---------2---------3--------CVS Log -----------------------7---------8---------9--------0
|
47 |
|
|
//
|
48 |
|
|
// $Id: work_updreg.v,v 1.1.1.1 2004-04-13 23:48:00 bporcella Exp $
|
49 |
|
|
//
|
50 |
|
|
// $Date: 2004-04-13 23:48:00 $
|
51 |
|
|
// $Revision: 1.1.1.1 $
|
52 |
|
|
// $Author: bporcella $
|
53 |
|
|
// $Locker: $
|
54 |
|
|
// $State: Exp $
|
55 |
|
|
//
|
56 |
|
|
// Change History:
|
57 |
|
|
// $Log: not supported by cvs2svn $
|
58 |
|
|
//
|
59 |
|
|
//
|
60 |
|
|
//-------1---------2---------3--------Comments on file -------------7---------8---------9--------0
|
61 |
|
|
//
|
62 |
|
|
NOP = 10'h00,// NOP ; 00
|
63 |
|
|
|
64 |
|
|
// update ar
|
65 |
|
|
RLCA = 10'h07,// RLCA ; 07
|
66 |
|
|
EXsAF_AFp = 10'h08,// EX AF,AF' ; 08
|
67 |
|
|
LDsA_6BC7 = 10'h0A,// LD A,(BC) ; 0A
|
68 |
|
|
RRCA = 10'h0F,// RRCA ; 0F
|
69 |
|
|
RLA = 10'h17,// RLA ; 17
|
70 |
|
|
LDsA_6DE7 = 10'h1A,// LD A,(DE) ; 1A
|
71 |
|
|
RRA = 10'h1F,// RRA ; 1F
|
72 |
|
|
DAA = 10'h27,// DAA ; 27
|
73 |
|
|
CPL = 10'h2F,// CPL ; 2F a <= ~a
|
74 |
|
|
LDsA_6NN7 = 10'h3A,// LD A,(NN) ; 3A XX XX
|
75 |
|
|
INCsA = 10'h3C,// INC A ; 3C
|
76 |
|
|
DECsA = 10'h3D,// DEC A ; 3D
|
77 |
|
|
LDsA_N = 10'h3E,// LD A,N ; 3E XX
|
78 |
|
|
LDsA_B = 10'h78,// LD A,B ; 78
|
79 |
|
|
LDsA_C = 10'h79,// LD A,C ; 79
|
80 |
|
|
LDsA_D = 10'h7A,// LD A,D ; 7A
|
81 |
|
|
LDsA_E = 10'h7B,// LD A,E ; 7B
|
82 |
|
|
LDsA_H = 10'h7C,// LD A,H ; 7C
|
83 |
|
|
LDsA_L = 10'h7D,// LD A,L ; 7D
|
84 |
|
|
LDsA_6HL7 = 10'h7E,// LD A,(HL) ; 7E
|
85 |
|
|
LDsA_A = 10'h7F,// LD A,A ; 7F
|
86 |
|
|
ADDsA_B = 10'h80,// ADD A,B ; 80
|
87 |
|
|
ADDsA_C = 10'h81,// ADD A,C ; 81
|
88 |
|
|
ADDsA_D = 10'h82,// ADD A,D ; 82
|
89 |
|
|
ADDsA_E = 10'h83,// ADD A,E ; 83
|
90 |
|
|
ADDsA_H = 10'h84,// ADD A,H ; 84
|
91 |
|
|
ADDsA_L = 10'h85,// ADD A,L ; 85
|
92 |
|
|
ADDsA_6HL7 = 10'h86,// ADD A,(HL) ; 86
|
93 |
|
|
ADDsA_A = 10'h87,// ADD A,A ; 87
|
94 |
|
|
ADCsA_B = 10'h88,// ADC A,B ; 88
|
95 |
|
|
ADCsA_C = 10'h89,// ADC A,C ; 89
|
96 |
|
|
ADCsA_D = 10'h8A,// ADC A,D ; 8A
|
97 |
|
|
ADCsA_E = 10'h8B,// ADC A,E ; 8B
|
98 |
|
|
ADCsA_H = 10'h8C,// ADC A,H ; 8C
|
99 |
|
|
ADCsA_L = 10'h8D,// ADC A,L ; 8D
|
100 |
|
|
ADCsA_6HL7 = 10'h8E,// ADC A,(HL) ; 8E
|
101 |
|
|
ADCsA_A = 10'h8F,// ADC A,A ; 8F
|
102 |
|
|
SUBsB = 10'h90,// SUB B ; 90
|
103 |
|
|
SUBsC = 10'h91,// SUB C ; 91
|
104 |
|
|
SUBsD = 10'h92,// SUB D ; 92
|
105 |
|
|
SUBsE = 10'h93,// SUB E ; 93
|
106 |
|
|
SUBsH = 10'h94,// SUB H ; 94
|
107 |
|
|
SUBsL = 10'h95,// SUB L ; 95
|
108 |
|
|
SUBs6HL7 = 10'h96,// SUB (HL) ; 96
|
109 |
|
|
SUBsA = 10'h97,// SUB A ; 97
|
110 |
|
|
SBCsB = 10'h98,// SBC B ; 98
|
111 |
|
|
SBCsC = 10'h99,// SBC C ; 99
|
112 |
|
|
SBCsD = 10'h9A,// SBC D ; 9A
|
113 |
|
|
SBCsE = 10'h9B,// SBC E ; 9B
|
114 |
|
|
SBCsH = 10'h9C,// SBC H ; 9C
|
115 |
|
|
SBCsL = 10'h9D,// SBC L ; 9D
|
116 |
|
|
SBCs6HL7 = 10'h9E,// SBC (HL) ; 9E
|
117 |
|
|
SBCsA = 10'h9F,// SBC A ; 9F
|
118 |
|
|
ANDsB = 10'hA0,// AND B ; A0
|
119 |
|
|
ANDsC = 10'hA1,// AND C ; A1
|
120 |
|
|
ANDsD = 10'hA2,// AND D ; A2
|
121 |
|
|
ANDsE = 10'hA3,// AND E ; A3
|
122 |
|
|
ANDsH = 10'hA4,// AND H ; A4
|
123 |
|
|
ANDsL = 10'hA5,// AND L ; A5
|
124 |
|
|
ANDs6HL7 = 10'hA6,// AND (HL) ; A6
|
125 |
|
|
ANDsA = 10'hA7,// AND A ; A7
|
126 |
|
|
XORsB = 10'hA8,// XOR B ; A8
|
127 |
|
|
XORsC = 10'hA9,// XOR C ; A9
|
128 |
|
|
XORsD = 10'hAA,// XOR D ; AA
|
129 |
|
|
XORsE = 10'hAB,// XOR E ; AB
|
130 |
|
|
XORsH = 10'hAC,// XOR H ; AC
|
131 |
|
|
XORsL = 10'hAD,// XOR L ; AD
|
132 |
|
|
XORs6HL7 = 10'hAE,// XOR (HL) ; AE
|
133 |
|
|
XORsA = 10'hAF,// XOR A ; AF
|
134 |
|
|
ORsB = 10'hB0,// OR B ; B0
|
135 |
|
|
ORsC = 10'hB1,// OR C ; B1
|
136 |
|
|
ORsD = 10'hB2,// OR D ; B2
|
137 |
|
|
ORsE = 10'hB3,// OR E ; B3
|
138 |
|
|
ORsH = 10'hB4,// OR H ; B4
|
139 |
|
|
ORsL = 10'hB5,// OR L ; B5
|
140 |
|
|
ORs6HL7 = 10'hB6,// OR (HL) ; B6
|
141 |
|
|
ORsA = 10'hB7,// OR A ; B7
|
142 |
|
|
ADDsA_N = 10'hC6,// ADD A,N ; C6 XX
|
143 |
|
|
ADCsA_N = 10'hCE,// ADC A,N ; CE XX
|
144 |
|
|
SUBsN = 10'hD6,// SUB N ; D6 XX
|
145 |
|
|
EXX = 10'hD9,// EXX ; D9
|
146 |
|
|
INsA_6N7 = 10'hDB,// IN A,(N) ; DB XX
|
147 |
|
|
SBCsA_N = 10'hDE,// SBC A,N ; DE XX
|
148 |
|
|
ANDsN = 10'hE6,// AND N ; E6 XX
|
149 |
|
|
XORsN = 10'hEE,// XOR N ; EE XX
|
150 |
|
|
POPsAF = 10'hF1,// POP AF ; F1
|
151 |
|
|
ORsN = 10'hF6,// OR N ; F6 XX
|
152 |
|
|
ED_NEG = 5'b01___100, // compair with {ir[7:6],ir[2:0]} all A<= -A
|
153 |
|
|
|
154 |
|
|
// update br
|
155 |
|
|
LDsBC_nn = 10'h01,// LD BC,NN ; 01 XX XX
|
156 |
|
|
INCsBC = 10'h03,// INC BC ; 03
|
157 |
|
|
INCsB = 10'h04,// INC B ; 04
|
158 |
|
|
DECsB = 10'h05,// DEC B ; 05
|
159 |
|
|
LDsB_N = 10'h06,// LD B,N ; 06 XX
|
160 |
|
|
DECsBC = 10'h0B,// DEC BC ; 0B
|
161 |
|
|
DJNZs$t2 = 10'h10,// DJNZ $+2 ; 10 XX //pre dec br
|
162 |
|
|
LDsB_B = 10'h40,// LD B,B ; 40
|
163 |
|
|
LDsB_C = 10'h41,// LD B,C ; 41
|
164 |
|
|
LDsB_D = 10'h42,// LD B,D ; 42
|
165 |
|
|
LDsB_E = 10'h43,// LD B,E ; 43
|
166 |
|
|
LDsB_H = 10'h44,// LD B,H ; 44
|
167 |
|
|
LDsB_L = 10'h45,// LD B,L ; 45
|
168 |
|
|
LDsB_6HL7 = 10'h46,// LD B,(HL) ; 46
|
169 |
|
|
LDsB_A = 10'h47,// LD B,A ; 47
|
170 |
|
|
POPsBC = 10'hC1,// POP BC ; C1
|
171 |
|
|
EXX = 10'hD9,// EXX ; D9
|
172 |
|
|
// update cr
|
173 |
|
|
LDsBC_nn = 10'h01,// LD BC,NN ; 01 XX XX
|
174 |
|
|
INCsBC = 10'h03,// INC BC ; 03
|
175 |
|
|
DECsBC = 10'h0B,// DEC BC ; 0B
|
176 |
|
|
INCsC = 10'h0C,// INC C ; 0C
|
177 |
|
|
DECsC = 10'h0D,// DEC C ; 0D
|
178 |
|
|
LDsC_N = 10'h0E,// LD C,N ; 0E XX
|
179 |
|
|
LDsC_B = 10'h48,// LD C,B ; 48
|
180 |
|
|
LDsC_C = 10'h49,// LD C,C ; 49
|
181 |
|
|
LDsC_D = 10'h4A,// LD C,D ; 4A
|
182 |
|
|
LDsC_E = 10'h4B,// LD C,E ; 4B
|
183 |
|
|
LDsC_H = 10'h4C,// LD C,H ; 4C
|
184 |
|
|
LDsC_L = 10'h4D,// LD C,L ; 4D
|
185 |
|
|
LDsC_6HL7 = 10'h4E,// LD C,(HL) ; 4E
|
186 |
|
|
LDsC_A = 10'h4F,// LD C,A ; 4F
|
187 |
|
|
POPsBC = 10'hC1,// POP BC ; C1
|
188 |
|
|
EXX = 10'hD9,// EXX ; D9
|
189 |
|
|
// update dr
|
190 |
|
|
LDsDE_NN = 10'h11,// LD DE,NN ; 11 XX XX
|
191 |
|
|
INCsDE = 10'h13,// INC DE ; 13
|
192 |
|
|
INCsD = 10'h14,// INC D ; 14
|
193 |
|
|
DECsD = 10'h15,// DEC D ; 15
|
194 |
|
|
LDsD_N = 10'h16,// LD D,N ; 16 XX
|
195 |
|
|
DECsDE = 10'h1B,// DEC DE ; 1B
|
196 |
|
|
LDsD_B = 10'h50,// LD D,B ; 50
|
197 |
|
|
LDsD_C = 10'h51,// LD D,C ; 51
|
198 |
|
|
LDsD_D = 10'h52,// LD D,D ; 52
|
199 |
|
|
LDsD_E = 10'h53,// LD D,E ; 53
|
200 |
|
|
LDsD_H = 10'h54,// LD D,H ; 54
|
201 |
|
|
LDsD_L = 10'h55,// LD D,L ; 55
|
202 |
|
|
LDsD_6HL7 = 10'h56,// LD D,(HL) ; 56
|
203 |
|
|
LDsD_A = 10'h57,// LD D,A ; 57
|
204 |
|
|
POPsDE = 10'hD1,// POP DE ; D1
|
205 |
|
|
EXX = 10'hD9,// EXX ; D9
|
206 |
|
|
EXsDE_HL = 10'hEB,// EX DE,HL ; EB
|
207 |
|
|
// update er
|
208 |
|
|
LDsDE_NN = 10'h11,// LD DE,NN ; 11 XX XX
|
209 |
|
|
INCsDE = 10'h13,// INC DE ; 13
|
210 |
|
|
DECsDE = 10'h1B,// DEC DE ; 1B
|
211 |
|
|
INCsE = 10'h1C,// INC E ; 1C
|
212 |
|
|
DECsE = 10'h1D,// DEC E ; 1D
|
213 |
|
|
LDsE_N = 10'h1E,// LD E,N ; 1E XX
|
214 |
|
|
LDsE_B = 10'h58,// LD E,B ; 58
|
215 |
|
|
LDsE_C = 10'h59,// LD E,C ; 59
|
216 |
|
|
LDsE_D = 10'h5A,// LD E,D ; 5A
|
217 |
|
|
LDsE_E = 10'h5B,// LD E,E ; 5B
|
218 |
|
|
LDsE_H = 10'h5C,// LD E,H ; 5C
|
219 |
|
|
LDsE_L = 10'h5D,// LD E,L ; 5D
|
220 |
|
|
LDsE_6HL7 = 10'h5E,// LD E,(HL) ; 5E
|
221 |
|
|
LDsE_A = 10'h5F,// LD E,A ; 5F
|
222 |
|
|
POPsDE = 10'hD1,// POP DE ; D1
|
223 |
|
|
EXX = 10'hD9,// EXX ; D9
|
224 |
|
|
EXsDE_HL = 10'hEB,// EX DE,HL ; EB
|
225 |
|
|
// update hr
|
226 |
|
|
ADDsHL_BC = 10'h09,// ADD HL,BC ; 09
|
227 |
|
|
ADDsHL_DE = 10'h19,// ADD HL,DE ; 19
|
228 |
|
|
LDsHL_NN = 10'h21,// LD HL,NN ; 21 XX XX
|
229 |
|
|
INCsHL = 10'h23,// INC HL ; 23
|
230 |
|
|
INCsH = 10'h24,// INC H ; 24
|
231 |
|
|
DECsH = 10'h25,// DEC H ; 25
|
232 |
|
|
LDsH_N = 10'h26,// LD H,N ; 26 XX
|
233 |
|
|
ADDsHL_HL = 10'h29,// ADD HL,HL ; 29
|
234 |
|
|
LDsHL_6NN7 = 10'h2A,// LD HL,(NN) ; 2A XX XX
|
235 |
|
|
DECsHL = 10'h2B,// DEC HL ; 2B
|
236 |
|
|
ADDsHL_SP = 10'h39,// ADD HL,SP ; 39
|
237 |
|
|
LDsH_B = 10'h60,// LD H,B ; 60
|
238 |
|
|
LDsH_C = 10'h61,// LD H,C ; 61
|
239 |
|
|
LDsH_D = 10'h62,// LD H,D ; 62
|
240 |
|
|
LDsH_E = 10'h63,// LD H,E ; 63
|
241 |
|
|
LDsH_H = 10'h64,// LD H,H ; 64
|
242 |
|
|
LDsH_L = 10'h65,// LD H,L ; 65
|
243 |
|
|
LDsH_6HL7 = 10'h66,// LD H,(HL) ; 66
|
244 |
|
|
LDsH_A = 10'h67,// LD H,A ; 67
|
245 |
|
|
EXX = 10'hD9,// EXX ; D9
|
246 |
|
|
POPsHL = 10'hE1,// POP HL ; E1
|
247 |
|
|
EXs6SP7_HL = 10'hE3,// EX (SP),HL ; E3
|
248 |
|
|
EXsDE_HL = 10'hEB,// EX DE,HL ; EB
|
249 |
|
|
// update lr
|
250 |
|
|
ADDsHL_BC = 10'h09,// ADD HL,BC ; 09
|
251 |
|
|
ADDsHL_DE = 10'h19,// ADD HL,DE ; 19
|
252 |
|
|
LDsHL_NN = 10'h21,// LD HL,NN ; 21 XX XX
|
253 |
|
|
INCsHL = 10'h23,// INC HL ; 23
|
254 |
|
|
ADDsHL_HL = 10'h29,// ADD HL,HL ; 29
|
255 |
|
|
LDsHL_6NN7 = 10'h2A,// LD HL,(NN) ; 2A XX XX
|
256 |
|
|
DECsHL = 10'h2B,// DEC HL ; 2B
|
257 |
|
|
INCsL = 10'h2C,// INC L ; 2C
|
258 |
|
|
DECsL = 10'h2D,// DEC L ; 2D
|
259 |
|
|
LDsL_N = 10'h2E,// LD L,N ; 2E XX
|
260 |
|
|
ADDsHL_SP = 10'h39,// ADD HL,SP ; 39
|
261 |
|
|
LDsL_B = 10'h68,// LD L,B ; 68
|
262 |
|
|
LDsL_C = 10'h69,// LD L,C ; 69
|
263 |
|
|
LDsL_D = 10'h6A,// LD L,D ; 6A
|
264 |
|
|
LDsL_E = 10'h6B,// LD L,E ; 6B
|
265 |
|
|
LDsL_H = 10'h6C,// LD L,H ; 6C
|
266 |
|
|
LDsL_L = 10'h6D,// LD L,L ; 6D
|
267 |
|
|
LDsL_6HL7 = 10'h6E,// LD L,(HL) ; 6E
|
268 |
|
|
LDsL_A = 10'h6F,// LD L,A ; 6F
|
269 |
|
|
EXX = 10'hD9,// EXX ; D9
|
270 |
|
|
POPsHL = 10'hE1,// POP HL ; E1
|
271 |
|
|
EXs6SP7_HL = 10'hE3,// EX (SP),HL ; E3
|
272 |
|
|
EXsDE_HL = 10'hEB,// EX DE,HL ; EB
|
273 |
|
|
// update ixr
|
274 |
|
|
// update iyr
|
275 |
|
|
// update fr
|
276 |
|
|
SCF = 10'h37,// SCF ; 37
|
277 |
|
|
EXsAF_AFp = 10'h08,// EX AF,AF' ; 08
|
278 |
|
|
CCF = 10'h3F,// CCF ; 3F
|
279 |
|
|
CPsB = 10'hB8,// CP B ; B8
|
280 |
|
|
CPsC = 10'hB9,// CP C ; B9
|
281 |
|
|
CPsD = 10'hBA,// CP D ; BA
|
282 |
|
|
CPsE = 10'hBB,// CP E ; BB
|
283 |
|
|
CPsH = 10'hBC,// CP H ; BC
|
284 |
|
|
CPsL = 10'hBD,// CP L ; BD
|
285 |
|
|
CPs6HL7 = 10'hBE,// CP (HL) ; BE
|
286 |
|
|
CPsA = 10'hBF,// CP A ; BF
|
287 |
|
|
CPsN = 10'hFE,// CP N ; FE XX
|
288 |
|
|
EXX = 10'hD9,// EXX ; D9
|
289 |
|
|
POPsAF = 10'hF1,// POP AF ; F1
|
290 |
|
|
|
291 |
|
|
// update shadow register
|
292 |
|
|
EXsAF_AFp = 10'h08,// EX AF,AF' ; 08
|
293 |
|
|
EXX = 10'hD9,// EXX ; D9
|
294 |
|
|
|
295 |
|
|
// stuff to worry about
|
296 |
|
|
LDsSP_NN = 10'h31,// LD SP,NN ; 31 XX XX
|
297 |
|
|
INCsSP = 10'h33,// INC SP ; 33
|
298 |
|
|
DECsSP = 10'h3B,// DEC SP ; 3B
|
299 |
|
|
|
300 |
|
|
|
301 |
|
|
// memory stors and others
|
302 |
|
|
LDs6DE7_A = 10'h12,// LD (DE),A ; 12
|
303 |
|
|
LDs6BC7_A = 10'h02,// LD (BC),A ; 02
|
304 |
|
|
JRs$t2 = 10'h18,// JR $+2 ; 18 XX
|
305 |
|
|
JRsNZ_$t2 = 10'h20,// JR NZ,$+2 ; 20
|
306 |
|
|
LDs6NN7_HL = 10'h22,// LD (NN),HL ; 22 XX XX
|
307 |
|
|
JRsZ_$t2 = 10'h28,// JR Z,$+2 ; 28 XX
|
308 |
|
|
JRsNC_$t2 = 10'h30,// JR NC,$+2 ; 30 XX
|
309 |
|
|
LDs6NN7_A = 10'h32,// LD (NN),A ; 32 XX XX
|
310 |
|
|
INCs6HL7 = 10'h34,// INC (HL) ; 34
|
311 |
|
|
DECs6HL7 = 10'h35,// DEC (HL) ; 35
|
312 |
|
|
LDs6HL7_N = 10'h36,// LD (HL),N ; 36 XX
|
313 |
|
|
JRsC_$t2 = 10'h38,// JR C,$+2 ; 38 XX
|
314 |
|
|
LDs6HL7_B = 10'h70,// LD (HL),B ; 70
|
315 |
|
|
LDs6HL7_C = 10'h71,// LD (HL),C ; 71
|
316 |
|
|
LDs6HL7_D = 10'h72,// LD (HL),D ; 72
|
317 |
|
|
LDs6HL7_E = 10'h73,// LD (HL),E ; 73
|
318 |
|
|
LDs6HL7_H = 10'h74,// LD (HL),H ; 74
|
319 |
|
|
LDs6HL7_L = 10'h75,// LD (HL),L ; 75
|
320 |
|
|
HALT = 10'h76,// HALT ; 76
|
321 |
|
|
LDs6HL7_A = 10'h77,// LD (HL),A ; 77
|
322 |
|
|
RETsNZ = 10'hC0,// RET NZ ; C0
|
323 |
|
|
JPsNZ = 10'hC2,// JP NZ ; C2 XX XX
|
324 |
|
|
JP = 10'hC3,// JP ; C3 XX XX
|
325 |
|
|
CALLsNZ_NN = 10'hC4,// CALL NZ,NN ; C4 XX XX
|
326 |
|
|
PUSHsBC = 10'hC5,// PUSH BC ; C5
|
327 |
|
|
RSTs0 = 10'hC7,// RST 0 ; C7
|
328 |
|
|
RETsZ = 10'hC8,// RET Z ; C8
|
329 |
|
|
RET = 10'hC9,// RET ; C9
|
330 |
|
|
JPsZ = 10'hCA,// JP Z ; CA XX XX
|
331 |
|
|
CALLsZ_NN = 10'hCC,// CALL Z,NN ; CC XX XX
|
332 |
|
|
CBgrp = 10'hCB,// CBgrp is rotates and bit munging below
|
333 |
|
|
CALLsNN = 10'hCD,// CALL NN ; CD XX XX
|
334 |
|
|
RSTs8H = 10'hCF,// RST 8H ; CF
|
335 |
|
|
RETsNC = 10'hD0,// RET NC ; D0
|
336 |
|
|
JPsNC = 10'hD2,// JP NC, ; D2 XX XX
|
337 |
|
|
OUTs6N7_A = 10'hD3,// OUT (N),A ; D3 XX
|
338 |
|
|
CALLsNC_NN = 10'hD4,// CALL NC,NN ; D4 XX XX
|
339 |
|
|
PUSHsDE = 10'hD5,// PUSH DE ; D5
|
340 |
|
|
RSTs10H = 10'hD7,// RST 10H ; D7
|
341 |
|
|
RETsC = 10'hD8,// RET C ; D8
|
342 |
|
|
JPsC = 10'hDA,// JP C ; DA XX XX
|
343 |
|
|
CALLsC_NN = 10'hDC,// CALL C,NN ; DC XX XX
|
344 |
|
|
DDgrp = 10'hDD,// DDgrp
|
345 |
|
|
RSTs18H = 10'hDF,// RST 18H ; DF
|
346 |
|
|
RETsPO = 10'hE0,// RET PO ; E0 // ret if positive
|
347 |
|
|
JPsPO = 10'hE2,// JP PO ; E2 XX XX
|
348 |
|
|
EXs6SP7_HL = 10'hE3,// EX (SP),HL ; E3
|
349 |
|
|
CALLsPO_NN = 10'hE4,// CALL PO,NN ; E4 XX XX
|
350 |
|
|
PUSHsHL = 10'hE5,// PUSH HL ; E5
|
351 |
|
|
RSTs20H = 10'hE7,// RST 20H ; E7
|
352 |
|
|
RETsPE = 10'hE8,// RET PE ; E8
|
353 |
|
|
JPsHL = 10'hE9,// JP HL ; E9 // documented as indirect IS NOT
|
354 |
|
|
JPsPE = 10'hEA,// JP PE, ; EA XX XX
|
355 |
|
|
CALLsPE_NN = 10'hEC,// CALL PE,NN ; EC XX XX
|
356 |
|
|
EDgrp = 10'hED,// EDgrp ED
|
357 |
|
|
|
358 |
|
|
RSTs28H = 10'hEF,// RST 28H ; EF
|
359 |
|
|
RETsP = 10'hF0,// RET P ; F0
|
360 |
|
|
JPsP = 10'hF2,// JP P ; F2 XX XX
|
361 |
|
|
DI = 10'hF3,// DI ; F3
|
362 |
|
|
CALLsP_NN = 10'hF4,// CALL P,NN ; F4 XX XX
|
363 |
|
|
PUSHsAF = 10'hF5,// PUSH AF ; F5
|
364 |
|
|
RSTs30H = 10'hF7,// RST 30H ; F7
|
365 |
|
|
RETsM = 10'hF8,// RET M ; F8
|
366 |
|
|
LDsSP_HL = 10'hF9,// LD SP,HL ; F9
|
367 |
|
|
JPsM = 10'hFA,// JP M, ; FA XX XX
|
368 |
|
|
EI = 10'hFB,// EI ; FB
|
369 |
|
|
CALLsM_NN = 10'hFC,// CALL M,NN ; FC XX XX
|
370 |
|
|
FDgrp = 10'hFD,// FDgrp FD
|
371 |
|
|
RSTs38H = 10'hFF,// RST 38H ; FF
|
372 |
|
|
|
373 |
|
|
// the CB set
|
374 |
|
|
// These have enough structure that I don't believe I will define a parameter for each
|
375 |
|
|
// First cut below
|
376 |
|
|
// put together a decode term here for all registers
|
377 |
|
|
|
378 |
|
|
CB_RLC = 7'b01_00_000, // these must be compaired with ir[9:3]
|
379 |
|
|
CB_RRC = 7'b01_00_001, // these must be compaired with ir[9:3]
|
380 |
|
|
CB_RL = 7'b01_00_010, // these must be compaired with ir[9:3]
|
381 |
|
|
CB_RR = 7'b01_00_011, // these must be compaired with ir[9:3]
|
382 |
|
|
CB_SLA = 7'b01_00_100, // these must be compaired with ir[9:3]
|
383 |
|
|
CB_SRA = 7'b01_00_101, // these must be compaired with ir[9:3]
|
384 |
|
|
CB_SLL = 7'b01_00_110, // these must be compaired with ir[9:3]
|
385 |
|
|
CB_SRL = 7'b01_00_111, // these must be compaired with ir[9:3]
|
386 |
|
|
|
387 |
|
|
CB_BIT = 4'b01_01, // these must be compaired with ir[9:6]
|
388 |
|
|
CB_RES = 4'b01_10, // these must be compaired with ir[9:6]
|
389 |
|
|
CB_SET = 4'b01_11, // these must be compaired with ir[9:6]
|
390 |
|
|
|
391 |
|
|
CB_MEM = 3'h110, // this must be compaired with ir[2:0]
|
392 |
|
|
// note these are all read-modify-writ except CB_BIT
|
393 |
|
|
|
394 |
|
|
// The ED Group
|
395 |
|
|
// These are the "unique instructions in the 46, 47 rows that NEED? to be implemented
|
396 |
|
|
// Not sure I want to worry about all undocumented stuff in these rows - hard to believe
|
397 |
|
|
// It will matter.(IM modes are very system dependent - hard to believe even a programmer
|
398 |
|
|
// would use undocumented instructions to muck with this stuff)
|
399 |
|
|
ED_IMs0 = 10'h246// IM 0 ; ED 46 set IM0
|
400 |
|
|
ED_LDsI_A = 10'h247// LD I,A ; ED 47 move a to I
|
401 |
|
|
ED_IMs1 = 10'h256// IM 1 ; ED 56 set IM1
|
402 |
|
|
ED_LDsA_I = 10'h257// LD A,I ; ED 57 move I to A
|
403 |
|
|
ED_IMs2 = 10'h25E// IM 2 ; ED 5E set IM2
|
404 |
|
|
ED_RRD = 10'h267// RRD ; ED 67 nibble roates A HL
|
405 |
|
|
ED_RLD = 10'h26F// RLD ; ED 6F nibble roates A HL
|
406 |
|
|
|
407 |
|
|
|
408 |
|
|
ED_LDI = 10'h2A0// LDI ; ED A0 These are block move
|
409 |
|
|
ED_CPI = 10'h2A1// CPI ; ED A1 type insts that don't repeat
|
410 |
|
|
ED_INI = 10'h2A2// INI ; ED A2
|
411 |
|
|
ED_OUTI = 10'h2A3// OUTI ; ED A3
|
412 |
|
|
ED_LDD = 10'h2A8// LDD ; ED A8
|
413 |
|
|
ED_CPD = 10'h2A9// CPD ; ED A9
|
414 |
|
|
ED_IND = 10'h2AA// IND ; ED AA
|
415 |
|
|
ED_OUTD = 10'h2AB// OUTD ; ED AB
|
416 |
|
|
ED_LDIR = 10'h2B0// LDIR ; ED B0 These are block move
|
417 |
|
|
ED_CPIR = 10'h2B1// CPIR ; ED B1 type insts that DO repeat
|
418 |
|
|
ED_INIR = 10'h2B2// INIR ; ED B2
|
419 |
|
|
ED_OTIR = 10'h2B3// OTIR ; ED B3
|
420 |
|
|
ED_LDDR = 10'h2B8// LDDR ; ED B8
|
421 |
|
|
ED_CPDR = 10'h2B9// CPDR ; ED B9
|
422 |
|
|
ED_INDR = 10'h2BA// INDR ; ED BA
|
423 |
|
|
ED_OTDR = 10'h2BB// OTDR ; ED BB
|
424 |
|
|
|
425 |
|
|
// the ED gropu definitions from 40 to 7f from document on undocumented insts.....
|
426 |
|
|
//
|
427 |
|
|
// ED40 IN B,(C) ED50 IN D,(C) ED60 IN H,(C) ED70 IN (C) / IN F,(C)
|
428 |
|
|
// ED41 OUT (C),B ED51 OUT (C),D ED61 OUT (C),H ED71 OUT (C),0*
|
429 |
|
|
// ED42 SBC HL,BC ED52 SBC HL,DE ED62 SBC HL,HL ED72 SBC HL,SP
|
430 |
|
|
// ED43 LD (nn),BC ED53 LD (nn),DE ED63 LD (nn),HL ED73 LD (nn),SP
|
431 |
|
|
// ED44 NEG ED54 NEG* ED64 NEG* ED74 NEG*
|
432 |
|
|
// ED45 RETN ED55 RETN* ED65 RETN* ED75 RETN*
|
433 |
|
|
// ED46 IM 0 ED56 IM 1 ED66 IM 0* ED76 IM 1*
|
434 |
|
|
// ED47 LD I,A ED57 LD A,I ED67 RRD ED77 NOP*
|
435 |
|
|
|
436 |
|
|
// ED48 IN C,(C) ED58 IN E,(C) ED68 IN L,(C) ED78 IN A,(C)
|
437 |
|
|
// ED49 OUT (C),C ED59 OUT (C),E ED69 OUT (C),L ED79 OUT (C),A
|
438 |
|
|
// ED4A ADC HL,BC ED5A ADC HL,DE ED6A ADC HL,HL ED7A ADC HL,SP
|
439 |
|
|
// ED4B LD BC,(nn) ED5B LD DE,(nn) ED6B LD HL,(nn) ED7B LD SP,(nn)
|
440 |
|
|
// ED4C NEG* ED5C NEG* ED6C NEG* ED7C NEG*
|
441 |
|
|
// ED4D RETI ED5D RETN* ED6D RETN* ED7D RETN*
|
442 |
|
|
// ED4E IM 0* ED5E IM 2 ED6E IM 0* ED7E IM 2*
|
443 |
|
|
// ED4F LD R,A ED5F LD A,R ED6F RLD ED7F NOP*
|
444 |
|
|
|
445 |
|
|
|
446 |
|
|
//The ED70 instruction reads from I/O port C,
|
447 |
|
|
//but does not store the result.
|
448 |
|
|
//It just affects the flags. Hard to test. like the other IN x,(C) instruction.
|
449 |
|
|
//
|
450 |
|
|
//ED71 simply outs the value 0 to I/O port C.
|
451 |
|
|
// This suggests that we should decode as follows:
|
452 |
|
|
// I hope if I don't get all the IM duplicates right it won't be a tragedy
|
453 |
|
|
ED_INsREG_6C7 = 5'b01___000,// compair with {ir[7:6],ir[2:0]}
|
454 |
|
|
|
455 |
|
|
ED_SBCsHL_REG = 6'b01__0010, // compair with {ir[9:6],ir[3:0]}
|
456 |
|
|
ED_ADCsHL_REG = 6'b01__1010, // compair with {ir[9:6],ir[3:0]}
|
457 |
|
|
ED_LDs6NN7_REG = 6'b01__0011, // compair with {ir[9:6],ir[3:0]} REG = BC,DE,HL,SP
|
458 |
|
|
ED_LDsREG_6NN7 = 6'b01__1011, // compair with {ir[9:6],ir[3:0]} REG = BC,DE,HL,SP
|
459 |
|
|
ED_NEG = 5'b01___100, // compair with {ir[9:6],ir[2:0]} all A<= -A
|
460 |
|
|
ED_RETN = 5'b01___101, // compair with {ir[9:6],ir[2:0]} and !reti
|
461 |
|
|
|
462 |
|
|
DBL_REG_BC = 2'b00, // compair with ir[5:4]
|
463 |
|
|
DBL_REG_DE = 2'b00, // compair with ir[5:4]
|
464 |
|
|
DBL_REG_HL = 2'b00, // compair with ir[5:4]
|
465 |
|
|
DBL_REG_SP = 2'b00, // compair with ir[5:4]
|
466 |
|
|
|
467 |
|
|
REG8_B = 3'b000,
|
468 |
|
|
REG8_C = 3'b001,
|
469 |
|
|
REG8_D = 3'b010,
|
470 |
|
|
REG8_E = 3'b011,
|
471 |
|
|
REG8_H = 3'b100,
|
472 |
|
|
REG8_L = 3'b101,
|
473 |
|
|
REG8_A = 3'b110,
|
474 |
|
|
REG8_A = 3'b111;
|
475 |
|
|
|
476 |
|
|
|
477 |
|
|
|
478 |
|
|
|
479 |
|
|
|
480 |
|
|
|
481 |
|
|
|
482 |
|
|
|
483 |
|
|
|
484 |
|
|
|
485 |
|
|
|
486 |
|
|
|
487 |
|
|
|
488 |
|
|
|
489 |
|
|
|
490 |
|
|
|
491 |
|
|
|
492 |
|
|
|
493 |
|
|
|
494 |
|
|
|
495 |
|
|
|
496 |
|
|
|
497 |
|
|
|
498 |
|
|
|
499 |
|
|
|
500 |
|
|
|
501 |
|
|
|
502 |
|
|
|
503 |
|
|
|
504 |
|
|
|
505 |
|
|
|
506 |
|
|
|
507 |
|
|
|
508 |
|
|
|
509 |
|
|
|
510 |
|
|
|
511 |
|
|
|
512 |
|
|
|
513 |
|
|
|
514 |
|
|
|
515 |
|
|
|
516 |
|
|
|
517 |
|
|
|
518 |
|
|
|
519 |
|
|
|
520 |
|
|
|
521 |
|
|
|
522 |
|
|
|
523 |
|
|
|
524 |
|
|
|
525 |
|
|
|