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[] = {
42 { "ldahli", "ld a,(hl+)" },
43 { "ldahlsp", "lda hl,%d(sp)" },
44 { "ldaspsp", "lda sp,%d(sp)" },
47 { "enter", "push bc" },
66 { "adjustsp", "lda sp,-%d(sp)" },
70 static const ASM_MAPPING _rgbds_mapping[] = {
71 { "global", "GLOBAL %s" },
72 { "slabeldef", "%s:" },
73 { "labeldef", "%s:" },
74 { "tlabeldef", ".l%05d:" },
75 { "tlabel", ".l%05d" },
77 "; Generated using the rgbds tokens.\n"
78 "\t; We have to define these here as sdcc dosnt make them global by default\n"
79 "\tGLOBAL __mulschar\n"
80 "\tGLOBAL __muluchar\n"
81 "\tGLOBAL __mulsint\n"
82 "\tGLOBAL __muluint\n"
83 "\tGLOBAL __divschar\n"
84 "\tGLOBAL __divuchar\n"
85 "\tGLOBAL __divsint\n"
86 "\tGLOBAL __divuint\n"
87 "\tGLOBAL __modschar\n"
88 "\tGLOBAL __moduchar\n"
89 "\tGLOBAL __modsint\n"
93 "; ---------------------------------\n"
95 "; ---------------------------------"
97 { "functionlabeldef", "%s:" },
100 { "area", "SECTION \"%s\",%C" },
101 { "areacode", "SECTION \"CODE\",%C" },
102 { "areadata", "SECTION \"DATA\",BSS" },
103 { "ascii", "DB \"%s\"" },
110 { "constbyte", "$%02X" },
111 { "constword", "$%04X" },
112 { "immedword", "$%04X" },
113 { "immedbyte", "$%02X" },
114 { "hashedstr", "%s" },
115 { "lsbimmeds", "%s & $FF" },
116 { "msbimmeds", "%s >> 8" },
117 { "module", "; MODULE %s" },
121 static const ASM_MAPPING _rgbds_gb_mapping[] = {
129 { "adjustsp", "add sp,-%d" },
130 { "enter", "push bc" },
144 { "ldahli", "ld a,[hl+]" },
146 { "ldahlsp", "ld hl,[sp+%d]" },
147 { "ldaspsp", "add sp,%d" },
153 static const ASM_MAPPING _isas_mapping[] = {
154 { "global", "GLOBAL %s" },
155 { "slabeldef", "%s:" },
156 { "labeldef", "%s:" },
157 { "tlabeldef", "?l%05d:" },
158 { "tlabel", "?l%05d" },
160 ";Generated using the isas tokens.\n"
161 "\tLPREFIX '?' ; Treat labels starting with ? as local.\n"
162 "\tONCNUM ; Numbers are hex\n"
163 "\tCAPSOFF ; Case sensitive\n"
164 "\tISDMG ; Gameboy mode\n"
166 "\t; We have to define these here as sdcc dosnt make them global by default\n"
167 "\tGLOBAL __mulschar\n"
168 "\tGLOBAL __muluchar\n"
169 "\tGLOBAL __mulsint\n"
170 "\tGLOBAL __muluint\n"
171 "\tGLOBAL __divschar\n"
172 "\tGLOBAL __divuchar\n"
173 "\tGLOBAL __divsint\n"
174 "\tGLOBAL __divuint\n"
175 "\tGLOBAL __modschar\n"
176 "\tGLOBAL __moduchar\n"
177 "\tGLOBAL __modsint\n"
181 "; ---------------------------------\n"
183 "; ---------------------------------"
185 { "functionlabeldef", "%s:" },
188 { "area", "%s\tGROUP" },
189 { "areacode", "_CODE\tGROUP" },
190 { "areadata", "_DATA\tGROUP" },
191 { "ascii", "DB \"%s\"" },
198 { "constbyte", "0x%02X" },
199 { "constword", "0x%04X" },
200 { "immedword", "0x%04X" },
201 { "immedbyte", "0x%02X" },
202 { "hashedstr", "%s" },
203 { "lsbimmeds", "%s & 0xFF" },
204 { "msbimmeds", "%s >> 8" },
205 { "module", "; MODULE %s" },
209 static const ASM_MAPPING _isas_gb_mapping[] = {
217 { "adjustsp", "add sp,-%d" },
218 { "enter", "push bc" },
232 { "ldahli", "ld a,(hli)" },
234 { "ldahlsp", "ldhl sp,%d" },
235 { "ldaspsp", "add sp,%d" },
241 static const ASM_MAPPINGS _isas = {
246 const ASM_MAPPINGS _isas_gb = {
251 static const ASM_MAPPINGS _rgbds = {
256 const ASM_MAPPINGS _rgbds_gb = {
261 const ASM_MAPPINGS _asxxxx_gb = {
266 const ASM_MAPPINGS _asxxxx_z80 = {