Is there a difference between equals sign assignment “x = 1” and “.equ x, 1” or “.set x, 1” in GNU Gas assembly?

后端 未结 1 1748
别跟我提以往
别跟我提以往 2021-01-20 23:14

E.g.:

a = 1

and:

.equ a, 1

and:

.set a, 1

all produce the same output byte-

相关标签:
1条回答
  • 2021-01-20 23:54

    It is the same.

    After grepping the documentation source, I've found the section that confirms it https://sourceware.org/binutils/docs-2.25/as/Setting-Symbols.html

    A symbol can be given an arbitrary value by writing a symbol, followed by an equals sign `=', followed by an expression (see Expressions). This is equivalent to using the .set directive.

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