]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/ng_assembly/emulator/opcodes/HCS08_table.ma
(no commit message)
[helm.git] / helm / software / matita / contribs / ng_assembly / emulator / opcodes / HCS08_table.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 (* ********************************************************************** *)
16 (*                          Progetto FreeScale                            *)
17 (*                                                                        *)
18 (*   Sviluppato da: Ing. Cosimo Oliboni, oliboni@cs.unibo.it              *)
19 (*   Sviluppo: 2008-2010                                                  *)
20 (*                                                                        *)
21 (* ********************************************************************** *)
22
23 include "emulator/opcodes/HCS08_opcode.ma".
24 include "emulator/opcodes/HC08_instr_mode.ma".
25 include "emulator/opcodes/byte_or_word.ma".
26 include "common/list.ma".
27
28 (* ****************** *)
29 (* TABELLA DELL'HCS08 *)
30 (* ****************** *)
31
32 (* definizione come concatenazione finale di liste per velocizzare il parsing *)
33 (* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
34 (* NB: l'uso di any_opcode m + concatenazione finale tutte liste
35        impedisce di introdurre opcode disomogenei (per mcu) *)
36
37 ndefinition opcode_table_HCS08_1 ≝
38 [
39   quadruple … ADC MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
40 ; quadruple … ADC MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
41 ; quadruple … ADC MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉
42 ; quadruple … ADC MODE_IX2  (Byte 〈xD,x9〉) 〈x0,x4〉
43 ; quadruple … ADC MODE_IX1  (Byte 〈xE,x9〉) 〈x0,x3〉
44 ; quadruple … ADC MODE_IX0  (Byte 〈xF,x9〉) 〈x0,x3〉
45 ; quadruple … ADC MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x9〉〉) 〈x0,x5〉
46 ; quadruple … ADC MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x9〉〉) 〈x0,x4〉
47 ].
48
49 ndefinition opcode_table_HCS08_2 ≝
50 [
51   quadruple … ADD MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉
52 ; quadruple … ADD MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉
53 ; quadruple … ADD MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉
54 ; quadruple … ADD MODE_IX2  (Byte 〈xD,xB〉) 〈x0,x4〉
55 ; quadruple … ADD MODE_IX1  (Byte 〈xE,xB〉) 〈x0,x3〉
56 ; quadruple … ADD MODE_IX0  (Byte 〈xF,xB〉) 〈x0,x3〉
57 ; quadruple … ADD MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xB〉〉) 〈x0,x5〉
58 ; quadruple … ADD MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xB〉〉) 〈x0,x4〉
59 ].
60
61 ndefinition opcode_table_HCS08_3 ≝
62 [
63   quadruple … AND MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
64 ; quadruple … AND MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
65 ; quadruple … AND MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉
66 ; quadruple … AND MODE_IX2  (Byte 〈xD,x4〉) 〈x0,x4〉
67 ; quadruple … AND MODE_IX1  (Byte 〈xE,x4〉) 〈x0,x3〉
68 ; quadruple … AND MODE_IX0  (Byte 〈xF,x4〉) 〈x0,x3〉
69 ; quadruple … AND MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x4〉〉) 〈x0,x5〉
70 ; quadruple … AND MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x4〉〉) 〈x0,x4〉
71 ].
72
73 ndefinition opcode_table_HCS08_4 ≝
74 [
75   quadruple … ASL MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x5〉
76 ; quadruple … ASL MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉
77 ; quadruple … ASL MODE_INHX (Byte 〈x5,x8〉) 〈x0,x1〉
78 ; quadruple … ASL MODE_IX1  (Byte 〈x6,x8〉) 〈x0,x5〉
79 ; quadruple … ASL MODE_IX0  (Byte 〈x7,x8〉) 〈x0,x4〉
80 ; quadruple … ASL MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x8〉〉) 〈x0,x6〉
81 ].
82
83 ndefinition opcode_table_HCS08_5 ≝
84 [
85   quadruple … ASR MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x5〉
86 ; quadruple … ASR MODE_INHA (Byte 〈x4,x7〉) 〈x0,x1〉
87 ; quadruple … ASR MODE_INHX (Byte 〈x5,x7〉) 〈x0,x1〉
88 ; quadruple … ASR MODE_IX1  (Byte 〈x6,x7〉) 〈x0,x5〉
89 ; quadruple … ASR MODE_IX0  (Byte 〈x7,x7〉) 〈x0,x4〉
90 ; quadruple … ASR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x7〉〉) 〈x0,x6〉
91 ].
92
93 ndefinition opcode_table_HCS08_6 ≝
94 [
95   quadruple … BRA  MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉
96 ; quadruple … BRN  MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉
97 ; quadruple … BHI  MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉
98 ; quadruple … BLS  MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉
99 ; quadruple … BCC  MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉
100 ; quadruple … BCS  MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉
101 ; quadruple … BNE  MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉
102 ; quadruple … BEQ  MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉
103 ; quadruple … BHCC MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉
104 ; quadruple … BHCS MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉
105 ; quadruple … BPL  MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉
106 ; quadruple … BMI  MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉
107 ; quadruple … BMC  MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉
108 ; quadruple … BMS  MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉
109 ; quadruple … BIL  MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉
110 ; quadruple … BIH  MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉
111 ; quadruple … BGE  MODE_IMM1 (Byte 〈x9,x0〉) 〈x0,x3〉
112 ; quadruple … BLT  MODE_IMM1 (Byte 〈x9,x1〉) 〈x0,x3〉
113 ; quadruple … BGT  MODE_IMM1 (Byte 〈x9,x2〉) 〈x0,x3〉
114 ; quadruple … BLE  MODE_IMM1 (Byte 〈x9,x3〉) 〈x0,x3〉
115 ].
116
117 ndefinition opcode_table_HCS08_7 ≝
118 [
119   quadruple … BSETn (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉
120 ; quadruple … BCLRn (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉
121 ; quadruple … BSETn (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉
122 ; quadruple … BCLRn (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉
123 ; quadruple … BSETn (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉
124 ; quadruple … BCLRn (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉
125 ; quadruple … BSETn (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉
126 ; quadruple … BCLRn (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉
127 ; quadruple … BSETn (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉
128 ; quadruple … BCLRn (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉
129 ; quadruple … BSETn (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉
130 ; quadruple … BCLRn (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉
131 ; quadruple … BSETn (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉
132 ; quadruple … BCLRn (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉
133 ; quadruple … BSETn (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉
134 ; quadruple … BCLRn (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉
135 ].
136
137 ndefinition opcode_table_HCS08_8 ≝
138 [
139   quadruple … BRSETn (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
140 ; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
141 ; quadruple … BRSETn (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
142 ; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
143 ; quadruple … BRSETn (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
144 ; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
145 ; quadruple … BRSETn (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
146 ; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
147 ; quadruple … BRSETn (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
148 ; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
149 ; quadruple … BRSETn (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
150 ; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
151 ; quadruple … BRSETn (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
152 ; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
153 ; quadruple … BRSETn (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
154 ; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
155 ].
156
157 ndefinition opcode_table_HCS08_9 ≝
158 [
159   quadruple … BIT MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉
160 ; quadruple … BIT MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉
161 ; quadruple … BIT MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉
162 ; quadruple … BIT MODE_IX2  (Byte 〈xD,x5〉) 〈x0,x4〉
163 ; quadruple … BIT MODE_IX1  (Byte 〈xE,x5〉) 〈x0,x3〉
164 ; quadruple … BIT MODE_IX0  (Byte 〈xF,x5〉) 〈x0,x3〉
165 ; quadruple … BIT MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x5〉〉) 〈x0,x5〉
166 ; quadruple … BIT MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x5〉〉) 〈x0,x4〉
167 ].
168
169 ndefinition opcode_table_HCS08_10 ≝
170 [
171   quadruple … MUL  MODE_INH  (Byte 〈x4,x2〉) 〈x0,x5〉
172 ; quadruple … DIV  MODE_INH  (Byte 〈x5,x2〉) 〈x0,x6〉
173 ; quadruple … NSA  MODE_INH  (Byte 〈x6,x2〉) 〈x0,x1〉
174 ; quadruple … DAA  MODE_INH  (Byte 〈x7,x2〉) 〈x0,x1〉
175 ; quadruple … RTI  MODE_INH  (Byte 〈x8,x0〉) 〈x0,x9〉
176 ; quadruple … RTS  MODE_INH  (Byte 〈x8,x1〉) 〈x0,x6〉
177 ; quadruple … SWI  MODE_INH  (Byte 〈x8,x3〉) 〈x0,xB〉
178 ; quadruple … BGND MODE_INH  (Byte 〈x8,x2〉) 〈x0,x5〉
179 ; quadruple … TAP  MODE_INH  (Byte 〈x8,x4〉) 〈x0,x1〉
180 ; quadruple … TPA  MODE_INH  (Byte 〈x8,x5〉) 〈x0,x1〉
181 ; quadruple … PULA MODE_INH  (Byte 〈x8,x6〉) 〈x0,x3〉
182 ; quadruple … PSHA MODE_INH  (Byte 〈x8,x7〉) 〈x0,x2〉
183 ; quadruple … PULX MODE_INH  (Byte 〈x8,x8〉) 〈x0,x3〉
184 ; quadruple … PSHX MODE_INH  (Byte 〈x8,x9〉) 〈x0,x2〉
185 ; quadruple … PULH MODE_INH  (Byte 〈x8,xA〉) 〈x0,x3〉
186 ; quadruple … PSHH MODE_INH  (Byte 〈x8,xB〉) 〈x0,x2〉
187 ; quadruple … STOP MODE_INH  (Byte 〈x8,xE〉) 〈x0,x2〉
188 ; quadruple … WAIT MODE_INH  (Byte 〈x8,xF〉) 〈x0,x2〉
189 ; quadruple … TXS  MODE_INH  (Byte 〈x9,x4〉) 〈x0,x2〉
190 ; quadruple … TSX  MODE_INH  (Byte 〈x9,x5〉) 〈x0,x2〉
191 ; quadruple … TAX  MODE_INH  (Byte 〈x9,x7〉) 〈x0,x1〉
192 ; quadruple … CLC  MODE_INH  (Byte 〈x9,x8〉) 〈x0,x1〉
193 ; quadruple … SEC  MODE_INH  (Byte 〈x9,x9〉) 〈x0,x1〉
194 ; quadruple … CLI  MODE_INH  (Byte 〈x9,xA〉) 〈x0,x1〉
195 ; quadruple … SEI  MODE_INH  (Byte 〈x9,xB〉) 〈x0,x1〉
196 ; quadruple … RSP  MODE_INH  (Byte 〈x9,xC〉) 〈x0,x1〉
197 ; quadruple … NOP  MODE_INH  (Byte 〈x9,xD〉) 〈x0,x1〉
198 ; quadruple … TXA  MODE_INH  (Byte 〈x9,xF〉) 〈x0,x1〉
199 ; quadruple … AIS  MODE_IMM1 (Byte 〈xA,x7〉) 〈x0,x2〉
200 ; quadruple … AIX  MODE_IMM1 (Byte 〈xA,xF〉) 〈x0,x2〉
201 ].
202
203 ndefinition opcode_table_HCS08_11 ≝
204 [
205   quadruple … CBEQA MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉
206 ; quadruple … CBEQA MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉
207 ; quadruple … CBEQX MODE_IMM1_and_IMM1 (Byte 〈x5,x1〉) 〈x0,x4〉
208 ; quadruple … CBEQA MODE_IX1p_and_IMM1 (Byte 〈x6,x1〉) 〈x0,x5〉
209 ; quadruple … CBEQA MODE_IX0p_and_IMM1 (Byte 〈x7,x1〉) 〈x0,x5〉
210 ; quadruple … CBEQA MODE_SP1_and_IMM1  (Word 〈〈x9,xE〉:〈x6,x1〉〉) 〈x0,x6〉
211 ].
212
213 ndefinition opcode_table_HCS08_12 ≝
214 [
215   quadruple … CLR MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x5〉
216 ; quadruple … CLR MODE_INHA (Byte 〈x4,xF〉) 〈x0,x1〉
217 ; quadruple … CLR MODE_INHX (Byte 〈x5,xF〉) 〈x0,x1〉
218 ; quadruple … CLR MODE_IX1  (Byte 〈x6,xF〉) 〈x0,x5〉
219 ; quadruple … CLR MODE_IX0  (Byte 〈x7,xF〉) 〈x0,x4〉
220 ; quadruple … CLR MODE_INHH (Byte 〈x8,xC〉) 〈x0,x1〉
221 ; quadruple … CLR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xF〉〉) 〈x0,x6〉
222 ].
223
224 ndefinition opcode_table_HCS08_13 ≝
225 [
226   quadruple … CMP MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
227 ; quadruple … CMP MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
228 ; quadruple … CMP MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉
229 ; quadruple … CMP MODE_IX2  (Byte 〈xD,x1〉) 〈x0,x4〉
230 ; quadruple … CMP MODE_IX1  (Byte 〈xE,x1〉) 〈x0,x3〉
231 ; quadruple … CMP MODE_IX0  (Byte 〈xF,x1〉) 〈x0,x3〉
232 ; quadruple … CMP MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x1〉〉) 〈x0,x5〉
233 ; quadruple … CMP MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x1〉〉) 〈x0,x4〉
234 ].
235
236 ndefinition opcode_table_HCS08_14 ≝
237 [
238   quadruple … COM MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x5〉
239 ; quadruple … COM MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉
240 ; quadruple … COM MODE_INHX (Byte 〈x5,x3〉) 〈x0,x1〉
241 ; quadruple … COM MODE_IX1  (Byte 〈x6,x3〉) 〈x0,x5〉
242 ; quadruple … COM MODE_IX0  (Byte 〈x7,x3〉) 〈x0,x4〉
243 ; quadruple … COM MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x3〉〉) 〈x0,x6〉
244 ].
245
246 ndefinition opcode_table_HCS08_15 ≝
247 [
248   quadruple … CPHX MODE_DIR2 (Byte 〈x3,xE〉) 〈x0,x6〉
249 ; quadruple … CPHX MODE_IMM2 (Byte 〈x6,x5〉) 〈x0,x3〉
250 ; quadruple … CPHX MODE_DIR1 (Byte 〈x7,x5〉) 〈x0,x5〉
251 ; quadruple … CPHX MODE_SP1  (Word 〈〈x9,xE〉:〈xF,x3〉〉) 〈x0,x6〉
252
253 ; quadruple … LDHX MODE_DIR2 (Byte 〈x3,x2〉) 〈x0,x5〉
254 ; quadruple … LDHX MODE_IMM2 (Byte 〈x4,x5〉) 〈x0,x3〉
255 ; quadruple … LDHX MODE_DIR1 (Byte 〈x5,x5〉) 〈x0,x4〉
256 ; quadruple … LDHX MODE_IX0  (Word 〈〈x9,xE〉:〈xA,xE〉〉) 〈x0,x5〉
257 ; quadruple … LDHX MODE_IX2  (Word 〈〈x9,xE〉:〈xB,xE〉〉) 〈x0,x6〉
258 ; quadruple … LDHX MODE_IX1  (Word 〈〈x9,xE〉:〈xC,xE〉〉) 〈x0,x5〉
259 ; quadruple … LDHX MODE_SP1  (Word 〈〈x9,xE〉:〈xF,xE〉〉) 〈x0,x5〉
260
261 ; quadruple … STHX MODE_DIR1 (Byte 〈x3,x5〉) 〈x0,x4〉
262 ; quadruple … STHX MODE_DIR2 (Byte 〈x9,x6〉) 〈x0,x5〉
263 ; quadruple … STHX MODE_SP1  (Word 〈〈x9,xE〉:〈xF,xF〉〉) 〈x0,x5〉
264 ].
265
266 ndefinition opcode_table_HCS08_16 ≝
267 [
268   quadruple … CPX MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉
269 ; quadruple … CPX MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉
270 ; quadruple … CPX MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉
271 ; quadruple … CPX MODE_IX2  (Byte 〈xD,x3〉) 〈x0,x4〉
272 ; quadruple … CPX MODE_IX1  (Byte 〈xE,x3〉) 〈x0,x3〉
273 ; quadruple … CPX MODE_IX0  (Byte 〈xF,x3〉) 〈x0,x3〉
274 ; quadruple … CPX MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x3〉〉) 〈x0,x5〉
275 ; quadruple … CPX MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x3〉〉) 〈x0,x4〉
276 ].
277
278 ndefinition opcode_table_HCS08_17 ≝
279 [
280   quadruple … DBNZ MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x7〉
281 ; quadruple … DBNZ MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x4〉
282 ; quadruple … DBNZ MODE_INHX_and_IMM1 (Byte 〈x5,xB〉) 〈x0,x4〉
283 ; quadruple … DBNZ MODE_IX1_and_IMM1  (Byte 〈x6,xB〉) 〈x0,x7〉
284 ; quadruple … DBNZ MODE_IX0_and_IMM1  (Byte 〈x7,xB〉) 〈x0,x6〉
285 ; quadruple … DBNZ MODE_SP1_and_IMM1  (Word 〈〈x9,xE〉:〈x6,xB〉〉) 〈x0,x8〉
286 ].
287
288 ndefinition opcode_table_HCS08_18 ≝
289 [
290   quadruple … DEC MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x5〉
291 ; quadruple … DEC MODE_INHA (Byte 〈x4,xA〉) 〈x0,x1〉
292 ; quadruple … DEC MODE_INHX (Byte 〈x5,xA〉) 〈x0,x1〉
293 ; quadruple … DEC MODE_IX1  (Byte 〈x6,xA〉) 〈x0,x5〉
294 ; quadruple … DEC MODE_IX0  (Byte 〈x7,xA〉) 〈x0,x4〉
295 ; quadruple … DEC MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xA〉〉) 〈x0,x6〉
296 ].
297
298 ndefinition opcode_table_HCS08_19 ≝
299 [
300   quadruple … EOR MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
301 ; quadruple … EOR MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
302 ; quadruple … EOR MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉
303 ; quadruple … EOR MODE_IX2  (Byte 〈xD,x8〉) 〈x0,x4〉
304 ; quadruple … EOR MODE_IX1  (Byte 〈xE,x8〉) 〈x0,x3〉
305 ; quadruple … EOR MODE_IX0  (Byte 〈xF,x8〉) 〈x0,x3〉
306 ; quadruple … EOR MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x8〉〉) 〈x0,x5〉
307 ; quadruple … EOR MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x8〉〉) 〈x0,x4〉
308 ].
309
310 ndefinition opcode_table_HCS08_20 ≝
311 [
312   quadruple … INC MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x5〉
313 ; quadruple … INC MODE_INHA (Byte 〈x4,xC〉) 〈x0,x1〉
314 ; quadruple … INC MODE_INHX (Byte 〈x5,xC〉) 〈x0,x1〉
315 ; quadruple … INC MODE_IX1  (Byte 〈x6,xC〉) 〈x0,x5〉
316 ; quadruple … INC MODE_IX0  (Byte 〈x7,xC〉) 〈x0,x4〉
317 ; quadruple … INC MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xC〉〉) 〈x0,x6〉
318 ].
319
320 ndefinition opcode_table_HCS08_21 ≝
321 [
322   quadruple … JMP MODE_IMM1EXT  (Byte 〈xB,xC〉) 〈x0,x3〉
323 ; quadruple … JMP MODE_IMM2     (Byte 〈xC,xC〉) 〈x0,x4〉
324 ; quadruple … JMP MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉
325 ; quadruple … JMP MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉
326 ; quadruple … JMP MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x3〉
327 ].
328
329 ndefinition opcode_table_HCS08_22 ≝
330 [
331   quadruple … BSR MODE_IMM1     (Byte 〈xA,xD〉) 〈x0,x5〉
332 ; quadruple … JSR MODE_IMM1EXT  (Byte 〈xB,xD〉) 〈x0,x5〉
333 ; quadruple … JSR MODE_IMM2     (Byte 〈xC,xD〉) 〈x0,x6〉
334 ; quadruple … JSR MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x6〉
335 ; quadruple … JSR MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x5〉
336 ; quadruple … JSR MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x5〉
337 ].
338
339 ndefinition opcode_table_HCS08_23 ≝
340 [
341   quadruple … LDA MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉
342 ; quadruple … LDA MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉
343 ; quadruple … LDA MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉
344 ; quadruple … LDA MODE_IX2  (Byte 〈xD,x6〉) 〈x0,x4〉
345 ; quadruple … LDA MODE_IX1  (Byte 〈xE,x6〉) 〈x0,x3〉
346 ; quadruple … LDA MODE_IX0  (Byte 〈xF,x6〉) 〈x0,x3〉
347 ; quadruple … LDA MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x6〉〉) 〈x0,x5〉
348 ; quadruple … LDA MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x6〉〉) 〈x0,x4〉
349 ].
350
351 ndefinition opcode_table_HCS08_24 ≝
352 [
353   quadruple … LDX MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉
354 ; quadruple … LDX MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉
355 ; quadruple … LDX MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉
356 ; quadruple … LDX MODE_IX2  (Byte 〈xD,xE〉) 〈x0,x4〉
357 ; quadruple … LDX MODE_IX1  (Byte 〈xE,xE〉) 〈x0,x3〉
358 ; quadruple … LDX MODE_IX0  (Byte 〈xF,xE〉) 〈x0,x3〉
359 ; quadruple … LDX MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xE〉〉) 〈x0,x5〉
360 ; quadruple … LDX MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xE〉〉) 〈x0,x4〉
361 ].
362
363 ndefinition opcode_table_HCS08_25 ≝
364 [
365   quadruple … LSR MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x5〉
366 ; quadruple … LSR MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉
367 ; quadruple … LSR MODE_INHX (Byte 〈x5,x4〉) 〈x0,x1〉
368 ; quadruple … LSR MODE_IX1  (Byte 〈x6,x4〉) 〈x0,x5〉
369 ; quadruple … LSR MODE_IX0  (Byte 〈x7,x4〉) 〈x0,x4〉
370 ; quadruple … LSR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x4〉〉) 〈x0,x6〉
371 ].
372
373 ndefinition opcode_table_HCS08_26 ≝
374 [
375   quadruple … MOV MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉
376 ; quadruple … MOV MODE_DIR1_to_IX0p (Byte 〈x5,xE〉) 〈x0,x5〉
377 ; quadruple … MOV MODE_IMM1_to_DIR1 (Byte 〈x6,xE〉) 〈x0,x4〉
378 ; quadruple … MOV MODE_IX0p_to_DIR1 (Byte 〈x7,xE〉) 〈x0,x5〉
379 ].
380
381 ndefinition opcode_table_HCS08_27 ≝
382 [
383   quadruple … NEG MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x5〉
384 ; quadruple … NEG MODE_INHA (Byte 〈x4,x0〉) 〈x0,x1〉
385 ; quadruple … NEG MODE_INHX (Byte 〈x5,x0〉) 〈x0,x1〉
386 ; quadruple … NEG MODE_IX1  (Byte 〈x6,x0〉) 〈x0,x5〉
387 ; quadruple … NEG MODE_IX0  (Byte 〈x7,x0〉) 〈x0,x4〉
388 ; quadruple … NEG MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x0〉〉) 〈x0,x6〉
389 ].
390
391 ndefinition opcode_table_HCS08_28 ≝
392 [
393   quadruple … ORA MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
394 ; quadruple … ORA MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
395 ; quadruple … ORA MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉
396 ; quadruple … ORA MODE_IX2  (Byte 〈xD,xA〉) 〈x0,x4〉
397 ; quadruple … ORA MODE_IX1  (Byte 〈xE,xA〉) 〈x0,x3〉
398 ; quadruple … ORA MODE_IX0  (Byte 〈xF,xA〉) 〈x0,x3〉
399 ; quadruple … ORA MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xA〉〉) 〈x0,x5〉
400 ; quadruple … ORA MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xA〉〉) 〈x0,x4〉
401 ].
402
403 ndefinition opcode_table_HCS08_29 ≝
404 [
405   quadruple … ROL MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x5〉
406 ; quadruple … ROL MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉
407 ; quadruple … ROL MODE_INHX (Byte 〈x5,x9〉) 〈x0,x1〉
408 ; quadruple … ROL MODE_IX1  (Byte 〈x6,x9〉) 〈x0,x5〉
409 ; quadruple … ROL MODE_IX0  (Byte 〈x7,x9〉) 〈x0,x4〉
410 ; quadruple … ROL MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x9〉〉) 〈x0,x6〉
411 ].
412
413 ndefinition opcode_table_HCS08_30 ≝
414 [
415   quadruple … ROR MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x5〉
416 ; quadruple … ROR MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉
417 ; quadruple … ROR MODE_INHX (Byte 〈x5,x6〉) 〈x0,x1〉
418 ; quadruple … ROR MODE_IX1  (Byte 〈x6,x6〉) 〈x0,x5〉
419 ; quadruple … ROR MODE_IX0  (Byte 〈x7,x6〉) 〈x0,x4〉
420 ; quadruple … ROR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x6〉〉) 〈x0,x6〉
421 ].
422
423 ndefinition opcode_table_HCS08_31 ≝
424 [
425   quadruple … SBC MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
426 ; quadruple … SBC MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
427 ; quadruple … SBC MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉
428 ; quadruple … SBC MODE_IX2  (Byte 〈xD,x2〉) 〈x0,x4〉
429 ; quadruple … SBC MODE_IX1  (Byte 〈xE,x2〉) 〈x0,x3〉
430 ; quadruple … SBC MODE_IX0  (Byte 〈xF,x2〉) 〈x0,x3〉
431 ; quadruple … SBC MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x2〉〉) 〈x0,x5〉
432 ; quadruple … SBC MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x2〉〉) 〈x0,x4〉
433 ].
434
435 ndefinition opcode_table_HCS08_32 ≝
436 [
437   quadruple … STA MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x3〉
438 ; quadruple … STA MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x4〉
439 ; quadruple … STA MODE_IX2  (Byte 〈xD,x7〉) 〈x0,x4〉
440 ; quadruple … STA MODE_IX1  (Byte 〈xE,x7〉) 〈x0,x3〉
441 ; quadruple … STA MODE_IX0  (Byte 〈xF,x7〉) 〈x0,x2〉
442 ; quadruple … STA MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x7〉〉) 〈x0,x5〉
443 ; quadruple … STA MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x7〉〉) 〈x0,x4〉
444 ].
445
446 ndefinition opcode_table_HCS08_33 ≝
447 [
448   quadruple … STX MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x3〉
449 ; quadruple … STX MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x4〉
450 ; quadruple … STX MODE_IX2  (Byte 〈xD,xF〉) 〈x0,x4〉
451 ; quadruple … STX MODE_IX1  (Byte 〈xE,xF〉) 〈x0,x3〉
452 ; quadruple … STX MODE_IX0  (Byte 〈xF,xF〉) 〈x0,x2〉
453 ; quadruple … STX MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xF〉〉) 〈x0,x5〉
454 ; quadruple … STX MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xF〉〉) 〈x0,x4〉
455 ].
456
457 ndefinition opcode_table_HCS08_34 ≝
458 [
459   quadruple … SUB MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉
460 ; quadruple … SUB MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉
461 ; quadruple … SUB MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉
462 ; quadruple … SUB MODE_IX2  (Byte 〈xD,x0〉) 〈x0,x4〉
463 ; quadruple … SUB MODE_IX1  (Byte 〈xE,x0〉) 〈x0,x3〉
464 ; quadruple … SUB MODE_IX0  (Byte 〈xF,x0〉) 〈x0,x3〉
465 ; quadruple … SUB MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x0〉〉) 〈x0,x5〉
466 ; quadruple … SUB MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x0〉〉) 〈x0,x4〉
467 ].
468
469 ndefinition opcode_table_HCS08_35 ≝
470 [
471   quadruple … TST MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x4〉
472 ; quadruple … TST MODE_INHA (Byte 〈x4,xD〉) 〈x0,x1〉
473 ; quadruple … TST MODE_INHX (Byte 〈x5,xD〉) 〈x0,x1〉
474 ; quadruple … TST MODE_IX1  (Byte 〈x6,xD〉) 〈x0,x4〉
475 ; quadruple … TST MODE_IX0  (Byte 〈x7,xD〉) 〈x0,x3〉
476 ; quadruple … TST MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xD〉〉) 〈x0,x5〉
477 ].
478
479 ndefinition opcode_table_HCS08 ≝
480 opcode_table_HCS08_1  @ opcode_table_HCS08_2  @ opcode_table_HCS08_3  @ opcode_table_HCS08_4  @
481 opcode_table_HCS08_5  @ opcode_table_HCS08_6  @ opcode_table_HCS08_7  @ opcode_table_HCS08_8  @
482 opcode_table_HCS08_9  @ opcode_table_HCS08_10 @ opcode_table_HCS08_11 @ opcode_table_HCS08_12 @
483 opcode_table_HCS08_13 @ opcode_table_HCS08_14 @ opcode_table_HCS08_15 @ opcode_table_HCS08_16 @
484 opcode_table_HCS08_17 @ opcode_table_HCS08_18 @ opcode_table_HCS08_19 @ opcode_table_HCS08_20 @
485 opcode_table_HCS08_21 @ opcode_table_HCS08_22 @ opcode_table_HCS08_23 @ opcode_table_HCS08_24 @
486 opcode_table_HCS08_25 @ opcode_table_HCS08_26 @ opcode_table_HCS08_27 @ opcode_table_HCS08_28 @
487 opcode_table_HCS08_29 @ opcode_table_HCS08_30 @ opcode_table_HCS08_31 @ opcode_table_HCS08_32 @
488 opcode_table_HCS08_33 @ opcode_table_HCS08_34 @ opcode_table_HCS08_35.