3

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.

IamIC
  • 16,917
  • 18
  • 83
  • 148

1 Answers1

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.

Michael
  • 55,116
  • 9
  • 74
  • 120
  • Wow, I wasn't expecting that. Thank you. – IamIC Oct 06 '15 at 08:31
  • 1
    @IanC: Making immediate operands 64bit in long mode would have bloated code a lot. Introducing a lot of new opcodes with imm64 operands would have used up a lot of opcode space and added complexity to the decoders. – Peter Cordes Oct 07 '15 at 13:49