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 __mulint\n"
123 "\tGLOBAL __divschar\n"
124 "\tGLOBAL __divuchar\n"
125 "\tGLOBAL __divsint\n"
126 "\tGLOBAL __divuint\n"
127 "\tGLOBAL __modschar\n"
128 "\tGLOBAL __moduchar\n"
129 "\tGLOBAL __modsint\n"
130 "\tGLOBAL __moduint\n"
131 "\tGLOBAL __mullong\n"
132 "\tGLOBAL __modslong\n"
133 "\tGLOBAL __divslong\n"
134 "\tGLOBAL banked_call\n"
135 "\tGLOBAL banked_ret\n"
138 "; ---------------------------------\n"
140 "; ---------------------------------"
142 { "functionlabeldef", "%s:" },
145 { "area", "SECTION \"%s\",CODE" },
146 { "areadata", "SECTION \"%F_%s\",BSS" },
147 { "areacode", "SECTION \"%F_CODE\",%s" },
148 { "areahome", "SECTION \"%F_HOME\",HOME" },
149 { "ascii", "DB \"%s\"" },
156 { "constbyte", "$%02X" },
157 { "constword", "$%04X" },
158 { "immedword", "$%04X" },
159 { "immedbyte", "$%02X" },
160 { "hashedstr", "%s" },
161 { "lsbimmeds", "%s & $FF" },
162 { "msbimmeds", "%s >> 8" },
163 { "bankimmeds", "BANK(%s)" },
164 { "module", "; MODULE %s" },
168 static const ASM_MAPPING _rgbds_gb_mapping[] = {
176 { "adjustsp", "add sp,-%d" },
178 { "enterx", "add sp,-%d"
182 { "leavex", "add sp,%d"
184 { "ldahli", "ld a,[hl+]" },
186 { "ldahlsp", "ld hl,[sp+%d]" },
187 { "ldaspsp", "add sp,%d" },
193 static const ASM_MAPPING _isas_mapping[] = {
194 { "global", "GLOBAL %s" },
195 { "extern", "GLOBAL %s" },
196 { "slabeldef", "%s:" },
197 { "labeldef", "%s:" },
198 { "tlabeldef", "?l%05d:" },
199 { "tlabel", "?l%05d" },
201 ";Generated using the isas tokens.\n"
202 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
203 "\tONCNUM ; Numbers are hex\n"
204 "\tCAPSOFF ; Case sensitive\n"
205 "\tISDMG ; Gameboy mode\n"
207 "\t; We have to define these here as sdcc doesnt make them global by default\n"
208 "\tGLOBAL __mulschar\n"
209 "\tGLOBAL __muluchar\n"
210 "\tGLOBAL __mulint\n"
211 "\tGLOBAL __divschar\n"
212 "\tGLOBAL __divuchar\n"
213 "\tGLOBAL __divsint\n"
214 "\tGLOBAL __divuint\n"
215 "\tGLOBAL __modschar\n"
216 "\tGLOBAL __moduchar\n"
217 "\tGLOBAL __modsint\n"
218 "\tGLOBAL __moduint\n"
219 "\tGLOBAL banked_call\n"
220 "\tGLOBAL banked_ret\n"
223 "; ---------------------------------\n"
225 "; ---------------------------------"
227 { "functionlabeldef", "%s:" },
230 { "area", "%s\tGROUP" },
231 { "areacode", "_CODE\tGROUP" },
232 { "areadata", "_DATA\tGROUP" },
233 { "areahome", "_CODE\tGROUP" },
234 { "ascii", "DB \"%s\"" },
241 { "constbyte", "0x%02X" },
242 { "constword", "0x%04X" },
243 { "immedword", "0x%04X" },
244 { "immedbyte", "0x%02X" },
245 { "hashedstr", "%s" },
246 { "lsbimmeds", "%s & 0xFF" },
247 { "msbimmeds", "%s >> 8" },
248 { "bankimmeds", "!%s" },
249 { "module", "; MODULE %s" },
253 static const ASM_MAPPING _isas_gb_mapping[] = {
261 { "adjustsp", "add sp,-%d" },
263 { "enterx", "add sp,-%d"
267 { "leavex", "add sp,%d\n" },
268 { "ldahli", "ld a,(hli)" },
270 { "ldahlsp", "ldhl sp,%d" },
271 { "ldaspsp", "add sp,%d" },
277 static const ASM_MAPPING _z80asm_mapping[] = {
278 { "global", "XDEF %s" },
279 { "extern", "XREF %s" },
280 { "slabeldef", "\n.%s" },
281 { "labeldef", "\n.%s" },
282 { "tlabeldef", "\n.l%N%05d" },
283 { "tlabel", "l%N%05d" },
285 "; Generated using the z80asm/z88 tokens.\n"
286 "\tXREF __muluchar_rrx_s\n"
287 "\tXREF __mulschar_rrx_s\n"
288 "\tXREF __mulint_rrx_s\n"
289 "\tXREF __mullong_rrx_s\n"
290 "\tXREF __divuchar_rrx_s\n"
291 "\tXREF __divschar_rrx_s\n"
292 "\tXREF __divsint_rrx_s\n"
293 "\tXREF __divuint_rrx_s\n"
294 "\tXREF __divulong_rrx_s\n"
295 "\tXREF __divslong_rrx_s\n"
296 "\tXREF __rrulong_rrx_s\n"
297 "\tXREF __rrslong_rrx_s\n"
298 "\tXREF __rlulong_rrx_s\n"
299 "\tXREF __rlslong_rrx_s\n"
302 "; ---------------------------------\n"
304 "; ---------------------------------"
306 { "functionlabeldef", ".%s" },
309 { "ascii", "DEFM \"%s\"" },
312 { "dbs", "DEFB %s" },
314 { "dws", "DEFB %s" },
316 { "constbyte", "$%02X" },
317 { "constword", "$%04X" },
318 { "immedword", "$%04X" },
319 { "immedbyte", "$%02X" },
320 { "hashedstr", "%s" },
321 { "lsbimmeds", "%s & $FF" },
322 { "msbimmeds", "%s / 256" },
324 { "bankimmeds", "BANK(%s)" },
325 { "module", "MODULE %s" },
326 { "area", "; Area %s" },
327 { "areadata", "; Aread BSS" },
328 { "areacode", "; Area CODE" },
329 { "areahome", "; Area HOME" },
333 static const ASM_MAPPING _z80asm_z80_mapping[] = {
334 { "*ixx", "(ix%+d)" },
335 { "*iyx", "(iy%+d)" },
375 { "adjustsp", "lda sp,(sp%+d)" },
387 static const ASM_MAPPINGS _isas = {
392 const ASM_MAPPINGS _isas_gb = {
397 static const ASM_MAPPINGS _rgbds = {
402 const ASM_MAPPINGS _rgbds_gb = {
407 const ASM_MAPPINGS _asxxxx_gb = {
412 const ASM_MAPPINGS _asxxxx_z80 = {
417 static const ASM_MAPPINGS _z80asm = {
422 const ASM_MAPPINGS _z80asm_z80 = {