Support negation, parentheses. Always zero-extend registers for bugless memory operand usage

This commit is contained in:
mid
2024-06-12 11:17:09 +03:00
parent fa40a78546
commit 012320569e
7 changed files with 137 additions and 49 deletions

View File

@@ -1,2 +1,6 @@
u32 x: 123;
u33 y: 5;
u33 y: 5;
u3 *o = 5000;
u3 z = *o;
u3 p = *(o + z);

View File

@@ -2,10 +2,11 @@ u16 x: 5;
loop {
u16* y = 257;
u9 w = -4;
u4 z = 3 + *y;
u16 p = *y;
u4 z = p + 3;
u2 o = -w;
if(x != 0) {
break;
}
}
}

View File

@@ -4,4 +4,6 @@ loop {
a = 3;
u8 b = 1;
u8 c = 2;
}

View File

@@ -1,5 +1,5 @@
u8 a = 5;
if(a) {
if(a != 0) {
u8 a = 10; /* Should not cause scoping errors. */
}
u8 b = 15; /* `a` in the if statement scope should be free'd. */
u8 b = 15; /* `a` in the if statement scope should be free'd. */