Search code examples
assemblyx86x86-64att

Does referencing constants without a dollar sign have a distinct meaning?


I wrote:

mov 60, %rax

GNU as accepted it, although I should have written

mov $60, %rax

Is there any difference between two such calls?


Solution

  • Yes; the first loads the value stored in memory at address 60 and stores the result in rax, the second stores the immediate value 60 into rax.