Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #1468
2015-01-15 11:13:06 UTC
with no size prefix, the assembler assumes a pointer type and will convert the right operator, in this case:
byte[eax] = val1;
I will however look at changing this to check against the right operand.
EDIT: I have updated the assembler and this is solved for next release.
0CodErr
member
Posts
201
Threads
37
Location
Unknown
Post #1721
2015-02-17 14:05:43 UTC
I think it a bit relevant to this topic:
procedure Test(qword X) {} Test(0);
Result:
00000000 6A00 push byte +0x0
00000002 E800000000 call dword 0x7
00000007 55 push ebp
00000008 8BEC mov ebp,esp
0000000A 8BE5 mov esp,ebp
0000000C 5D pop ebp
0000000D C20800 ret 0x8
Also in 16 bit mode we get wrong opcodes:
00000000 6A00 push byte +0x0
00000002 E80000558B call dword 0x8b550007
00000007 EC in al,dx
00000008 8BE5 mov esp,ebp
0000000A 5D pop ebp
0000000B C20800 ret 0x8
0CodErr
member
Posts
201
Threads
37
Location
Unknown
Post #1722
2015-02-18 10:47:06 UTC
Also in 16 bit mode we get wrong opcodes: Actually result was:
00000000 6A00 push byte +0x0
00000002 E80000 call word 0x5
00000005 55 push bp
00000006 8BEC mov bp,sp
00000008 8BE5 mov sp,bp
0000000A 5D pop bp
0000000B C20800 ret 0x8
In post above result was just because i disassembled it in 32 bit mode.
But anyway :)
0CodErr
member
Posts
201
Threads
37
Location
Unknown
Post #1724
2015-02-18 11:38:54 UTC
Also strange warnings:
program RAW_IMAGE 'test';
#set bits 32;
qword a, b;
a = b;
[7,6]: Warning: [666] b passed as value to stack, consider passing by ref in [te
st.zir]
[7,6]: Warning: [666] a passed as value to stack, consider passing by ref in [te
st.zir]
0CodErr
member
Posts
201
Threads
37
Location
Unknown
Post #1725
2015-02-18 12:11:27 UTC
Also there is value was truncated to 32-bit without any warnings:
program RAW_IMAGE 'test';
#set bits 32;
procedure Test(qword X) {}
Test(0x123456789ABCDEF0);
Result:
00000000 68F0DEBC9A push dword 0x9abcdef0
00000005 E800000000 call dword 0xa
0000000A 55 push ebp
0000000B 8BEC mov ebp,esp
0000000D 8BE5 mov esp,ebp
0000000F 5D pop ebp
00000010 C20800 ret 0x8
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #1866
2016-12-13 00:33:11 UTC
Also strange warnings: This is warning you that 2 dwords are being pushed to the stack. (because: 32-bit mode)
Also there is value was truncated to 32-bit without any warnings Fixed for next release.