1

Using the GNU Assembler Manual, v2.19.51, I was not able to find a definitive difference between these types of equates:

  • .equ
  • .reg
  • .set

Does anyone know the difference and proper usage?

artless noise
  • 21,212
  • 6
  • 68
  • 105
bluestar
  • 21
  • 3

1 Answers1

2

.equ and .set are documented to be the same. I was not able to find any mention of .reg, where did you see that? There is however a .req which defines register aliases, as opposed to the other two which define symbols.

Jester
  • 56,577
  • 4
  • 81
  • 125
  • Interestingly, I just came across this link that gave a definitive definition of the equates. http://bel.gsi.de/scripts/gnu-arm-assy-quick-ref.pdf They indicates that .equ is a directive that sets the value of a symbol while, .set sets the value of a variable and .req (my mistaken typo of .reg in original note) defines the name of a register. – bluestar Jun 02 '13 at 21:07
  • The definite is the [GAS manual](http://sourceware.org/binutils/docs-2.23.1/as/index.html). And [that says `.equ` and `.set` are the same](http://sourceware.org/binutils/docs-2.23.1/as/Equ.html) and `.reg` is for registers, as I have written in the answer. There is no such thing as a variable anyway. – Jester Jun 02 '13 at 22:22