Mercurial > hg > Members > kono > os9 > sbc09
annotate src/d09.c @ 105:6eef99bb4771
fix runtime
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 29 Dec 2018 12:25:26 +0900 |
parents | c29030b5e4b4 |
children | 3f8bbec566b3 |
rev | line source |
---|---|
0 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 #include <sys/types.h> | |
4 #include <sys/stat.h> | |
5 #include <fcntl.h> | |
6 #include <unistd.h> | |
7 #include <string.h> | |
8 | |
9 | |
10 /*************************************************************************** | |
11 Originally posted to comp.sys.m6809 by Didier Derny (didier@aida.remcomp.fr) | |
12 | |
13 Minor hacks by Alan DeKok | |
14 | |
15 Fixed: D_Indexed addressing used prog[2] and prog[3] when it meant | |
16 prog[pc+2] and prog[pc+3]: Would produce flawed disassemblies! | |
17 | |
18 changed addresses in D_Indexed to be all hex. | |
19 added 2 instances of 'extrabyte' in D_Indexed: would not skip them.. | |
20 Added PC offsets to D_Indexed ,PCR formats | |
21 added SWI2 print out as OS9 | |
22 | |
23 To do: | |
24 | |
25 handle command-line options properly... | |
26 | |
27 Fix handling of illegal opcodes so it doesn't skip a byte | |
28 i.e. $87 is a skip 2 | |
29 | |
30 Move defines to another file | |
31 | |
32 Add 6309 support | |
33 also add 6309 native-mode support, and listing of clock cycles for opcodes. | |
34 | |
35 Add OS-9 support | |
36 | |
37 add proper label-disassembly. i.e. 2-pass. | |
38 | |
39 ****************************************************************************/ | |
40 | |
41 // extern int errno; | |
42 // extern char *sys_errlist[]; | |
43 | |
44 static unsigned char prog0[65536]; | |
45 unsigned char *prog = prog0; | |
46 | |
47 FILE *fp; | |
48 | |
49 typedef struct { | |
50 char *name; | |
51 int clock; | |
52 int bytes; | |
53 int (*display)(); | |
54 int (*execute)(); | |
55 } Opcode; | |
56 | |
57 typedef struct { | |
58 int address; | |
59 int length; | |
60 int width; | |
61 } String; | |
62 | |
63 int D_Illegal(Opcode *, int, int, char *); | |
64 int D_Direct(Opcode *, int, int, char *); | |
65 int D_Page10(Opcode *, int, int, char *); | |
66 int D_Page11(Opcode *, int, int, char *); | |
67 int D_Immediat(Opcode *, int, int, char *); | |
68 int D_ImmediatL(Opcode *, int, int, char *); | |
69 int D_Inherent(Opcode *, int, int, char *); | |
70 int D_Indexed(Opcode *, int, int, char *); | |
71 int D_Extended(Opcode *, int, int, char *); | |
72 int D_Relative(Opcode *, int, int, char *); | |
73 int D_RelativeL(Opcode *, int, int, char *); | |
74 int D_Register0(Opcode *, int, int, char *); | |
75 int D_Register1(Opcode *, int, int, char *); | |
76 int D_Register2(Opcode *, int, int, char *); | |
77 int D_Page10(Opcode *, int, int, char *); | |
78 int D_Page11(Opcode *, int, int, char *); | |
79 int D_OS9(Opcode *, int, int, char *); | |
80 char *IndexRegister(int); | |
81 | |
82 String stringtable[] = { | |
83 { 0xc321, 16, 16 }, | |
84 { 0xc395, 258, 16 }, | |
85 { 0xeb15, 50, 16 }, | |
86 { 0xee6f, 128, 16 }, | |
87 { 0xfdf4, 492, 16 }, | |
88 { 0xfff0, 16, 2 }, | |
89 }; | |
90 | |
91 int adoffset = 0; | |
92 int laststring = 6; | |
93 | |
94 Opcode optable[] = { | |
95 { "NEG ", 6, 2, D_Direct, NULL }, /* 0x00 */ | |
96 { "?????", 0, 1, D_Illegal, NULL }, /* 0x01 */ | |
97 { "?????", 0, 1, D_Illegal, NULL }, /* 0x02 */ | |
98 { "COM ", 6, 2, D_Direct, NULL }, /* 0x03 */ | |
99 { "LSR ", 6, 2, D_Direct, NULL }, /* 0x04 */ | |
100 { "?????", 0, 1, D_Illegal, NULL }, /* 0x05 */ | |
101 { "ROR ", 6, 2, D_Direct, NULL }, /* 0x06 */ | |
102 { "ASR ", 6, 2, D_Direct, NULL }, /* 0x07 */ | |
103 { "LSL ", 6, 2, D_Direct, NULL }, /* 0x08 */ | |
74
c29030b5e4b4
program is correctly stored. fix d09 ror bug
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
71
diff
changeset
|
104 { "ROL ", 6, 2, D_Direct, NULL }, /* 0x09 */ |
0 | 105 { "DEC ", 6, 2, D_Direct, NULL }, /* 0x0a */ |
106 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0b */ | |
107 { "INC ", 6, 2, D_Direct, NULL }, /* 0x0c */ | |
108 { "TST ", 6, 2, D_Direct, NULL }, /* 0x0d */ | |
109 { "JMP ", 3, 2, D_Direct, NULL }, /* 0x0e */ | |
110 { "CLR ", 6, 2, D_Direct, NULL }, /* 0x0f */ | |
111 | |
112 { "", 0, 1, D_Page10, NULL }, /* 0x10 */ | |
113 { "", 0, 1, D_Page11, NULL }, /* 0x11 */ | |
114 { "NOP ", 2, 1, D_Inherent, NULL }, /* 0x12 */ | |
115 { "SYNC ", 4, 1, D_Inherent, NULL }, /* 0x13 */ | |
116 { "?????", 0, 1, D_Illegal, NULL }, /* 0x14 */ | |
117 { "?????", 0, 1, D_Illegal, NULL }, /* 0x15 */ | |
118 { "LBRA ", 5, 3, D_RelativeL, NULL }, /* 0x16 */ | |
119 { "LBSR ", 9, 3, D_RelativeL, NULL }, /* 0x17 */ | |
120 { "?????", 0, 1, D_Illegal, NULL }, /* 0x18 */ | |
121 { "DAA ", 2, 1, D_Inherent, NULL }, /* 0x19 */ | |
122 { "ORCC ", 3, 2, D_Immediat, NULL }, /* 0x1a */ | |
123 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1b */ | |
124 { "ANDCC", 3, 2, D_Immediat, NULL }, /* 0x1c */ | |
125 { "SEX ", 2, 1, D_Inherent, NULL }, /* 0x1d */ | |
126 { "EXG ", 8, 2, D_Register0, NULL }, /* 0x1e */ | |
127 { "TFR ", 6, 2, D_Register0, NULL }, /* 0x1f */ | |
128 | |
129 { "BRA ", 3, 2, D_Relative, NULL }, /* 0x20 */ | |
130 { "BRN ", 3, 2, D_Relative, NULL }, /* 0x21 */ | |
131 { "BHI ", 3, 2, D_Relative, NULL }, /* 0x22 */ | |
132 { "BLS ", 3, 2, D_Relative, NULL }, /* 0x23 */ | |
133 { "BCC ", 3, 2, D_Relative, NULL }, /* 0x24 */ | |
134 { "BCS ", 3, 2, D_Relative, NULL }, /* 0x25 */ | |
135 { "BNE ", 3, 2, D_Relative, NULL }, /* 0x26 */ | |
136 { "BEQ ", 3, 2, D_Relative, NULL }, /* 0x27 */ | |
137 { "BVC ", 3, 2, D_Relative, NULL }, /* 0x28 */ | |
138 { "BVS ", 3, 2, D_Relative, NULL }, /* 0x29 */ | |
139 { "BPL ", 3, 2, D_Relative, NULL }, /* 0x2a */ | |
140 { "BMI ", 3, 2, D_Relative, NULL }, /* 0x2b */ | |
141 { "BGE ", 3, 2, D_Relative, NULL }, /* 0x2c */ | |
142 { "BLT ", 3, 2, D_Relative, NULL }, /* 0x2d */ | |
143 { "BGT ", 3, 2, D_Relative, NULL }, /* 0x2e */ | |
144 { "BLE ", 3, 2, D_Relative, NULL }, /* 0x2f */ | |
145 | |
146 { "LEAX ", 4, 2, D_Indexed, NULL }, /* 0x30 */ | |
147 { "LEAY ", 4, 2, D_Indexed, NULL }, /* 0x31 */ | |
148 { "LEAS ", 4, 2, D_Indexed, NULL }, /* 0x32 */ | |
149 { "LEAU ", 4, 2, D_Indexed, NULL }, /* 0x33 */ | |
150 { "PSHS ", 5, 2, D_Register1, NULL }, /* 0x34 */ | |
151 { "PULS ", 5, 2, D_Register1, NULL }, /* 0x35 */ | |
152 { "PSHU ", 5, 2, D_Register2, NULL }, /* 0x36 */ | |
153 { "PULU ", 5, 2, D_Register2, NULL }, /* 0x37 */ | |
154 { "?????", 0, 1, D_Illegal, NULL }, /* 0x38 */ | |
155 { "RTS ", 5, 1, D_Inherent, NULL }, /* 0x39 */ | |
156 { "ABX ", 3, 1, D_Inherent, NULL }, /* 0x3a */ | |
157 { "RTI ", 6, 1, D_Inherent, NULL }, /* 0x3b */ | |
158 { "CWAI ", 20, 2, D_Inherent, NULL }, /* 0x3c */ | |
159 { "MUL ", 11, 1, D_Inherent, NULL }, /* 0x3d */ | |
160 { "?????", 0, 1, D_Illegal, NULL }, /* 0x3e */ | |
161 { "SWI ", 19, 1, D_Inherent, NULL }, /* 0x3f */ | |
162 | |
163 { "NEGA ", 2, 1, D_Inherent, NULL }, /* 0x40 */ | |
164 { "?????", 0, 1, D_Illegal, NULL }, /* 0x41 */ | |
165 { "?????", 0, 1, D_Illegal, NULL }, /* 0x42 */ | |
166 { "COMA ", 2, 1, D_Inherent, NULL }, /* 0x43 */ | |
167 { "LSRA ", 2, 1, D_Inherent, NULL }, /* 0x44 */ | |
168 { "?????", 0, 1, D_Illegal, NULL }, /* 0x45 */ | |
169 { "RORA ", 2, 1, D_Inherent, NULL }, /* 0x46 */ | |
170 { "ASRA ", 2, 1, D_Inherent, NULL }, /* 0x47 */ | |
171 { "LSLA ", 2, 1, D_Inherent, NULL }, /* 0x48 */ | |
172 { "ROLA ", 2, 1, D_Inherent, NULL }, /* 0x49 */ | |
173 { "DECA ", 2, 1, D_Inherent, NULL }, /* 0x4a */ | |
174 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4b */ | |
175 { "INCA ", 2, 1, D_Inherent, NULL }, /* 0x4c */ | |
176 { "TSTA ", 2, 1, D_Inherent, NULL }, /* 0x4d */ | |
177 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4e */ | |
178 { "CLRA ", 2, 1, D_Inherent, NULL }, /* 0x4f */ | |
179 | |
180 { "NEGB ", 2, 1, D_Inherent, NULL }, /* 0x50 */ | |
181 { "?????", 0, 1, D_Illegal, NULL }, /* 0x51 */ | |
182 { "?????", 0, 1, D_Illegal, NULL }, /* 0x52 */ | |
183 { "COMB ", 2, 1, D_Inherent, NULL }, /* 0x53 */ | |
184 { "LSRB ", 2, 1, D_Inherent, NULL }, /* 0x54 */ | |
185 { "?????", 0, 1, D_Illegal, NULL }, /* 0x55 */ | |
186 { "RORB ", 2, 1, D_Inherent, NULL }, /* 0x56 */ | |
187 { "ASRB ", 2, 1, D_Inherent, NULL }, /* 0x57 */ | |
188 { "LSLB ", 2, 1, D_Inherent, NULL }, /* 0x58 */ | |
189 { "ROLB ", 2, 1, D_Inherent, NULL }, /* 0x59 */ | |
190 { "DECB ", 2, 1, D_Inherent, NULL }, /* 0x5a */ | |
191 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5b */ | |
192 { "INCB ", 2, 1, D_Inherent, NULL }, /* 0x5c */ | |
193 { "TSTB ", 2, 1, D_Inherent, NULL }, /* 0x5d */ | |
194 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5e */ | |
195 { "CLRB ", 2, 1, D_Inherent, NULL }, /* 0x5f */ | |
196 | |
197 { "NEG ", 6, 2, D_Indexed, NULL }, /* 0x60 */ | |
198 { "?????", 0, 2, D_Illegal, NULL }, /* 0x61 */ | |
199 { "?????", 0, 2, D_Illegal, NULL }, /* 0x62 */ | |
200 { "COM ", 6, 2, D_Indexed, NULL }, /* 0x63 */ | |
201 { "LSR ", 6, 2, D_Indexed, NULL }, /* 0x64 */ | |
202 { "?????", 0, 2, D_Indexed, NULL }, /* 0x65 */ | |
203 { "ROR ", 6, 2, D_Indexed, NULL }, /* 0x66 */ | |
204 { "ASR ", 6, 2, D_Indexed, NULL }, /* 0x67 */ | |
205 { "LSL ", 6, 2, D_Indexed, NULL }, /* 0x68 */ | |
206 { "ROL ", 6, 2, D_Indexed, NULL }, /* 0x69 */ | |
207 { "DEC ", 6, 2, D_Indexed, NULL }, /* 0x6a */ | |
208 { "?????", 0, 2, D_Illegal, NULL }, /* 0x6b */ | |
209 { "INC ", 6, 2, D_Indexed, NULL }, /* 0x6c */ | |
210 { "TST ", 6, 2, D_Indexed, NULL }, /* 0x6d */ | |
211 { "JMP ", 3, 2, D_Indexed, NULL }, /* 0x6e */ | |
212 { "CLR ", 6, 2, D_Indexed, NULL }, /* 0x6f */ | |
213 | |
214 { "NEG ", 7, 3, D_Extended, NULL }, /* 0x70 */ | |
215 { "?????", 0, 1, D_Illegal, NULL }, /* 0x71 */ | |
216 { "?????", 0, 1, D_Illegal, NULL }, /* 0x72 */ | |
217 { "COM ", 7, 3, D_Extended, NULL }, /* 0x73 */ | |
218 { "LSR ", 7, 3, D_Extended, NULL }, /* 0x74 */ | |
219 { "?????", 0, 1, D_Illegal, NULL }, /* 0x75 */ | |
220 { "ROR ", 7, 3, D_Extended, NULL }, /* 0x76 */ | |
221 { "ASR ", 7, 3, D_Extended, NULL }, /* 0x77 */ | |
222 { "LSL ", 7, 3, D_Extended, NULL }, /* 0x78 */ | |
223 { "ROL ", 7, 3, D_Extended, NULL }, /* 0x79 */ | |
224 { "DEC ", 7, 3, D_Extended, NULL }, /* 0x7a */ | |
225 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7b */ | |
226 { "INC ", 7, 3, D_Extended, NULL }, /* 0x7c */ | |
227 { "TST ", 7, 3, D_Extended, NULL }, /* 0x7d */ | |
228 { "JMP ", 4, 3, D_Extended, NULL }, /* 0x7e */ | |
229 { "CLR ", 7, 3, D_Extended, NULL }, /* 0x7f */ | |
230 | |
231 { "SUBA ", 2, 2, D_Immediat, NULL }, /* 0x80 */ | |
232 { "CMPA ", 2, 2, D_Immediat, NULL }, /* 0x81 */ | |
233 { "SBCA ", 2, 2, D_Immediat, NULL }, /* 0x82 */ | |
234 { "SUBD ", 4, 3, D_ImmediatL, NULL }, /* 0x83 */ | |
235 { "ANDA ", 2, 2, D_Immediat, NULL }, /* 0x84 */ | |
236 { "BITA ", 2, 2, D_Immediat, NULL }, /* 0x85 */ | |
237 { "LDA ", 2, 2, D_Immediat, NULL }, /* 0x86 */ | |
238 { "?????", 0, 2, D_Illegal, NULL }, /* 0x87 */ | |
239 { "EORA ", 2, 2, D_Immediat, NULL }, /* 0x88 */ | |
240 { "ADCA ", 2, 2, D_Immediat, NULL }, /* 0x89 */ | |
241 { "ORA ", 2, 2, D_Immediat, NULL }, /* 0x8a */ | |
242 { "ADDA ", 2, 2, D_Immediat, NULL }, /* 0x8b */ | |
243 { "CMPX ", 4, 3, D_ImmediatL, NULL }, /* 0x8c */ | |
244 { "BSR ", 7, 2, D_Relative, NULL }, /* 0x8d */ | |
245 { "LDX ", 3, 3, D_ImmediatL, NULL }, /* 0x8e */ | |
246 { "?????", 0, 2, D_Illegal, NULL }, /* 0x8f */ | |
247 | |
248 { "SUBA ", 4, 2, D_Direct, NULL }, /* 0x90 */ | |
249 { "CMPA ", 4, 2, D_Direct, NULL }, /* 0x91 */ | |
250 { "SBCA ", 4, 2, D_Direct, NULL }, /* 0x92 */ | |
251 { "SUBD ", 6, 2, D_Direct, NULL }, /* 0x93 */ | |
252 { "ANDA ", 4, 2, D_Direct, NULL }, /* 0x94 */ | |
253 { "BITA ", 4, 2, D_Direct, NULL }, /* 0x95 */ | |
254 { "LDA ", 4, 2, D_Direct, NULL }, /* 0x96 */ | |
255 { "STA ", 4, 2, D_Direct, NULL }, /* 0x97 */ | |
256 { "EORA ", 4, 2, D_Direct, NULL }, /* 0x98 */ | |
257 { "ADCA ", 4, 2, D_Direct, NULL }, /* 0x99 */ | |
258 { "ORA ", 4, 2, D_Direct, NULL }, /* 0x9a */ | |
259 { "ADDA ", 4, 2, D_Direct, NULL }, /* 0x9b */ | |
260 { "CMPX ", 6, 2, D_Direct, NULL }, /* 0x9c */ | |
261 { "JSR ", 7, 2, D_Direct, NULL }, /* 0x9d */ | |
262 { "LDX ", 5, 2, D_Direct, NULL }, /* 0x9e */ | |
263 { "STX ", 5, 2, D_Direct, NULL }, /* 0x9f */ | |
264 | |
265 { "SUBA ", 4, 2, D_Indexed, NULL }, /* 0xa0 */ | |
266 { "CMPA ", 4, 2, D_Indexed, NULL }, /* 0xa1 */ | |
267 { "SBCA ", 4, 2, D_Indexed, NULL }, /* 0xa2 */ | |
268 { "SUBD ", 6, 2, D_Indexed, NULL }, /* 0xa3 */ | |
269 { "ANDA ", 4, 2, D_Indexed, NULL }, /* 0xa4 */ | |
270 { "BITA ", 4, 2, D_Indexed, NULL }, /* 0xa5 */ | |
271 { "LDA ", 4, 2, D_Indexed, NULL }, /* 0xa6 */ | |
272 { "STA ", 4, 2, D_Indexed, NULL }, /* 0xa7 */ | |
273 { "EORA ", 4, 2, D_Indexed, NULL }, /* 0xa8 */ | |
274 { "ADCA ", 4, 2, D_Indexed, NULL }, /* 0xa9 */ | |
275 { "ORA ", 4, 2, D_Indexed, NULL }, /* 0xaa */ | |
276 { "ADDA ", 4, 2, D_Indexed, NULL }, /* 0xab */ | |
277 { "CMPX ", 6, 2, D_Indexed, NULL }, /* 0xac */ | |
278 { "JSR ", 7, 2, D_Indexed, NULL }, /* 0xad */ | |
279 { "LDX ", 5, 2, D_Indexed, NULL }, /* 0xae */ | |
280 { "STX ", 5, 2, D_Indexed, NULL }, /* 0xaf */ | |
281 | |
282 { "SUBA ", 5, 3, D_Extended, NULL }, /* 0xb0 */ | |
283 { "CMPA ", 5, 3, D_Extended, NULL }, /* 0xb1 */ | |
284 { "SBCA ", 5, 3, D_Extended, NULL }, /* 0xb2 */ | |
285 { "SUBD ", 7, 3, D_Extended, NULL }, /* 0xb3 */ | |
286 { "ANDA ", 5, 3, D_Extended, NULL }, /* 0xb4 */ | |
287 { "BITA ", 5, 3, D_Extended, NULL }, /* 0xb5 */ | |
288 { "LDA ", 5, 3, D_Extended, NULL }, /* 0xb6 */ | |
289 { "STA ", 5, 3, D_Extended, NULL }, /* 0xb7 */ | |
290 { "EORA ", 5, 3, D_Extended, NULL }, /* 0xb8 */ | |
291 { "ADCA ", 5, 3, D_Extended, NULL }, /* 0xb9 */ | |
292 { "ORA ", 5, 3, D_Extended, NULL }, /* 0xba */ | |
293 { "ADDA ", 5, 3, D_Extended, NULL }, /* 0xbb */ | |
294 { "CMPX ", 7, 3, D_Extended, NULL }, /* 0xbc */ | |
295 { "JSR ", 8, 3, D_Extended, NULL }, /* 0xbd */ | |
296 { "LDX ", 6, 3, D_Extended, NULL }, /* 0xbe */ | |
297 { "STX ", 6, 3, D_Extended, NULL }, /* 0xbf */ | |
298 | |
299 { "SUBB ", 2, 2, D_Immediat, NULL }, /* 0xc0 */ | |
300 { "CMPB ", 2, 2, D_Immediat, NULL }, /* 0xc1 */ | |
301 { "SBCB ", 2, 2, D_Immediat, NULL }, /* 0xc2 */ | |
302 { "ADDD ", 4, 3, D_ImmediatL, NULL }, /* 0xc3 */ | |
303 { "ANDB ", 2, 2, D_Immediat, NULL }, /* 0xc4 */ | |
304 { "BITB ", 2, 2, D_Immediat, NULL }, /* 0xc5 */ | |
305 { "LDB ", 2, 2, D_Immediat, NULL }, /* 0xc6 */ | |
306 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc7 */ | |
307 { "EORB ", 2, 2, D_Immediat, NULL }, /* 0xc8 */ | |
308 { "ADCB ", 2, 2, D_Immediat, NULL }, /* 0xc9 */ | |
309 { "ORB ", 2, 2, D_Immediat, NULL }, /* 0xca */ | |
310 { "ADDB ", 2, 2, D_Immediat, NULL }, /* 0xcb */ | |
311 { "LDD ", 3, 3, D_ImmediatL, NULL }, /* 0xcc */ | |
312 { "?????", 0, 1, D_Illegal, NULL }, /* 0xcd */ | |
313 { "LDU ", 3, 3, D_ImmediatL, NULL }, /* 0xce */ | |
314 { "?????", 0, 1, D_Illegal, NULL }, /* 0xcf */ | |
315 | |
316 { "SUBB ", 4, 2, D_Direct, NULL }, /* 0xd0 */ | |
317 { "CMPB ", 4, 2, D_Direct, NULL }, /* 0xd1 */ | |
318 { "SBCB ", 4, 2, D_Direct, NULL }, /* 0xd2 */ | |
319 { "ADDD ", 6, 2, D_Direct, NULL }, /* 0xd3 */ | |
320 { "ANDB ", 4, 2, D_Direct, NULL }, /* 0xd4 */ | |
321 { "BITB ", 4, 2, D_Direct, NULL }, /* 0xd5 */ | |
322 { "LDB ", 4, 2, D_Direct, NULL }, /* 0xd6 */ | |
323 { "STB ", 4, 2, D_Direct, NULL }, /* 0xd7 */ | |
324 { "EORB ", 4, 2, D_Direct, NULL }, /* 0xd8 */ | |
325 { "ADCB ", 4, 2, D_Direct, NULL }, /* 0xd9 */ | |
326 { "ORB ", 4, 2, D_Direct, NULL }, /* 0xda */ | |
327 { "ADDB ", 4, 2, D_Direct, NULL }, /* 0xdb */ | |
328 { "LDD ", 5, 2, D_Direct, NULL }, /* 0xdc */ | |
329 { "STD ", 5, 2, D_Direct, NULL }, /* 0xdd */ | |
330 { "LDU ", 5, 2, D_Direct, NULL }, /* 0xde */ | |
331 { "STU ", 5, 2, D_Direct, NULL }, /* 0xdf */ | |
332 | |
333 { "SUBB ", 4, 2, D_Indexed, NULL }, /* 0xe0 */ | |
334 { "CMPB ", 4, 2, D_Indexed, NULL }, /* 0xe1 */ | |
335 { "SBCB ", 4, 2, D_Indexed, NULL }, /* 0xe2 */ | |
336 { "ADDD ", 6, 2, D_Indexed, NULL }, /* 0xe3 */ | |
337 { "ANDB ", 4, 2, D_Indexed, NULL }, /* 0xe4 */ | |
338 { "BITB ", 4, 2, D_Indexed, NULL }, /* 0xe5 */ | |
339 { "LDB ", 4, 2, D_Indexed, NULL }, /* 0xe6 */ | |
340 { "STB ", 4, 2, D_Indexed, NULL }, /* 0xe7 */ | |
341 { "EORB ", 4, 2, D_Indexed, NULL }, /* 0xe8 */ | |
342 { "ADCB ", 4, 2, D_Indexed, NULL }, /* 0xe9 */ | |
343 { "ORB ", 4, 2, D_Indexed, NULL }, /* 0xea */ | |
344 { "ADDB ", 4, 2, D_Indexed, NULL }, /* 0xeb */ | |
345 { "LDD ", 5, 2, D_Indexed, NULL }, /* 0xec */ | |
346 { "STD ", 5, 2, D_Indexed, NULL }, /* 0xed */ | |
347 { "LDU ", 5, 2, D_Indexed, NULL }, /* 0xee */ | |
348 { "STU ", 5, 2, D_Indexed, NULL }, /* 0xef */ | |
349 | |
350 { "SUBB ", 5, 3, D_Extended, NULL }, /* 0xf0 */ | |
351 { "CMPB ", 5, 3, D_Extended, NULL }, /* 0xf1 */ | |
352 { "SBCB ", 5, 3, D_Extended, NULL }, /* 0xf2 */ | |
353 { "ADDD ", 7, 3, D_Extended, NULL }, /* 0xf3 */ | |
354 { "ANDB ", 5, 3, D_Extended, NULL }, /* 0xf4 */ | |
355 { "BITB ", 5, 3, D_Extended, NULL }, /* 0xf5 */ | |
356 { "LDB ", 5, 3, D_Extended, NULL }, /* 0xf6 */ | |
357 { "STB ", 5, 3, D_Extended, NULL }, /* 0xf7 */ | |
358 { "EORB ", 5, 3, D_Extended, NULL }, /* 0xf8 */ | |
359 { "ADCB ", 5, 3, D_Extended, NULL }, /* 0xf9 */ | |
360 { "ORB ", 5, 3, D_Extended, NULL }, /* 0xfa */ | |
361 { "ADDB ", 5, 3, D_Extended, NULL }, /* 0xfb */ | |
362 { "LDD ", 6, 3, D_Extended, NULL }, /* 0xfc */ | |
363 { "STD ", 6, 3, D_Extended, NULL }, /* 0xfd */ | |
364 { "LDU ", 6, 3, D_Extended, NULL }, /* 0xfe */ | |
365 { "STU ", 6, 3, D_Extended, NULL }, /* 0xff */ | |
366 }; | |
367 | |
368 Opcode optable10[] = { | |
369 { "?????", 0, 1, D_Illegal, NULL }, /* 0x00 */ | |
370 { "?????", 0, 1, D_Illegal, NULL }, /* 0x01 */ | |
371 { "?????", 0, 1, D_Illegal, NULL }, /* 0x02 */ | |
372 { "?????", 0, 1, D_Illegal, NULL }, /* 0x03 */ | |
373 { "?????", 0, 1, D_Illegal, NULL }, /* 0x04 */ | |
374 { "?????", 0, 1, D_Illegal, NULL }, /* 0x05 */ | |
375 { "?????", 0, 1, D_Illegal, NULL }, /* 0x06 */ | |
376 { "?????", 0, 1, D_Illegal, NULL }, /* 0x07 */ | |
377 { "?????", 0, 1, D_Illegal, NULL }, /* 0x08 */ | |
378 { "?????", 0, 1, D_Illegal, NULL }, /* 0x09 */ | |
379 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0a */ | |
380 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0b */ | |
381 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0c */ | |
382 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0d */ | |
383 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0e */ | |
384 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0f */ | |
385 | |
386 { "?????", 0, 1, D_Illegal, NULL }, /* 0x10 */ | |
387 { "?????", 0, 1, D_Illegal, NULL }, /* 0x11 */ | |
388 { "?????", 0, 1, D_Illegal, NULL }, /* 0x12 */ | |
389 { "?????", 0, 1, D_Illegal, NULL }, /* 0x13 */ | |
390 { "?????", 0, 1, D_Illegal, NULL }, /* 0x14 */ | |
391 { "?????", 0, 1, D_Illegal, NULL }, /* 0x15 */ | |
392 { "?????", 0, 1, D_Illegal, NULL }, /* 0x16 */ | |
393 { "?????", 0, 1, D_Illegal, NULL }, /* 0x17 */ | |
394 { "?????", 0, 1, D_Illegal, NULL }, /* 0x18 */ | |
395 { "?????", 0, 1, D_Illegal, NULL }, /* 0x19 */ | |
396 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1a */ | |
397 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1b */ | |
398 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1c */ | |
399 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1d */ | |
400 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1e */ | |
401 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1f */ | |
402 | |
403 { "?????", 0, 1, D_Illegal, NULL }, /* 0x20 */ | |
404 { "LBRN ", 5, 4, D_RelativeL, NULL }, /* 0x21 */ | |
405 { "LBHI ", 5, 4, D_RelativeL, NULL }, /* 0x22 */ | |
406 { "LBLS ", 5, 4, D_RelativeL, NULL }, /* 0x23 */ | |
407 { "LBCC ", 5, 4, D_RelativeL, NULL }, /* 0x24 */ | |
408 { "LBCS ", 5, 4, D_RelativeL, NULL }, /* 0x25 */ | |
409 { "LBNE ", 5, 4, D_RelativeL, NULL }, /* 0x26 */ | |
410 { "LBEQ ", 5, 4, D_RelativeL, NULL }, /* 0x27 */ | |
411 { "LBVC ", 5, 4, D_RelativeL, NULL }, /* 0x28 */ | |
412 { "LBVS ", 5, 4, D_RelativeL, NULL }, /* 0x29 */ | |
413 { "LBPL ", 5, 4, D_RelativeL, NULL }, /* 0x2a */ | |
414 { "LBMI ", 5, 4, D_RelativeL, NULL }, /* 0x2b */ | |
415 { "LBGE ", 5, 4, D_RelativeL, NULL }, /* 0x2c */ | |
416 { "LBLT ", 5, 4, D_RelativeL, NULL }, /* 0x2d */ | |
417 { "LBGT ", 5, 4, D_RelativeL, NULL }, /* 0x2e */ | |
418 { "LBLE ", 5, 4, D_RelativeL, NULL }, /* 0x2f */ | |
419 | |
420 { "?????", 0, 1, D_Illegal, NULL }, /* 0x30 */ | |
421 { "?????", 0, 1, D_Illegal, NULL }, /* 0x31 */ | |
422 { "?????", 0, 1, D_Illegal, NULL }, /* 0x32 */ | |
423 { "?????", 0, 1, D_Illegal, NULL }, /* 0x33 */ | |
424 { "?????", 0, 1, D_Illegal, NULL }, /* 0x34 */ | |
425 { "?????", 0, 1, D_Illegal, NULL }, /* 0x35 */ | |
426 { "?????", 0, 1, D_Illegal, NULL }, /* 0x36 */ | |
427 { "?????", 0, 1, D_Illegal, NULL }, /* 0x37 */ | |
428 { "?????", 0, 1, D_Illegal, NULL }, /* 0x38 */ | |
429 { "?????", 0, 1, D_Illegal, NULL }, /* 0x39 */ | |
430 { "?????", 0, 1, D_Illegal, NULL }, /* 0x3a */ | |
431 { "?????", 0, 1, D_Illegal, NULL }, /* 0x3b */ | |
432 { "?????", 0, 1, D_Illegal, NULL }, /* 0x3c */ | |
433 { "?????", 0, 1, D_Illegal, NULL }, /* 0x3d */ | |
434 { "?????", 0, 1, D_Illegal, NULL }, /* 0x3e */ | |
435 /* Fake SWI2 as an OS9 F$xxx system call */ | |
436 { "OS9 ", 20, 3, D_OS9, NULL }, /* 0x3f */ | |
437 | |
438 { "?????", 0, 1, D_Illegal, NULL }, /* 0x40 */ | |
439 { "?????", 0, 1, D_Illegal, NULL }, /* 0x41 */ | |
440 { "?????", 0, 1, D_Illegal, NULL }, /* 0x42 */ | |
441 { "?????", 0, 1, D_Illegal, NULL }, /* 0x43 */ | |
442 { "?????", 0, 1, D_Illegal, NULL }, /* 0x44 */ | |
443 { "?????", 0, 1, D_Illegal, NULL }, /* 0x45 */ | |
444 { "?????", 0, 1, D_Illegal, NULL }, /* 0x46 */ | |
445 { "?????", 0, 1, D_Illegal, NULL }, /* 0x47 */ | |
446 { "?????", 0, 1, D_Illegal, NULL }, /* 0x48 */ | |
447 { "?????", 0, 1, D_Illegal, NULL }, /* 0x49 */ | |
448 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4a */ | |
449 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4b */ | |
450 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4c */ | |
451 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4d */ | |
452 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4e */ | |
453 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4f */ | |
454 | |
455 { "?????", 0, 1, D_Illegal, NULL }, /* 0x50 */ | |
456 { "?????", 0, 1, D_Illegal, NULL }, /* 0x51 */ | |
457 { "?????", 0, 1, D_Illegal, NULL }, /* 0x52 */ | |
458 { "?????", 0, 1, D_Illegal, NULL }, /* 0x53 */ | |
459 { "?????", 0, 1, D_Illegal, NULL }, /* 0x54 */ | |
460 { "?????", 0, 1, D_Illegal, NULL }, /* 0x55 */ | |
461 { "?????", 0, 1, D_Illegal, NULL }, /* 0x56 */ | |
462 { "?????", 0, 1, D_Illegal, NULL }, /* 0x57 */ | |
463 { "?????", 0, 1, D_Illegal, NULL }, /* 0x58 */ | |
464 { "?????", 0, 1, D_Illegal, NULL }, /* 0x59 */ | |
465 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5a */ | |
466 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5b */ | |
467 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5c */ | |
468 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5d */ | |
469 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5e */ | |
470 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5f */ | |
471 | |
472 { "?????", 0, 1, D_Illegal, NULL }, /* 0x60 */ | |
473 { "?????", 0, 1, D_Illegal, NULL }, /* 0x61 */ | |
474 { "?????", 0, 1, D_Illegal, NULL }, /* 0x62 */ | |
475 { "?????", 0, 1, D_Illegal, NULL }, /* 0x63 */ | |
476 { "?????", 0, 1, D_Illegal, NULL }, /* 0x64 */ | |
477 { "?????", 0, 1, D_Illegal, NULL }, /* 0x65 */ | |
478 { "?????", 0, 1, D_Illegal, NULL }, /* 0x66 */ | |
479 { "?????", 0, 1, D_Illegal, NULL }, /* 0x67 */ | |
480 { "?????", 0, 1, D_Illegal, NULL }, /* 0x68 */ | |
481 { "?????", 0, 1, D_Illegal, NULL }, /* 0x69 */ | |
482 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6a */ | |
483 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6b */ | |
484 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6c */ | |
485 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6d */ | |
486 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6e */ | |
487 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6f */ | |
488 | |
489 { "?????", 0, 1, D_Illegal, NULL }, /* 0x70 */ | |
490 { "?????", 0, 1, D_Illegal, NULL }, /* 0x71 */ | |
491 { "?????", 0, 1, D_Illegal, NULL }, /* 0x72 */ | |
492 { "?????", 0, 1, D_Illegal, NULL }, /* 0x73 */ | |
493 { "?????", 0, 1, D_Illegal, NULL }, /* 0x74 */ | |
494 { "?????", 0, 1, D_Illegal, NULL }, /* 0x75 */ | |
495 { "?????", 0, 1, D_Illegal, NULL }, /* 0x76 */ | |
496 { "?????", 0, 1, D_Illegal, NULL }, /* 0x77 */ | |
497 { "?????", 0, 1, D_Illegal, NULL }, /* 0x78 */ | |
498 { "?????", 0, 1, D_Illegal, NULL }, /* 0x79 */ | |
499 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7a */ | |
500 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7b */ | |
501 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7c */ | |
502 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7d */ | |
503 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7e */ | |
504 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7f */ | |
505 | |
506 { "?????", 0, 1, D_Illegal, NULL }, /* 0x80 */ | |
507 { "?????", 0, 1, D_Illegal, NULL }, /* 0x81 */ | |
508 { "?????", 0, 1, D_Illegal, NULL }, /* 0x82 */ | |
509 { "CMPD ", 5, 4, D_ImmediatL, NULL }, /* 0x83 */ | |
510 { "?????", 0, 1, D_Illegal, NULL }, /* 0x84 */ | |
511 { "?????", 0, 1, D_Illegal, NULL }, /* 0x85 */ | |
512 { "?????", 0, 1, D_Illegal, NULL }, /* 0x86 */ | |
513 { "?????", 0, 1, D_Illegal, NULL }, /* 0x87 */ | |
514 { "?????", 0, 1, D_Illegal, NULL }, /* 0x88 */ | |
515 { "?????", 0, 1, D_Illegal, NULL }, /* 0x89 */ | |
516 { "?????", 0, 1, D_Illegal, NULL }, /* 0x8a */ | |
517 { "?????", 0, 1, D_Illegal, NULL }, /* 0x8b */ | |
518 { "CMPY ", 5, 4, D_ImmediatL, NULL }, /* 0x8c */ | |
519 { "?????", 0, 1, D_Illegal, NULL }, /* 0x8d */ | |
520 { "LDY ", 4, 4, D_ImmediatL, NULL }, /* 0x8e */ | |
521 { "?????", 0, 1, D_Illegal, NULL }, /* 0x8f */ | |
522 | |
523 { "?????", 0, 1, D_Illegal, NULL }, /* 0x90 */ | |
524 { "?????", 0, 1, D_Illegal, NULL }, /* 0x91 */ | |
525 { "?????", 0, 1, D_Illegal, NULL }, /* 0x92 */ | |
526 { "CMPD ", 7, 3, D_Direct, NULL }, /* 0x93 */ | |
527 { "?????", 0, 1, D_Illegal, NULL }, /* 0x94 */ | |
528 { "?????", 0, 1, D_Illegal, NULL }, /* 0x95 */ | |
529 { "?????", 0, 1, D_Illegal, NULL }, /* 0x96 */ | |
530 { "?????", 0, 1, D_Illegal, NULL }, /* 0x97 */ | |
531 { "?????", 0, 1, D_Illegal, NULL }, /* 0x98 */ | |
532 { "?????", 0, 1, D_Illegal, NULL }, /* 0x99 */ | |
533 { "?????", 0, 1, D_Illegal, NULL }, /* 0x9a */ | |
534 { "?????", 0, 1, D_Illegal, NULL }, /* 0x9b */ | |
535 { "CMPY ", 7, 3, D_Direct, NULL }, /* 0x9c */ | |
536 { "?????", 0, 1, D_Illegal, NULL }, /* 0x9d */ | |
537 { "LDY ", 6, 3, D_Direct, NULL }, /* 0x9e */ | |
538 { "STY ", 6, 3, D_Direct, NULL }, /* 0x9f */ | |
539 | |
540 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa0 */ | |
541 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa1 */ | |
542 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa2 */ | |
543 { "CMPD ", 7, 3, D_Indexed, NULL }, /* 0xa3 */ | |
544 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa4 */ | |
545 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa5 */ | |
546 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa6 */ | |
547 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa7 */ | |
548 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa8 */ | |
549 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa9 */ | |
550 { "?????", 0, 1, D_Illegal, NULL }, /* 0xaa */ | |
551 { "?????", 0, 1, D_Illegal, NULL }, /* 0xab */ | |
552 { "CMPY ", 7, 3, D_Indexed, NULL }, /* 0xac */ | |
553 { "?????", 0, 1, D_Illegal, NULL }, /* 0xad */ | |
554 { "LDY ", 6, 3, D_Indexed, NULL }, /* 0xae */ | |
555 { "STY ", 6, 3, D_Indexed, NULL }, /* 0xaf */ | |
556 | |
557 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb0 */ | |
558 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb1 */ | |
559 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb2 */ | |
560 { "CMPD ", 8, 4, D_Extended, NULL }, /* 0xb3 */ | |
561 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb4 */ | |
562 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb5 */ | |
563 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb6 */ | |
564 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb7 */ | |
565 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb8 */ | |
566 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb9 */ | |
567 { "?????", 0, 1, D_Illegal, NULL }, /* 0xba */ | |
568 { "?????", 0, 1, D_Illegal, NULL }, /* 0xbb */ | |
569 { "CMPY ", 8, 4, D_Extended, NULL }, /* 0xbc */ | |
570 { "?????", 0, 1, D_Illegal, NULL }, /* 0xbd */ | |
571 { "LDY ", 7, 4, D_Extended, NULL }, /* 0xbe */ | |
572 { "STY ", 7, 4, D_Extended, NULL }, /* 0xbf */ | |
573 | |
574 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc0 */ | |
575 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc1 */ | |
576 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc2 */ | |
577 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc3 */ | |
578 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc4 */ | |
579 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc5 */ | |
580 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc6 */ | |
581 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc7 */ | |
582 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc8 */ | |
583 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc9 */ | |
584 { "?????", 0, 1, D_Illegal, NULL }, /* 0xca */ | |
585 { "?????", 0, 1, D_Illegal, NULL }, /* 0xcb */ | |
586 { "?????", 0, 1, D_Illegal, NULL }, /* 0xcc */ | |
587 { "?????", 0, 1, D_Illegal, NULL }, /* 0xcd */ | |
588 { "LDS ", 4, 4, D_ImmediatL, NULL }, /* 0xce */ | |
589 { "?????", 0, 1, D_Illegal, NULL }, /* 0xcf */ | |
590 | |
591 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd0 */ | |
592 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd1 */ | |
593 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd2 */ | |
594 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd3 */ | |
595 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd4 */ | |
596 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd5 */ | |
597 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd6 */ | |
598 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd7 */ | |
599 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd8 */ | |
600 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd9 */ | |
601 { "?????", 0, 1, D_Illegal, NULL }, /* 0xda */ | |
602 { "?????", 0, 1, D_Illegal, NULL }, /* 0xdb */ | |
603 { "?????", 0, 1, D_Illegal, NULL }, /* 0xdc */ | |
604 { "?????", 0, 1, D_Illegal, NULL }, /* 0xdd */ | |
605 { "LDS ", 6, 3, D_Direct, NULL }, /* 0xde */ | |
606 { "STS ", 6, 3, D_Direct, NULL }, /* 0xdf */ | |
607 | |
608 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe0 */ | |
609 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe1 */ | |
610 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe2 */ | |
611 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe3 */ | |
612 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe4 */ | |
613 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe5 */ | |
614 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe6 */ | |
615 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe7 */ | |
616 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe8 */ | |
617 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe9 */ | |
618 { "?????", 0, 1, D_Illegal, NULL }, /* 0xea */ | |
619 { "?????", 0, 1, D_Illegal, NULL }, /* 0xeb */ | |
620 { "?????", 0, 1, D_Illegal, NULL }, /* 0xec */ | |
621 { "?????", 0, 1, D_Illegal, NULL }, /* 0xed */ | |
622 { "LDS ", 6, 3, D_Indexed, NULL }, /* 0xee */ | |
623 { "STS ", 6, 3, D_Indexed, NULL }, /* 0xef */ | |
624 | |
625 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf0 */ | |
626 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf1 */ | |
627 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf2 */ | |
628 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf3 */ | |
629 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf4 */ | |
630 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf5 */ | |
631 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf6 */ | |
632 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf7 */ | |
633 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf8 */ | |
634 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf9 */ | |
635 { "?????", 0, 1, D_Illegal, NULL }, /* 0xfa */ | |
636 { "?????", 0, 1, D_Illegal, NULL }, /* 0xfb */ | |
637 { "?????", 0, 1, D_Illegal, NULL }, /* 0xfc */ | |
638 { "?????", 0, 1, D_Illegal, NULL }, /* 0xfd */ | |
639 { "LDS ", 7, 4, D_Extended, NULL }, /* 0xfe */ | |
640 { "STS ", 7, 4, D_Extended, NULL }, /* 0xff */ | |
641 | |
642 }; | |
643 | |
644 | |
645 Opcode optable11[] = { | |
646 { "?????", 0, 1, D_Illegal, NULL }, /* 0x00 */ | |
647 { "?????", 0, 1, D_Illegal, NULL }, /* 0x01 */ | |
648 { "?????", 0, 1, D_Illegal, NULL }, /* 0x02 */ | |
649 { "?????", 0, 1, D_Illegal, NULL }, /* 0x03 */ | |
650 { "?????", 0, 1, D_Illegal, NULL }, /* 0x04 */ | |
651 { "?????", 0, 1, D_Illegal, NULL }, /* 0x05 */ | |
652 { "?????", 0, 1, D_Illegal, NULL }, /* 0x06 */ | |
653 { "?????", 0, 1, D_Illegal, NULL }, /* 0x07 */ | |
654 { "?????", 0, 1, D_Illegal, NULL }, /* 0x08 */ | |
655 { "?????", 0, 1, D_Illegal, NULL }, /* 0x09 */ | |
656 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0a */ | |
657 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0b */ | |
658 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0c */ | |
659 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0d */ | |
660 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0e */ | |
661 { "?????", 0, 1, D_Illegal, NULL }, /* 0x0f */ | |
662 | |
663 { "?????", 0, 1, D_Illegal, NULL }, /* 0x10 */ | |
664 { "?????", 0, 1, D_Illegal, NULL }, /* 0x11 */ | |
665 { "?????", 0, 1, D_Illegal, NULL }, /* 0x12 */ | |
666 { "?????", 0, 1, D_Illegal, NULL }, /* 0x13 */ | |
667 { "?????", 0, 1, D_Illegal, NULL }, /* 0x14 */ | |
668 { "?????", 0, 1, D_Illegal, NULL }, /* 0x15 */ | |
669 { "?????", 0, 1, D_Illegal, NULL }, /* 0x16 */ | |
670 { "?????", 0, 1, D_Illegal, NULL }, /* 0x17 */ | |
671 { "?????", 0, 1, D_Illegal, NULL }, /* 0x18 */ | |
672 { "?????", 0, 1, D_Illegal, NULL }, /* 0x19 */ | |
673 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1a */ | |
674 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1b */ | |
675 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1c */ | |
676 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1d */ | |
677 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1e */ | |
678 { "?????", 0, 1, D_Illegal, NULL }, /* 0x1f */ | |
679 | |
680 { "?????", 0, 1, D_Illegal, NULL }, /* 0x20 */ | |
681 { "?????", 0, 1, D_Illegal, NULL }, /* 0x21 */ | |
682 { "?????", 0, 1, D_Illegal, NULL }, /* 0x22 */ | |
683 { "?????", 0, 1, D_Illegal, NULL }, /* 0x23 */ | |
684 { "?????", 0, 1, D_Illegal, NULL }, /* 0x24 */ | |
685 { "?????", 0, 1, D_Illegal, NULL }, /* 0x25 */ | |
686 { "?????", 0, 1, D_Illegal, NULL }, /* 0x26 */ | |
687 { "?????", 0, 1, D_Illegal, NULL }, /* 0x27 */ | |
688 { "?????", 0, 1, D_Illegal, NULL }, /* 0x28 */ | |
689 { "?????", 0, 1, D_Illegal, NULL }, /* 0x29 */ | |
690 { "?????", 0, 1, D_Illegal, NULL }, /* 0x2a */ | |
691 { "?????", 0, 1, D_Illegal, NULL }, /* 0x2b */ | |
692 { "?????", 0, 1, D_Illegal, NULL }, /* 0x2c */ | |
693 { "?????", 0, 1, D_Illegal, NULL }, /* 0x2d */ | |
694 { "?????", 0, 1, D_Illegal, NULL }, /* 0x2e */ | |
695 { "?????", 0, 1, D_Illegal, NULL }, /* 0x2f */ | |
696 | |
697 { "?????", 0, 1, D_Illegal, NULL }, /* 0x30 */ | |
698 { "?????", 0, 1, D_Illegal, NULL }, /* 0x31 */ | |
699 { "?????", 0, 1, D_Illegal, NULL }, /* 0x32 */ | |
700 { "?????", 0, 1, D_Illegal, NULL }, /* 0x33 */ | |
701 { "?????", 0, 1, D_Illegal, NULL }, /* 0x34 */ | |
702 { "?????", 0, 1, D_Illegal, NULL }, /* 0x35 */ | |
703 { "?????", 0, 1, D_Illegal, NULL }, /* 0x36 */ | |
704 { "?????", 0, 1, D_Illegal, NULL }, /* 0x37 */ | |
705 { "?????", 0, 1, D_Illegal, NULL }, /* 0x38 */ | |
706 { "?????", 0, 1, D_Illegal, NULL }, /* 0x39 */ | |
707 { "?????", 0, 1, D_Illegal, NULL }, /* 0x3a */ | |
708 { "?????", 0, 1, D_Illegal, NULL }, /* 0x3b */ | |
709 { "?????", 0, 1, D_Illegal, NULL }, /* 0x3c */ | |
710 { "?????", 0, 1, D_Illegal, NULL }, /* 0x3d */ | |
711 { "?????", 0, 1, D_Illegal, NULL }, /* 0x3e */ | |
712 { "SWI3 ", 20, 2, D_Inherent, NULL }, /* 0x3f */ | |
713 | |
714 { "?????", 0, 1, D_Illegal, NULL }, /* 0x40 */ | |
715 { "?????", 0, 1, D_Illegal, NULL }, /* 0x41 */ | |
716 { "?????", 0, 1, D_Illegal, NULL }, /* 0x42 */ | |
717 { "?????", 0, 1, D_Illegal, NULL }, /* 0x43 */ | |
718 { "?????", 0, 1, D_Illegal, NULL }, /* 0x44 */ | |
719 { "?????", 0, 1, D_Illegal, NULL }, /* 0x45 */ | |
720 { "?????", 0, 1, D_Illegal, NULL }, /* 0x46 */ | |
721 { "?????", 0, 1, D_Illegal, NULL }, /* 0x47 */ | |
722 { "?????", 0, 1, D_Illegal, NULL }, /* 0x48 */ | |
723 { "?????", 0, 1, D_Illegal, NULL }, /* 0x49 */ | |
724 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4a */ | |
725 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4b */ | |
726 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4c */ | |
727 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4d */ | |
728 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4e */ | |
729 { "?????", 0, 1, D_Illegal, NULL }, /* 0x4f */ | |
730 | |
731 { "?????", 0, 1, D_Illegal, NULL }, /* 0x50 */ | |
732 { "?????", 0, 1, D_Illegal, NULL }, /* 0x51 */ | |
733 { "?????", 0, 1, D_Illegal, NULL }, /* 0x52 */ | |
734 { "?????", 0, 1, D_Illegal, NULL }, /* 0x53 */ | |
735 { "?????", 0, 1, D_Illegal, NULL }, /* 0x54 */ | |
736 { "?????", 0, 1, D_Illegal, NULL }, /* 0x55 */ | |
737 { "?????", 0, 1, D_Illegal, NULL }, /* 0x56 */ | |
738 { "?????", 0, 1, D_Illegal, NULL }, /* 0x57 */ | |
739 { "?????", 0, 1, D_Illegal, NULL }, /* 0x58 */ | |
740 { "?????", 0, 1, D_Illegal, NULL }, /* 0x59 */ | |
741 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5a */ | |
742 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5b */ | |
743 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5c */ | |
744 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5d */ | |
745 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5e */ | |
746 { "?????", 0, 1, D_Illegal, NULL }, /* 0x5f */ | |
747 | |
748 { "?????", 0, 1, D_Illegal, NULL }, /* 0x60 */ | |
749 { "?????", 0, 1, D_Illegal, NULL }, /* 0x61 */ | |
750 { "?????", 0, 1, D_Illegal, NULL }, /* 0x62 */ | |
751 { "?????", 0, 1, D_Illegal, NULL }, /* 0x63 */ | |
752 { "?????", 0, 1, D_Illegal, NULL }, /* 0x64 */ | |
753 { "?????", 0, 1, D_Illegal, NULL }, /* 0x65 */ | |
754 { "?????", 0, 1, D_Illegal, NULL }, /* 0x66 */ | |
755 { "?????", 0, 1, D_Illegal, NULL }, /* 0x67 */ | |
756 { "?????", 0, 1, D_Illegal, NULL }, /* 0x68 */ | |
757 { "?????", 0, 1, D_Illegal, NULL }, /* 0x69 */ | |
758 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6a */ | |
759 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6b */ | |
760 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6c */ | |
761 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6d */ | |
762 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6e */ | |
763 { "?????", 0, 1, D_Illegal, NULL }, /* 0x6f */ | |
764 | |
765 { "?????", 0, 1, D_Illegal, NULL }, /* 0x70 */ | |
766 { "?????", 0, 1, D_Illegal, NULL }, /* 0x71 */ | |
767 { "?????", 0, 1, D_Illegal, NULL }, /* 0x72 */ | |
768 { "?????", 0, 1, D_Illegal, NULL }, /* 0x73 */ | |
769 { "?????", 0, 1, D_Illegal, NULL }, /* 0x74 */ | |
770 { "?????", 0, 1, D_Illegal, NULL }, /* 0x75 */ | |
771 { "?????", 0, 1, D_Illegal, NULL }, /* 0x76 */ | |
772 { "?????", 0, 1, D_Illegal, NULL }, /* 0x77 */ | |
773 { "?????", 0, 1, D_Illegal, NULL }, /* 0x78 */ | |
774 { "?????", 0, 1, D_Illegal, NULL }, /* 0x79 */ | |
775 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7a */ | |
776 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7b */ | |
777 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7c */ | |
778 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7d */ | |
779 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7e */ | |
780 { "?????", 0, 1, D_Illegal, NULL }, /* 0x7f */ | |
781 | |
782 { "?????", 0, 1, D_Illegal, NULL }, /* 0x80 */ | |
783 { "?????", 0, 1, D_Illegal, NULL }, /* 0x81 */ | |
784 { "?????", 0, 1, D_Illegal, NULL }, /* 0x82 */ | |
785 { "CMPU ", 5, 4, D_ImmediatL, NULL }, /* 0x83 */ | |
786 { "?????", 0, 1, D_Illegal, NULL }, /* 0x84 */ | |
787 { "?????", 0, 1, D_Illegal, NULL }, /* 0x85 */ | |
788 { "?????", 0, 1, D_Illegal, NULL }, /* 0x86 */ | |
789 { "?????", 0, 1, D_Illegal, NULL }, /* 0x87 */ | |
790 { "?????", 0, 1, D_Illegal, NULL }, /* 0x88 */ | |
791 { "?????", 0, 1, D_Illegal, NULL }, /* 0x89 */ | |
792 { "?????", 0, 1, D_Illegal, NULL }, /* 0x8a */ | |
793 { "?????", 0, 1, D_Illegal, NULL }, /* 0x8b */ | |
794 { "CMPS ", 5, 4, D_ImmediatL, NULL }, /* 0x8c */ | |
795 { "?????", 0, 1, D_Illegal, NULL }, /* 0x8d */ | |
796 { "?????", 0, 1, D_Illegal, NULL }, /* 0x8e */ | |
797 { "?????", 0, 1, D_Illegal, NULL }, /* 0x8f */ | |
798 | |
799 { "?????", 0, 1, D_Illegal, NULL }, /* 0x90 */ | |
800 { "?????", 0, 1, D_Illegal, NULL }, /* 0x91 */ | |
801 { "?????", 0, 1, D_Illegal, NULL }, /* 0x92 */ | |
802 { "CMPU ", 7, 3, D_Direct, NULL }, /* 0x93 */ | |
803 { "?????", 0, 1, D_Illegal, NULL }, /* 0x94 */ | |
804 { "?????", 0, 1, D_Illegal, NULL }, /* 0x95 */ | |
805 { "?????", 0, 1, D_Illegal, NULL }, /* 0x96 */ | |
806 { "?????", 0, 1, D_Illegal, NULL }, /* 0x97 */ | |
807 { "?????", 0, 1, D_Illegal, NULL }, /* 0x98 */ | |
808 { "?????", 0, 1, D_Illegal, NULL }, /* 0x99 */ | |
809 { "?????", 0, 1, D_Illegal, NULL }, /* 0x9a */ | |
810 { "?????", 0, 1, D_Illegal, NULL }, /* 0x9b */ | |
811 { "CMPS ", 7, 3, D_Direct, NULL }, /* 0x9c */ | |
812 { "?????", 0, 1, D_Illegal, NULL }, /* 0x9d */ | |
813 { "?????", 0, 1, D_Illegal, NULL }, /* 0x9e */ | |
814 { "?????", 0, 1, D_Illegal, NULL }, /* 0x9f */ | |
815 | |
816 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa0 */ | |
817 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa1 */ | |
818 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa2 */ | |
819 { "CMPU ", 7, 3, D_Indexed, NULL }, /* 0xa3 */ | |
820 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa4 */ | |
821 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa5 */ | |
822 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa6 */ | |
823 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa7 */ | |
824 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa8 */ | |
825 { "?????", 0, 1, D_Illegal, NULL }, /* 0xa9 */ | |
826 { "?????", 0, 1, D_Illegal, NULL }, /* 0xaa */ | |
827 { "?????", 0, 1, D_Illegal, NULL }, /* 0xab */ | |
828 { "CMPS ", 7, 3, D_Indexed, NULL }, /* 0xac */ | |
829 { "?????", 0, 1, D_Illegal, NULL }, /* 0xad */ | |
830 { "?????", 0, 1, D_Illegal, NULL }, /* 0xae */ | |
831 { "?????", 0, 1, D_Illegal, NULL }, /* 0xaf */ | |
832 | |
833 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb0 */ | |
834 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb1 */ | |
835 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb2 */ | |
836 { "CMPU ", 8, 4, D_Extended, NULL }, /* 0xb3 */ | |
837 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb4 */ | |
838 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb5 */ | |
839 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb6 */ | |
840 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb7 */ | |
841 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb8 */ | |
842 { "?????", 0, 1, D_Illegal, NULL }, /* 0xb9 */ | |
843 { "?????", 0, 1, D_Illegal, NULL }, /* 0xba */ | |
844 { "?????", 0, 1, D_Illegal, NULL }, /* 0xbb */ | |
845 { "CMPS ", 8, 4, D_Extended, NULL }, /* 0xbc */ | |
846 { "?????", 0, 1, D_Illegal, NULL }, /* 0xbd */ | |
847 { "?????", 0, 1, D_Illegal, NULL }, /* 0xbe */ | |
848 { "?????", 0, 1, D_Illegal, NULL }, /* 0xbf */ | |
849 | |
850 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc0 */ | |
851 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc1 */ | |
852 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc2 */ | |
853 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc3 */ | |
854 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc4 */ | |
855 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc5 */ | |
856 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc6 */ | |
857 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc7 */ | |
858 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc8 */ | |
859 { "?????", 0, 1, D_Illegal, NULL }, /* 0xc9 */ | |
860 { "?????", 0, 1, D_Illegal, NULL }, /* 0xca */ | |
861 { "?????", 0, 1, D_Illegal, NULL }, /* 0xcb */ | |
862 { "?????", 0, 1, D_Illegal, NULL }, /* 0xcc */ | |
863 { "?????", 0, 1, D_Illegal, NULL }, /* 0xcd */ | |
864 { "?????", 0, 1, D_Illegal, NULL }, /* 0xce */ | |
865 { "?????", 0, 1, D_Illegal, NULL }, /* 0xcf */ | |
866 | |
867 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd0 */ | |
868 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd1 */ | |
869 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd2 */ | |
870 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd3 */ | |
871 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd4 */ | |
872 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd5 */ | |
873 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd6 */ | |
874 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd7 */ | |
875 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd8 */ | |
876 { "?????", 0, 1, D_Illegal, NULL }, /* 0xd9 */ | |
877 { "?????", 0, 1, D_Illegal, NULL }, /* 0xda */ | |
878 { "?????", 0, 1, D_Illegal, NULL }, /* 0xdb */ | |
879 { "?????", 0, 1, D_Illegal, NULL }, /* 0xdc */ | |
880 { "?????", 0, 1, D_Illegal, NULL }, /* 0xdd */ | |
881 { "?????", 0, 1, D_Illegal, NULL }, /* 0xde */ | |
882 { "?????", 0, 1, D_Illegal, NULL }, /* 0xdf */ | |
883 | |
884 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe0 */ | |
885 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe1 */ | |
886 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe2 */ | |
887 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe3 */ | |
888 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe4 */ | |
889 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe5 */ | |
890 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe6 */ | |
891 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe7 */ | |
892 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe8 */ | |
893 { "?????", 0, 1, D_Illegal, NULL }, /* 0xe9 */ | |
894 { "?????", 0, 1, D_Illegal, NULL }, /* 0xea */ | |
895 { "?????", 0, 1, D_Illegal, NULL }, /* 0xeb */ | |
896 { "?????", 0, 1, D_Illegal, NULL }, /* 0xec */ | |
897 { "?????", 0, 1, D_Illegal, NULL }, /* 0xed */ | |
898 { "?????", 0, 1, D_Illegal, NULL }, /* 0xee */ | |
899 { "?????", 0, 1, D_Illegal, NULL }, /* 0xef */ | |
900 | |
901 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf0 */ | |
902 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf1 */ | |
903 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf2 */ | |
904 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf3 */ | |
905 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf4 */ | |
906 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf5 */ | |
907 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf6 */ | |
908 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf7 */ | |
909 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf8 */ | |
910 { "?????", 0, 1, D_Illegal, NULL }, /* 0xf9 */ | |
911 { "?????", 0, 1, D_Illegal, NULL }, /* 0xfa */ | |
912 { "?????", 0, 1, D_Illegal, NULL }, /* 0xfb */ | |
913 { "?????", 0, 1, D_Illegal, NULL }, /* 0xfc */ | |
914 { "?????", 0, 1, D_Illegal, NULL }, /* 0xfd */ | |
915 { "?????", 0, 1, D_Illegal, NULL }, /* 0xfe */ | |
916 { "?????", 0, 1, D_Illegal, NULL }, /* 0xff */ | |
917 }; | |
918 | |
1 | 919 |
920 struct os9syscall { int code; char *name; } os9sys[] = { | |
921 {0x0000,"F$LINK"}, | |
922 {0x0001,"F$LOAD"}, | |
923 {0x0002,"F$UNLINK"}, | |
924 {0x0003,"F$FORK"}, | |
925 {0x0004,"F$WAIT"}, | |
926 {0x0005,"F$CHAIN"}, | |
927 {0x0006,"F$EXIT"}, | |
928 {0x0007,"F$MEM"}, | |
929 {0x0008,"F$SEND"}, | |
930 {0x0009,"F$ICPT"}, | |
931 {0x000a,"F$SLEEP"}, | |
932 {0x000b,"F$SSPD"}, | |
933 {0x000c,"F$ID"}, | |
934 {0x000d,"F$SPRIOR"}, | |
935 {0x000e,"F$SSWI"}, | |
936 {0x000f,"F$PERR"}, | |
937 {0x0010,"F$PRSNAM"}, | |
938 {0x0011,"F$CMPNAM"}, | |
939 {0x0012,"F$SCHBIT"}, | |
940 {0x0013,"F$ALLBIT"}, | |
941 {0x0014,"F$DELBIT"}, | |
942 {0x0015,"F$TIME"}, | |
943 {0x0016,"F$STIME"}, | |
944 {0x0017,"F$CRC"}, | |
945 {0x0018,"F$GPRDSC"}, | |
946 {0x0019,"F$GBLKMP"}, | |
947 {0x001a,"F$GMODDR"}, | |
948 {0x001b,"F$CPYMEM"}, | |
949 {0x001c,"F$SUSER"}, | |
950 {0x001d,"F$UNLOAD"}, | |
65 | 951 {0x001e,"F$ALARM"}, |
952 {0x0021,"F$NMLINK"}, | |
953 {0x0022,"F$NMLOAD"}, | |
954 {0x0023,"F$DEBUG"}, | |
955 {0x0025,"F$TPS"}, | |
956 {0x0026,"F$TIMALM"}, | |
1 | 957 {0x0027,"F$VIRQ"}, |
958 {0x0028,"F$SRQMEM"}, | |
959 {0x0029,"F$SRTMEM"}, | |
960 {0x002a,"F$IRQ"}, | |
961 {0x002b,"F$IOQU"}, | |
962 {0x002c,"F$APROC"}, | |
963 {0x002d,"F$NPROC"}, | |
964 {0x002e,"F$VMODUL"}, | |
965 {0x002f,"F$FIND64"}, | |
966 {0x0030,"F$ALL64"}, | |
967 {0x0031,"F$RET64"}, | |
968 {0x0032,"F$SSVC"}, | |
969 {0x0033,"F$IODEL"}, | |
970 {0x0034,"F$SLINK"}, | |
971 {0x0035,"F$BOOT"}, | |
972 {0x0036,"F$BTMEM"}, | |
973 {0x0037,"F$GPROCP"}, | |
974 {0x0038,"F$MOVE"}, | |
975 {0x0039,"F$ALLRAM"}, | |
976 {0x003a,"F$ALLIMG"}, | |
977 {0x003b,"F$DELIMG"}, | |
978 {0x003c,"F$SETIMG"}, | |
979 {0x003d,"F$FREELB"}, | |
980 {0x003e,"F$FREEHB"}, | |
981 {0x003f,"F$ALLTSK"}, | |
982 {0x0040,"F$DELTSK"}, | |
983 {0x0041,"F$SETTSK"}, | |
984 {0x0042,"F$RESTSK"}, | |
985 {0x0043,"F$RELTSK"}, | |
986 {0x0044,"F$DATLOG"}, | |
987 {0x0045,"F$DATTMP"}, | |
988 {0x0046,"F$LDAXY"}, | |
989 {0x0047,"F$LDAXYP"}, | |
990 {0x0048,"F$LDDDXY"}, | |
991 {0x0049,"F$LDABX"}, | |
992 {0x004a,"F$STABX"}, | |
993 {0x004b,"F$ALLPRC"}, | |
994 {0x004c,"F$DELPRC"}, | |
995 {0x004d,"F$ELINK"}, | |
996 {0x004e,"F$FMODUL"}, | |
997 {0x004f,"F$MAPBLK"}, | |
998 {0x0050,"F$CLRBLK"}, | |
999 {0x0051,"F$DELRAM"}, | |
1000 {0x0052,"F$GCMDIR"}, | |
1001 {0x0053,"F$ALHRAM"}, | |
65 | 1002 {0x0054,"F$REBOOT"}, |
1003 {0x0055,"F$CRCMOD"}, | |
1004 {0x0056,"F$XTIME"}, | |
1005 {0x0057,"F$VBLOCK"}, | |
1006 {0x0070,"F$REGDMP"}, | |
1007 {0x0071,"F$NVRAM"}, | |
1008 {0x0080,"I$ATTACH"}, | |
1009 {0x0081,"I$DETACH"}, | |
1010 {0x0082,"I$DUP"}, | |
1011 {0x0083,"I$CREATE"}, | |
1012 {0x0084,"I$OPEN"}, | |
1013 {0x0085,"I$MAKDIR"}, | |
1014 {0x0086,"I$CHGDIR"}, | |
1015 {0x0087,"I$DELETE"}, | |
1016 {0x0088,"I$SEEK"}, | |
1017 {0x0089,"I$READ"}, | |
1018 {0x008a,"I$WRITE"}, | |
1019 {0x008b,"I$READLN"}, | |
1020 {0x008c,"I$WRITLN"}, | |
1021 {0x008d,"I$GETSTT"}, | |
1022 {0x008e,"I$SETSTT"}, | |
1023 {0x008f,"I$CLOSE"}, | |
1024 {0x0090,"I$DELETX"}, | |
1 | 1025 } ; |
1026 | |
1027 | |
0 | 1028 int iotable[32] = { |
1029 0x0000, | |
1030 0x0001, | |
1031 0x0002, | |
1032 0x0003, | |
1033 0x0008, | |
1034 0x0009, | |
1035 0x000a, | |
1036 0x000b, | |
1037 0x000c, | |
1038 0x000d, | |
1039 0x000e, | |
1040 0x0010, | |
1041 0x0011, | |
1042 0x0012, | |
1043 0x0013, | |
1044 0x0014, | |
1045 0x8000, | |
1046 0x8001, | |
1047 0x8002, | |
1048 0x8003, | |
1049 0x8004, | |
1050 0x8005, | |
1051 0x8006, | |
1052 0x8007, | |
1053 0x8008, | |
1054 0x8009, | |
1055 0x800a, | |
1056 0x800b, | |
1057 0x800c, | |
1058 0x800d, | |
1059 0x800e, | |
1060 0x800f, | |
1061 }; | |
1062 | |
1063 char *iocomment[32] = { | |
1064 "Data direction register port 1", | |
1065 "Data direction register port 2", | |
1066 "I/O register port 1", | |
1067 "I/O register port 2", | |
1068 "Timer control and status", | |
1069 "Counter high byte", | |
1070 "Counter low byte", | |
1071 "Output compare high byte", | |
1072 "Output compare low byte", | |
1073 "Input capture high byte", | |
1074 "Input capture low byte", | |
1075 "Serial rate and mode register", | |
1076 "Serial control and status register", | |
1077 "Serial receiver data register", | |
1078 "Serial transmit data register", | |
1079 "Ram control register", | |
1080 "Modem port 0", | |
1081 "Modem port 1", | |
1082 "Modem port 2", | |
1083 "Modem port 3", | |
1084 "Modem port 4", | |
1085 "Modem port 5", | |
1086 "Modem port 6", | |
1087 "Modem port 7", | |
1088 "Modem port 8", | |
1089 "Modem port 9", | |
1090 "Modem port 10", | |
1091 "Modem port 11", | |
1092 "Modem port 12", | |
1093 "Modem port 13", | |
1094 "Modem port 14", | |
1095 "Modem port 15", | |
1096 }; | |
1097 | |
1098 char *Inter_Register[16]={"D","X","Y","U","S","PC","??","??","A","B","CC","DP","??","??","??","??"}; | |
1099 | |
1100 char *Indexed_Register[4]={"X","Y","U","S"}; | |
1101 | |
1102 int lastio = 32; | |
1103 | |
1104 #pragma argsused | |
1105 int D_Illegal(op, code, pc, suffix) | |
1106 Opcode *op; | |
1107 int code; | |
1108 int pc; | |
1109 char *suffix; | |
1110 { | |
1111 fprintf(fp,"%0.2X %s%s", code, suffix, op->name); | |
1112 return op->bytes; | |
1113 } | |
1114 | |
1115 #pragma argsused | |
1116 int D_Direct(op, code, pc, suffix) | |
1117 Opcode *op; | |
1118 int code; | |
1119 int pc; | |
1120 char *suffix; | |
1121 { | |
1122 int offset; | |
1123 | |
1124 offset = prog[pc+1]; | |
8 | 1125 fprintf(fp,"%0.2X %0.2X %s%s <$%0.2X", |
0 | 1126 code, offset, suffix, op->name, offset); |
1127 return op->bytes; | |
1128 } | |
1129 | |
1130 #pragma argsused | |
1131 int D_Page10(op, code, pc, suffix) | |
1132 Opcode *op; | |
1133 int code; | |
1134 int pc; | |
1135 char *suffix; | |
1136 { | |
1137 fprintf(fp,"10 "); | |
1138 code = prog[pc+1]; | |
1139 return (*optable10[code].display)(&optable10[code], code, pc+1, ""); | |
1140 } | |
1141 | |
1142 #pragma argsused | |
1143 int D_Page11(op, code, pc, suffix) | |
1144 Opcode *op; | |
1145 int code; | |
1146 int pc; | |
1147 char *suffix; | |
1148 { | |
1149 fprintf(fp,"11 "); | |
1150 code = prog[pc+1]; | |
1151 return (*optable11[code].display)(&optable11[code], code, pc+1, ""); | |
1152 } | |
1153 | |
1154 #pragma argsused | |
1155 int D_Immediat(op, code, pc, suffix) | |
1156 Opcode *op; | |
1157 int code; | |
1158 int pc; | |
1159 char *suffix; | |
1160 { | |
1161 int offset; | |
1162 | |
1163 offset = prog[pc+1]; | |
1164 fprintf(fp,"%0.2X %0.2X %s%s #$%0.2X", | |
1165 code, offset, suffix, op->name, offset); | |
1166 return op->bytes; | |
1167 } | |
1168 | |
1169 #pragma argsused | |
1170 int D_ImmediatL(op, code, pc, suffix) | |
1171 Opcode *op; | |
1172 int code; | |
1173 int pc; | |
1174 char *suffix; | |
1175 { | |
1176 int offset; | |
1177 | |
1178 offset = prog[pc+1] * 256 + prog[pc+2]; | |
1179 fprintf(fp,"%0.2X %0.2X %0.2X %s%s #$%0.4X", | |
1180 code, prog[pc+1], prog[pc+2], suffix, op->name, offset); | |
1181 return op->bytes; | |
1182 } | |
1183 | |
1184 #pragma argsused | |
1185 int D_Inherent(op, code, pc, suffix) | |
1186 Opcode *op; | |
1187 int code; | |
1188 int pc; | |
1189 char *suffix; | |
1190 { | |
1191 fprintf(fp,"%0.2X %s%s", code, suffix, op->name); | |
1192 return op->bytes; | |
1193 } | |
1194 | |
1195 #pragma argsused | |
1196 int D_OS9(op, code, pc, suffix) | |
1197 Opcode *op; | |
1198 int code; | |
1199 int pc; | |
1200 char *suffix; | |
1201 { | |
1202 int offset; | |
1203 | |
1 | 1204 offset = prog[pc+1]; |
1205 for(int i =0, j = sizeof(os9sys)/sizeof(struct os9syscall), m = (i+j)/2 ;i<=j; m=(i+j)/2 ) { | |
1206 if (os9sys[m].code > offset) { | |
1207 j=m-1; | |
1208 } else if (os9sys[m].code < offset) { | |
1209 i=m+1; | |
1210 } else if (os9sys[m].code == offset) { | |
1211 fprintf(fp,"%0.2X %0.2X %s%s %s", | |
1212 code, offset, suffix, op->name, os9sys[m].name); | |
1213 return op->bytes; | |
1214 } | |
1215 } | |
0 | 1216 fprintf(fp,"%0.2X %0.2X %s%s $%0.2X", |
1 | 1217 code, offset, suffix, op->name, prog[pc+1]); |
0 | 1218 return op->bytes; |
1219 } | |
1220 | |
1221 #pragma argsused | |
1222 char *IndexRegister(postbyte) | |
1223 int postbyte; | |
1224 { | |
1225 return Indexed_Register[ (postbyte>>5) & 0x03]; | |
1226 } | |
1227 | |
1228 #pragma argsused | |
1229 int D_Indexed(op, code, pc, suffix) | |
1230 Opcode *op; | |
1231 int code; | |
1232 int pc; | |
1233 char *suffix; | |
1234 { | |
1235 int postbyte; | |
1236 char *s; | |
1237 int extrabytes; | |
1238 int disp; | |
1239 int address; | |
1240 int offset; | |
1241 | |
1242 extrabytes = 0; | |
1243 postbyte = prog[pc+1]; | |
1244 if ((postbyte & 0x80) == 0x00) { | |
1245 disp = postbyte & 0x1f; | |
1246 if ((postbyte & 0x10) == 0x10) { | |
1247 s = "-"; | |
1248 disp=0x20-disp; | |
1249 } | |
1250 else | |
1251 s = "+"; | |
1252 fprintf(fp,"%0.2X %0.2X %s%s %s$%0.2X,%s", | |
1253 code, postbyte, suffix, op->name, s,disp,IndexRegister(postbyte)); | |
1254 } else { | |
1255 switch(postbyte & 0x1f) { | |
1256 case 0x00 : | |
1257 fprintf(fp,"%0.2X %0.2X %s%s ,%s+", | |
1258 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1259 break; | |
1260 case 0x01 : | |
1261 fprintf(fp,"%0.2X %0.2X %s%s ,%s++", | |
1262 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1263 break; | |
1264 case 0x02 : | |
1265 fprintf(fp,"%0.2X %0.2X %s%s ,-%s", | |
1266 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1267 break; | |
1268 case 0x03 : | |
1269 fprintf(fp,"%0.2X %0.2X %s%s ,--%s", | |
1270 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1271 break; | |
1272 case 0x04 : | |
1273 fprintf(fp,"%0.2X %0.2X %s%s ,%s", | |
1274 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1275 break; | |
1276 case 0x05 : | |
1277 fprintf(fp,"%0.2X %0.2X %s%s B,%s", | |
1278 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1279 break; | |
1280 case 0x06 : | |
1281 fprintf(fp,"%0.2X %0.2X %s%s A,%s", | |
1282 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1283 break; | |
1284 case 0x07 : | |
1285 break; | |
1286 case 0x08 : | |
1287 offset = prog[pc+2]; | |
1288 if (offset < 128) | |
1289 s = "+"; | |
1290 else { | |
1291 s = "-"; | |
1292 offset=0x0100-offset; | |
1293 } | |
1294 fprintf(fp,"%0.2X %0.2X %0.2X %s%s %s$%0.2X,%s", | |
1295 code, postbyte, prog[pc+2], suffix, op->name, s, offset, | |
1296 IndexRegister(postbyte)); | |
1297 extrabytes=1; | |
1298 break; | |
1299 case 0x09 : | |
1300 offset = prog[pc+2] * 256 + prog[pc+3]; | |
1301 if (offset < 32768) | |
1302 s = "+"; | |
1303 else { | |
1304 s = "-"; | |
1305 offset=0xffff-offset+1; | |
1306 } | |
1307 fprintf(fp,"%0.2X %0.2X %0.2X %0.2X %s%s %s$%0.4X,%s", | |
1308 code, postbyte, prog[pc+2], prog[pc+3], suffix, op->name, s, offset, | |
1309 IndexRegister(postbyte)); | |
1310 extrabytes=2; | |
1311 break; | |
1312 case 0x0a : | |
1313 break; | |
1314 case 0x0b : | |
1315 fprintf(fp,"%0.2X %0.2X %s%s D,%s", | |
1316 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1317 break; | |
1318 case 0x0c : | |
33 | 1319 offset = (*(char *)(prog+pc+2)+pc+3) & 0xFFFF; |
0 | 1320 s = "<"; |
1321 fprintf(fp,"%0.2X %0.2X %0.2X %s%s %s$%0.2X,PCR", | |
8 | 1322 code, postbyte, prog[pc+2], suffix, op->name, s, offset+adoffset); |
0 | 1323 extrabytes = 1; |
1324 break; | |
1325 case 0x0d : | |
33 | 1326 offset = prog[pc+2] * 256 + prog[pc+3]; |
34 | 1327 offset = ((offset>0x7fff? offset-0x10000 : offset )+pc+4) & 0xFFFF; |
0 | 1328 s = ">"; |
1329 fprintf(fp,"%0.2X %0.2X %0.2X %0.2X %s%s %s$%0.4X,PCR", | |
8 | 1330 code, postbyte, prog[pc+2], prog[pc+3], suffix, op->name, s, offset+adoffset); |
0 | 1331 extrabytes = 2; |
1332 break; | |
1333 case 0x0e : | |
1334 break; | |
1335 case 0x0f : | |
1336 fprintf(fp,"%0.2X %0.2X %s?????", | |
1337 code, postbyte, suffix); | |
1338 break; | |
1339 case 0x10 : | |
1340 fprintf(fp,"%0.2X %0.2X %s?????", | |
1341 code, postbyte, suffix); | |
1342 break; | |
1343 case 0x11 : | |
1344 fprintf(fp,"%0.2X %0.2X %s%s [,%s++]", | |
1345 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1346 break; | |
1347 case 0x12 : | |
1348 fprintf(fp,"%0.2X %0.2X %s?????", | |
1349 code, postbyte, suffix); | |
1350 break; | |
1351 case 0x13 : | |
1352 fprintf(fp,"%0.2X %0.2X %s%s [,--%s]", | |
1353 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1354 break; | |
1355 case 0x14 : | |
1356 fprintf(fp,"%0.2X %0.2X %s%s [,%s]", | |
1357 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1358 break; | |
1359 case 0x15 : | |
1360 fprintf(fp,"%0.2X %0.2X %s%s [B,%s]", | |
1361 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1362 break; | |
1363 case 0x16 : | |
1364 fprintf(fp,"%0.2X %0.2X %s%s [A,%s]", | |
1365 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1366 break; | |
1367 case 0x17 : | |
1368 break; | |
1369 case 0x18 : | |
1370 offset = prog[pc+2]; | |
1371 if (offset < 128) | |
1372 s = "+"; | |
1373 else { | |
1374 s = "-"; | |
1375 offset=0x0100-offset; | |
1376 } | |
1377 fprintf(fp,"%0.2X %0.2X %0.2X %s%s [%s$%0.2X,%s]", | |
1378 code, postbyte, prog[pc+2], suffix, op->name, s, offset, | |
1379 IndexRegister(postbyte)); | |
35 | 1380 extrabytes = 1; |
0 | 1381 break; |
1382 case 0x19 : | |
1383 offset = prog[pc+2] * 256 + prog[pc+3]; | |
1384 if (offset < 32768) | |
1385 s = "+"; | |
1386 else { | |
1387 s = "-"; | |
1388 offset=0xffff-offset+1; | |
1389 } | |
52
51b437557f42
boot without disk image
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
35
diff
changeset
|
1390 fprintf(fp,"%0.2X %0.2X %0.2X %0.2X %s%s [%s$%0.4X,%s]", |
0 | 1391 code, postbyte, prog[pc+2], prog[pc+3], suffix, op->name, s, offset, |
1392 IndexRegister(postbyte)); | |
35 | 1393 extrabytes = 2; |
0 | 1394 break; |
1395 case 0x1a : | |
1396 break; | |
1397 case 0x1b : | |
1398 fprintf(fp,"%0.2X %0.2X %s%s [D,%s]", | |
1399 code, postbyte, suffix, op->name, IndexRegister(postbyte)); | |
1400 break; | |
1401 case 0x1c : | |
33 | 1402 offset = (*((char*)prog+pc+2)+pc+3) & 0xFFFF; |
0 | 1403 s = "<"; |
1404 fprintf(fp,"%0.2X %0.2X %0.2X %s%s [%s$%0.2X,PCR]", | |
8 | 1405 code, postbyte, prog[pc+2], suffix, op->name, s, offset+adoffset); |
0 | 1406 extrabytes = 1; |
1407 break; | |
1408 case 0x1d : | |
33 | 1409 offset = prog[pc+2] * 256 + prog[pc+3]; |
1410 offset = ((offset>0x7fff?offset-0x8001 : offset )+pc+4) & 0xFFFF; | |
0 | 1411 s = ">"; |
1412 fprintf(fp,"%0.2X %0.2X %0.2X %0.2X %s%s [%s$%0.4X,PCR]", | |
8 | 1413 code, postbyte, prog[pc+2], prog[pc+3], suffix, op->name, s, offset+adoffset); |
0 | 1414 extrabytes = 2; |
1415 break; | |
1416 case 0x1e : | |
1417 break; | |
1418 case 0x1f : | |
1419 address = prog[pc+2] * 256 + prog[pc+3]; | |
1420 extrabytes = 2; | |
1421 fprintf(fp,"%0.2X %0.2X %0.2X %0.2X %s%s [$%4X]", | |
1422 code, postbyte, prog[pc+2], prog[pc+3], suffix, op->name, address); | |
1423 break; | |
1424 } | |
1425 } | |
1426 return op->bytes + extrabytes; | |
1427 } | |
1428 | |
1429 #pragma argsused | |
1430 int D_Extended(op, code, pc, suffix) | |
1431 Opcode *op; | |
1432 int code; | |
1433 int pc; | |
1434 char *suffix; | |
1435 { | |
1436 int offset; | |
1437 | |
1438 offset = prog[pc+1] * 256 + prog[pc+2]; | |
1439 fprintf(fp,"%0.2X %0.2X %0.2X %s%s $%0.4X", | |
1440 code, prog[pc+1], prog[pc+2], suffix, op->name, offset); | |
1441 return op->bytes; | |
1442 } | |
1443 | |
1444 #pragma argsused | |
1445 int D_Relative(op, code, pc, suffix) | |
1446 Opcode *op; | |
1447 int code; | |
1448 int pc; | |
1449 char *suffix; | |
1450 { | |
1451 int offset; | |
1452 int disp; | |
1453 | |
1454 offset = prog[pc+1]; | |
1455 if (offset < 127 ) | |
71 | 1456 disp = pc + 2 + offset + adoffset; |
0 | 1457 else |
71 | 1458 disp = pc + 2 - (256 - offset + adoffset); |
0 | 1459 fprintf(fp,"%0.2X %0.2X %s%s $%0.4X", |
1460 code, offset, suffix, op->name, disp); | |
1461 return op->bytes; | |
1462 } | |
1463 | |
1464 #pragma argsused | |
1465 int D_RelativeL(op, code, pc, suffix) | |
1466 Opcode *op; | |
1467 int code; | |
1468 int pc; | |
1469 char *suffix; | |
1470 { | |
1471 int offset; | |
1472 int disp; | |
1473 | |
1474 offset = prog[pc+1] * 256 + prog[pc+2]; | |
1475 if (offset < 32767 ) | |
1476 disp = pc + 3 + offset + adoffset; | |
1477 else | |
1478 disp = pc + 3 - (65536 - offset) + adoffset; | |
1479 fprintf(fp,"%0.2X %0.2X %0.2X %s%s $%0.4X", | |
1480 code, prog[pc+1], prog[pc+2], suffix, op->name, disp); | |
1481 return op->bytes; | |
1482 } | |
1483 | |
1484 #pragma argsused | |
1485 int D_Register0(op, code, pc, suffix) | |
1486 Opcode *op; | |
1487 int code; | |
1488 int pc; | |
1489 char *suffix; | |
1490 { | |
1491 int postbyte; | |
1492 | |
1493 postbyte = prog[pc+1]; | |
1494 | |
1495 fprintf(fp,"%0.2X %0.2X %s%s %s,%s", | |
1496 code, postbyte, suffix, op->name, Inter_Register[postbyte>>4], Inter_Register[postbyte & 0x0F]); | |
1497 | |
1498 | |
1499 return op->bytes; | |
1500 } | |
1501 | |
1502 #pragma argsused | |
1503 int D_Register1(op, code, pc, suffix) | |
1504 Opcode *op; | |
1505 int code; | |
1506 int pc; | |
1507 char *suffix; | |
1508 { | |
1509 int postbyte; | |
1510 int i; | |
1511 int flag=0; | |
1512 static char *s_stack[8]={"PC","U","Y","X","DP","B","A","CC"}; | |
1513 static int bits[8]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01}; | |
1514 | |
1515 postbyte = prog[pc+1]; | |
1516 | |
1517 fprintf(fp,"%0.2X %0.2X %s%s ", | |
1518 code, postbyte, suffix, op->name); | |
1519 | |
1520 for(i=0;i<8;i++) { | |
1521 if ((postbyte & bits[i]) !=0) { | |
1522 if (flag !=0) { | |
1523 fprintf(fp,","); | |
1524 } else { | |
1525 flag=1; | |
1526 } | |
1527 fprintf(fp,s_stack[i]); | |
1528 } | |
1529 } | |
1530 return op->bytes; | |
1531 } | |
1532 | |
1533 #pragma argsused | |
1534 int D_Register2(op, code, pc, suffix) | |
1535 Opcode *op; | |
1536 int code; | |
1537 int pc; | |
1538 char *suffix; | |
1539 { | |
1540 int postbyte; | |
1541 int i; | |
1542 int flag=0; | |
1543 static char *u_stack[8]={"PC","S","Y","X","DP","B","A","CC"}; | |
1544 static int bits[8]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01}; | |
1545 | |
1546 postbyte = prog[pc+1]; | |
1547 fprintf(fp,"%0.2X %0.2X %s%s ", | |
1548 code, postbyte, suffix, op->name); | |
1549 | |
1550 for(i=0;i<8;i++) { | |
1551 if ((postbyte & bits[i]) !=0) { | |
1552 if (flag !=0) { | |
1553 fprintf(fp,","); | |
1554 } else { | |
1555 flag=1; | |
1556 } | |
1557 fprintf(fp,u_stack[i]); | |
1558 } | |
1559 } | |
1560 return op->bytes; | |
1561 } | |
1562 | |
1563 | |
1564 void hexadump(b, l, loc, w) | |
1565 unsigned char *b; | |
1566 int l; | |
1567 int loc; | |
1568 int w; | |
1569 { | |
1570 int i; | |
1571 int j; | |
1572 int end; | |
1573 // char b[4096]; | |
1574 | |
1575 // memset(b, '\0', 4096); | |
1576 // memcpy(b, s, l); | |
1577 //fprintf(fp,"\n"); | |
1578 end = ((l%w)>0)?(l/w)+1:(l/w); | |
1579 for (j=0;j<end;j++) { | |
1580 fprintf(fp,"%04X: ", loc+j*w+adoffset); | |
1581 for (i=0;i<w;i++) { | |
1582 fprintf(fp,"%02X ", b[j*w+i]); | |
1583 } | |
1584 fprintf(fp,"|"); | |
1585 for (i=0;i<w;i++) { | |
1586 if ((b[j*w+i] >= 0x20) && (b[j*w+i] < 0x7f)) { | |
1587 fprintf(fp,"%c", b[j*w+i]); | |
1588 } else { | |
1589 fprintf(fp,"."); | |
1590 } | |
1591 } | |
1592 fprintf(fp,"|\n"); | |
1593 } | |
1594 //fprintf(fp,"\n"); | |
1595 } | |
1596 | |
1597 char *comment(arg) | |
1598 int arg; | |
1599 { | |
1600 int i; | |
1601 | |
1602 for (i=0;i<lastio;i++) { | |
1603 if (arg == iotable[i]) { | |
1604 return iocomment[i]; | |
1605 } | |
1606 } | |
1607 return ""; | |
1608 } | |
1609 | |
12
111e5defb8ab
boot is called, rti failed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
1610 int disasm(start, end) |
0 | 1611 int start; |
1612 int end; | |
1613 { | |
1614 int pc; | |
1615 int code; | |
1616 int currstring; | |
1617 | |
1618 currstring = 0; | |
1619 for (pc=start; pc <= end;) { | |
1620 code = prog[pc]; | |
1621 fprintf(fp,"%0.4X: ", pc + adoffset); | |
1622 if (currstring < laststring) { | |
1623 if (pc == stringtable[currstring].address) { | |
1624 hexadump(&prog[pc], stringtable[currstring].length, pc, | |
1625 stringtable[currstring].width); | |
1626 pc += stringtable[currstring].length; | |
1627 currstring++; | |
1628 continue; | |
1629 } | |
1630 } | |
1631 pc += (*optable[code].display)(&optable[code], code, pc, " "); | |
1632 fprintf(fp,"\n"); | |
1633 } | |
12
111e5defb8ab
boot is called, rti failed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
1634 return pc; |
0 | 1635 } |
1636 | |
1637 #ifndef NO_MAIN | |
1638 | |
1639 int main(int argc, char **argv ) | |
1640 { | |
1641 int fd; | |
1642 int start,end; | |
1643 int size; | |
1644 | |
1645 if ( argc > 2 && *argv[1] == '-') { | |
1646 if (argv[1][1]=='o') { | |
1647 adoffset=strtol(argv[2],(char**)0,0); | |
1648 argc-=2; | |
1649 argv += 2; | |
1650 } | |
1651 } | |
1652 if ( argc != 4 ) { | |
1653 fprintf(stderr, "usage: disasm [-o offset] <file> <start> <end>\n"); | |
1654 fprintf(stderr, " where start and end are in hex.\n"); | |
1655 exit(1); | |
1656 } | |
1657 | |
1658 sscanf(argv[2],"%x",&start); start -= adoffset; | |
8 | 1659 sscanf(argv[3],"%x",&end); end -= adoffset; |
1660 printf("disass %x - %x\n",start,end); | |
0 | 1661 |
1662 fp = stdout; | |
1663 | |
1664 fd = open(argv[1], O_RDONLY, S_IREAD|S_IWRITE); | |
1665 size = read(fd, &prog[0x0000], 0xffff); | |
1666 | |
1667 if (end > size) end=size; | |
1668 | |
1669 disasm(start, end); | |
1670 close(fd); | |
1671 return 0; | |
1672 } | |
1673 | |
1674 #endif // NO_MAIN |