Trying to port
nasm assembly I encountered some discrepancy in the two syntax modes. Here’s a short reproducer.
# This works. .att_syntax prefix .set reg, %rax xor reg, reg # xor %rax, %rax # This doesn't, although it works with GNU as. .intel_syntax noprefix .set reg, rax xor reg, reg # reg.s:11:2: error: invalid operand for instruction # xor reg, reg # ^
I’m aware that the reproducer is kinda misusing symbols, but it comes in handy for macros. In my case it is crucial for porting the
So my question, is the above behavior intentional or a flaw? Any ideas how to work around it?