1

In gas, I can do movabs rcx, 0x402041, which assembles to 48b941204000. NASM doesn't support movabs. I've tried doing mov rcx, 0x402041, and mov rcx, QWORD 0x402041, but, in either case, NASM assembles it to b941204000 which disassembles to mov ecx, 0x402041.

Even though the result is the same, for my application, I need the assembler to do the full movabs equivalent, with identical bytes. How can I tell NASM to do this?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
SRobertJames
  • 8,210
  • 14
  • 60
  • 107
  • 6
    `mov rcx, strict qword 0x402041` – Jester Jan 04 '22 at 23:11
  • Or `strict dword 0x402041` to keep 64-bit operand-size, but use a normal-sized sign-extended immediate which is actually 7 bytes. The question omitted the high 4 bytes of the immediate for `movabs`, so I'm wondering if a huge long instruction is actually desired. – Peter Cordes Jan 05 '22 at 11:33

0 Answers0