This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: macro's and local variables


On 10/16/2012 08:20 PM, Ian Lance Taylor wrote:
On Tue, Oct 16, 2012 at 11:12 AM, Mischa Baars <mjbaars1977@gmail.com> wrote:
Also one uses i and the other uses j, and that matters because
you are invoking them in a loop that also uses i.
This is exactly what I'm pointing at. Apart from the register naming, I was
expecting the same values to be assigned to the respective registers. This
does not happen, because 'i' is not a local but a global value.
Yes. That is how assembler macros work.
So macro B is the only correct macro, as I understand.

Assembler macros are not a high level programming language. They are macros: bodies of text that are expanded with argument values substituted in textually. You may want to read about how \@ is expanded in a macro body.
I found the link: http://sourceware.org/binutils/docs-2.22/as/Macro.html#Macro

However, I do not understand. Do you have an example?

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]