Skip to content

Commit 33a52e9

Browse files
committed
oops
1 parent a368c0e commit 33a52e9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

source/backends/uxn.d

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,17 @@ class BackendUXN : CompilerBackend {
278278
}
279279

280280
switch (size) {
281-
case 1: output ~= "LDA #00 SWP\n"; break;
281+
case 1: output ~= "LDA\n"; break;
282282
case 2: output ~= "LDA2\n"; break;
283283
default: Error(node.error, "Bad variable type size");
284284
}
285+
286+
if ((size == 1) && var.type.isSigned) {
287+
output ~= "LIT2r 00ff DUP #80 AND ?{ SWPr } STHr POPr SWP\n";
288+
}
289+
else if (size == 1) {
290+
output ~= "#00 SWP\n";
291+
}
285292
}
286293

287294
void PushGlobalValue(
@@ -309,7 +316,7 @@ class BackendUXN : CompilerBackend {
309316
}
310317

311318
if ((size == 1) && var.type.isSigned) {
312-
output ~= "LITr 00 LITr ff DUP #80 AND ?{ SWPr } STHr POPr SWP\n";
319+
output ~= "LIT2r 00ff DUP #80 AND ?{ SWPr } STHr POPr SWP\n";
313320
}
314321
else if (size == 1) {
315322
output ~= "#00 SWP\n";

0 commit comments

Comments
 (0)