• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2// The following array has to be sorted by increasing
3// opcodes. Otherwise the binary_search will fail.
4//
5// Additional instructions only supported on HD6309 PAGE1
6static const inst_pageX g_hd6309_inst_overlay_table[] = {
7	{ 0x01, M680X_INS_OIM, imm8_hid, dir_hid },
8	{ 0x02, M680X_INS_AIM, imm8_hid, dir_hid },
9	{ 0x05, M680X_INS_EIM, imm8_hid, dir_hid },
10	{ 0x0B, M680X_INS_TIM, imm8_hid, dir_hid },
11	{ 0x14, M680X_INS_SEXW, inh_hid, inh_hid },
12	{ 0x61, M680X_INS_OIM, imm8_hid, idx09_hid },
13	{ 0x62, M680X_INS_AIM, imm8_hid, idx09_hid },
14	{ 0x65, M680X_INS_EIM, imm8_hid, idx09_hid },
15	{ 0x6B, M680X_INS_TIM, imm8_hid, idx09_hid },
16	{ 0x71, M680X_INS_OIM, imm8_hid, ext_hid },
17	{ 0x72, M680X_INS_AIM, imm8_hid, ext_hid },
18	{ 0x75, M680X_INS_EIM, imm8_hid, ext_hid },
19	{ 0x7B, M680X_INS_TIM, imm8_hid, ext_hid },
20	{ 0xCD, M680X_INS_LDQ, imm32_hid, inh_hid },
21};
22
23// The following array has to be sorted by increasing
24// opcodes. Otherwise the binary_search will fail.
25//
26// HD6309 PAGE2 instructions (with prefix 0x10)
27static const inst_pageX g_hd6309_inst_page2_table[] = {
28	// 0x2x, relative long branch instructions
29	{ 0x21, M680X_INS_LBRN, rel16_hid, inh_hid },
30	{ 0x22, M680X_INS_LBHI, rel16_hid, inh_hid },
31	{ 0x23, M680X_INS_LBLS, rel16_hid, inh_hid },
32	{ 0x24, M680X_INS_LBCC, rel16_hid, inh_hid },
33	{ 0x25, M680X_INS_LBCS, rel16_hid, inh_hid },
34	{ 0x26, M680X_INS_LBNE, rel16_hid, inh_hid },
35	{ 0x27, M680X_INS_LBEQ, rel16_hid, inh_hid },
36	{ 0x28, M680X_INS_LBVC, rel16_hid, inh_hid },
37	{ 0x29, M680X_INS_LBVS, rel16_hid, inh_hid },
38	{ 0x2a, M680X_INS_LBPL, rel16_hid, inh_hid },
39	{ 0x2b, M680X_INS_LBMI, rel16_hid, inh_hid },
40	{ 0x2c, M680X_INS_LBGE, rel16_hid, inh_hid },
41	{ 0x2d, M680X_INS_LBLT, rel16_hid, inh_hid },
42	{ 0x2e, M680X_INS_LBGT, rel16_hid, inh_hid },
43	{ 0x2f, M680X_INS_LBLE, rel16_hid, inh_hid },
44	// 0x3x
45	{ 0x30, M680X_INS_ADDR, rr09_hid, inh_hid },
46	{ 0x31, M680X_INS_ADCR, rr09_hid, inh_hid },
47	{ 0x32, M680X_INS_SUBR, rr09_hid, inh_hid },
48	{ 0x33, M680X_INS_SBCR, rr09_hid, inh_hid },
49	{ 0x34, M680X_INS_ANDR, rr09_hid, inh_hid },
50	{ 0x35, M680X_INS_ORR, rr09_hid, inh_hid },
51	{ 0x36, M680X_INS_EORR, rr09_hid, inh_hid },
52	{ 0x37, M680X_INS_CMPR, rr09_hid, inh_hid },
53	{ 0x38, M680X_INS_PSHSW, inh_hid, inh_hid },
54	{ 0x39, M680X_INS_PULSW, inh_hid, inh_hid },
55	{ 0x3a, M680X_INS_PSHUW, inh_hid, inh_hid },
56	{ 0x3b, M680X_INS_PULUW, inh_hid, inh_hid },
57	{ 0x3f, M680X_INS_SWI2, inh_hid, inh_hid },
58	// 0x4x, Register D instructions
59	{ 0x40, M680X_INS_NEGD, inh_hid, inh_hid },
60	{ 0x43, M680X_INS_COMD, inh_hid, inh_hid },
61	{ 0x44, M680X_INS_LSRD, inh_hid, inh_hid },
62	{ 0x46, M680X_INS_RORD, inh_hid, inh_hid },
63	{ 0x47, M680X_INS_ASRD, inh_hid, inh_hid },
64	{ 0x48, M680X_INS_LSLD, inh_hid, inh_hid },
65	{ 0x49, M680X_INS_ROLD, inh_hid, inh_hid },
66	{ 0x4a, M680X_INS_DECD, inh_hid, inh_hid },
67	{ 0x4c, M680X_INS_INCD, inh_hid, inh_hid },
68	{ 0x4d, M680X_INS_TSTD, inh_hid, inh_hid },
69	{ 0x4f, M680X_INS_CLRD, inh_hid, inh_hid },
70	// 0x5x, Register W instructions
71	{ 0x53, M680X_INS_COMW, inh_hid, inh_hid },
72	{ 0x54, M680X_INS_LSRW, inh_hid, inh_hid },
73	{ 0x56, M680X_INS_RORW, inh_hid, inh_hid },
74	{ 0x59, M680X_INS_ROLW, inh_hid, inh_hid },
75	{ 0x5a, M680X_INS_DECW, inh_hid, inh_hid },
76	{ 0x5c, M680X_INS_INCW, inh_hid, inh_hid },
77	{ 0x5d, M680X_INS_TSTW, inh_hid, inh_hid },
78	{ 0x5f, M680X_INS_CLRW, inh_hid, inh_hid },
79	// 0x8x, immediate instructionY with register D,W,Y
80	{ 0x80, M680X_INS_SUBW, imm16_hid, inh_hid },
81	{ 0x81, M680X_INS_CMPW, imm16_hid, inh_hid },
82	{ 0x82, M680X_INS_SBCD, imm16_hid, inh_hid },
83	{ 0x83, M680X_INS_CMPD, imm16_hid, inh_hid },
84	{ 0x84, M680X_INS_ANDD, imm16_hid, inh_hid },
85	{ 0x85, M680X_INS_BITD, imm16_hid, inh_hid },
86	{ 0x86, M680X_INS_LDW, imm16_hid, inh_hid },
87	{ 0x88, M680X_INS_EORD, imm16_hid, inh_hid },
88	{ 0x89, M680X_INS_ADCD, imm16_hid, inh_hid },
89	{ 0x8a, M680X_INS_ORD, imm16_hid, inh_hid },
90	{ 0x8b, M680X_INS_ADDW, imm16_hid, inh_hid },
91	{ 0x8c, M680X_INS_CMPY, imm16_hid, inh_hid },
92	{ 0x8e, M680X_INS_LDY, imm16_hid, inh_hid },
93	// 0x9x, direct instructions with register D,W,Y
94	{ 0x90, M680X_INS_SUBW, dir_hid, inh_hid },
95	{ 0x91, M680X_INS_CMPW, dir_hid, inh_hid },
96	{ 0x92, M680X_INS_SBCD, dir_hid, inh_hid },
97	{ 0x93, M680X_INS_CMPD, dir_hid, inh_hid },
98	{ 0x94, M680X_INS_ANDD, dir_hid, inh_hid },
99	{ 0x95, M680X_INS_BITD, dir_hid, inh_hid },
100	{ 0x96, M680X_INS_LDW, dir_hid, inh_hid },
101	{ 0x97, M680X_INS_STW, dir_hid, inh_hid },
102	{ 0x98, M680X_INS_EORD, dir_hid, inh_hid },
103	{ 0x99, M680X_INS_ADCD, dir_hid, inh_hid },
104	{ 0x9a, M680X_INS_ORD, dir_hid, inh_hid },
105	{ 0x9b, M680X_INS_ADDW, dir_hid, inh_hid },
106	{ 0x9c, M680X_INS_CMPY, dir_hid, inh_hid },
107	{ 0x9e, M680X_INS_LDY, dir_hid, inh_hid },
108	{ 0x9f, M680X_INS_STY, dir_hid, inh_hid },
109	// 0xAx, indexed instructions with register D,W,Y
110	{ 0xa0, M680X_INS_SUBW, idx09_hid, inh_hid },
111	{ 0xa1, M680X_INS_CMPW, idx09_hid, inh_hid },
112	{ 0xa2, M680X_INS_SBCD, idx09_hid, inh_hid },
113	{ 0xa3, M680X_INS_CMPD, idx09_hid, inh_hid },
114	{ 0xa4, M680X_INS_ANDD, idx09_hid, inh_hid },
115	{ 0xa5, M680X_INS_BITD, idx09_hid, inh_hid },
116	{ 0xa6, M680X_INS_LDW, idx09_hid, inh_hid },
117	{ 0xa7, M680X_INS_STW, idx09_hid, inh_hid },
118	{ 0xa8, M680X_INS_EORD, idx09_hid, inh_hid },
119	{ 0xa9, M680X_INS_ADCD, idx09_hid, inh_hid },
120	{ 0xaa, M680X_INS_ORD, idx09_hid, inh_hid },
121	{ 0xab, M680X_INS_ADDW, idx09_hid, inh_hid },
122	{ 0xac, M680X_INS_CMPY, idx09_hid, inh_hid },
123	{ 0xae, M680X_INS_LDY, idx09_hid, inh_hid },
124	{ 0xaf, M680X_INS_STY, idx09_hid, inh_hid },
125	// 0xBx, extended instructions with register D,W,Y
126	{ 0xb0, M680X_INS_SUBW, ext_hid, inh_hid },
127	{ 0xb1, M680X_INS_CMPW, ext_hid, inh_hid },
128	{ 0xb2, M680X_INS_SBCD, ext_hid, inh_hid },
129	{ 0xb3, M680X_INS_CMPD, ext_hid, inh_hid },
130	{ 0xb4, M680X_INS_ANDD, ext_hid, inh_hid },
131	{ 0xb5, M680X_INS_BITD, ext_hid, inh_hid },
132	{ 0xb6, M680X_INS_LDW, ext_hid, inh_hid },
133	{ 0xb7, M680X_INS_STW, ext_hid, inh_hid },
134	{ 0xb8, M680X_INS_EORD, ext_hid, inh_hid },
135	{ 0xb9, M680X_INS_ADCD, ext_hid, inh_hid },
136	{ 0xba, M680X_INS_ORD, ext_hid, inh_hid },
137	{ 0xbb, M680X_INS_ADDW, ext_hid, inh_hid },
138	{ 0xbc, M680X_INS_CMPY, ext_hid, inh_hid },
139	{ 0xbe, M680X_INS_LDY, ext_hid, inh_hid },
140	{ 0xbf, M680X_INS_STY, ext_hid, inh_hid },
141	// 0xCx, immediate instructions with register S
142	{ 0xce, M680X_INS_LDS, imm16_hid, inh_hid },
143	// 0xDx, direct instructions with register S,Q
144	{ 0xdc, M680X_INS_LDQ, dir_hid, inh_hid },
145	{ 0xdd, M680X_INS_STQ, dir_hid, inh_hid },
146	{ 0xde, M680X_INS_LDS, dir_hid, inh_hid },
147	{ 0xdf, M680X_INS_STS, dir_hid, inh_hid },
148	// 0xEx, indexed instructions with register S,Q
149	{ 0xec, M680X_INS_LDQ, idx09_hid, inh_hid },
150	{ 0xed, M680X_INS_STQ, idx09_hid, inh_hid },
151	{ 0xee, M680X_INS_LDS, idx09_hid, inh_hid },
152	{ 0xef, M680X_INS_STS, idx09_hid, inh_hid },
153	// 0xFx, extended instructions with register S,Q
154	{ 0xfc, M680X_INS_LDQ, ext_hid, inh_hid },
155	{ 0xfd, M680X_INS_STQ, ext_hid, inh_hid },
156	{ 0xfe, M680X_INS_LDS, ext_hid, inh_hid },
157	{ 0xff, M680X_INS_STS, ext_hid, inh_hid },
158};
159
160// The following array has to be sorted by increasing
161// opcodes. Otherwise the binary_search will fail.
162//
163// HD6309 PAGE3 instructions (with prefix 0x11)
164static const inst_pageX g_hd6309_inst_page3_table[] = {
165	{ 0x30, M680X_INS_BAND, bitmv_hid, inh_hid },
166	{ 0x31, M680X_INS_BIAND, bitmv_hid, inh_hid },
167	{ 0x32, M680X_INS_BOR, bitmv_hid, inh_hid },
168	{ 0x33, M680X_INS_BIOR, bitmv_hid, inh_hid },
169	{ 0x34, M680X_INS_BEOR, bitmv_hid, inh_hid },
170	{ 0x35, M680X_INS_BIEOR, bitmv_hid, inh_hid },
171	{ 0x36, M680X_INS_LDBT, bitmv_hid, inh_hid },
172	{ 0x37, M680X_INS_STBT, bitmv_hid, inh_hid },
173	{ 0x38, M680X_INS_TFM, tfm_hid, inh_hid },
174	{ 0x39, M680X_INS_TFM, tfm_hid, inh_hid },
175	{ 0x3a, M680X_INS_TFM, tfm_hid, inh_hid },
176	{ 0x3b, M680X_INS_TFM, tfm_hid, inh_hid },
177	{ 0x3c, M680X_INS_BITMD, imm8_hid, inh_hid },
178	{ 0x3d, M680X_INS_LDMD, imm8_hid, inh_hid },
179	{ 0x3f, M680X_INS_SWI3, inh_hid, inh_hid },
180	// 0x4x, Register E instructions
181	{ 0x43, M680X_INS_COME, inh_hid, inh_hid },
182	{ 0x4a, M680X_INS_DECE, inh_hid, inh_hid },
183	{ 0x4c, M680X_INS_INCE, inh_hid, inh_hid },
184	{ 0x4d, M680X_INS_TSTE, inh_hid, inh_hid },
185	{ 0x4f, M680X_INS_CLRE, inh_hid, inh_hid },
186	// 0x5x, Register F instructions
187	{ 0x53, M680X_INS_COMF, inh_hid, inh_hid },
188	{ 0x5a, M680X_INS_DECF, inh_hid, inh_hid },
189	{ 0x5c, M680X_INS_INCF, inh_hid, inh_hid },
190	{ 0x5d, M680X_INS_TSTF, inh_hid, inh_hid },
191	{ 0x5f, M680X_INS_CLRF, inh_hid, inh_hid },
192	// 0x8x, immediate instructions with register U,S,E
193	{ 0x80, M680X_INS_SUBE, imm8_hid, inh_hid },
194	{ 0x81, M680X_INS_CMPE, imm8_hid, inh_hid },
195	{ 0x83, M680X_INS_CMPU, imm16_hid, inh_hid },
196	{ 0x86, M680X_INS_LDE, imm8_hid, inh_hid },
197	{ 0x8b, M680X_INS_ADDE, imm8_hid, inh_hid },
198	{ 0x8c, M680X_INS_CMPS, imm16_hid, inh_hid },
199	{ 0x8d, M680X_INS_DIVD, imm8_hid, inh_hid },
200	{ 0x8e, M680X_INS_DIVQ, imm16_hid, inh_hid },
201	{ 0x8f, M680X_INS_MULD, imm16_hid, inh_hid },
202	// 0x9x, direct instructions with register U,S,E,Q
203	{ 0x90, M680X_INS_SUBE, dir_hid, inh_hid },
204	{ 0x91, M680X_INS_CMPE, dir_hid, inh_hid },
205	{ 0x93, M680X_INS_CMPU, dir_hid, inh_hid },
206	{ 0x96, M680X_INS_LDE, dir_hid, inh_hid },
207	{ 0x97, M680X_INS_STE, dir_hid, inh_hid },
208	{ 0x9b, M680X_INS_ADDE, dir_hid, inh_hid },
209	{ 0x9c, M680X_INS_CMPS, dir_hid, inh_hid },
210	{ 0x9d, M680X_INS_DIVD, dir_hid, inh_hid },
211	{ 0x9e, M680X_INS_DIVQ, dir_hid, inh_hid },
212	{ 0x9f, M680X_INS_MULD, dir_hid, inh_hid },
213	// 0xAx, indexed instructions with register U,S,D,Q
214	{ 0xa0, M680X_INS_SUBE, idx09_hid, inh_hid },
215	{ 0xa1, M680X_INS_CMPE, idx09_hid, inh_hid },
216	{ 0xa3, M680X_INS_CMPU, idx09_hid, inh_hid },
217	{ 0xa6, M680X_INS_LDE, idx09_hid, inh_hid },
218	{ 0xa7, M680X_INS_STE, idx09_hid, inh_hid },
219	{ 0xab, M680X_INS_ADDE, idx09_hid, inh_hid },
220	{ 0xac, M680X_INS_CMPS, idx09_hid, inh_hid },
221	{ 0xad, M680X_INS_DIVD, idx09_hid, inh_hid },
222	{ 0xae, M680X_INS_DIVQ, idx09_hid, inh_hid },
223	{ 0xaf, M680X_INS_MULD, idx09_hid, inh_hid },
224	// 0xBx, extended instructions with register U,S,D,Q
225	{ 0xb0, M680X_INS_SUBE, ext_hid, inh_hid },
226	{ 0xb1, M680X_INS_CMPE, ext_hid, inh_hid },
227	{ 0xb3, M680X_INS_CMPU, ext_hid, inh_hid },
228	{ 0xb6, M680X_INS_LDE, ext_hid, inh_hid },
229	{ 0xb7, M680X_INS_STE, ext_hid, inh_hid },
230	{ 0xbb, M680X_INS_ADDE, ext_hid, inh_hid },
231	{ 0xbc, M680X_INS_CMPS, ext_hid, inh_hid },
232	{ 0xbd, M680X_INS_DIVD, ext_hid, inh_hid },
233	{ 0xbe, M680X_INS_DIVQ, ext_hid, inh_hid },
234	{ 0xbf, M680X_INS_MULD, ext_hid, inh_hid },
235	// 0xCx, immediate instructions with register F
236	{ 0xc0, M680X_INS_SUBF, imm8_hid, inh_hid },
237	{ 0xc1, M680X_INS_CMPF, imm8_hid, inh_hid },
238	{ 0xc6, M680X_INS_LDF, imm8_hid, inh_hid },
239	{ 0xcb, M680X_INS_ADDF, imm8_hid, inh_hid },
240	// 0xDx, direct instructions with register F
241	{ 0xd0, M680X_INS_SUBF, dir_hid, inh_hid },
242	{ 0xd1, M680X_INS_CMPF, dir_hid, inh_hid },
243	{ 0xd6, M680X_INS_LDF, dir_hid, inh_hid },
244	{ 0xd7, M680X_INS_STF, dir_hid, inh_hid },
245	{ 0xdb, M680X_INS_ADDF, dir_hid, inh_hid },
246	// 0xEx, indexed instructions with register F
247	{ 0xe0, M680X_INS_SUBF, idx09_hid, inh_hid },
248	{ 0xe1, M680X_INS_CMPF, idx09_hid, inh_hid },
249	{ 0xe6, M680X_INS_LDF, idx09_hid, inh_hid },
250	{ 0xe7, M680X_INS_STF, idx09_hid, inh_hid },
251	{ 0xeb, M680X_INS_ADDF, idx09_hid, inh_hid },
252	// 0xFx, extended instructions with register F
253	{ 0xf0, M680X_INS_SUBF, ext_hid, inh_hid },
254	{ 0xf1, M680X_INS_CMPF, ext_hid, inh_hid },
255	{ 0xf6, M680X_INS_LDF, ext_hid, inh_hid },
256	{ 0xf7, M680X_INS_STF, ext_hid, inh_hid },
257	{ 0xfb, M680X_INS_ADDF, ext_hid, inh_hid },
258};
259
260