4 * Copyright (C) 1989-2009 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/>.
26 * Extensions: P. Felber
30 * TLCS90 Port: R. Keuchel
45 { NULL
, "CON", S_ATYP
, 0, A_CON
},
46 { NULL
, "OVR", S_ATYP
, 0, A_OVR
},
47 { NULL
, "REL", S_ATYP
, 0, A_REL
},
48 { NULL
, "ABS", S_ATYP
, 0, A_ABS
},
49 { NULL
, "NOPAG", S_ATYP
, 0, A_NOPAG
},
50 { NULL
, "PAG", S_ATYP
, 0, A_PAG
},
53 { NULL
, ".page", S_PAGE
, 0, 0 },
54 { NULL
, ".title", S_HEADER
, 0, O_TITLE
},
55 { NULL
, ".sbttl", S_HEADER
, 0, O_SBTTL
},
56 { NULL
, ".module", S_MODUL
, 0, 0 },
57 { NULL
, ".include", S_INCL
, 0, I_CODE
},
58 { NULL
, ".incbin", S_INCL
, 0, I_BNRY
},
59 { NULL
, ".area", S_AREA
, 0, 0 },
61 { NULL
, ".org", S_ORG
, 0, 0 },
62 { NULL
, ".radix", S_RADIX
, 0, 0 },
63 { NULL
, ".globl", S_GLOBL
, 0, 0 },
64 { NULL
, ".local", S_LOCAL
, 0, 0 },
65 { NULL
, ".if", S_CONDITIONAL
, 0, O_IF
},
66 { NULL
, ".iff", S_CONDITIONAL
, 0, O_IFF
},
67 { NULL
, ".ift", S_CONDITIONAL
, 0, O_IFT
},
68 { NULL
, ".iftf", S_CONDITIONAL
, 0, O_IFTF
},
69 { NULL
, ".ifdef", S_CONDITIONAL
, 0, O_IFDEF
},
70 { NULL
, ".ifndef", S_CONDITIONAL
, 0, O_IFNDEF
},
71 { NULL
, ".ifgt", S_CONDITIONAL
, 0, O_IFGT
},
72 { NULL
, ".iflt", S_CONDITIONAL
, 0, O_IFLT
},
73 { NULL
, ".ifge", S_CONDITIONAL
, 0, O_IFGE
},
74 { NULL
, ".ifle", S_CONDITIONAL
, 0, O_IFLE
},
75 { NULL
, ".ifeq", S_CONDITIONAL
, 0, O_IFEQ
},
76 { NULL
, ".ifne", S_CONDITIONAL
, 0, O_IFNE
},
77 { NULL
, ".ifb", S_CONDITIONAL
, 0, O_IFB
},
78 { NULL
, ".ifnb", S_CONDITIONAL
, 0, O_IFNB
},
79 { NULL
, ".ifidn", S_CONDITIONAL
, 0, O_IFIDN
},
80 { NULL
, ".ifdif", S_CONDITIONAL
, 0, O_IFDIF
},
81 { NULL
, ".iif", S_CONDITIONAL
, 0, O_IIF
},
82 { NULL
, ".iiff", S_CONDITIONAL
, 0, O_IIFF
},
83 { NULL
, ".iift", S_CONDITIONAL
, 0, O_IIFT
},
84 { NULL
, ".iiftf", S_CONDITIONAL
, 0, O_IIFTF
},
85 { NULL
, ".iifdef", S_CONDITIONAL
, 0, O_IIFDEF
},
86 { NULL
, ".iifndef", S_CONDITIONAL
, 0, O_IIFNDEF
},
87 { NULL
, ".iifgt", S_CONDITIONAL
, 0, O_IIFGT
},
88 { NULL
, ".iiflt", S_CONDITIONAL
, 0, O_IIFLT
},
89 { NULL
, ".iifge", S_CONDITIONAL
, 0, O_IIFGE
},
90 { NULL
, ".iifle", S_CONDITIONAL
, 0, O_IIFLE
},
91 { NULL
, ".iifeq", S_CONDITIONAL
, 0, O_IIFEQ
},
92 { NULL
, ".iifne", S_CONDITIONAL
, 0, O_IIFNE
},
93 { NULL
, ".iifb", S_CONDITIONAL
, 0, O_IIFB
},
94 { NULL
, ".iifnb", S_CONDITIONAL
, 0, O_IIFNB
},
95 { NULL
, ".iifidn", S_CONDITIONAL
, 0, O_IIFIDN
},
96 { NULL
, ".iifdif", S_CONDITIONAL
, 0, O_IIFDIF
},
97 { NULL
, ".else", S_CONDITIONAL
, 0, O_ELSE
},
98 { NULL
, ".endif", S_CONDITIONAL
, 0, O_ENDIF
},
99 { NULL
, ".list", S_LISTING
, 0, O_LIST
},
100 { NULL
, ".nlist", S_LISTING
, 0, O_NLIST
},
101 { NULL
, ".equ", S_EQU
, 0, O_EQU
},
102 { NULL
, ".gblequ", S_EQU
, 0, O_GBLEQU
},
103 { NULL
, ".lclequ", S_EQU
, 0, O_LCLEQU
},
104 { NULL
, ".byte", S_DATA
, 0, O_1BYTE
},
105 { NULL
, ".db", S_DATA
, 0, O_1BYTE
},
106 { NULL
, ".fcb", S_DATA
, 0, O_1BYTE
},
107 { NULL
, ".word", S_DATA
, 0, O_2BYTE
},
108 { NULL
, ".dw", S_DATA
, 0, O_2BYTE
},
109 { NULL
, ".fdb", S_DATA
, 0, O_2BYTE
},
110 /* { NULL, ".3byte", S_DATA, 0, O_3BYTE }, */
111 /* { NULL, ".triple", S_DATA, 0, O_3BYTE }, */
112 /* { NULL, ".4byte", S_DATA, 0, O_4BYTE }, */
113 /* { NULL, ".quad", S_DATA, 0, O_4BYTE }, */
114 { NULL
, ".df", S_FLOAT
, 0, 0 },
115 { NULL
, ".blkb", S_BLK
, 0, O_1BYTE
},
116 { NULL
, ".ds", S_BLK
, 0, O_1BYTE
},
117 { NULL
, ".rmb", S_BLK
, 0, O_1BYTE
},
118 { NULL
, ".rs", S_BLK
, 0, O_1BYTE
},
119 { NULL
, ".blkw", S_BLK
, 0, O_2BYTE
},
120 /* { NULL, ".blk3", S_BLK, 0, O_3BYTE }, */
121 /* { NULL, ".blk4", S_BLK, 0, O_4BYTE }, */
122 { NULL
, ".ascii", S_ASCIX
, 0, O_ASCII
},
123 { NULL
, ".ascis", S_ASCIX
, 0, O_ASCIS
},
124 { NULL
, ".asciz", S_ASCIX
, 0, O_ASCIZ
},
125 { NULL
, ".str", S_ASCIX
, 0, O_ASCII
},
126 { NULL
, ".strs", S_ASCIX
, 0, O_ASCIS
},
127 { NULL
, ".strz", S_ASCIX
, 0, O_ASCIZ
},
128 { NULL
, ".fcc", S_ASCIX
, 0, O_ASCII
},
129 { NULL
, ".define", S_DEFINE
, 0, O_DEF
},
130 { NULL
, ".undefine", S_DEFINE
, 0, O_UNDEF
},
131 { NULL
, ".even", S_BOUNDARY
, 0, O_EVEN
},
132 { NULL
, ".odd", S_BOUNDARY
, 0, O_ODD
},
133 { NULL
, ".bndry", S_BOUNDARY
, 0, O_BNDRY
},
134 { NULL
, ".msg" , S_MSG
, 0, 0 },
135 { NULL
, ".assume", S_ERROR
, 0, O_ASSUME
},
136 { NULL
, ".error", S_ERROR
, 0, O_ERROR
},
138 { NULL
, ".optsdcc", S_OPTSDCC
, 0, 0 },
139 /* end sdas specific */
141 /* Macro Processor */
143 { NULL
, ".macro", S_MACRO
, 0, O_MACRO
},
144 { NULL
, ".endm", S_MACRO
, 0, O_ENDM
},
145 { NULL
, ".mexit", S_MACRO
, 0, O_MEXIT
},
147 { NULL
, ".narg", S_MACRO
, 0, O_NARG
},
148 { NULL
, ".nchr", S_MACRO
, 0, O_NCHR
},
149 { NULL
, ".ntyp", S_MACRO
, 0, O_NTYP
},
151 { NULL
, ".irp", S_MACRO
, 0, O_IRP
},
152 { NULL
, ".irpc", S_MACRO
, 0, O_IRPC
},
153 { NULL
, ".rept", S_MACRO
, 0, O_REPT
},
155 { NULL
, ".nval", S_MACRO
, 0, O_NVAL
},
157 { NULL
, ".mdelete", S_MACRO
, 0, O_MDEL
},
161 { NULL
, ".t90", S_CPU
, 0, X_T90
},
163 // NOTE: the opcode is not always correct here, changed in code..
164 { NULL
, "push", S_PUSH
, 0, 0x50 },
165 { NULL
, "pop", S_PUSH
, 0, 0x58 },
167 { NULL
, "lda", S_LDA
, 0, 0xF4 },
169 { NULL
, "call", S_CALL
, 0, 0x1C },
170 { NULL
, "ret", S_RET
, 0, 0x1E },
171 { NULL
, "reti", S_INH1
, 0, 0x1F },
173 { NULL
, "swi", S_INH1
, 0, 0xFF },
175 { NULL
, "jp", S_JP
, 0, 0x1A },
176 { NULL
, "jr", S_JR
, 0, 0xC0 },
177 { NULL
, "djnz", S_DJNZ
, 0, 0x18 },
179 { NULL
, "ex", S_EX
, 0, 0x50 },
181 { NULL
, "nop", S_INH1
, 0, 0x00 },
182 { NULL
, "halt", S_INH1
, 0, 0x01 },
183 { NULL
, "di", S_INH1
, 0, 0x02 },
184 { NULL
, "ei", S_INH1
, 0, 0x03 },
186 { NULL
, "exx", S_INH1
, 0, 0x0A },
188 { NULL
, "daa", S_INH1
, 0, 0x0B },
189 { NULL
, "scf", S_INH1
, 0, 0x0D },
190 { NULL
, "ccf", S_INH1
, 0, 0x0E },
192 { NULL
, "cpl", S_INH1
, 0, 0x10 },
193 { NULL
, "neg", S_INH1
, 0, 0x11 },
195 { NULL
, "inc", S_INC
, 0, 0x80 },
196 { NULL
, "dec", S_DEC
, 0, 0x88 },
198 { NULL
, "bit", S_BIT
, 0, 0xA8 },
199 { NULL
, "res", S_RES
, 0, 0xB0 },
200 { NULL
, "set", S_SET
, 0, 0xB8 },
201 { NULL
, "tset", S_TSET
, 0, 0x18 },
204 { NULL
, "rld", S_RLD
, 0, 0x10 },
205 { NULL
, "rrd", S_RRD
, 0, 0x11 },
207 { NULL
, "rlca", S_INH1
, 0, 0xA0 },
208 { NULL
, "rrca", S_INH1
, 0, 0xA1 },
209 { NULL
, "rla", S_INH1
, 0, 0xA2 },
210 { NULL
, "rra", S_INH1
, 0, 0xA3 },
212 { NULL
, "rlc", S_RLC
, 0, 0xA0 }, // a
213 { NULL
, "rrc", S_RRC
, 0, 0xA1 }, // a, mem
214 { NULL
, "rl", S_RL
, 0, 0xA2 },
215 { NULL
, "rr", S_RR
, 0, 0xA3 }, // a,c
216 { NULL
, "sla", S_SLA
, 0, 0xA4 }, // a and mm
217 { NULL
, "sra", S_SRA
, 0, 0xA5 }, // a and mm
218 { NULL
, "sll", S_SLL
, 0, 0xA6 }, // a and mm
219 { NULL
, "srl", S_SRL
, 0, 0xA7 }, // a,b,c and mm, a7/e7/fe/f8
221 { NULL
, "ld", S_LD
, 0, 0x20 },
223 { NULL
, "callr", S_CALLR
, 0, 0x1D },
225 { NULL
, "mul", S_MUL
, 0, 0x12 },
226 { NULL
, "div", S_DIV
, 0, 0x13 },
228 { NULL
, "add", S_ADD
, 0, 0x60 },
229 { NULL
, "adc", S_ADC
, 0, 0x61 },
230 { NULL
, "sub", S_SUB
, 0, 0x62 },
231 { NULL
, "sbc", S_SBC
, 0, 0x63 },
232 { NULL
, "and", S_AND
, 0, 0x64 },
233 { NULL
, "xor", S_XOR
, 0, 0x65 },
234 { NULL
, "or", S_OR
, 0, 0x66 },
235 { NULL
, "cp", S_CP
, 0, 0x67 },
236 { NULL
, "ldar", S_LDAR
, 0, 0x17 },
238 { NULL
, "ldi", S_LDI
, 0, 0x58 }, // fe 58
239 { NULL
, "ldir", S_LDIR
, 0, 0x59 }, // fe 59
240 { NULL
, "ldd", S_LDD
, 0, 0x5A }, // fe 5a
241 { NULL
, "lddr", S_LDDR
, 0, 0x5B }, // fe 5b
242 { NULL
, "cpi", S_CPI
, 0, 0x5C }, // fe 5c
243 { NULL
, "cpir", S_CPIR
, 0, 0x5D }, // fe 5d
244 { NULL
, "cpd", S_CPD
, 0, 0x5D }, // fe 5e
245 { NULL
, "cpdr", S_CPDR
, 0, 0x5D }, // fe 5f
247 { NULL
, "ldw", S_LDW
, 0, 0x20 },
249 { NULL
, "incw", S_INCW
, 0, 0x97 },
250 { NULL
, "incx", S_INCX
, 0, 0x07 },
251 { NULL
, "decw", S_DECW
, 0, 0x9F },
252 { NULL
, "decx", S_DECX
, S_EOL
, 0x0F } // NOTE: must be last (S_EOL)!