I am trying to assemble some 64-bit code and the assembling fails on the line:
addq $0xffffff7fc0005000, %rax
with the error:
Error operand type mismatch for `add'
The first operand is a 64-bit value and the latter a register which should assemble fine. This instruction is preceded by a .code64
pseudo-op. I am assembling with
x86_64-elf-as test.s -o test.o --64
As for the assembler itself, when called with --version
it returns:
GNU assembler (GNU Binutils) 2.32
Copyright (C) 2019 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-elf'.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…