1 static const ASM_MAPPING _asxxxx_gb_mapping[] = {
2 /* We want to prepend the _ */
3 { "area", ".area _%s" },
4 { "areacode", ".area _%s" },
5 { "areadata", ".area _%s" },
6 { "areahome", ".area _%s" },
7 { "functionlabeldef", "%s:" },
10 { "ldahli", "ld a,(hl+)" },
11 { "ldahlsp", "lda hl,%d(sp)" },
12 { "ldaspsp", "lda sp,%d(sp)" },
25 { "leavex", "lda sp,%d(sp)"
38 { "adjustsp", "lda sp,-%d(sp)" },
39 { "fileprelude", "" },
51 static const ASM_MAPPING _asxxxx_z80_mapping[] = {
52 /* We want to prepend the _ */
53 { "area", ".area _%s" },
54 { "areacode", ".area _%s" },
55 { "areadata", ".area _%s" },
56 { "areahome", ".area _%s" },
98 { "adjustsp", "lda sp,-%d(sp)" },
110 static const ASM_MAPPING _rgbds_mapping[] = {
111 { "global", "GLOBAL %s" },
112 { "extern", "GLOBAL %s" },
113 { "slabeldef", "%s:" },
114 { "labeldef", "%s:" },
115 { "tlabeldef", ".l%05d:" },
116 { "tlabel", ".l%05d" },
118 "; Generated using the rgbds tokens.\n"
119 "\t; We have to define these here as sdcc dosnt make them global by default\n"
120 "\tGLOBAL __mulschar\n"
121 "\tGLOBAL __muluchar\n"
122 "\tGLOBAL __mulsint\n"
123 "\tGLOBAL __muluint\n"
124 "\tGLOBAL __divschar\n"
125 "\tGLOBAL __divuchar\n"
126 "\tGLOBAL __divsint\n"
127 "\tGLOBAL __divuint\n"
128 "\tGLOBAL __modschar\n"
129 "\tGLOBAL __moduchar\n"
130 "\tGLOBAL __modsint\n"
131 "\tGLOBAL __moduint\n"
132 "\tGLOBAL __mulslong\n"
133 "\tGLOBAL __modslong\n"
134 "\tGLOBAL __divslong\n"
135 "\tGLOBAL banked_call\n"
136 "\tGLOBAL banked_ret\n"
139 "; ---------------------------------\n"
141 "; ---------------------------------"
143 { "functionlabeldef", "%s:" },
146 { "area", "SECTION \"%s\",CODE" },
147 { "areadata", "SECTION \"%F_%s\",BSS" },
148 { "areacode", "SECTION \"%F_CODE\",%s" },
149 { "areahome", "SECTION \"%F_HOME\",HOME" },
150 { "ascii", "DB \"%s\"" },
157 { "constbyte", "$%02X" },
158 { "constword", "$%04X" },
159 { "immedword", "$%04X" },
160 { "immedbyte", "$%02X" },
161 { "hashedstr", "%s" },
162 { "lsbimmeds", "%s & $FF" },
163 { "msbimmeds", "%s >> 8" },
164 { "bankimmeds", "BANK(%s)" },
165 { "module", "; MODULE %s" },
169 static const ASM_MAPPING _rgbds_gb_mapping[] = {
177 { "adjustsp", "add sp,-%d" },
179 { "enterx", "add sp,-%d"
183 { "leavex", "add sp,%d"
185 { "ldahli", "ld a,[hl+]" },
187 { "ldahlsp", "ld hl,[sp+%d]" },
188 { "ldaspsp", "add sp,%d" },
194 static const ASM_MAPPING _isas_mapping[] = {
195 { "global", "GLOBAL %s" },
196 { "extern", "GLOBAL %s" },
197 { "slabeldef", "%s:" },
198 { "labeldef", "%s:" },
199 { "tlabeldef", "?l%05d:" },
200 { "tlabel", "?l%05d" },
202 ";Generated using the isas tokens.\n"
203 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
204 "\tONCNUM ; Numbers are hex\n"
205 "\tCAPSOFF ; Case sensitive\n"
206 "\tISDMG ; Gameboy mode\n"
208 "\t; We have to define these here as sdcc dosnt make them global by default\n"
209 "\tGLOBAL __mulschar\n"
210 "\tGLOBAL __muluchar\n"
211 "\tGLOBAL __mulsint\n"
212 "\tGLOBAL __muluint\n"
213 "\tGLOBAL __divschar\n"
214 "\tGLOBAL __divuchar\n"
215 "\tGLOBAL __divsint\n"
216 "\tGLOBAL __divuint\n"
217 "\tGLOBAL __modschar\n"
218 "\tGLOBAL __moduchar\n"
219 "\tGLOBAL __modsint\n"
220 "\tGLOBAL __moduint\n"
221 "\tGLOBAL banked_call\n"
222 "\tGLOBAL banked_ret\n"
225 "; ---------------------------------\n"
227 "; ---------------------------------"
229 { "functionlabeldef", "%s:" },
232 { "area", "%s\tGROUP" },
233 { "areacode", "_CODE\tGROUP" },
234 { "areadata", "_DATA\tGROUP" },
235 { "areahome", "_CODE\tGROUP" },
236 { "ascii", "DB \"%s\"" },
243 { "constbyte", "0x%02X" },
244 { "constword", "0x%04X" },
245 { "immedword", "0x%04X" },
246 { "immedbyte", "0x%02X" },
247 { "hashedstr", "%s" },
248 { "lsbimmeds", "%s & 0xFF" },
249 { "msbimmeds", "%s >> 8" },
250 { "bankimmeds", "!%s" },
251 { "module", "; MODULE %s" },
255 static const ASM_MAPPING _isas_gb_mapping[] = {
263 { "adjustsp", "add sp,-%d" },
265 { "enterx", "add sp,-%d"
269 { "leavex", "add sp,%d\n" },
270 { "ldahli", "ld a,(hli)" },
272 { "ldahlsp", "ldhl sp,%d" },
273 { "ldaspsp", "add sp,%d" },
279 static const ASM_MAPPING _z80asm_mapping[] = {
280 { "global", "XDEF %s" },
281 { "extern", "XREF %s" },
282 { "slabeldef", "\n.%s" },
283 { "labeldef", "\n.%s" },
284 { "tlabeldef", "\n.l%N%05d" },
285 { "tlabel", "l%N%05d" },
287 "; Generated using the z80asm/z88 tokens.\n"
288 "\tXREF __muluchar_rrx_s\n"
289 "\tXREF __mulschar_rrx_s\n"
290 "\tXREF __mulsint_rrx_s\n"
291 "\tXREF __muluint_rrx_s\n"
292 "\tXREF __mululong_rrx_s\n"
293 "\tXREF __mulslong_rrx_s\n"
294 "\tXREF __divuchar_rrx_s\n"
295 "\tXREF __divschar_rrx_s\n"
296 "\tXREF __divsint_rrx_s\n"
297 "\tXREF __divuint_rrx_s\n"
298 "\tXREF __divulong_rrx_s\n"
299 "\tXREF __divslong_rrx_s\n"
300 "\tXREF __rrulong_rrx_s\n"
301 "\tXREF __rrslong_rrx_s\n"
302 "\tXREF __rlulong_rrx_s\n"
303 "\tXREF __rlslong_rrx_s\n"
306 "; ---------------------------------\n"
308 "; ---------------------------------"
310 { "functionlabeldef", ".%s" },
313 { "ascii", "DEFM \"%s\"" },
316 { "dbs", "DEFB %s" },
318 { "dws", "DEFB %s" },
320 { "constbyte", "$%02X" },
321 { "constword", "$%04X" },
322 { "immedword", "$%04X" },
323 { "immedbyte", "$%02X" },
324 { "hashedstr", "%s" },
325 { "lsbimmeds", "%s & $FF" },
326 { "msbimmeds", "%s / 256" },
328 { "bankimmeds", "BANK(%s)" },
329 { "module", "MODULE %s" },
330 { "area", "; Area %s" },
331 { "areadata", "; Aread BSS" },
332 { "areacode", "; Area CODE" },
333 { "areahome", "; Area HOME" },
337 static const ASM_MAPPING _z80asm_z80_mapping[] = {
338 { "*ixx", "(ix%+d)" },
339 { "*iyx", "(iy%+d)" },
379 { "adjustsp", "lda sp,(sp%+d)" },
391 static const ASM_MAPPINGS _isas = {
396 const ASM_MAPPINGS _isas_gb = {
401 static const ASM_MAPPINGS _rgbds = {
406 const ASM_MAPPINGS _rgbds_gb = {
411 const ASM_MAPPINGS _asxxxx_gb = {
416 const ASM_MAPPINGS _asxxxx_z80 = {
421 static const ASM_MAPPINGS _z80asm = {
426 const ASM_MAPPINGS _z80asm_z80 = {