Hi,
how can I use hex and decimal number together in my sourcecode ?
:stupid:
Thank you,
Nordwind
how can I use hex and decimal number together in my sourcecode ?
:stupid:
Thank you,
Nordwind
mov eax, 10
or
mov eax, 10d
is for decimal.
mov eax, 10h
for hex.
But you can also set a compiler option to make all numbers hex/decimal/binary.
Hi bAZik,
mov eax,10h
won't work.
How can I to set the compiler option...?
Greetings, Nordwind
mov eax,10h
won't work.
How can I to set the compiler option...?
Greetings, Nordwind
mov eax, 10h
should work, however
mov eax, d1h
would cause a problem (Masm would think this was a label instead of a number) so you have to do:
mov eax, 0d1h
Are you sure mov eax, 10h isn't working?
And am I very much mistaken or did Hiro edit your sig?
should work, however
mov eax, d1h
would cause a problem (Masm would think this was a label instead of a number) so you have to do:
mov eax, 0d1h
Are you sure mov eax, 10h isn't working?
And am I very much mistaken or did Hiro edit your sig?
Hi,
0h - 3fffh ist working ok, a000h - ffffffffh not...
How can I use hex number from a000h to ffffffffh in MASM32 ???
Greeting,
Nordwind64
0h - 3fffh ist working ok, a000h - ffffffffh not...
How can I use hex number from a000h to ffffffffh in MASM32 ???
Greeting,
Nordwind64
lead number with a zero:
0FFFFFFFFh
Or, use twos-complement of number:
-1h
If you don't want to use the letters on the end of numbers, search the MASM manual for RADIX. All numbers need to begin with a number [0,9]. Otherwise MASM doesn't know if it is a label or number.
0FFFFFFFFh
Or, use twos-complement of number:
-1h
If you don't want to use the letters on the end of numbers, search the MASM manual for RADIX. All numbers need to begin with a number [0,9]. Otherwise MASM doesn't know if it is a label or number.
You can also set the "RADIX" option in masm,
But this doesnt solve your problem, rather its like using ASSUME on registers, you tell the compiler to "assume" all following numbers are base 10, or 16 etc.
.radix 16
bob dd 12345678 ; Considered HEX
.radix 10
bob2 dd 12345678 ; considered decmal
NaN
But this doesnt solve your problem, rather its like using ASSUME on registers, you tell the compiler to "assume" all following numbers are base 10, or 16 etc.
.radix 16
bob dd 12345678 ; Considered HEX
.radix 10
bob2 dd 12345678 ; considered decmal
NaN
Hi,
0a000h works fine...
Thank you !!!
Greetings, Nordwind64
0a000h works fine...
Thank you !!!
Greetings, Nordwind64