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" },
79 { "adjustsp", "lda sp,-%d(sp)" },
83 static const ASM_MAPPING _rgbds_mapping[] = {
84 { "global", "GLOBAL %s" },
85 { "slabeldef", "%s:" },
86 { "labeldef", "%s:" },
87 { "tlabeldef", ".l%05d:" },
88 { "tlabel", ".l%05d" },
90 "; Generated using the rgbds tokens.\n"
91 "\t; We have to define these here as sdcc dosnt make them global by default\n"
92 "\tGLOBAL __mulschar\n"
93 "\tGLOBAL __muluchar\n"
94 "\tGLOBAL __mulsint\n"
95 "\tGLOBAL __muluint\n"
96 "\tGLOBAL __divschar\n"
97 "\tGLOBAL __divuchar\n"
98 "\tGLOBAL __divsint\n"
99 "\tGLOBAL __divuint\n"
100 "\tGLOBAL __modschar\n"
101 "\tGLOBAL __moduchar\n"
102 "\tGLOBAL __modsint\n"
103 "\tGLOBAL __moduint\n"
104 "\tGLOBAL __mulslong\n"
105 "\tGLOBAL __modslong\n"
106 "\tGLOBAL __divslong\n"
107 "\tGLOBAL banked_call\n"
108 "\tGLOBAL banked_ret\n"
111 "; ---------------------------------\n"
113 "; ---------------------------------"
115 { "functionlabeldef", "%s:" },
118 { "area", "SECTION \"%s\",CODE" },
119 { "areadata", "SECTION \"%F_%s\",BSS" },
120 { "areacode", "SECTION \"%F_CODE\",%s" },
121 { "areahome", "SECTION \"%F_HOME\",HOME" },
122 { "ascii", "DB \"%s\"" },
129 { "constbyte", "$%02X" },
130 { "constword", "$%04X" },
131 { "immedword", "$%04X" },
132 { "immedbyte", "$%02X" },
133 { "hashedstr", "%s" },
134 { "lsbimmeds", "%s & $FF" },
135 { "msbimmeds", "%s >> 8" },
136 { "bankimmeds", "BANK(%s)" },
137 { "module", "; MODULE %s" },
141 static const ASM_MAPPING _rgbds_gb_mapping[] = {
149 { "adjustsp", "add sp,-%d" },
151 { "enterx", "add sp,-%d"
155 { "leavex", "add sp,%d"
157 { "ldahli", "ld a,[hl+]" },
159 { "ldahlsp", "ld hl,[sp+%d]" },
160 { "ldaspsp", "add sp,%d" },
166 static const ASM_MAPPING _isas_mapping[] = {
167 { "global", "GLOBAL %s" },
168 { "slabeldef", "%s:" },
169 { "labeldef", "%s:" },
170 { "tlabeldef", "?l%05d:" },
171 { "tlabel", "?l%05d" },
173 ";Generated using the isas tokens.\n"
174 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
175 "\tONCNUM ; Numbers are hex\n"
176 "\tCAPSOFF ; Case sensitive\n"
177 "\tISDMG ; Gameboy mode\n"
179 "\t; We have to define these here as sdcc dosnt make them global by default\n"
180 "\tGLOBAL __mulschar\n"
181 "\tGLOBAL __muluchar\n"
182 "\tGLOBAL __mulsint\n"
183 "\tGLOBAL __muluint\n"
184 "\tGLOBAL __divschar\n"
185 "\tGLOBAL __divuchar\n"
186 "\tGLOBAL __divsint\n"
187 "\tGLOBAL __divuint\n"
188 "\tGLOBAL __modschar\n"
189 "\tGLOBAL __moduchar\n"
190 "\tGLOBAL __modsint\n"
191 "\tGLOBAL __moduint\n"
192 "\tGLOBAL banked_call\n"
193 "\tGLOBAL banked_ret\n"
196 "; ---------------------------------\n"
198 "; ---------------------------------"
200 { "functionlabeldef", "%s:" },
203 { "area", "%s\tGROUP" },
204 { "areacode", "_CODE\tGROUP" },
205 { "areadata", "_DATA\tGROUP" },
206 { "areahome", "_CODE\tGROUP" },
207 { "ascii", "DB \"%s\"" },
214 { "constbyte", "0x%02X" },
215 { "constword", "0x%04X" },
216 { "immedword", "0x%04X" },
217 { "immedbyte", "0x%02X" },
218 { "hashedstr", "%s" },
219 { "lsbimmeds", "%s & 0xFF" },
220 { "msbimmeds", "%s >> 8" },
221 { "bankimmeds", "!%s" },
222 { "module", "; MODULE %s" },
226 static const ASM_MAPPING _isas_gb_mapping[] = {
234 { "adjustsp", "add sp,-%d" },
236 { "enterx", "add sp,-%d"
240 { "leavex", "add sp,%d\n" },
241 { "ldahli", "ld a,(hli)" },
243 { "ldahlsp", "ldhl sp,%d" },
244 { "ldaspsp", "add sp,%d" },
250 static const ASM_MAPPINGS _isas = {
255 const ASM_MAPPINGS _isas_gb = {
260 static const ASM_MAPPINGS _rgbds = {
265 const ASM_MAPPINGS _rgbds_gb = {
270 const ASM_MAPPINGS _asxxxx_gb = {
275 const ASM_MAPPINGS _asxxxx_z80 = {