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)" },
20 { "leavex", "lda sp,%d(sp)"
28 { "adjustsp", "lda sp,-%d(sp)" },
29 { "fileprelude", "" },
41 static const ASM_MAPPING _asxxxx_z80_mapping[] = {
42 /* We want to prepend the _ */
43 { "area", ".area _%s" },
44 { "areacode", ".area _%s" },
45 { "areadata", ".area _%s" },
46 { "areahome", ".area _%s" },
88 { "adjustsp", "lda sp,-%d(sp)" },
100 static const ASM_MAPPING _rgbds_mapping[] = {
101 { "global", "GLOBAL %s" },
102 { "slabeldef", "%s:" },
103 { "labeldef", "%s:" },
104 { "tlabeldef", ".l%05d:" },
105 { "tlabel", ".l%05d" },
107 "; Generated using the rgbds tokens.\n"
108 "\t; We have to define these here as sdcc dosnt make them global by default\n"
109 "\tGLOBAL __mulschar\n"
110 "\tGLOBAL __muluchar\n"
111 "\tGLOBAL __mulsint\n"
112 "\tGLOBAL __muluint\n"
113 "\tGLOBAL __divschar\n"
114 "\tGLOBAL __divuchar\n"
115 "\tGLOBAL __divsint\n"
116 "\tGLOBAL __divuint\n"
117 "\tGLOBAL __modschar\n"
118 "\tGLOBAL __moduchar\n"
119 "\tGLOBAL __modsint\n"
120 "\tGLOBAL __moduint\n"
121 "\tGLOBAL __mulslong\n"
122 "\tGLOBAL __modslong\n"
123 "\tGLOBAL __divslong\n"
124 "\tGLOBAL banked_call\n"
125 "\tGLOBAL banked_ret\n"
128 "; ---------------------------------\n"
130 "; ---------------------------------"
132 { "functionlabeldef", "%s:" },
135 { "area", "SECTION \"%s\",CODE" },
136 { "areadata", "SECTION \"%F_%s\",BSS" },
137 { "areacode", "SECTION \"%F_CODE\",%s" },
138 { "areahome", "SECTION \"%F_HOME\",HOME" },
139 { "ascii", "DB \"%s\"" },
146 { "constbyte", "$%02X" },
147 { "constword", "$%04X" },
148 { "immedword", "$%04X" },
149 { "immedbyte", "$%02X" },
150 { "hashedstr", "%s" },
151 { "lsbimmeds", "%s & $FF" },
152 { "msbimmeds", "%s >> 8" },
153 { "bankimmeds", "BANK(%s)" },
154 { "module", "; MODULE %s" },
158 static const ASM_MAPPING _rgbds_gb_mapping[] = {
166 { "adjustsp", "add sp,-%d" },
168 { "enterx", "add sp,-%d"
172 { "leavex", "add sp,%d"
174 { "ldahli", "ld a,[hl+]" },
176 { "ldahlsp", "ld hl,[sp+%d]" },
177 { "ldaspsp", "add sp,%d" },
183 static const ASM_MAPPING _isas_mapping[] = {
184 { "global", "GLOBAL %s" },
185 { "slabeldef", "%s:" },
186 { "labeldef", "%s:" },
187 { "tlabeldef", "?l%05d:" },
188 { "tlabel", "?l%05d" },
190 ";Generated using the isas tokens.\n"
191 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
192 "\tONCNUM ; Numbers are hex\n"
193 "\tCAPSOFF ; Case sensitive\n"
194 "\tISDMG ; Gameboy mode\n"
196 "\t; We have to define these here as sdcc dosnt make them global by default\n"
197 "\tGLOBAL __mulschar\n"
198 "\tGLOBAL __muluchar\n"
199 "\tGLOBAL __mulsint\n"
200 "\tGLOBAL __muluint\n"
201 "\tGLOBAL __divschar\n"
202 "\tGLOBAL __divuchar\n"
203 "\tGLOBAL __divsint\n"
204 "\tGLOBAL __divuint\n"
205 "\tGLOBAL __modschar\n"
206 "\tGLOBAL __moduchar\n"
207 "\tGLOBAL __modsint\n"
208 "\tGLOBAL __moduint\n"
209 "\tGLOBAL banked_call\n"
210 "\tGLOBAL banked_ret\n"
213 "; ---------------------------------\n"
215 "; ---------------------------------"
217 { "functionlabeldef", "%s:" },
220 { "area", "%s\tGROUP" },
221 { "areacode", "_CODE\tGROUP" },
222 { "areadata", "_DATA\tGROUP" },
223 { "areahome", "_CODE\tGROUP" },
224 { "ascii", "DB \"%s\"" },
231 { "constbyte", "0x%02X" },
232 { "constword", "0x%04X" },
233 { "immedword", "0x%04X" },
234 { "immedbyte", "0x%02X" },
235 { "hashedstr", "%s" },
236 { "lsbimmeds", "%s & 0xFF" },
237 { "msbimmeds", "%s >> 8" },
238 { "bankimmeds", "!%s" },
239 { "module", "; MODULE %s" },
243 static const ASM_MAPPING _isas_gb_mapping[] = {
251 { "adjustsp", "add sp,-%d" },
253 { "enterx", "add sp,-%d"
257 { "leavex", "add sp,%d\n" },
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 = {