Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Requests and Feedback

Assignment operands with different operand size

A community discussion post from the original code:zIRON forum.

0CodErr member
Posts
201
Threads
37
Location
Unknown

Assignment operands with different operand size

This currently unsupported, but it would be useful :)

dword d1;
word w1;
byte b1;

int32 sd1;
int16 sw1;
int8 sb1;

d1 = w1;
d1 = b1;
d1 = sw1;
d1 = sb1;

w1 = d1;
w1 = b1;
w1 = sd1;
w1 = sb1;

b1 = d1;
b1 = w1;
b1 = sd1;
b1 = sw1;

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

I have partially implemented this, however, for w1 = d1; ? what would you like to happen here? to truncate the value with a warning?

0CodErr member
Posts
201
Threads
37
Location
Unknown

Yes, i think that need to

truncate the value with a warning
Colin admin
Posts
928
Threads
49
Location
Bulgaria

OK, will add that for next release.

Colin admin
Posts
928
Threads
49
Location
Bulgaria

Added for next release truncation.