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", "" },
33 static const ASM_MAPPING _asxxxx_z80_mapping[] = {
34 /* We want to prepend the _ */
35 { "area", ".area _%s" },
36 { "areacode", ".area _%s" },
37 { "areadata", ".area _%s" },
38 { "areahome", ".area _%s" },
84 { "adjustsp", "lda sp,-%d(sp)" },
88 static const ASM_MAPPING _rgbds_mapping[] = {
89 { "global", "GLOBAL %s" },
90 { "slabeldef", "%s:" },
91 { "labeldef", "%s:" },
92 { "tlabeldef", ".l%05d:" },
93 { "tlabel", ".l%05d" },
95 "; Generated using the rgbds tokens.\n"
96 "\t; We have to define these here as sdcc dosnt make them global by default\n"
97 "\tGLOBAL __mulschar\n"
98 "\tGLOBAL __muluchar\n"
99 "\tGLOBAL __mulsint\n"
100 "\tGLOBAL __muluint\n"
101 "\tGLOBAL __divschar\n"
102 "\tGLOBAL __divuchar\n"
103 "\tGLOBAL __divsint\n"
104 "\tGLOBAL __divuint\n"
105 "\tGLOBAL __modschar\n"
106 "\tGLOBAL __moduchar\n"
107 "\tGLOBAL __modsint\n"
108 "\tGLOBAL __moduint\n"
109 "\tGLOBAL __mulslong\n"
110 "\tGLOBAL __modslong\n"
111 "\tGLOBAL __divslong\n"
112 "\tGLOBAL banked_call\n"
113 "\tGLOBAL banked_ret\n"
116 "; ---------------------------------\n"
118 "; ---------------------------------"
120 { "functionlabeldef", "%s:" },
123 { "area", "SECTION \"%s\",CODE" },
124 { "areadata", "SECTION \"%F_%s\",BSS" },
125 { "areacode", "SECTION \"%F_CODE\",%s" },
126 { "areahome", "SECTION \"%F_HOME\",HOME" },
127 { "ascii", "DB \"%s\"" },
134 { "constbyte", "$%02X" },
135 { "constword", "$%04X" },
136 { "immedword", "$%04X" },
137 { "immedbyte", "$%02X" },
138 { "hashedstr", "%s" },
139 { "lsbimmeds", "%s & $FF" },
140 { "msbimmeds", "%s >> 8" },
141 { "bankimmeds", "BANK(%s)" },
142 { "module", "; MODULE %s" },
146 static const ASM_MAPPING _rgbds_gb_mapping[] = {
154 { "adjustsp", "add sp,-%d" },
156 { "enterx", "add sp,-%d"
160 { "leavex", "add sp,%d"
162 { "ldahli", "ld a,[hl+]" },
164 { "ldahlsp", "ld hl,[sp+%d]" },
165 { "ldaspsp", "add sp,%d" },
171 static const ASM_MAPPING _isas_mapping[] = {
172 { "global", "GLOBAL %s" },
173 { "slabeldef", "%s:" },
174 { "labeldef", "%s:" },
175 { "tlabeldef", "?l%05d:" },
176 { "tlabel", "?l%05d" },
178 ";Generated using the isas tokens.\n"
179 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
180 "\tONCNUM ; Numbers are hex\n"
181 "\tCAPSOFF ; Case sensitive\n"
182 "\tISDMG ; Gameboy mode\n"
184 "\t; We have to define these here as sdcc dosnt make them global by default\n"
185 "\tGLOBAL __mulschar\n"
186 "\tGLOBAL __muluchar\n"
187 "\tGLOBAL __mulsint\n"
188 "\tGLOBAL __muluint\n"
189 "\tGLOBAL __divschar\n"
190 "\tGLOBAL __divuchar\n"
191 "\tGLOBAL __divsint\n"
192 "\tGLOBAL __divuint\n"
193 "\tGLOBAL __modschar\n"
194 "\tGLOBAL __moduchar\n"
195 "\tGLOBAL __modsint\n"
196 "\tGLOBAL __moduint\n"
197 "\tGLOBAL banked_call\n"
198 "\tGLOBAL banked_ret\n"
201 "; ---------------------------------\n"
203 "; ---------------------------------"
205 { "functionlabeldef", "%s:" },
208 { "area", "%s\tGROUP" },
209 { "areacode", "_CODE\tGROUP" },
210 { "areadata", "_DATA\tGROUP" },
211 { "areahome", "_CODE\tGROUP" },
212 { "ascii", "DB \"%s\"" },
219 { "constbyte", "0x%02X" },
220 { "constword", "0x%04X" },
221 { "immedword", "0x%04X" },
222 { "immedbyte", "0x%02X" },
223 { "hashedstr", "%s" },
224 { "lsbimmeds", "%s & 0xFF" },
225 { "msbimmeds", "%s >> 8" },
226 { "bankimmeds", "!%s" },
227 { "module", "; MODULE %s" },
231 static const ASM_MAPPING _isas_gb_mapping[] = {
239 { "adjustsp", "add sp,-%d" },
241 { "enterx", "add sp,-%d"
245 { "leavex", "add sp,%d\n" },
246 { "ldahli", "ld a,(hli)" },
248 { "ldahlsp", "ldhl sp,%d" },
249 { "ldaspsp", "add sp,%d" },
255 static const ASM_MAPPINGS _isas = {
260 const ASM_MAPPINGS _isas_gb = {
265 static const ASM_MAPPINGS _rgbds = {
270 const ASM_MAPPINGS _rgbds_gb = {
275 const ASM_MAPPINGS _asxxxx_gb = {
280 const ASM_MAPPINGS _asxxxx_z80 = {