I'm attempting to create a 64-Bit version of my OS, and due to a problem in my toolchain (I need to find a 64-bit version of gas) I decided to make it in assembler.
Most of it is simple to understand but there is something I don't get, why does this work
Code: Select all
mov QWORD [QWORD _MM_PhysBitmap], rax
but this not
Code: Select all
mov qword [QWORD _MM_PhysSuperBitmap], r8
(this is from my memory manager, _MM_PhysBitmap and _MM_PhysSuperBitmap are both address symbols defined in the same file, but in .data)
The second code segment fails to compile in YASM with the error
Code: Select all
error: invalid combination of opcode and operands
and in nasm it seems to compile as a 32-bit address and LD quits saying
Code: Select all
relocation truncated to fit: R_X86_64_32 against `.data'
Does anyone know why this happens?