include \masm32\include\masm32rt.inc ; plain Masm32
@signed$ MACRO arg ; returns signed immediate as string (borrowed from MasmBasic)
if arg lt 0
EXITM @CatStr(<->, %(-arg))
else
EXITM %arg
endif
endm
negnum=80000000h
echo using 80000000h:
if negnum lt 0
echo number is negative
else
echo number is positive
endif
tmp$ CATSTR < TheNumber=>, %negnum
% echo tmp$
tmp$ CATSTR < TheNumber=>, @signed$(negnum)
% echo tmp$
echo
negnum=-2147483648
echo using -2147483648:
if negnum lt 0
echo number is negative
else
echo number is positive
endif
tmp$ CATSTR < TheNumber=>, %negnum
% echo tmp$
tmp$ CATSTR < TheNumber=>, @signed$(negnum)
% echo tmp$
.code
start:
exit
.err <--- ok -->
end start
Output:
using 80000000h:
number is positive
TheNumber=2147483648
TheNumber=2147483648
using -2147483648:
number is negative
TheNumber=2147483648
TheNumber=-2147483648
IMHO 80000000h and -2147483648 should be, ehm, roughly the same ::)