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 { "functionlabeldef", "%s:" },
9 { "ldahli", "ld a,(hl+)" },
10 { "ldahlsp", "lda hl,%d(sp)" },
11 { "ldaspsp", "lda sp,%d(sp)" },
19 { "leavex", "lda sp,%d(sp)"
27 { "adjustsp", "lda sp,-%d(sp)" },
28 { "fileprelude", "" },
32 static const ASM_MAPPING _asxxxx_z80_mapping[] = {
33 /* We want to prepend the _ */
34 { "area", ".area _%s" },
35 { "areacode", ".area _%s" },
36 { "areadata", ".area _%s" },
77 { "adjustsp", "lda sp,-%d(sp)" },
81 static const ASM_MAPPING _rgbds_mapping[] = {
82 { "global", "GLOBAL %s" },
83 { "slabeldef", "%s:" },
84 { "labeldef", "%s:" },
85 { "tlabeldef", ".l%05d:" },
86 { "tlabel", ".l%05d" },
88 "; Generated using the rgbds tokens.\n"
89 "\t; We have to define these here as sdcc dosnt make them global by default\n"
90 "\tGLOBAL __mulschar\n"
91 "\tGLOBAL __muluchar\n"
92 "\tGLOBAL __mulsint\n"
93 "\tGLOBAL __muluint\n"
94 "\tGLOBAL __divschar\n"
95 "\tGLOBAL __divuchar\n"
96 "\tGLOBAL __divsint\n"
97 "\tGLOBAL __divuint\n"
98 "\tGLOBAL __modschar\n"
99 "\tGLOBAL __moduchar\n"
100 "\tGLOBAL __modsint\n"
101 "\tGLOBAL __moduint\n"
102 "\tGLOBAL __mulslong\n"
103 "\tGLOBAL __modslong\n"
104 "\tGLOBAL __divslong\n"
105 "\tGLOBAL banked_call\n"
106 "\tGLOBAL banked_ret\n"
109 "; ---------------------------------\n"
111 "; ---------------------------------"
113 { "functionlabeldef", "%s:" },
116 { "area", "SECTION \"%s_%F_%I\",%C" },
117 { "areacode", "SECTION \"CODE\",%C" },
118 { "areadata", "SECTION \"DATA\",BSS" },
119 { "ascii", "DB \"%s\"" },
126 { "constbyte", "$%02X" },
127 { "constword", "$%04X" },
128 { "immedword", "$%04X" },
129 { "immedbyte", "$%02X" },
130 { "hashedstr", "%s" },
131 { "lsbimmeds", "%s & $FF" },
132 { "msbimmeds", "%s >> 8" },
133 { "bankimmeds", "BANK(%s)" },
134 { "module", "; MODULE %s" },
138 static const ASM_MAPPING _rgbds_gb_mapping[] = {
146 { "adjustsp", "add sp,-%d" },
148 { "enterx", "add sp,-%d"
152 { "leavex", "add sp,%d"
154 { "ldahli", "ld a,[hl+]" },
156 { "ldahlsp", "ld hl,[sp+%d]" },
157 { "ldaspsp", "add sp,%d" },
163 static const ASM_MAPPING _isas_mapping[] = {
164 { "global", "GLOBAL %s" },
165 { "slabeldef", "%s:" },
166 { "labeldef", "%s:" },
167 { "tlabeldef", "?l%05d:" },
168 { "tlabel", "?l%05d" },
170 ";Generated using the isas tokens.\n"
171 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
172 "\tONCNUM ; Numbers are hex\n"
173 "\tCAPSOFF ; Case sensitive\n"
174 "\tISDMG ; Gameboy mode\n"
176 "\t; We have to define these here as sdcc dosnt make them global by default\n"
177 "\tGLOBAL __mulschar\n"
178 "\tGLOBAL __muluchar\n"
179 "\tGLOBAL __mulsint\n"
180 "\tGLOBAL __muluint\n"
181 "\tGLOBAL __divschar\n"
182 "\tGLOBAL __divuchar\n"
183 "\tGLOBAL __divsint\n"
184 "\tGLOBAL __divuint\n"
185 "\tGLOBAL __modschar\n"
186 "\tGLOBAL __moduchar\n"
187 "\tGLOBAL __modsint\n"
188 "\tGLOBAL __moduint\n"
189 "\tGLOBAL banked_call\n"
190 "\tGLOBAL banked_ret\n"
193 "; ---------------------------------\n"
195 "; ---------------------------------"
197 { "functionlabeldef", "%s:" },
200 { "area", "%s\tGROUP" },
201 { "areacode", "_CODE\tGROUP" },
202 { "areadata", "_DATA\tGROUP" },
203 { "ascii", "DB \"%s\"" },
210 { "constbyte", "0x%02X" },
211 { "constword", "0x%04X" },
212 { "immedword", "0x%04X" },
213 { "immedbyte", "0x%02X" },
214 { "hashedstr", "%s" },
215 { "lsbimmeds", "%s & 0xFF" },
216 { "msbimmeds", "%s >> 8" },
217 { "bankimmeds", "!%s" },
218 { "module", "; MODULE %s" },
222 static const ASM_MAPPING _isas_gb_mapping[] = {
230 { "adjustsp", "add sp,-%d" },
232 { "enterx", "add sp,-%d"
236 { "leavex", "add sp,%d\n" },
237 { "ldahli", "ld a,(hli)" },
239 { "ldahlsp", "ldhl sp,%d" },
240 { "ldaspsp", "add sp,%d" },
246 static const ASM_MAPPINGS _isas = {
251 const ASM_MAPPINGS _isas_gb = {
256 static const ASM_MAPPINGS _rgbds = {
261 const ASM_MAPPINGS _rgbds_gb = {
266 const ASM_MAPPINGS _asxxxx_gb = {
271 const ASM_MAPPINGS _asxxxx_z80 = {