Meaning of dollar sign in gnu assembly labels

后端 未结 1 1642
日久生厌
日久生厌 2021-02-08 08:00

What is the meaning of a dollar sign in front of a gnu assembly label?

For example, what is the difference between mov msg, %si and mov $msg, %si

相关标签:
1条回答
  • 2021-02-08 08:25

    You use $(dollar) sign when addressing a constant, e.g.: movl $1, %eax (put 1 to %eax register) or when handling an address of some variable, e.g.: movl $var, %eax (this means take an address of var label and put it into %eax register). If you don't use dollar sign that would mean "take the value from var label and put it to register".

    0 讨论(0)
提交回复
热议问题