Lazarus FPC refusing a 64-bit value for AND op in ASM

时间:2015-10-06 08:13:50

标签: assembly x86-64 freepascal lazarus

The following won't compile:

and rax, $7FFFFFFFFFFFFFFF

I've tried making the value a constant, even cast as a qword, but the compiler throws "dword value exceeds bounds."

Of course, this is a qword, not a dword. How do I get the compiler to realize this?

As a note, the 64-bit code is otherwise compiling and running correctly.

I have the latest Lazarus release.

1 个答案:

答案 0 :(得分:5)

There's no variant of AND in the x86 instruction set that takes an imm64 operand. You can use mov r64, imm64 followed by and r/m64, r64.