Article View: gnu.gcc.help
Article #51378(none)
From: Elliot Stewart
Date: Wed, 26 May 1993 19:43
Date: Wed, 26 May 1993 19:43
35 lines
2048 bytes
2048 bytes
The environment that I am using is the following:
Sun SPARCstation 2
Sun OS v4.1.3
GCC v1.42
I am trying to take advantage of the ability of having C expressions in asm
statements, however I am not sure if GCC can support what I am trying to do.
What I like to accomplish is to have a C procedure call generate unique labels
at the assembly level. For instance, I can use the following two statements
inside my procedure to create a new label:
asm(".global __REENTER");
asm("__REENTER:");
The problem with this is that the label will be the same every time my
procedure is called. What I was hoping to do was something along the
following:
/*global variables*/
int count = 0;
char buffer[20];
.
.
.
void my_procedure()
{ sprintf(buffer, "__REENTER%d", count++);
asm(".global %0" : : "g" <--[then somehow make buffer the
argument, but I think this is
really not correct])
Is there any way to generate unique labels from a procedure call? Any help
with this would be greatly appreciated!
Elliot Stewart
stewart@crhc.uiuc.edu
Technical Details
Message-ID:
<199305261938.AA23276@basagran.crhc.uiuc.edu>Path:
arc1-ca.pugleaf.net!gmd.de!rrz.uni-koeln.de!unidui!math.fu-berlin.de!ifmsun8.ifm.uni-hamburg.de!news.DKRZ-Hamburg.DE!dscomsa!dxcern!mcsun!uknet!warwick!doc.ic.ac.uk!aixssc.uk.ibm.com!yktnews.watson.ibm.com!newsgate.watson.ibm.com!news.ans.net!europa.eng.gtefsd.com!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!crhc.uiuc.edu!stewartShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,c89006695e50b0de,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-05-26 14:37:52 PST Path: arc1-ca.pugleaf.net!gmd.de!rrz.uni-koeln.de!unidui!math.fu-berlin.de!ifmsun8.ifm.uni-hamburg.de!news.DKRZ-Hamburg.DE!dscomsa!dxcern!mcsun!uknet!warwick!doc.ic.ac.uk!aixssc.uk.ibm.com!yktnews.watson.ibm.com!newsgate.watson.ibm.com!news.ans.net!europa.eng.gtefsd.com!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!crhc.uiuc.edu!stewart From: stewart@crhc.uiuc.edu (Elliot Stewart) Newsgroups: gnu.gcc.help Subject: (none) Date: 26 May 1993 15:43:17 -0400 Organization: GNUs Not Usenet Lines: 35 Sender: daemon@cis.ohio-state.edu Distribution: gnu Message-ID: <199305261938.AA23276@basagran.crhc.uiuc.edu>