signed | unsigned comparison
When comparing signed numbers unsigned comparison occures. Below assume that in eax int32 number.
program RAW_IMAGE 'test';
#set bits 32;
if ([int32]eax < 0) {}
if ([int32]eax <= 0) {}
if ([int32]eax => 0) {}
if ([int32]eax > 0) {}
while ([int32]eax < 0){}
while ([int32]eax <= 0){}
while ([int32]eax => 0){}
while ([int32]eax > 0){}
repeat {} until ([int32]eax < 0)
repeat {} until ([int32]eax <= 0)
repeat {} until ([int32]eax => 0)
repeat {} until ([int32]eax > 0)
repeat {break if ([int32]eax < 0);};
repeat {break if ([int32]eax <= 0);};
repeat {break if ([int32]eax => 0);};
repeat {break if ([int32]eax > 0);};
Result:
00000000 85C0 test eax,eax
00000002 7300 jnc 0x4
00000004 85C0 test eax,eax
00000006 7700 ja 0x8
00000008 85C0 test eax,eax
0000000A 7200 jc 0xc
0000000C 85C0 test eax,eax
0000000E 7600 jna 0x10
00000010 85C0 test eax,eax
00000012 7302 jnc 0x16
00000014 EBFA jmp short 0x10
00000016 85C0 test eax,eax
00000018 7702 ja 0x1c
0000001A EBFA jmp short 0x16
0000001C 85C0 test eax,eax
0000001E 7202 jc 0x22
00000020 EBFA jmp short 0x1c
00000022 85C0 test eax,eax
00000024 7602 jna 0x28
00000026 EBFA jmp short 0x22
00000028 85C0 test eax,eax
0000002A 73FC jnc 0x28
0000002C 85C0 test eax,eax
0000002E 77FC ja 0x2c
00000030 85C0 test eax,eax
00000032 72FC jc 0x30
00000034 85C0 test eax,eax
00000036 76FC jna 0x34
00000038 85C0 test eax,eax
0000003A 7202 jc 0x3e
0000003C EBFA jmp short 0x38
0000003E 85C0 test eax,eax
00000040 7602 jna 0x44
00000042 EBFA jmp short 0x3e
00000044 85C0 test eax,eax
00000046 7302 jnc 0x4a
00000048 EBFA jmp short 0x44
0000004A 85C0 test eax,eax
0000004C 7702 ja 0x50
0000004E EBFA jmp short 0x4a
Also noticed that after unconditional repeat{} need semicolon(otherwise error). Is it should be? I mean is there right behavior or not? Because after conditional repeat{} semicolon does not need.