Why the following code illegal in gas?
# cat -n gas.asm
1
2 .code64
3 pushb $12
4
# as gas.asm
gas.asm: Assembler messages:
gas.asm:3: Error: suffix or operands invalid for `push'
Isn’t it matchs:
| Opcode* | Instruction | Op/En | 64-Bit Mode | Compat/Leg Mode | Description |
| 6A | PUSH imm8 | C | Valid | Valid | Push imm8. |
But, the following code works in NASM.
bits 64
push byte 12
Why gas get that error on X86-64 platform?
Thanks!
See this thread.
Quote:
In short, this is in effect a
pushw.gasmake this fact explicit and force you to usepushw $12.