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:" },
11 { "ldahli", "ld a,(hl+)" },
12 { "ldahlsp", "lda hl,%d(sp)" },
13 { "ldaspsp", "lda sp,%d(sp)" },
26 { "leavex", "lda sp,%d(sp)"
45 { "adjustsp", "lda sp,-%d(sp)" },
46 { "fileprelude", "" },
58 static const ASM_MAPPING _asxxxx_z80_mapping[] = {
59 /* We want to prepend the _ */
60 { "area", ".area _%s" },
61 { "areacode", ".area _%s" },
62 { "areadata", ".area _%s" },
63 { "areahome", ".area _%s" },
114 { "adjustsp", "lda sp,-%d(sp)" },
126 static const ASM_MAPPING _rgbds_mapping[] = {
127 { "global", "GLOBAL %s" },
128 { "extern", "GLOBAL %s" },
129 { "slabeldef", "%s:" },
130 { "labeldef", "%s:" },
131 { "tlabeldef", ".l%05d:" },
132 { "tlabel", ".l%05d" },
134 "; Generated using the rgbds tokens.\n"
135 "\t; We have to define these here as sdcc dosnt make them global by default\n"
136 "\tGLOBAL __mulschar\n"
137 "\tGLOBAL __muluchar\n"
138 "\tGLOBAL __mulint\n"
139 "\tGLOBAL __divschar\n"
140 "\tGLOBAL __divuchar\n"
141 "\tGLOBAL __divsint\n"
142 "\tGLOBAL __divuint\n"
143 "\tGLOBAL __modschar\n"
144 "\tGLOBAL __moduchar\n"
145 "\tGLOBAL __modsint\n"
146 "\tGLOBAL __moduint\n"
147 "\tGLOBAL __mullong\n"
148 "\tGLOBAL __modslong\n"
149 "\tGLOBAL __divslong\n"
150 "\tGLOBAL banked_call\n"
151 "\tGLOBAL banked_ret\n"
154 "; ---------------------------------\n"
156 "; ---------------------------------"
158 { "functionlabeldef", "%s:" },
161 { "area", "SECTION \"%s\",CODE" },
162 { "areadata", "SECTION \"%F_%s\",BSS" },
163 { "areacode", "SECTION \"%F_CODE\",%s" },
164 { "areahome", "SECTION \"%F_HOME\",HOME" },
165 { "ascii", "DB \"%s\"" },
172 { "constbyte", "$%02X" },
173 { "constword", "$%04X" },
174 { "immedword", "$%04X" },
175 { "immedbyte", "$%02X" },
176 { "hashedstr", "%s" },
177 { "lsbimmeds", "%s & $FF" },
178 { "msbimmeds", "%s >> 8" },
179 { "bankimmeds", "BANK(%s)" },
180 { "module", "; MODULE %s" },
184 static const ASM_MAPPING _rgbds_gb_mapping[] = {
199 { "adjustsp", "add sp,-%d" },
201 { "enterx", "add sp,-%d"
205 { "leavex", "add sp,%d"
207 { "ldahli", "ld a,[hl+]" },
209 { "ldahlsp", "ld hl,[sp+%d]" },
210 { "ldaspsp", "add sp,%d" },
216 static const ASM_MAPPING _isas_mapping[] = {
217 { "global", "GLOBAL %s" },
218 { "extern", "GLOBAL %s" },
219 { "slabeldef", "%s:" },
220 { "labeldef", "%s:" },
221 { "tlabeldef", "?l%05d:" },
222 { "tlabel", "?l%05d" },
224 ";Generated using the isas tokens.\n"
225 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
226 "\tONCNUM ; Numbers are hex\n"
227 "\tCAPSOFF ; Case sensitive\n"
228 "\tISDMG ; Gameboy mode\n"
230 "\t; We have to define these here as sdcc doesnt make them global by default\n"
231 "\tGLOBAL __mulschar\n"
232 "\tGLOBAL __muluchar\n"
233 "\tGLOBAL __mulint\n"
234 "\tGLOBAL __divschar\n"
235 "\tGLOBAL __divuchar\n"
236 "\tGLOBAL __divsint\n"
237 "\tGLOBAL __divuint\n"
238 "\tGLOBAL __modschar\n"
239 "\tGLOBAL __moduchar\n"
240 "\tGLOBAL __modsint\n"
241 "\tGLOBAL __moduint\n"
242 "\tGLOBAL banked_call\n"
243 "\tGLOBAL banked_ret\n"
246 "; ---------------------------------\n"
248 "; ---------------------------------"
250 { "functionlabeldef", "%s:" },
253 { "area", "%s\tGROUP" },
254 { "areacode", "_CODE\tGROUP" },
255 { "areadata", "_DATA\tGROUP" },
256 { "areahome", "_CODE\tGROUP" },
257 { "ascii", "DB \"%s\"" },
264 { "constbyte", "0x%02X" },
265 { "constword", "0x%04X" },
266 { "immedword", "0x%04X" },
267 { "immedbyte", "0x%02X" },
268 { "hashedstr", "%s" },
269 { "lsbimmeds", "%s & 0xFF" },
270 { "msbimmeds", "%s >> 8" },
271 { "bankimmeds", "!%s" },
272 { "module", "; MODULE %s" },
276 static const ASM_MAPPING _isas_gb_mapping[] = {
291 { "adjustsp", "add sp,-%d" },
293 { "enterx", "add sp,-%d"
297 { "leavex", "add sp,%d\n" },
298 { "ldahli", "ld a,(hli)" },
300 { "ldahlsp", "ldhl sp,%d" },
301 { "ldaspsp", "add sp,%d" },
307 static const ASM_MAPPING _z80asm_mapping[] = {
308 { "global", "XDEF %s" },
309 { "extern", "XREF %s" },
310 { "slabeldef", "\n.%s" },
311 { "labeldef", "\n.%s" },
312 { "tlabeldef", "\n.l%N%05d" },
313 { "tlabel", "l%N%05d" },
315 "; Generated using the z80asm/z88 tokens.\n"
316 "\tXREF __muluchar_rrx_s\n"
317 "\tXREF __mulschar_rrx_s\n"
318 "\tXREF __mulint_rrx_s\n"
319 "\tXREF __mullong_rrx_s\n"
320 "\tXREF __divuchar_rrx_s\n"
321 "\tXREF __divschar_rrx_s\n"
322 "\tXREF __divsint_rrx_s\n"
323 "\tXREF __divuint_rrx_s\n"
324 "\tXREF __divulong_rrx_s\n"
325 "\tXREF __divslong_rrx_s\n"
326 "\tXREF __rrulong_rrx_s\n"
327 "\tXREF __rrslong_rrx_s\n"
328 "\tXREF __rlulong_rrx_s\n"
329 "\tXREF __rlslong_rrx_s\n"
332 "; ---------------------------------\n"
334 "; ---------------------------------"
336 { "functionlabeldef", ".%s" },
339 { "ascii", "DEFM \"%s\"" },
342 { "dbs", "DEFB %s" },
344 { "dws", "DEFB %s" },
346 { "constbyte", "$%02X" },
347 { "constword", "$%04X" },
348 { "immedword", "$%04X" },
349 { "immedbyte", "$%02X" },
350 { "hashedstr", "%s" },
351 { "lsbimmeds", "%s & $FF" },
352 { "msbimmeds", "%s / 256" },
354 { "bankimmeds", "BANK(%s)" },
355 { "module", "MODULE %s" },
356 { "area", "; Area %s" },
357 { "areadata", "; Aread BSS" },
358 { "areacode", "; Area CODE" },
359 { "areahome", "; Area HOME" },
363 static const ASM_MAPPING _z80asm_z80_mapping[] = {
364 { "*ixx", "(ix%+d)" },
365 { "*iyx", "(iy%+d)" },
414 { "adjustsp", "lda sp,(sp%+d)" },
426 static const ASM_MAPPINGS _isas = {
431 const ASM_MAPPINGS _isas_gb = {
436 static const ASM_MAPPINGS _rgbds = {
441 const ASM_MAPPINGS _rgbds_gb = {
446 const ASM_MAPPINGS _asxxxx_gb = {
451 const ASM_MAPPINGS _asxxxx_z80 = {
456 static const ASM_MAPPINGS _z80asm = {
461 const ASM_MAPPINGS _z80asm_z80 = {