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:" },
8 { "globalfunctionlabeldef", "%s::" },
10 { "jphl", "jp (hl)" },
13 { "ldahli", "ld\ta, (hl+)"},
14 { "ldahld", "ld\ta, (hl-)"},
15 { "lldahli", "ld\t(hl+), a"},
16 { "lldahld", "ld\t(hl-), a"},
17 { "rldh", "ldh a, (%s + %d)"},
18 { "lldh", "ldh (%s + %d), a"},
19 { "ldahlsp", "ldhl\tsp, #%d" },
20 { "ldaspsp", "add sp, #%d" },
38 { "adjustsp", "add sp, #-%d" },
39 { "fileprelude", "" },
41 { "optsdcc", ".optsdcc" },
45 static const ASM_MAPPING _asxxxx_z80_mapping
[] = {
46 /* We want to prepend the _
*/
47 { "area", ".area _%s" },
48 { "areacode", ".area _%s" },
49 { "areadata", ".area _%s" },
50 { "areahome", ".area _%s" },
51 { "*ixx", "%d (ix)" },
52 { "*iyx", "%d (iy)" },
54 { "jphl", "jp (hl)" },
82 "call\t___sdcc_enter_ix\n" },
97 { "adjustsp", "lda sp,-%d(sp)" },
99 { "optsdcc", ".optsdcc" },
103 static const ASM_MAPPING _asxxxx_r2k_mapping
[] = {
104 /* We want to prepend the _
*/
105 { "area", ".area _%s" },
106 { "areacode", ".area _%s" },
107 { "areadata", ".area _%s" },
108 { "areahome", ".area _%s" },
109 { "*ixx", "%d (ix)" },
110 { "*iyx", "%d (iy)" },
112 { "jphl", "jp (hl)" },
140 "call\t___sdcc_enter_ix\n" },
155 { "adjustsp", "lda sp,-%d(sp)" },
156 { "optsdcc", ".optsdcc" },
160 static const ASM_MAPPING _rgbds_mapping
[] = {
161 { "global", "EXPORT %s" },
163 { "slabeldef", "%s:" },
164 { "labeldef", "%s:" },
165 { "tlabeldef", ".l%05d:" },
166 { "tlabel", ".l%05d" },
168 "; Generated using the rgbds tokens.\n"
171 "; ---------------------------------\n"
173 "; ---------------------------------"
175 { "functionlabeldef", "%s:" },
176 { "globalfunctionlabeldef", "%s::" },
179 { "area", "SECTION FRAGMENT \"_
%s\
",ROM0" },
180 { "areadata", "SECTION FRAGMENT \"%F_DATA\
",%s" },
181 { "areacode", "SECTION FRAGMENT \"%F_CODE\
",%s" },
182 { "areahome", "SECTION FRAGMENT \"%F_HOME\
",ROM0" },
183 { "ascii", "DB \"%s\
"" },
190 { "constbyte", "$%02X" },
191 { "constword", "$%04X" },
192 { "immedword", "$%04X" },
193 { "immedbyte", "$%02X" },
194 { "hashedstr", "%s" },
195 { "lsbimmeds", "LOW(%s)" },
196 { "msbimmeds", "HIGH(%s)" },
197 { "bankimmeds", "BANK(%s)" },
198 { "hashedbankimmeds", "BANK(%s)" },
199 { "module", "; MODULE %s" },
201 { "bequ", "\rb%s EQU %i" },
203 { "optsdcc", "; optsdcc" },
207 static const ASM_MAPPING _rgbds_gb_mapping
[] = {
222 { "adjustsp", "add sp, -%d" },
227 { "rldh", "ldh a, [%s + %d]"},
228 { "lldh", "ldh [%s + %d], a"},
229 { "ldahli", "ld a, [hl+]" },
230 { "ldahld", "ld a, [hl-]" },
231 { "lldahli", "ld [hl+], a" },
232 { "lldahld", "ld [hl-], a" },
235 { "ldahlsp", "ld hl, sp+%d" },
236 { "ldaspsp", "add sp, %d" },
238 { "optsdcc", "; optsdcc" },
242 static const ASM_MAPPING _isas_mapping
[] = {
243 { "global", "GLOBAL %s" },
244 { "extern", "GLOBAL %s" },
245 { "slabeldef", "%s:" },
246 { "labeldef", "%s:" },
247 { "tlabeldef", "?l%05d:" },
248 { "tlabel", "?l%05d" },
250 ";Generated using the isas tokens.\n"
251 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
252 "\tONCNUM ; Numbers are hex\n"
253 "\tCAPSOFF ; Case sensitive\n"
254 "\tISDMG ; Gameboy mode\n"
256 "\t; We have to define these here as sdcc doesn't make them global by default\n"
257 "\tGLOBAL __mulschar\n"
258 "\tGLOBAL __muluchar\n"
259 "\tGLOBAL __mulint\n"
260 "\tGLOBAL __divschar\n"
261 "\tGLOBAL __divuchar\n"
262 "\tGLOBAL __divsint\n"
263 "\tGLOBAL __divuint\n"
264 "\tGLOBAL __modschar\n"
265 "\tGLOBAL __moduchar\n"
266 "\tGLOBAL __modsint\n"
267 "\tGLOBAL __moduint\n"
268 "\tGLOBAL banked_call\n"
269 "\tGLOBAL banked_ret\n"
272 "; ---------------------------------\n"
274 "; ---------------------------------"
276 { "functionlabeldef", "%s:" },
277 { "globalfunctionlabeldef", "%s::" },
280 { "area", "%s\tGROUP" },
281 { "areacode", "_CODE\tGROUP" },
282 { "areadata", "_DATA\tGROUP" },
283 { "areahome", "_CODE\tGROUP" },
284 { "ascii", "DB \"%s\
"" },
291 { "constbyte", "0x%02X" },
292 { "constword", "0x%04X" },
293 { "immedword", "0x%04X" },
294 { "immedbyte", "0x%02X" },
295 { "hashedstr", "%s" },
296 { "lsbimmeds", "%s & 0xFF" },
297 { "msbimmeds", "%s >> 8" },
298 { "bankimmeds", "!%s" },
299 { "hashedbankimmeds", "!%s" },
300 { "module", "; MODULE %s" },
301 { "optsdcc", "; optsdcc" },
305 static const ASM_MAPPING _isas_gb_mapping
[] = {
320 { "adjustsp", "add sp, -%d" },
323 { "ldahli", "ld a, (hli)" },
324 { "ldahld", "ld a, (hld)" },
325 { "lldahli", "ld (hli), a" },
326 { "lldahld", "ld (hld), a" },
328 { "jphl", "jp (hl)" },
329 { "ldahlsp", "ldhl sp, %d" },
330 { "ldaspsp", "add sp, %d" },
332 { "optsdcc", "; optsdcc" },
336 static const ASM_MAPPING _z80asm_mapping
[] = {
337 { "global", "XDEF %s" },
338 { "extern", "XREF %s" },
339 { "slabeldef", "\n.%s" },
340 { "labeldef", "\n.%s" },
341 { "tlabeldef", "\n.l%N%05d" },
342 { "tlabel", "l%N%05d" },
344 "; Generated using the z80asm/z88 tokens.\n"
345 "\tXREF __muluchar_rrx_s\n"
346 "\tXREF __mulschar_rrx_s\n"
347 "\tXREF __mulint_rrx_s\n"
348 "\tXREF __mullong_rrx_s\n"
349 "\tXREF __divuchar_rrx_s\n"
350 "\tXREF __divschar_rrx_s\n"
351 "\tXREF __divsint_rrx_s\n"
352 "\tXREF __divuint_rrx_s\n"
353 "\tXREF __divulong_rrx_s\n"
354 "\tXREF __divslong_rrx_s\n"
355 "\tXREF __rrulong_rrx_s\n"
356 "\tXREF __rrslong_rrx_s\n"
357 "\tXREF __rlulong_rrx_s\n"
358 "\tXREF __rlslong_rrx_s\n"
361 "; ---------------------------------\n"
363 "; ---------------------------------"
365 { "functionlabeldef", ".%s" },
366 { "globalfunctionlabeldef", ".%s" },
369 { "ascii", "DEFM \"%s\
"" },
372 { "dbs", "DEFB %s" },
374 { "dws", "DEFB %s" },
376 { "constbyte", "$%02X" },
377 { "constword", "$%04X" },
378 { "immedword", "$%04X" },
379 { "immedbyte", "$%02X" },
380 { "hashedstr", "%s" },
381 { "lsbimmeds", "%s ~ $FF" },
382 { "msbimmeds", "%s / 256" },
384 { "bankimmeds", "BANK(%s)" },
385 { "hashedbankimmeds", "BANK(%s)" },
386 { "module", "MODULE %s" },
387 { "area", "; Area %s" },
388 { "areadata", "; Aread BSS" },
389 { "areacode", "; Area CODE" },
390 { "areahome", "; Area HOME" },
391 { "optsdcc", "; optsdcc" },
395 static const ASM_MAPPING _z80asm_z80_mapping
[] = {
396 { "*ixx", "(ix%+d)" },
397 { "*iyx", "(iy%+d)" },
399 { "jphl", "jp (hl)" },
427 "call\t___sdcc_enter_ix\n" },
442 { "adjustsp", "lda sp, (sp%+d)" },
443 { "optsdcc", "; optsdcc" },
446 static const ASM_MAPPING _gas_gb_mapping
[] = {
450 { "area", ".area\t%s" },
451 { "areacode", ".area\t%s"},
452 { "areadata", ".area\t%s"},
453 { "areahome", ".area\t%s"},
454 { "functionlabeldef", "%s:" },
455 { "globalfunctionlabeldef", "%s:" },
459 { "ldahli", "ldi\ta, (hl)" },
460 { "ldahld", "ldd\ta, (hl)" },
461 { "lldahli", "ldi\t(hl), a" },
462 { "lldahld", "ldd\t(hl), a" },
463 { "ldahlsp", "ldhl\tsp, #%d" },
464 { "ldaspsp", "add\tsp, #%d" },
468 { "enterx", "add\tsp, #-%d" },
481 { "adjustsp", "lda\tsp, -%d (sp)" },
482 { "fileprelude", "" },
483 { "optsdcc", "; optsdcc" },
487 static const ASM_MAPPING _gas_z80_mapping
[] = {
491 {"area", ".area\t%s"},
492 {"areacode", ".area\t%s"},
493 {"areadata", ".area\t%s"},
494 {"areahome", ".area\t%s"},
495 {"constbyte", "0x%02x"},
496 {"constword", "0x%04x"},
497 {"immedword", "#0x%04x"},
498 {"immedbyte", "#0x%02x"},
499 {"hashedstr", "#%s"},
500 {"bankimmeds", "%s >> 16"},
501 { "*ixx", "%d (ix)" },
502 { "*iyx", "%d (iy)" },
530 { "enters", "call\t___sdcc_enter_ix\n" },
545 { "adjustsp", "lda\tsp,-%d (sp)" },
546 { "optsdcc", "; optsdcc" },
550 static const ASM_MAPPINGS _isas
= {
555 const ASM_MAPPINGS _isas_gb
= {
560 static const ASM_MAPPINGS _rgbds
= {
565 const ASM_MAPPINGS _rgbds_gb
= {
570 const ASM_MAPPINGS _asxxxx_gb
= {
575 const ASM_MAPPINGS _asxxxx_z80
= {
580 static const ASM_MAPPINGS _z80asm
= {
585 const ASM_MAPPINGS _z80asm_z80
= {
590 const ASM_MAPPINGS _asxxxx_r2k
= {
595 const ASM_MAPPINGS _gas_gb
= {
600 const ASM_MAPPINGS _gas_z80
= {