Hi Olaf,
I missed the possibility to reference
a) the individual invocation count of each macro and b) the previous
invocation count for each macro.
Actually this can be done using the current macro features of gas.
Problem: I need to build a single linked list at assemble time. This is
traditionally done with somethink like:
.set LINK, 0
.macro HEAD foo, bar
...
.word LINK
.set LINK,.
.endm
This does not work with gas assembling msp430 code on a PPC Mac, because
LINK only gets resoved at relocation time, so all LINK fields are the
same :-(
Ah, but that is because you are setting LINK to the value of "." which is the
location counter which needs to be resolved at link time. If instead you use a
static count for the macro then you can achieve the results you want. Like this:
.set LINK, 0
.macro HEAD
.word LINK
.set LINK, LINK + 1
.endm
You can also use expressions like "(LINK +1)" and "(LINK - 1)" to get the next
and previous invocation counts.
Cheers
Nick
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils