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)" },
14 { "enter", "push bc" },
33 { "adjustsp", "lda sp,-%d(sp)" },
37 static const ASM_MAPPING _asxxxx_z80_mapping[] = {
38 /* We want to prepend the _ */
39 { "area", ".area _%s" },
40 { "areacode", ".area _%s" },
41 { "areadata", ".area _%s" },
92 { "adjustsp", "lda sp,-%d(sp)" },
96 static const ASM_MAPPING _rgbds_mapping[] = {
97 { "global", "GLOBAL %s" },
98 { "slabeldef", "%s:" },
99 { "labeldef", "%s:" },
100 { "tlabeldef", ".l%05d:" },
101 { "tlabel", ".l%05d" },
103 "; Generated using the rgbds tokens.\n"
104 "\t; We have to define these here as sdcc dosnt make them global by default\n"
105 "\tGLOBAL __mulschar\n"
106 "\tGLOBAL __muluchar\n"
107 "\tGLOBAL __mulsint\n"
108 "\tGLOBAL __muluint\n"
109 "\tGLOBAL __divschar\n"
110 "\tGLOBAL __divuchar\n"
111 "\tGLOBAL __divsint\n"
112 "\tGLOBAL __divuint\n"
113 "\tGLOBAL __modschar\n"
114 "\tGLOBAL __moduchar\n"
115 "\tGLOBAL __modsint\n"
119 "; ---------------------------------\n"
121 "; ---------------------------------"
123 { "functionlabeldef", "%s:" },
126 { "area", "SECTION \"%s\",%C" },
127 { "areacode", "SECTION \"CODE\",%C" },
128 { "areadata", "SECTION \"DATA\",BSS" },
129 { "ascii", "DB \"%s\"" },
136 { "constbyte", "$%02X" },
137 { "constword", "$%04X" },
138 { "immedword", "$%04X" },
139 { "immedbyte", "$%02X" },
140 { "hashedstr", "%s" },
141 { "lsbimmeds", "%s & $FF" },
142 { "msbimmeds", "%s >> 8" },
143 { "module", "; MODULE %s" },
147 static const ASM_MAPPING _rgbds_gb_mapping[] = {
155 { "adjustsp", "add sp,-%d" },
156 { "enter", "push bc" },
170 { "ldahli", "ld a,[hl+]" },
172 { "ldahlsp", "ld hl,[sp+%d]" },
173 { "ldaspsp", "add sp,%d" },
179 static const ASM_MAPPING _isas_mapping[] = {
180 { "global", "GLOBAL %s" },
181 { "slabeldef", "%s:" },
182 { "labeldef", "%s:" },
183 { "tlabeldef", "?l%05d:" },
184 { "tlabel", "?l%05d" },
186 ";Generated using the isas tokens.\n"
187 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
188 "\tONCNUM ; Numbers are hex\n"
189 "\tCAPSOFF ; Case sensitive\n"
190 "\tISDMG ; Gameboy mode\n"
192 "\t; We have to define these here as sdcc dosnt make them global by default\n"
193 "\tGLOBAL __mulschar\n"
194 "\tGLOBAL __muluchar\n"
195 "\tGLOBAL __mulsint\n"
196 "\tGLOBAL __muluint\n"
197 "\tGLOBAL __divschar\n"
198 "\tGLOBAL __divuchar\n"
199 "\tGLOBAL __divsint\n"
200 "\tGLOBAL __divuint\n"
201 "\tGLOBAL __modschar\n"
202 "\tGLOBAL __moduchar\n"
203 "\tGLOBAL __modsint\n"
207 "; ---------------------------------\n"
209 "; ---------------------------------"
211 { "functionlabeldef", "%s:" },
214 { "area", "%s\tGROUP" },
215 { "areacode", "_CODE\tGROUP" },
216 { "areadata", "_DATA\tGROUP" },
217 { "ascii", "DB \"%s\"" },
224 { "constbyte", "0x%02X" },
225 { "constword", "0x%04X" },
226 { "immedword", "0x%04X" },
227 { "immedbyte", "0x%02X" },
228 { "hashedstr", "%s" },
229 { "lsbimmeds", "%s & 0xFF" },
230 { "msbimmeds", "%s >> 8" },
231 { "module", "; MODULE %s" },
235 static const ASM_MAPPING _isas_gb_mapping[] = {
243 { "adjustsp", "add sp,-%d" },
244 { "enter", "push bc" },
258 { "ldahli", "ld a,(hli)" },
260 { "ldahlsp", "ldhl sp,%d" },
261 { "ldaspsp", "add sp,%d" },
267 static const ASM_MAPPINGS _isas = {
272 const ASM_MAPPINGS _isas_gb = {
277 static const ASM_MAPPINGS _rgbds = {
282 const ASM_MAPPINGS _rgbds_gb = {
287 const ASM_MAPPINGS _asxxxx_gb = {
292 const ASM_MAPPINGS _asxxxx_z80 = {