4

E.g.:

a = 1

and:

.equ a, 1

and:

.set a, 1

all produce the same output byte-by-byte upon:

as --32 main.S

according to cmp.

I know that .equ and .set do the same thing according to the documentation of .equ: https://sourceware.org/binutils/docs-2.25/as/Equ.html :

It is synonymous with `.set'.

and I know what .equ does from Difference between .equ and .word in ARM Assembly?

So what about =? Is it the same as the other two?

Community
  • 1
  • 1
Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985

1 Answers1

4

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.

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985