1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2026-04-20 16:16:34 +00:00

Add CFFB to portable VM with test case

This commit is contained in:
dschmenk
2017-07-27 19:15:57 -07:00
parent 0ffaef968d
commit c4912583de
3 changed files with 8 additions and 5 deletions
+4 -4
View File
@@ -540,12 +540,12 @@ void emit_codetag(int tag)
}
void emit_const(int cval)
{
if (cval == 0)
if (cval == 0x0000)
printf("\t%s\t$00\t\t\t; ZERO\n", DB);
else if (cval > 0 && cval < 256)
else if ((cval & 0xFF00) == 0x0000)
printf("\t%s\t$2A,$%02X\t\t\t; CB\t%d\n", DB, cval, cval);
else if ((cval&0xFF00) >= 0xFF00)
printf("\t%s\t$5E,$%02X\t\t\t; CFFB\t%d\n", DB, cval&0xFF, cval&0xFF);
else if ((cval & 0xFF00) == 0xFF00)
printf("\t%s\t$5E,$%02X\t\t\t; CFFB\t%d\n", DB, cval&0xFF, cval);
else
printf("\t%s\t$2C,$%02X,$%02X\t\t; CW\t%d\n", DB, cval&0xFF,(cval>>8)&0xFF, cval);
}