flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
LocoDelAssembly 24 Aug 2009, 03:18
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 24 Aug 2009, 03:38
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 24 Aug 2009, 03:41
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 24 Aug 2009, 03:48
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 24 Aug 2009, 03:52
You choose signed/unsigned results by selecting the jump to use after cmp:
ja - unsigned jg - signed jb - unsigned jl - signed |
|||
![]() |
|
nazha 24 Aug 2009, 03:55
Thanks
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.