]>
Commit | Line | Data |
---|---|---|
dd3b648e RP |
1 | /* ns32k-opcode.h */ |
2 | ||
3 | #ifndef ns32k_opcodeT | |
4 | #define ns32k_opcodeT int | |
5 | #endif /* no ns32k_opcodeT */ | |
6 | ||
7 | struct not_wot /* ns32k opcode table: wot to do with this */ | |
8 | /* particular opcode */ | |
9 | { | |
10 | int obits; /* number of opcode bits */ | |
11 | int ibits; /* number of instruction bits */ | |
12 | ns32k_opcodeT code; /* op-code (may be > 8 bits!) */ | |
13 | char *args; /* how to compile said opcode */ | |
14 | }; | |
15 | ||
16 | struct not /* ns32k opcode text */ | |
17 | { | |
18 | char * name; /* opcode name: lowercase string [key] */ | |
19 | struct not_wot detail; /* rest of opcode table [datum] */ | |
20 | }; | |
21 | ||
22 | /* Instructions look like this: | |
23 | ||
24 | basic instruction--1, 2, or 3 bytes | |
25 | index byte for operand A, if operand A is indexed--1 byte | |
26 | index byte for operand B, if operand B is indexed--1 byte | |
27 | addressing extension for operand A | |
28 | addressing extension for operand B | |
29 | implied operands | |
30 | ||
31 | Operand A is the operand listed first in the following opcode table. | |
32 | Operand B is the operand listed second in the following opcode table. | |
33 | All instructions have at most 2 general operands, so this is enough. | |
34 | The implied operands are associated with operands other than A and B. | |
35 | ||
36 | Each operand has a digit and a letter. | |
37 | ||
38 | The digit gives the position in the assembly language. The letter, | |
39 | one of the following, tells us what kind of operand it is. */ | |
40 | ||
41 | /* F : 32 bit float | |
42 | * L : 64 bit float | |
43 | * B : byte | |
44 | * W : word | |
45 | * D : double-word | |
46 | * Q : quad-word | |
47 | * d : displacement | |
48 | * q : quick | |
49 | * i : immediate (8 bits) | |
50 | * r : register number (3 bits) | |
51 | * p : displacement - pc relative addressing | |
52 | */ | |
53 | static struct not | |
54 | notstrs[] = | |
55 | { | |
56 | { "absf", 14,24, 0x35be, "1F2F" }, | |
57 | { "absl", 14,24, 0x34be, "1L2L" }, | |
58 | { "absb", 14,24, 0x304e, "1B2B" }, | |
59 | { "absw", 14,24, 0x314e, "1W2W" }, | |
60 | { "absd", 14,24, 0x334e, "1D2D" }, | |
61 | { "acbb", 7,16, 0x4c, "2B1q3p" }, | |
62 | { "acbw", 7,16, 0x4d, "2W1q3p" }, | |
63 | { "acbd", 7,16, 0x4f, "2D1q3p" }, | |
64 | { "addf", 14,24, 0x01be, "1F2F" }, | |
65 | { "addl", 14,24, 0x00be, "1L2L" }, | |
66 | { "addb", 6,16, 0x00, "1B2B" }, | |
67 | { "addw", 6,16, 0x01, "1W2W" }, | |
68 | { "addd", 6,16, 0x03, "1D2D" }, | |
69 | { "addcb", 6,16, 0x10, "1B2B" }, | |
70 | { "addcw", 6,16, 0x11, "1W2W" }, | |
71 | { "addcd", 6,16, 0x13, "1D2D" }, | |
72 | { "addpb", 14,24, 0x3c4e, "1B2B" }, | |
73 | { "addpw", 14,24, 0x3d4e, "1W2W" }, | |
74 | { "addpd", 14,24, 0x3f4e, "1D2D" }, | |
75 | { "addqb", 7,16, 0x0c, "2B1q" }, | |
76 | { "addqw", 7,16, 0x0d, "2W1q" }, | |
77 | { "addqd", 7,16, 0x0f, "2D1q" }, | |
78 | { "addr", 6,16, 0x27, "1D2D" }, | |
79 | { "adjspb", 11,16, 0x057c, "1B" }, | |
80 | { "adjspw", 11,16, 0x057d, "1W" }, | |
81 | { "adjspd", 11,16, 0x057f, "1D" }, | |
82 | { "andb", 6,16, 0x28, "1B2B" }, | |
83 | { "andw", 6,16, 0x29, "1W2W" }, | |
84 | { "andd", 6,16, 0x2b, "1D2D" }, | |
85 | { "ashb", 14,24, 0x044e, "1B2B" }, | |
86 | { "ashw", 14,24, 0x054e, "1B2W" }, | |
87 | { "ashd", 14,24, 0x074e, "1B2D" }, | |
88 | { "beq", 8,8, 0x0a, "1p" }, | |
89 | { "bne", 8,8, 0x1a, "1p" }, | |
90 | { "bcs", 8,8, 0x2a, "1p" }, | |
91 | { "bcc", 8,8, 0x3a, "1p" }, | |
92 | { "bhi", 8,8, 0x4a, "1p" }, | |
93 | { "bls", 8,8, 0x5a, "1p" }, | |
94 | { "bgt", 8,8, 0x6a, "1p" }, | |
95 | { "ble", 8,8, 0x7a, "1p" }, | |
96 | { "bfs", 8,8, 0x8a, "1p" }, | |
97 | { "bfc", 8,8, 0x9a, "1p" }, | |
98 | { "blo", 8,8, 0xaa, "1p" }, | |
99 | { "bhs", 8,8, 0xba, "1p" }, | |
100 | { "blt", 8,8, 0xca, "1p" }, | |
101 | { "bge", 8,8, 0xda, "1p" }, | |
102 | { "bicb", 6,16, 0x08, "1B2B" }, | |
103 | { "bicw", 6,16, 0x09, "1W2W" }, | |
104 | { "bicd", 6,16, 0x0b, "1D2D" }, | |
105 | { "bicpsrb", 11,16, 0x17c, "1B" }, | |
106 | { "bicpsrw", 11,16, 0x17d, "1W" }, | |
107 | { "bispsrb", 11,16, 0x37c, "1B" }, | |
108 | { "bispsrw", 11,16, 0x37d, "1W" }, | |
109 | { "bpt", 8,8, 0xf2, "" }, | |
110 | { "br", 8,8, 0xea, "1p" }, | |
111 | { "bsr", 8,8, 0x02, "1p" }, | |
112 | { "caseb", 11,16, 0x77c, "1B" }, | |
113 | { "casew", 11,16, 0x77d, "1W" }, | |
114 | { "cased", 11,16, 0x77f, "1D" }, | |
115 | { "cbitb", 14,24, 0x084e, "1B2D" }, | |
116 | { "cbitw", 14,24, 0x094e, "1W2D" }, | |
117 | { "cbitd", 14,24, 0x0b4e, "1D2D" }, | |
118 | { "cbitib", 14,24, 0x0c4e, "1B2D" }, | |
119 | { "cbitiw", 14,24, 0x0d4e, "1W2D" }, | |
120 | { "cbitid", 14,24, 0x0f4e, "1D2D" }, | |
121 | { "checkb", 11,24, 0x0ee, "2A3B1r" }, | |
122 | { "checkw", 11,24, 0x1ee, "2A3B1r" }, | |
123 | { "checkd", 11,24, 0x3ee, "2A3D1r" }, | |
124 | { "cmpf", 14,24, 0x09be, "1F2F" }, | |
125 | { "cmpl", 14,24, 0x08be, "1L2L" }, | |
126 | { "cmpb", 6,16, 0x04, "1B2B" }, | |
127 | { "cmpw", 6,16, 0x05, "1W2W" }, | |
128 | { "cmpd", 6,16, 0x07, "1D2D" }, | |
129 | { "cmpmb", 14,24, 0x04ce, "1D2D3d" }, | |
130 | { "cmpmw", 14,24, 0x05ce, "1D2D3d" }, | |
131 | { "cmpmd", 14,24, 0x07ce, "1D2D3d" }, | |
132 | { "cmpqb", 7,16, 0x1c, "2B1q" }, | |
133 | { "cmpqw", 7,16, 0x1d, "2W1q" }, | |
134 | { "cmpqd", 7,16, 0x1f, "2D1q" }, | |
135 | { "cmpsb", 16,16, 0x040e, "1i" }, | |
136 | { "cmpsw", 16,16, 0x050e, "1i" }, | |
137 | { "cmpsd", 16,16, 0x070e, "1i" }, | |
138 | { "cmpst", 16,16, 0x840e, "1i" }, | |
139 | { "comb", 14,24, 0x344e, "1B2B" }, | |
140 | { "comw", 14,24, 0x354e, "1W2W" }, | |
141 | { "comd", 14,24, 0x374e, "1D2D" }, | |
142 | { "cvtp", 11,24, 0x036e, "2D3D1r" }, | |
143 | { "cxp", 8,8, 0x22, "1p" }, | |
144 | { "cxpd", 11,16, 0x07f, "1D" }, | |
145 | { "deib", 14,24, 0x2cce, "1B2W" }, | |
146 | { "deiw", 14,24, 0x2dce, "1W2D" }, | |
147 | { "deid", 14,24, 0x2fce, "1D2Q" }, | |
148 | { "dia", 8,8, 0xc2, "" }, | |
149 | { "divf", 14,24, 0x21be, "1F2F" }, | |
150 | { "divl", 14,24, 0x20be, "1L2L" }, | |
151 | { "divb", 14,24, 0x3cce, "1B2B" }, | |
152 | { "divw", 14,24, 0x3dce, "1W2W" }, | |
153 | { "divd", 14,24, 0x3fce, "1D2D" }, | |
154 | { "enter", 8,8, 0x82, "1i2d" }, | |
155 | { "exit", 8,8, 0x92, "1i" }, | |
156 | { "extb", 11,24, 0x02e, "2D3B1r4d" }, | |
157 | { "extw", 11,24, 0x12e, "2D3W1r4d" }, | |
158 | { "extd", 11,24, 0x32e, "2D3D1r4d" }, | |
159 | { "extsb", 14,24, 0x0cce, "1D2B3i" }, | |
160 | { "extsw", 14,24, 0x0dce, "1D2W3i" }, | |
161 | { "extsd", 14,24, 0x0fce, "1D2D3i" }, | |
162 | { "ffsb", 14,24, 0x046e, "1B2B" }, | |
163 | { "ffsw", 14,24, 0x056e, "1W2B" }, | |
164 | { "ffsd", 14,24, 0x076e, "1D2B" }, | |
165 | { "flag", 8,8, 0xd2, "" }, | |
166 | { "floorfb", 14,24, 0x3c3e, "1F2B" }, | |
167 | { "floorfw", 14,24, 0x3d3e, "1F2W" }, | |
168 | { "floorfd", 14,24, 0x3f3e, "1F2D" }, | |
169 | { "floorlb", 14,24, 0x383e, "1L2B" }, | |
170 | { "floorlw", 14,24, 0x393e, "1L2W" }, | |
171 | { "floorld", 14,24, 0x3b3e, "1L2D" }, | |
172 | { "ibitb", 14,24, 0x384e, "1B2D" }, | |
173 | { "ibitw", 14,24, 0x394e, "1W2D" }, | |
174 | { "ibitd", 14,24, 0x3b4e, "1D2D" }, | |
175 | { "indexb", 11,24, 0x42e, "2B3B1r" }, | |
176 | { "indexw", 11,24, 0x52e, "2W3W1r" }, | |
177 | { "indexd", 11,24, 0x72e, "2D3D1r" }, | |
178 | { "insb", 11,24, 0x0ae, "2B3B1r4d" }, | |
179 | { "insw", 11,24, 0x1ae, "2W3W1r4d" }, | |
180 | { "insd", 11,24, 0x3ae, "2D3D1r4d" }, | |
181 | { "inssb", 14,24, 0x08ce, "1B2D3i" }, | |
182 | { "inssw", 14,24, 0x09ce, "1W2D3i" }, | |
183 | { "inssd", 14,24, 0x0bce, "1D2D3i" }, | |
184 | { "jsr", 11,16, 0x67f, "1A" }, | |
185 | { "jump", 11,16, 0x27f, "1A" }, | |
186 | { "lfsr", 19,24, 0x00f3e,"1D" }, | |
187 | { "lmr", 15,24, 0x0b1e, "2D1q" }, | |
188 | { "lprb", 7,16, 0x6c, "2B1q" }, | |
189 | { "lprw", 7,16, 0x6d, "2W1q" }, | |
190 | { "lprd", 7,16, 0x6f, "2D1q" }, | |
191 | { "lshb", 14,24, 0x144e, "1B2B" }, | |
192 | { "lshw", 14,24, 0x154e, "1B2W" }, | |
193 | { "lshd", 14,24, 0x174e, "1B2D" }, | |
194 | { "meib", 14,24, 0x24ce, "1B2W" }, | |
195 | { "meiw", 14,24, 0x25ce, "1W2D" }, | |
196 | { "meid", 14,24, 0x27ce, "1D2Q" }, | |
197 | { "modb", 14,24, 0x38ce, "1B2B" }, | |
198 | { "modw", 14,24, 0x39ce, "1W2W" }, | |
199 | { "modd", 14,24, 0x3bce, "1D2D" }, | |
200 | { "movf", 14,24, 0x05be, "1F2F" }, | |
201 | { "movl", 14,24, 0x04be, "1L2L" }, | |
202 | { "movb", 6,16, 0x14, "1B2B" }, | |
203 | { "movw", 6,16, 0x15, "1W2W" }, | |
204 | { "movd", 6,16, 0x17, "1D2D" }, | |
205 | { "movbf", 14,24, 0x043e, "1B2F" }, | |
206 | { "movwf", 14,24, 0x053e, "1W2F" }, | |
207 | { "movdf", 14,24, 0x073e, "1D2F" }, | |
208 | { "movbl", 14,24, 0x003e, "1B2L" }, | |
209 | { "movwl", 14,24, 0x013e, "1W2L" }, | |
210 | { "movdl", 14,24, 0x033e, "1D2L" }, | |
211 | { "movfl", 14,24, 0x1b3e, "1F2L" }, | |
212 | { "movlf", 14,24, 0x163e, "1L2F" }, | |
213 | { "movmb", 14,24, 0x00ce, "1D2D3d" }, | |
f4b13194 JG |
214 | { "movmw", 14,24, 0x01ce, "1D2D3d" }, |
215 | { "movmd", 14,24, 0x03ce, "1D2D3d" }, | |
dd3b648e RP |
216 | { "movqb", 7,16, 0x5c, "2B1q" }, |
217 | { "movqw", 7,16, 0x5d, "2B1q" }, | |
218 | { "movqd", 7,16, 0x5f, "2B1q" }, | |
219 | { "movsb", 16,16, 0x000e, "1i" }, | |
220 | { "movsw", 16,16, 0x010e, "1i" }, | |
221 | { "movsd", 16,16, 0x030e, "1i" }, | |
222 | { "movst", 16,16, 0x800e, "1i" }, | |
223 | { "movsub", 14,24, 0x0cae, "1A1A" }, | |
224 | { "movsuw", 14,24, 0x0dae, "1A1A" }, | |
225 | { "movsud", 14,24, 0x0fae, "1A1A" }, | |
226 | { "movusb", 14,24, 0x1cae, "1A1A" }, | |
227 | { "movusw", 14,24, 0x1dae, "1A1A" }, | |
228 | { "movusd", 14,24, 0x1fae, "1A1A" }, | |
229 | { "movxbd", 14,24, 0x1cce, "1B2D" }, | |
230 | { "movxwd", 14,24, 0x1dce, "1W2D" }, | |
231 | { "movxbw", 14,24, 0x10ce, "1B2W" }, | |
232 | { "movzbd", 14,24, 0x18ce, "1B2D" }, | |
233 | { "movzwd", 14,24, 0x19ce, "1W2D" }, | |
234 | { "movzbw", 14,24, 0x14ce, "1B2W" }, | |
235 | { "mulf", 14,24, 0x31be, "1F2F" }, | |
236 | { "mull", 14,24, 0x30be, "1L2L" }, | |
237 | { "mulb", 14,24, 0x20ce, "1B2B" }, | |
238 | { "mulw", 14,24, 0x21ce, "1W2W" }, | |
239 | { "muld", 14,24, 0x23ce, "1D2D" }, | |
240 | { "negf", 14,24, 0x15be, "1F2F" }, | |
241 | { "negl", 14,24, 0x14be, "1L2L" }, | |
242 | { "negb", 14,24, 0x204e, "1B2B" }, | |
243 | { "negw", 14,24, 0x214e, "1W2W" }, | |
244 | { "negd", 14,24, 0x234e, "1D2D" }, | |
245 | { "nop", 8,8, 0xa2, "" }, | |
246 | { "notb", 14,24, 0x244e, "1B2B" }, | |
247 | { "notw", 14,24, 0x254e, "1W2W" }, | |
248 | { "notd", 14,24, 0x274e, "1D2D" }, | |
249 | { "orb", 6,16, 0x18, "1B1B" }, | |
250 | { "orw", 6,16, 0x19, "1W1W" }, | |
251 | { "ord", 6,16, 0x1b, "1D2D" }, | |
252 | { "quob", 14,24, 0x30ce, "1B2B" }, | |
253 | { "quow", 14,24, 0x31ce, "1W2W" }, | |
254 | { "quod", 14,24, 0x33ce, "1D2D" }, | |
255 | { "rdval", 19,24, 0x0031e,"1A" }, | |
256 | { "remb", 14,24, 0x34ce, "1B2B" }, | |
257 | { "remw", 14,24, 0x35ce, "1W2W" }, | |
258 | { "remd", 14,24, 0x37ce, "1D2D" }, | |
259 | { "restore", 8,8, 0x72, "1i" }, | |
260 | { "ret", 8,8, 0x12, "1d" }, | |
261 | { "reti", 8,8, 0x52, "" }, | |
262 | { "rett", 8,8, 0x42, "" }, | |
263 | { "rotb", 14,24, 0x004e, "1B2B" }, | |
264 | { "rotw", 14,24, 0x014e, "1B2W" }, | |
265 | { "rotd", 14,24, 0x034e, "1B2D" }, | |
266 | { "roundfb", 14,24, 0x243e, "1F2B" }, | |
267 | { "roundfw", 14,24, 0x253e, "1F2W" }, | |
268 | { "roundfd", 14,24, 0x273e, "1F2D" }, | |
269 | { "roundlb", 14,24, 0x203e, "1L2B" }, | |
270 | { "roundlw", 14,24, 0x213e, "1L2W" }, | |
271 | { "roundld", 14,24, 0x233e, "1L2D" }, | |
272 | { "rxp", 8,8, 0x32, "1d" }, | |
273 | { "sCONDb", 7,16, 0x3c, "2B1q" }, | |
274 | { "sCONDw", 7,16, 0x3d, "2D1q" }, | |
275 | { "sCONDd", 7,16, 0x3f, "2D1q" }, | |
276 | { "save", 8,8, 0x62, "1i" }, | |
277 | { "sbitb", 14,24, 0x184e, "1B2A" }, | |
278 | { "sbitw", 14,24, 0x194e, "1W2A" }, | |
279 | { "sbitd", 14,24, 0x1b4e, "1D2A" }, | |
280 | { "sbitib", 14,24, 0x1c4e, "1B2A" }, | |
281 | { "sbitiw", 14,24, 0x1d4e, "1W2A" }, | |
282 | { "sbitid", 14,24, 0x1f4e, "1D2A" }, | |
283 | { "setcfg", 15,24, 0x0b0e, "5D1q" }, | |
ccef841c | 284 | { "sfsr", 14,24, 0x373e, "5D1D" }, |
dd3b648e RP |
285 | { "skpsb", 16,16, 0x0c0e, "1i" }, |
286 | { "skpsw", 16,16, 0x0d0e, "1i" }, | |
287 | { "skpsd", 16,16, 0x0f0e, "1i" }, | |
288 | { "skpst", 16,16, 0x8c0e, "1i" }, | |
289 | { "smr", 15,24, 0x0f1e, "2D1q" }, | |
290 | { "sprb", 7,16, 0x2c, "2B1q" }, | |
291 | { "sprw", 7,16, 0x2d, "2W1q" }, | |
292 | { "sprd", 7,16, 0x2f, "2D1q" }, | |
293 | { "subf", 14,24, 0x11be, "1F2F" }, | |
294 | { "subl", 14,24, 0x10be, "1L2L" }, | |
295 | { "subb", 6,16, 0x20, "1B2B" }, | |
296 | { "subw", 6,16, 0x21, "1W2W" }, | |
297 | { "subd", 6,16, 0x23, "1D2D" }, | |
298 | { "subcb", 6,16, 0x30, "1B2B" }, | |
299 | { "subcw", 6,16, 0x31, "1W2W" }, | |
300 | { "subcd", 6,16, 0x33, "1D2D" }, | |
301 | { "subpb", 14,24, 0x2c4e, "1B2B" }, | |
302 | { "subpw", 14,24, 0x2d4e, "1W2W" }, | |
303 | { "subpd", 14,24, 0x2f4e, "1D2D" }, | |
61454104 | 304 | #ifdef NS32K_SVC_IMMED_OPERANDS |
dd3b648e RP |
305 | { "svc", 8,8, 0xe2, "2i1i" }, /* not really, but unix uses it */ |
306 | #else | |
307 | { "svc", 8,8, 0xe2, "" }, /* not really, but unix uses it */ | |
308 | #endif | |
309 | { "tbitb", 6,16, 0x34, "1B2A" }, | |
310 | { "tbitw", 6,16, 0x35, "1W2A" }, | |
311 | { "tbitd", 6,16, 0x37, "1D2A" }, | |
312 | { "truncfb", 14,24, 0x2c3e, "1F2B" }, | |
313 | { "truncfw", 14,24, 0x2d3e, "1F2W" }, | |
314 | { "truncfd", 14,24, 0x2f3e, "1F2D" }, | |
315 | { "trunclb", 14,24, 0x283e, "1L2B" }, | |
316 | { "trunclw", 14,24, 0x293e, "1L2W" }, | |
317 | { "truncld", 14,24, 0x2b3e, "1L2D" }, | |
318 | { "wait", 8,8, 0xb2, "" }, | |
319 | { "wrval", 19,24, 0x0071e,"1A" }, | |
320 | { "xorb", 6,16, 0x38, "1B2B" }, | |
321 | { "xorw", 6,16, 0x39, "1W2W" }, | |
322 | { "xord", 6,16, 0x3b, "1D2D" }, | |
323 | }; /* notstrs */ | |
324 | ||
325 | /* end: ns32k.opcode.h */ | |
326 | ||
327 | #define MAX_ARGS 4 | |
328 | #define ARG_LEN 50 |