🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50231

ASM and memory addresses of local automatic variables

#50231
From: Chris Asano,SDSC 230,45031,,{sta...
Date: Wed, 27 Oct 1993 18:54
26 lines
1269 bytes
I have been able to use ASM with gcc on the DEC alpha when my variables
are global.  I cannot figure out how to do this when the variables are local.
I tried various combinations of syntax following the gcc manual pages on
asm.  I'm not sure if this problem is gcc asm syntax or possibly some
assembler-related specifics.

works:

int i;
int j=1;
main()
{
   asm ("ldl $1, j" : :);
   asm ("stl $1, i" : :);
   printf("%d" ,i);
}

fails
main()
(
   int i;
   int j=1;
   asm ("ldl $1, j" : :);
   asm ("stl $1, i" : :);
   printf("%d" ,i);
}
Technical Details
Message-ID: <2amg5t$fn3@pravda.sdsc.edu>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!agate!dog.ee.lbl.gov!network.ucsd.edu!pravda.sdsc.edu!boris!asano
References: <1993Oct18.110924.13753@uwasa.fi>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,4057b36a15dcc03e
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-10-30 03:55:19 PST
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!agate!dog.ee.lbl.gov!network.ucsd.edu!pravda.sdsc.edu!boris!asano
From: asano@sdsc.edu (Chris Asano,SDSC 230,45031,,{staff},)
Newsgroups: gnu.gcc.help
Subject: ASM and memory addresses of local automatic variables
Date: 27 Oct 1993 18:54:53 GMT
Organization: San Diego Supercomputer Center @ UCSD
Lines: 26
Distribution: world
Message-ID: <2amg5t$fn3@pravda.sdsc.edu>
References: <1993Oct18.110924.13753@uwasa.fi>
Reply-To: asano@sdsc.edu
NNTP-Posting-Host: boris.sdsc.edu