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[] = {
40 { "ldahli", "ld a,(hl+)" },
41 { "ldahlsp", "lda hl,%d(sp)" },
42 { "ldaspsp", "lda sp,%d(sp)" },
45 { "enter", "push bc" },
64 { "adjustsp", "lda sp,-%d(sp)" },
68 static const ASM_MAPPING _rgbds_mapping[] = {
69 { "global", "GLOBAL %s" },
70 { "slabeldef", "%s:" },
71 { "labeldef", "%s:" },
72 { "tlabeldef", ".l%05d:" },
73 { "tlabel", ".l%05d" },
75 "; Generated using the rgbds tokens.\n"
76 "\t; We have to define these here as sdcc dosnt make them global by default\n"
77 "\tGLOBAL __mulschar\n"
78 "\tGLOBAL __muluchar\n"
79 "\tGLOBAL __mulsint\n"
80 "\tGLOBAL __muluint\n"
81 "\tGLOBAL __divschar\n"
82 "\tGLOBAL __divuchar\n"
83 "\tGLOBAL __divsint\n"
84 "\tGLOBAL __divuint\n"
85 "\tGLOBAL __modschar\n"
86 "\tGLOBAL __moduchar\n"
87 "\tGLOBAL __modsint\n"
91 "; ---------------------------------\n"
93 "; ---------------------------------"
95 { "functionlabeldef", "%s:" },
98 { "area", "SECTION \"%s\",%C" },
99 { "areacode", "SECTION \"CODE\",%C" },
100 { "areadata", "SECTION \"DATA\",BSS" },
101 { "ascii", "DB \"%s\"" },
108 { "constbyte", "$%02X" },
109 { "constword", "$%04X" },
110 { "immedword", "$%04X" },
111 { "immedbyte", "$%02X" },
112 { "hashedstr", "%s" },
113 { "lsbimmeds", "%s & $FF" },
114 { "msbimmeds", "%s >> 8" },
115 { "module", "; MODULE %s" },
119 static const ASM_MAPPING _rgbds_gb_mapping[] = {
127 { "adjustsp", "add sp,-%d" },
128 { "enter", "push bc" },
142 { "ldahli", "ld a,[hl+]" },
144 { "ldahlsp", "ld hl,[sp+%d]" },
145 { "ldaspsp", "add sp,%d" },
151 static const ASM_MAPPING _isas_mapping[] = {
152 { "global", "GLOBAL %s" },
153 { "slabeldef", "%s:" },
154 { "labeldef", "%s:" },
155 { "tlabeldef", "?l%05d:" },
156 { "tlabel", "?l%05d" },
158 ";Generated using the isas tokens.\n"
159 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
160 "\tONCNUM ; Numbers are hex\n"
161 "\tCAPSOFF ; Case sensitive\n"
162 "\tISDMG ; Gameboy mode\n"
164 "\t; We have to define these here as sdcc dosnt make them global by default\n"
165 "\tGLOBAL __mulschar\n"
166 "\tGLOBAL __muluchar\n"
167 "\tGLOBAL __mulsint\n"
168 "\tGLOBAL __muluint\n"
169 "\tGLOBAL __divschar\n"
170 "\tGLOBAL __divuchar\n"
171 "\tGLOBAL __divsint\n"
172 "\tGLOBAL __divuint\n"
173 "\tGLOBAL __modschar\n"
174 "\tGLOBAL __moduchar\n"
175 "\tGLOBAL __modsint\n"
179 "; ---------------------------------\n"
181 "; ---------------------------------"
183 { "functionlabeldef", "%s:" },
186 { "area", "%s\tGROUP" },
187 { "areacode", "_CODE\tGROUP" },
188 { "areadata", "_DATA\tGROUP" },
189 { "ascii", "DB \"%s\"" },
196 { "constbyte", "0x%02X" },
197 { "constword", "0x%04X" },
198 { "immedword", "0x%04X" },
199 { "immedbyte", "0x%02X" },
200 { "hashedstr", "%s" },
201 { "lsbimmeds", "%s & 0xFF" },
202 { "msbimmeds", "%s >> 8" },
203 { "module", "; MODULE %s" },
207 static const ASM_MAPPING _isas_gb_mapping[] = {
215 { "adjustsp", "add sp,-%d" },
216 { "enter", "push bc" },
230 { "ldahli", "ld a,(hli)" },
232 { "ldahlsp", "ldhl sp,%d" },
233 { "ldaspsp", "add sp,%d" },
239 static const ASM_MAPPINGS _isas = {
244 const ASM_MAPPINGS _isas_gb = {
249 static const ASM_MAPPINGS _rgbds = {
254 const ASM_MAPPINGS _rgbds_gb = {
259 const ASM_MAPPINGS _asxxxx_gb = {
264 const ASM_MAPPINGS _asxxxx_z80 = {