All of lore.kernel.org
 help / color / mirror / Atom feed
* GAS - \@ in macros and labels
@ 2002-05-29 14:49 kieft_brian
  2002-05-30 17:13 ` Scott Lanning
  0 siblings, 1 reply; 3+ messages in thread
From: kieft_brian @ 2002-05-29 14:49 UTC (permalink / raw)
  To: linux-assembly

I'm having a little trouble with specifying labels inside of two different
macros using the \@ variable. See the following...

 .MACRO tableHdr    someArgs
A_\@:
     .DC.W  (B_\@ - A_\@)   
    stuff....

 .ENDM

 .MACRO tableEnd    someArgs
B_\@:
 .ENDM

Unfortunately the number produced by \@ will never be in sync between the two
macros due to the fact that a new macro call will increment the counter (not to
mention that there may be some other macros called in between Hdr and End).

So I attempted to resolve the situation by creating my own variable...

.MACRO  tableHdr    someArgs
.SET    CMD_NUM,\@
A_CMD_NUM:
     .DC.W  (B_CMD_NUM - A_CMD_NUM)     
    stuff....

 .ENDM

 .MACRO tableEnd    someArgs
B_CMD_NUM:
 .ENDM


Unfortunately GAS sees this as literal text and throws a bunch of "symbol
already defined" errors. Any ideas on how to make the CMD_NUM appear as its
value in a label? Thanks,

Brian


**********************************************************************
This e-mail and any files transmitted with it are confidential and may
be legally privileged or otherwise exempt from disclosure under
applicable law. This e-mail and its files are intended solely for
the individual or entity to whom they are addressed and their content
is the property of Smiths Aerospace.  If you are not the intended
recipient, please do not read, copy, use or disclose this communication.
If you have received this e-mail in error please notify the e-mail 
administrator at postmaster@si.com and then delete this e-mail, its
files and any copies.

This footnote also confirms that this e-mail message has been scanned
for the presence of known computer viruses.
***********************************************************************

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-05-30 22:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-29 14:49 GAS - \@ in macros and labels kieft_brian
2002-05-30 17:13 ` Scott Lanning
2002-05-30 22:44   ` h-peter recktenwald

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.