Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #1498
2015-01-21 19:56:17 UTC
Added a couple more warning notifications, but many immediate inputs are auto truncated and are expected to be handled by the user.
0CodErr
member
Posts
201
Threads
37
Location
Unknown
Post #1546
2015-01-30 00:58:01 UTC
Below compiles without errors
program RAW_IMAGE 'test';
#set bits 32;
byte b1;
word w1;
eax |= b1; eax |= w1;
eax &= b1; eax &= w1;
eax ^= b1; eax ^= w1;
and result is
00000000 0B052A000000 or eax,[dword 0x2a]
00000006 0B052B000000 or eax,[dword 0x2b]
0000000C 23052A000000 and eax,[dword 0x2a]
00000012 23052B000000 and eax,[dword 0x2b]
00000018 33052A000000 xor eax,[dword 0x2a]
0000001E 33052B000000 xor eax,[dword 0x2b]
But error occures when
program RAW_IMAGE 'test';
#set bits 32;
byte b1;
word w1;
eax = b1; eax = w1;
Operand size mismatch! This without errors
eax = al; eax = ax;
And in result movzx used.
I think in first case should say 'Operand size mismatch!'.
And in second case we can do like in third case with movzx.
0CodErr
member
Posts
201
Threads
37
Location
Unknown
Post #1549
2015-01-30 11:53:49 UTC
This works correctly:
program RAW_IMAGE 'test';
#set bits 32;
eax = @[eax];
Result:
00000000 8D00 lea eax,[eax]
But this not:
program RAW_IMAGE 'test';
#set bits 32;
eax = @[ax];
eax = @[ah];
eax = @[al];
Result:
00000002 8D00 lea eax,[eax]
00000004 8D0424 lea eax,[esp]
00000007 8D00 lea eax,[eax]
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #1560
2015-01-30 23:30:54 UTC
All of these problems have been corrected for next release.
0CodErr
member
Posts
201
Threads
37
Location
Unknown
Post #1730
2015-02-18 16:39:37 UTC
Actually i am not sure is it need to show error or not, but warning need i think, because someone can use '== ' instead of '= '.
program RAW_IMAGE 'test';
#set bits 32;
byte[eax] == ord('X');
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #1742
2015-02-19 22:32:43 UTC
This is valid since it is a type of high level cmp which doesn't need a direct jmp operation.
byte[eax] == ord('X');
eax = 5;
if (zero_flag == true) {
// ... etc
0CodErr
member
Posts
201
Threads
37
Location
Unknown
Post #1759
2015-02-22 19:45:07 UTC
This is valid since it is a type of high level cmp which doesn't need a direct jmp operation. Yes, because of 'high level '. With enabled optimizations it is unknown how were made comparisons. It can be 'cmp ' or 'test '. And it has different effects on flags. We cannot be sure which instruction was used without disassembling.
Therefore my point -- need to show at least warning.