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 { "slabeldef", "%s:" },
113 { "labeldef", "%s:" },
114 { "tlabeldef", ".l%05d:" },
115 { "tlabel", ".l%05d" },
117 "; Generated using the rgbds tokens.\n"
118 "\t; We have to define these here as sdcc dosnt make them global by default\n"
119 "\tGLOBAL __mulschar\n"
120 "\tGLOBAL __muluchar\n"
121 "\tGLOBAL __mulsint\n"
122 "\tGLOBAL __muluint\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 __mulslong\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 { "slabeldef", "%s:" },
196 { "labeldef", "%s:" },
197 { "tlabeldef", "?l%05d:" },
198 { "tlabel", "?l%05d" },
200 ";Generated using the isas tokens.\n"
201 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
202 "\tONCNUM ; Numbers are hex\n"
203 "\tCAPSOFF ; Case sensitive\n"
204 "\tISDMG ; Gameboy mode\n"
206 "\t; We have to define these here as sdcc dosnt make them global by default\n"
207 "\tGLOBAL __mulschar\n"
208 "\tGLOBAL __muluchar\n"
209 "\tGLOBAL __mulsint\n"
210 "\tGLOBAL __muluint\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_MAPPINGS _isas = {
282 const ASM_MAPPINGS _isas_gb = {
287 static const ASM_MAPPINGS _rgbds = {
292 const ASM_MAPPINGS _rgbds_gb = {
297 const ASM_MAPPINGS _asxxxx_gb = {
302 const ASM_MAPPINGS _asxxxx_z80 = {