delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/05/04:30:14

Xref: news2.mv.net comp.os.msdos.djgpp:5678
From: Pål-Kristian Engstad <engstad AT funcom DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Redefined labels in GAS
Date: Fri, 05 Jul 1996 09:37:39 +0200
Organization: Funcom Oslo AS
Lines: 23
Message-ID: <31DCC643.7C02@funcom.com>
References: <4rhj29$8ca AT news7 DOT erols DOT com>
Reply-To: engstad AT funcom DOT com
NNTP-Posting-Host: khazad.funcom.com
Mime-Version: 1.0
To: "F.G." <arcanix AT pop DOT erols DOT com>
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

F.G. wrote:
> 
> I've run into a small snag with a section of my program written for GAS.
>  In it, I use a macro which contains a label.  Later in the code I call
> the macro 8 times as part of an unrolled loop. Not surprisingly, it gives
> me an error telling me that the label has already been defined.  I
> believe that TASM has a directive called "local" which allows labels to
> be placed in macros and cause the lables to act as if they were
> in functions.  In other words, using the macro multiple times in the
> program will not yield "redefined label" errors.  Since GAS does not
> directly support macros AFAIK, there seems to be no such directive.  Is
> there any way to get around my problem?
> Thanks in advance.

Use numbered labels, "1:", "2:", etc. These are guaranteed to be local
within the asm statement.

PKE.
-- 
----------------------------------------------------------------------
| Pål-Kristian Engstad | engstad AT funcom DOT com  | Games programmer, PSX |
| Funcom Oslo AS       | Ph +47 22 42 01 02  | developer & Linux Fan |
----------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019