Article View: gnu.gcc.help
Article #42013Why no ':'s in top level asms?
From: David Mazieres
Date: Sun, 28 Jan 1996 00:00
Date: Sun, 28 Jan 1996 00:00
25 lines
1390 bytes
1390 bytes
Is there some reason why there cannot be ':' arguments to an asm
directive at the top level (outside any procedure)?
For instance, on the 386 I would like to declare a structure at a
particular virtual address. I would like to do this without some
sort of horrible "genassym" program which first creates a header file
with sizes and offsets which I can then include in a .S file and use
to generate the proper .set directive. Thus, I would like something
like this:
asm volatile (".set _u,%P0" :: "i" (USTACKTOP - sizeof (struct Uenv)));
extern struct Uenv u;
Unfortunately, gcc seems to dislike the presence of a colon in an asm
structure not in a function. This works if I put it in a fuction, but
that seems must less appropriate and makes the code much less
readable.
Is there some other way to get what I want, or some reason why gcc is
limiting how I can use asm statements?
[I'm using gcc 2.7.2 on i386/OpenBSD]
Thanks,
David
Technical Details
Message-ID:
<qwon377y5xi.fsf@amsterdam.lcs.mit.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,3da2228ab4529fc6,start X-Google-Attributes: gid11318c,public From: dm@amsterdam.lcs.mit.edu (David Mazieres) Subject: Why no ':'s in top level asms? Date: 1996/01/28 Message-ID: <qwon377y5xi.fsf@amsterdam.lcs.mit.edu> X-Deja-AN: 136998296 sender: dm@amsterdam.lcs.mit.edu organization: MIT Laboratory for Computer Science newsgroups: gnu.gcc.help