Delete unused files as suggested by Felix Salfelder (felixs).
[sdcc.git] / sdcc / sdas / as6808 / m08pst.c
blob6e870eb12a068e8efd9a04fe40d4153fc9f0e4ab
1 /* m08pst.c */
3 /*
4 * Copyright (C) 1993-2021 Alan R. Baldwin
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * Alan R. Baldwin
21 * 721 Berkeley St.
22 * Kent, Ohio 44240
25 #include "asxxxx.h"
26 #include "m6808.h"
29 * Mnemonic Structure
31 struct mne mne[] = {
33 /* machine */
35 /* system */
37 { NULL, "CON", S_ATYP, 0, A_CON },
38 { NULL, "OVR", S_ATYP, 0, A_OVR },
39 { NULL, "REL", S_ATYP, 0, A_REL },
40 { NULL, "ABS", S_ATYP, 0, A_ABS },
41 { NULL, "NOPAG", S_ATYP, 0, A_NOPAG },
42 { NULL, "PAG", S_ATYP, 0, A_PAG },
44 { NULL, "CODE", S_ATYP, 0, A_CODE },
45 { NULL, "DATA", S_ATYP, 0, A_DATA },
46 { NULL, "LOAD", S_ATYP, 0, A_LOAD },
47 { NULL, "NOLOAD", S_ATYP, 0, A_NOLOAD },
49 { NULL, ".page", S_PAGE, 0, 0 },
50 { NULL, ".title", S_HEADER, 0, O_TITLE },
51 { NULL, ".sbttl", S_HEADER, 0, O_SBTTL },
52 { NULL, ".module", S_MODUL, 0, 0 },
53 { NULL, ".include", S_INCL, 0, I_CODE },
54 { NULL, ".incbin", S_INCL, 0, I_BNRY },
55 { NULL, ".area", S_AREA, 0, 0 },
56 // { NULL, ".bank", S_BANK, 0, 0 },
57 { NULL, ".org", S_ORG, 0, 0 },
58 { NULL, ".radix", S_RADIX, 0, 0 },
59 { NULL, ".globl", S_GLOBL, 0, 0 },
60 { NULL, ".local", S_LOCAL, 0, 0 },
61 { NULL, ".if", S_CONDITIONAL, 0, O_IF },
62 { NULL, ".iff", S_CONDITIONAL, 0, O_IFF },
63 { NULL, ".ift", S_CONDITIONAL, 0, O_IFT },
64 { NULL, ".iftf", S_CONDITIONAL, 0, O_IFTF },
65 { NULL, ".ifdef", S_CONDITIONAL, 0, O_IFDEF },
66 { NULL, ".ifndef", S_CONDITIONAL, 0, O_IFNDEF},
67 { NULL, ".ifgt", S_CONDITIONAL, 0, O_IFGT },
68 { NULL, ".iflt", S_CONDITIONAL, 0, O_IFLT },
69 { NULL, ".ifge", S_CONDITIONAL, 0, O_IFGE },
70 { NULL, ".ifle", S_CONDITIONAL, 0, O_IFLE },
71 { NULL, ".ifeq", S_CONDITIONAL, 0, O_IFEQ },
72 { NULL, ".ifne", S_CONDITIONAL, 0, O_IFNE },
73 { NULL, ".ifb", S_CONDITIONAL, 0, O_IFB },
74 { NULL, ".ifnb", S_CONDITIONAL, 0, O_IFNB },
75 { NULL, ".ifidn", S_CONDITIONAL, 0, O_IFIDN },
76 { NULL, ".ifdif", S_CONDITIONAL, 0, O_IFDIF },
77 { NULL, ".iif", S_CONDITIONAL, 0, O_IIF },
78 { NULL, ".iiff", S_CONDITIONAL, 0, O_IIFF },
79 { NULL, ".iift", S_CONDITIONAL, 0, O_IIFT },
80 { NULL, ".iiftf", S_CONDITIONAL, 0, O_IIFTF },
81 { NULL, ".iifdef", S_CONDITIONAL, 0, O_IIFDEF},
82 { NULL, ".iifndef", S_CONDITIONAL, 0, O_IIFNDEF},
83 { NULL, ".iifgt", S_CONDITIONAL, 0, O_IIFGT },
84 { NULL, ".iiflt", S_CONDITIONAL, 0, O_IIFLT },
85 { NULL, ".iifge", S_CONDITIONAL, 0, O_IIFGE },
86 { NULL, ".iifle", S_CONDITIONAL, 0, O_IIFLE },
87 { NULL, ".iifeq", S_CONDITIONAL, 0, O_IIFEQ },
88 { NULL, ".iifne", S_CONDITIONAL, 0, O_IIFNE },
89 { NULL, ".iifb", S_CONDITIONAL, 0, O_IIFB },
90 { NULL, ".iifnb", S_CONDITIONAL, 0, O_IIFNB },
91 { NULL, ".iifidn", S_CONDITIONAL, 0, O_IIFIDN},
92 { NULL, ".iifdif", S_CONDITIONAL, 0, O_IIFDIF},
93 { NULL, ".else", S_CONDITIONAL, 0, O_ELSE },
94 { NULL, ".endif", S_CONDITIONAL, 0, O_ENDIF },
95 { NULL, ".list", S_LISTING, 0, O_LIST },
96 { NULL, ".nlist", S_LISTING, 0, O_NLIST },
97 { NULL, ".uleb128", S_ULEB128, 0, 0 },
98 { NULL, ".sleb128", S_SLEB128, 0, 0 },
99 { NULL, ".equ", S_EQU, 0, O_EQU },
100 { NULL, ".gblequ", S_EQU, 0, O_GBLEQU},
101 { NULL, ".lclequ", S_EQU, 0, O_LCLEQU},
102 { NULL, ".byte", S_DATA, 0, O_1BYTE },
103 { NULL, ".db", S_DATA, 0, O_1BYTE },
104 { NULL, ".fcb", S_DATA, 0, O_1BYTE },
105 { NULL, ".word", S_DATA, 0, O_2BYTE },
106 { NULL, ".dw", S_DATA, 0, O_2BYTE },
107 { NULL, ".fdb", S_DATA, 0, O_2BYTE },
108 /* { NULL, ".3byte", S_DATA, 0, O_3BYTE }, */
109 /* { NULL, ".triple", S_DATA, 0, O_3BYTE }, */
110 /* { NULL, ".4byte", S_DATA, 0, O_4BYTE }, */
111 /* { NULL, ".quad", S_DATA, 0, O_4BYTE }, */
112 { NULL, ".blkb", S_BLK, 0, O_1BYTE },
113 { NULL, ".ds", S_BLK, 0, O_1BYTE },
114 { NULL, ".rmb", S_BLK, 0, O_1BYTE },
115 { NULL, ".rs", S_BLK, 0, O_1BYTE },
116 { NULL, ".blkw", S_BLK, 0, O_2BYTE },
117 /* { NULL, ".blk3", S_BLK, 0, O_3BYTE }, */
118 /* { NULL, ".blk4", S_BLK, 0, O_4BYTE }, */
119 { NULL, ".ascii", S_ASCIX, 0, O_ASCII },
120 { NULL, ".ascis", S_ASCIX, 0, O_ASCIS },
121 { NULL, ".asciz", S_ASCIX, 0, O_ASCIZ },
122 { NULL, ".str", S_ASCIX, 0, O_ASCII },
123 { NULL, ".strs", S_ASCIX, 0, O_ASCIS },
124 { NULL, ".strz", S_ASCIX, 0, O_ASCIZ },
125 { NULL, ".fcc", S_ASCIX, 0, O_ASCII },
126 { NULL, ".define", S_DEFINE, 0, O_DEF },
127 { NULL, ".undefine", S_DEFINE, 0, O_UNDEF },
128 { NULL, ".even", S_BOUNDARY, 0, O_EVEN },
129 { NULL, ".odd", S_BOUNDARY, 0, O_ODD },
130 { NULL, ".bndry", S_BOUNDARY, 0, O_BNDRY },
131 { NULL, ".msg" , S_MSG, 0, 0 },
132 { NULL, ".assume", S_ERROR, 0, O_ASSUME},
133 { NULL, ".error", S_ERROR, 0, O_ERROR },
134 /* { NULL, ".msb", S_MSB, 0, 0 }, */
135 /* { NULL, ".lohi", S_MSB, 0, O_LOHI }, */
136 /* { NULL, ".hilo", S_MSB, 0, O_HILO }, */
137 /* { NULL, ".8bit", S_BITS, 0, O_1BYTE }, */
138 /* { NULL, ".16bit", S_BITS, 0, O_2BYTE }, */
139 /* { NULL, ".24bit", S_BITS, 0, O_3BYTE }, */
140 /* { NULL, ".32bit", S_BITS, 0, O_4BYTE }, */
141 // { NULL, ".end", S_END, 0, 0 },
143 /* sdas specific */
144 { NULL, ".optsdcc", S_OPTSDCC, 0, 0 },
145 /* end sdas specific */
147 /* Macro Processor */
149 { NULL, ".macro", S_MACRO, 0, O_MACRO },
150 { NULL, ".endm", S_MACRO, 0, O_ENDM },
151 { NULL, ".mexit", S_MACRO, 0, O_MEXIT },
153 { NULL, ".narg", S_MACRO, 0, O_NARG },
154 { NULL, ".nchr", S_MACRO, 0, O_NCHR },
155 { NULL, ".ntyp", S_MACRO, 0, O_NTYP },
157 { NULL, ".irp", S_MACRO, 0, O_IRP },
158 { NULL, ".irpc", S_MACRO, 0, O_IRPC },
159 { NULL, ".rept", S_MACRO, 0, O_REPT },
161 { NULL, ".nval", S_MACRO, 0, O_NVAL },
163 { NULL, ".mdelete", S_MACRO, 0, O_MDEL },
165 /* Special */
167 { NULL, ".setdp", S_SDP, 0, 0 },
169 /* Machines */
171 { NULL, ".hc08", S_CPU, 0, X_HC08 },
172 { NULL, ".hcs08", S_CPU, 0, X_HCS08 },
173 { NULL, ".cs08", S_CPU, 0, X_HCS08 },
174 { NULL, ".6805", S_CPU, 0, X_6805 },
175 { NULL, ".hc05", S_CPU, 0, X_HC05 },
177 /* 68HC08 */
179 { NULL, "neg", S_TYP1, 0, 0x30 },
180 { NULL, "com", S_TYP1, 0, 0x33 },
181 { NULL, "lsr", S_TYP1, 0, 0x34 },
182 { NULL, "ror", S_TYP1, 0, 0x36 },
183 { NULL, "asr", S_TYP1, 0, 0x37 },
184 { NULL, "asl", S_TYP1, 0, 0x38 },
185 { NULL, "lsl", S_TYP1, 0, 0x38 },
186 { NULL, "rol", S_TYP1, 0, 0x39 },
187 { NULL, "dec", S_TYP1, 0, 0x3A },
188 { NULL, "inc", S_TYP1, 0, 0x3C },
189 { NULL, "tst", S_TYP1, 0, 0x3D },
190 { NULL, "clr", S_TYP1, 0, 0x3F },
192 { NULL, "sub", S_TYP2, 0, 0xA0 },
193 { NULL, "cmp", S_TYP2, 0, 0xA1 },
194 { NULL, "sbc", S_TYP2, 0, 0xA2 },
195 { NULL, "cpx", S_TYP2, 0, 0xA3 },
196 { NULL, "and", S_TYP2, 0, 0xA4 },
197 { NULL, "bit", S_TYP2, 0, 0xA5 },
198 { NULL, "lda", S_TYP2, 0, 0xA6 },
199 { NULL, "sta", S_TYP2, 0, 0xA7 },
200 { NULL, "eor", S_TYP2, 0, 0xA8 },
201 { NULL, "adc", S_TYP2, 0, 0xA9 },
202 { NULL, "ora", S_TYP2, 0, 0xAA },
203 { NULL, "add", S_TYP2, 0, 0xAB },
204 { NULL, "jmp", S_TYP2, 0, 0xAC },
205 { NULL, "jsr", S_TYP2, 0, 0xAD },
206 { NULL, "ldx", S_TYP2, 0, 0xAE },
207 { NULL, "stx", S_TYP2, 0, 0xAF },
209 { NULL, "bset", S_TYP3, 0, 0x10 },
210 { NULL, "bclr", S_TYP3, 0, 0x11 },
212 { NULL, "brset", S_TYP4, 0, 0x00 },
213 { NULL, "brclr", S_TYP4, 0, 0x01 },
215 { NULL, "ais", S_TYPAI, 0, 0xA7 },
216 { NULL, "aix", S_TYPAI, 0, 0xAF },
218 { NULL, "sthx", S_TYPHX, 0, 0x25 },
219 { NULL, "ldhx", S_TYPHX, 0, 0x45 },
220 { NULL, "cphx", S_TYPHX, 0, 0x65 },
222 { NULL, "cbeq", S_CBEQ, 0, 0x31 },
223 { NULL, "cbeqa", S_CQAX, 0, 0x41 },
224 { NULL, "cbeqx", S_CQAX, 0, 0x51 },
226 { NULL, "dbnz", S_DBNZ, 0, 0x3B },
227 { NULL, "dbnza", S_DZAX, 0, 0x4B },
228 { NULL, "dbnzx", S_DZAX, 0, 0x5B },
230 { NULL, "mov", S_MOV, 0, 0x4E },
232 { NULL, "bra", S_BRA, 0, 0x20 },
233 { NULL, "brn", S_BRA, 0, 0x21 },
234 { NULL, "bhi", S_BRA, 0, 0x22 },
235 { NULL, "bls", S_BRA, 0, 0x23 },
236 { NULL, "bcc", S_BRA, 0, 0x24 },
237 { NULL, "bhs", S_BRA, 0, 0x24 },
238 { NULL, "bcs", S_BRA, 0, 0x25 },
239 { NULL, "blo", S_BRA, 0, 0x25 },
240 { NULL, "bne", S_BRA, 0, 0x26 },
241 { NULL, "beq", S_BRA, 0, 0x27 },
242 { NULL, "bhcc", S_BRA, 0, 0x28 },
243 { NULL, "bhcs", S_BRA, 0, 0x29 },
244 { NULL, "bpl", S_BRA, 0, 0x2A },
245 { NULL, "bmi", S_BRA, 0, 0x2B },
246 { NULL, "bmc", S_BRA, 0, 0x2C },
247 { NULL, "bms", S_BRA, 0, 0x2D },
248 { NULL, "bil", S_BRA, 0, 0x2E },
249 { NULL, "bih", S_BRA, 0, 0x2F },
250 { NULL, "bge", S_BRA8, 0, 0x90 },
251 { NULL, "blt", S_BRA8, 0, 0x91 },
252 { NULL, "bgt", S_BRA8, 0, 0x92 },
253 { NULL, "ble", S_BRA8, 0, 0x93 },
254 { NULL, "bsr", S_BRA, 0, 0xAD },
256 { NULL, "nega", S_INH, 0, 0x40 },
257 { NULL, "mul", S_INH, 0, 0x42 },
258 { NULL, "coma", S_INH, 0, 0x43 },
259 { NULL, "lsra", S_INH, 0, 0x44 },
260 { NULL, "rora", S_INH, 0, 0x46 },
261 { NULL, "asra", S_INH, 0, 0x47 },
262 { NULL, "asla", S_INH, 0, 0x48 },
263 { NULL, "lsla", S_INH, 0, 0x48 },
264 { NULL, "rola", S_INH, 0, 0x49 },
265 { NULL, "deca", S_INH, 0, 0x4A },
266 { NULL, "inca", S_INH, 0, 0x4C },
267 { NULL, "tsta", S_INH, 0, 0x4D },
268 { NULL, "clra", S_INH, 0, 0x4F },
270 { NULL, "negx", S_INH, 0, 0x50 },
271 { NULL, "div", S_INH8, 0, 0x52 },
272 { NULL, "comx", S_INH, 0, 0x53 },
273 { NULL, "lsrx", S_INH, 0, 0x54 },
274 { NULL, "rorx", S_INH, 0, 0x56 },
275 { NULL, "asrx", S_INH, 0, 0x57 },
276 { NULL, "aslx", S_INH, 0, 0x58 },
277 { NULL, "lslx", S_INH, 0, 0x58 },
278 { NULL, "rolx", S_INH, 0, 0x59 },
279 { NULL, "decx", S_INH, 0, 0x5A },
280 { NULL, "incx", S_INH, 0, 0x5C },
281 { NULL, "tstx", S_INH, 0, 0x5D },
282 { NULL, "clrx", S_INH, 0, 0x5F },
284 { NULL, "nsa", S_INH8, 0, 0x62 },
286 { NULL, "daa", S_INH8, 0, 0x72 },
288 { NULL, "rti", S_INH, 0, 0x80 },
289 { NULL, "rts", S_INH, 0, 0x81 },
290 { NULL, "bgnd", S_INH8S, 0, 0x82 },
291 { NULL, "swi", S_INH, 0, 0x83 },
292 { NULL, "tap", S_INH8, 0, 0x84 },
293 { NULL, "tpa", S_INH8, 0, 0x85 },
294 { NULL, "pula", S_INH8, 0, 0x86 },
295 { NULL, "psha", S_INH8, 0, 0x87 },
296 { NULL, "pulx", S_INH8, 0, 0x88 },
297 { NULL, "pshx", S_INH8, 0, 0x89 },
298 { NULL, "pulh", S_INH8, 0, 0x8A },
299 { NULL, "pshh", S_INH8, 0, 0x8B },
300 { NULL, "clrh", S_INH8, 0, 0x8C },
301 { NULL, "stop", S_INH, 0, 0x8E },
302 { NULL, "wait", S_INH, 0, 0x8F },
304 { NULL, "txs", S_INH8, 0, 0x94 },
305 { NULL, "tsx", S_INH8, 0, 0x95 },
306 { NULL, "tax", S_INH, 0, 0x97 },
307 { NULL, "clc", S_INH, 0, 0x98 },
308 { NULL, "sec", S_INH, 0, 0x99 },
309 { NULL, "cli", S_INH, 0, 0x9A },
310 { NULL, "sei", S_INH, 0, 0x9B },
311 { NULL, "rsp", S_INH, 0, 0x9C },
312 { NULL, "nop", S_INH, 0, 0x9D },
313 { NULL, "txa", S_INH, S_EOL, 0x9F }