Page 1 of 1

NASM Bug and rax, 0x1000000000

Posted: Wed Jun 19, 2013 2:37 am
by tsdnz
Hi, this is my macro.

%macro ExtractBits 3; %1 = Register, %2 = Starting Bit, %3 = Ending Bits
%if %2 > 0
shr %1, %2
%endif
and %1, ((1 << (%3 - %2)) - 1)
%endmacro

but the nasm compiler displays this warning:
warning: signed dword immediate exceeds bounds

Does anyone know how to fix this?

Re: NASM Bug and rax, 0x1000000000

Posted: Wed Jun 19, 2013 3:00 am
by bluemoon
I support you meant you get warning with and rax, 0x1000000000
This has nothing to do with macro, x86_64 cpu do not support imm64 for such instruction.
You may do a move to reg then and reg64,reg64 them.
Read the manual for detail.

Re: NASM Bug and rax, 0x1000000000

Posted: Wed Jun 19, 2013 3:43 pm
by tsdnz
Cheers mate, moved to r15 and used this to do the and.
I just assumed it was 64 bit.