File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 " ;
You can’t perform that action at this time.
0 commit comments