flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
LocoDelAssembly
Code: dd 4294967295 fasm doesn't support signed/unsigned constraints for data defines so this will also provide the same result as above: Code: dd -1 |
|||
![]() |
|
nazha
it's strange, pls see following code I used:
myint dd 4294967295 invoke sprintf,szTemp,"%d", [myint] invoke MessageBox,HWND_DESKTOP,szTemp,"ok",MB_OK it return "-1", and if compare with 0, it return less than 0 cmp [myint], 0 is this normal? Tks. |
|||
![]() |
|
LocoDelAssembly
Try with this: invoke sprintf,szTemp,"%u", [myint]
Take in mind that memory contents does not understand the sign concept nor the processor actually (except for floats), it thinks it is signed and unsigned at the same time and then you pick your desired interpretation based on the EFLAGS or whatever. |
|||
![]() |
|
nazha
if using %u the return is correct, thanks.
but how to do comparison? it treat 4294967295 as -1 if compare it with other integer. |
|||
![]() |
|
revolution
You choose signed/unsigned results by selecting the jump to use after cmp:
ja - unsigned jg - signed jb - unsigned jl - signed |
|||
![]() |
|
nazha
Thanks
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.