I was wondering why some assembly instructions can be inferred, but others cannot. For example, in the following program I have:
.globl main
main:
push %rbp
mov %rsp, %rbp
mov $8, -8(%rbp)
mov -8(%rbp), %rax
pop %rbp
ret
I get the following error:
stack.s:5: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
However, if I change: the 5th line to:
movq $8, -8(%rbp)
It runs without error. How can all the other operations infer the size, but that particular instruction cannot?