Skip to content

Commit ba5548f

Browse files
update gas icon output
1 parent cc1ec99 commit ba5548f

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

src/icon.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,53 +144,54 @@ int icon_convert(struct icon *icon)
144144
// fall through
145145
case ICON_FORMAT_GAS:
146146
fprintf(fd, "\t.assume adl=1\n\n");
147-
fprintf(fd, "\t.section .init.icon\n\n");
148-
fprintf(fd, "\tjp\t___prgm_init\n");
147+
fprintf(fd, "\t.section .header.icon\n\n");
148+
fprintf(fd, "\t.local ___icon\n");
149+
fprintf(fd, "___icon_jump:\n");
150+
fprintf(fd, "\tjp\t__start\n");
149151
if (has_icon)
150152
{
151-
fprintf(fd, "\tdb\t$01\n");
153+
fprintf(fd, "\t.db\t0x01\n");
152154
fprintf(fd, "\t.global ___icon\n");
153155
fprintf(fd, "___icon:\n");
154-
fprintf(fd, "\tdb\t$%02X, $%02X", image.width, image.height);
156+
fprintf(fd, "\t.db\t0x%02X, 0x%02X", image.width, image.height);
155157
for (uint32_t y = 0; y < image.height; y++)
156158
{
157159
uint32_t offset = y * image.width;
158160
uint32_t x;
159161

160-
fprintf(fd, "\n\tdb\t");
162+
fprintf(fd, "\n\t.db\t");
161163
for (x = 0; x < image.width; x++)
162164
{
163165
if (x + 1 == image.width)
164166
{
165-
fprintf(fd, "$%02X", data[x + offset]);
167+
fprintf(fd, "0x%02X", data[x + offset]);
166168
}
167169
else
168170
{
169-
fprintf(fd, "$%02X, ", data[x + offset]);
171+
fprintf(fd, "0x%02X, ", data[x + offset]);
170172
}
171173
}
172174
}
173175
}
174176
else
175177
{
176-
fprintf(fd, "\tdb\t$02\n");
178+
fprintf(fd, "\t.db\t$02\n");
177179
}
178180

179181
fprintf(fd, "\n");
180182
if (icon->description != NULL && icon->description[0])
181183
{
182184
fprintf(fd, "\t.global ___description\n");
183185
fprintf(fd, "___description:\n");
184-
fprintf(fd, "\tdb\t\"%s\", 0\n", icon->description);
186+
fprintf(fd, "\t.db\t\"%s\", 0\n", icon->description);
185187
}
186188
else
187189
{
188190
fprintf(fd, "\t.global ___description\n");
189191
fprintf(fd, "___description:\n");
190-
fprintf(fd, "\tdb\t0\n");
192+
fprintf(fd, "\t.db\t0\n");
191193
}
192-
fprintf(fd, "\t.global ___prgm_init\n");
193-
fprintf(fd, "___prgm_init:\n");
194+
fprintf(fd, "\t.extern __start\n");
194195
break;
195196

196197
case ICON_FORMAT_FASMG:

0 commit comments

Comments
 (0)