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)"
44 { "adjustsp", "lda sp,-%d(sp)" },
45 { "fileprelude", "" },
57 static const ASM_MAPPING _asxxxx_z80_mapping[] = {
58 /* We want to prepend the _ */
59 { "area", ".area _%s" },
60 { "areacode", ".area _%s" },
61 { "areadata", ".area _%s" },
62 { "areahome", ".area _%s" },
112 { "adjustsp", "lda sp,-%d(sp)" },
124 static const ASM_MAPPING _rgbds_mapping[] = {
125 { "global", "GLOBAL %s" },
126 { "extern", "GLOBAL %s" },
127 { "slabeldef", "%s:" },
128 { "labeldef", "%s:" },
129 { "tlabeldef", ".l%05d:" },
130 { "tlabel", ".l%05d" },
132 "; Generated using the rgbds tokens.\n"
133 "\t; We have to define these here as sdcc dosnt make them global by default\n"
134 "\tGLOBAL __mulschar\n"
135 "\tGLOBAL __muluchar\n"
136 "\tGLOBAL __mulint\n"
137 "\tGLOBAL __divschar\n"
138 "\tGLOBAL __divuchar\n"
139 "\tGLOBAL __divsint\n"
140 "\tGLOBAL __divuint\n"
141 "\tGLOBAL __modschar\n"
142 "\tGLOBAL __moduchar\n"
143 "\tGLOBAL __modsint\n"
144 "\tGLOBAL __moduint\n"
145 "\tGLOBAL __mullong\n"
146 "\tGLOBAL __modslong\n"
147 "\tGLOBAL __divslong\n"
148 "\tGLOBAL banked_call\n"
149 "\tGLOBAL banked_ret\n"
152 "; ---------------------------------\n"
154 "; ---------------------------------"
156 { "functionlabeldef", "%s:" },
159 { "area", "SECTION \"%s\",CODE" },
160 { "areadata", "SECTION \"%F_%s\",BSS" },
161 { "areacode", "SECTION \"%F_CODE\",%s" },
162 { "areahome", "SECTION \"%F_HOME\",HOME" },
163 { "ascii", "DB \"%s\"" },
170 { "constbyte", "$%02X" },
171 { "constword", "$%04X" },
172 { "immedword", "$%04X" },
173 { "immedbyte", "$%02X" },
174 { "hashedstr", "%s" },
175 { "lsbimmeds", "%s & $FF" },
176 { "msbimmeds", "%s >> 8" },
177 { "bankimmeds", "BANK(%s)" },
178 { "module", "; MODULE %s" },
182 static const ASM_MAPPING _rgbds_gb_mapping[] = {
196 { "adjustsp", "add sp,-%d" },
198 { "enterx", "add sp,-%d"
202 { "leavex", "add sp,%d"
204 { "ldahli", "ld a,[hl+]" },
206 { "ldahlsp", "ld hl,[sp+%d]" },
207 { "ldaspsp", "add sp,%d" },
213 static const ASM_MAPPING _isas_mapping[] = {
214 { "global", "GLOBAL %s" },
215 { "extern", "GLOBAL %s" },
216 { "slabeldef", "%s:" },
217 { "labeldef", "%s:" },
218 { "tlabeldef", "?l%05d:" },
219 { "tlabel", "?l%05d" },
221 ";Generated using the isas tokens.\n"
222 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
223 "\tONCNUM ; Numbers are hex\n"
224 "\tCAPSOFF ; Case sensitive\n"
225 "\tISDMG ; Gameboy mode\n"
227 "\t; We have to define these here as sdcc doesnt make them global by default\n"
228 "\tGLOBAL __mulschar\n"
229 "\tGLOBAL __muluchar\n"
230 "\tGLOBAL __mulint\n"
231 "\tGLOBAL __divschar\n"
232 "\tGLOBAL __divuchar\n"
233 "\tGLOBAL __divsint\n"
234 "\tGLOBAL __divuint\n"
235 "\tGLOBAL __modschar\n"
236 "\tGLOBAL __moduchar\n"
237 "\tGLOBAL __modsint\n"
238 "\tGLOBAL __moduint\n"
239 "\tGLOBAL banked_call\n"
240 "\tGLOBAL banked_ret\n"
243 "; ---------------------------------\n"
245 "; ---------------------------------"
247 { "functionlabeldef", "%s:" },
250 { "area", "%s\tGROUP" },
251 { "areacode", "_CODE\tGROUP" },
252 { "areadata", "_DATA\tGROUP" },
253 { "areahome", "_CODE\tGROUP" },
254 { "ascii", "DB \"%s\"" },
261 { "constbyte", "0x%02X" },
262 { "constword", "0x%04X" },
263 { "immedword", "0x%04X" },
264 { "immedbyte", "0x%02X" },
265 { "hashedstr", "%s" },
266 { "lsbimmeds", "%s & 0xFF" },
267 { "msbimmeds", "%s >> 8" },
268 { "bankimmeds", "!%s" },
269 { "module", "; MODULE %s" },
273 static const ASM_MAPPING _isas_gb_mapping[] = {
287 { "adjustsp", "add sp,-%d" },
289 { "enterx", "add sp,-%d"
293 { "leavex", "add sp,%d\n" },
294 { "ldahli", "ld a,(hli)" },
296 { "ldahlsp", "ldhl sp,%d" },
297 { "ldaspsp", "add sp,%d" },
303 static const ASM_MAPPING _z80asm_mapping[] = {
304 { "global", "XDEF %s" },
305 { "extern", "XREF %s" },
306 { "slabeldef", "\n.%s" },
307 { "labeldef", "\n.%s" },
308 { "tlabeldef", "\n.l%N%05d" },
309 { "tlabel", "l%N%05d" },
311 "; Generated using the z80asm/z88 tokens.\n"
312 "\tXREF __muluchar_rrx_s\n"
313 "\tXREF __mulschar_rrx_s\n"
314 "\tXREF __mulint_rrx_s\n"
315 "\tXREF __mullong_rrx_s\n"
316 "\tXREF __divuchar_rrx_s\n"
317 "\tXREF __divschar_rrx_s\n"
318 "\tXREF __divsint_rrx_s\n"
319 "\tXREF __divuint_rrx_s\n"
320 "\tXREF __divulong_rrx_s\n"
321 "\tXREF __divslong_rrx_s\n"
322 "\tXREF __rrulong_rrx_s\n"
323 "\tXREF __rrslong_rrx_s\n"
324 "\tXREF __rlulong_rrx_s\n"
325 "\tXREF __rlslong_rrx_s\n"
328 "; ---------------------------------\n"
330 "; ---------------------------------"
332 { "functionlabeldef", ".%s" },
335 { "ascii", "DEFM \"%s\"" },
338 { "dbs", "DEFB %s" },
340 { "dws", "DEFB %s" },
342 { "constbyte", "$%02X" },
343 { "constword", "$%04X" },
344 { "immedword", "$%04X" },
345 { "immedbyte", "$%02X" },
346 { "hashedstr", "%s" },
347 { "lsbimmeds", "%s & $FF" },
348 { "msbimmeds", "%s / 256" },
350 { "bankimmeds", "BANK(%s)" },
351 { "module", "MODULE %s" },
352 { "area", "; Area %s" },
353 { "areadata", "; Aread BSS" },
354 { "areacode", "; Area CODE" },
355 { "areahome", "; Area HOME" },
359 static const ASM_MAPPING _z80asm_z80_mapping[] = {
360 { "*ixx", "(ix%+d)" },
361 { "*iyx", "(iy%+d)" },
409 { "adjustsp", "lda sp,(sp%+d)" },
421 static const ASM_MAPPINGS _isas = {
426 const ASM_MAPPINGS _isas_gb = {
431 static const ASM_MAPPINGS _rgbds = {
436 const ASM_MAPPINGS _rgbds_gb = {
441 const ASM_MAPPINGS _asxxxx_gb = {
446 const ASM_MAPPINGS _asxxxx_z80 = {
451 static const ASM_MAPPINGS _z80asm = {
456 const ASM_MAPPINGS _z80asm_z80 = {