You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var array : [u8; 32];
// ...
bc = 10;
hl = &array[bc] as u16;
it results in a fairly nonsensical-looking compilation error.
This should however, map into a simple load + add expression. It should be equivalent to:
hl = &array as u16 + bc;
or in Z80:
ld hl, array
add hl, bc
Figure out why address-of operator isn't able to rewrite the index expression into address arithmetic in this case. Do the same fix for unaligned indexing.
Note that something like this seems to work fine, because compile/link-time expressions get handled differently, and it is able to fold the expression together at compile-time:
hl = &array[10];
The text was updated successfully, but these errors were encountered:
Currently if you write an expression like:
it results in a fairly nonsensical-looking compilation error.
This should however, map into a simple load + add expression. It should be equivalent to:
or in Z80:
Figure out why address-of operator isn't able to rewrite the index expression into address arithmetic in this case. Do the same fix for unaligned indexing.
Note that something like this seems to work fine, because compile/link-time expressions get handled differently, and it is able to fold the expression together at compile-time:
The text was updated successfully, but these errors were encountered: