🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42294

Urgent help needed.....

#42294
From: Varadarajan
Date: Thu, 21 Dec 1995 00:00
37 lines
2008 bytes
Hello all,
	I would like to know as to how I could access the C variables from
assembly  language  constructs using  gcc. I  did  go through the info
pages, but I was never able to follow them.  (Yes, I did make a honest
effort). I am  running gcc 2.7.2 on  a sun sparc  system (4.1.3). I am
not able to get even the sethi instruction compile.

I have tried the following variants.

asm("sethi %%hi(%0), %%i7", :: "m" (foo.bar));
asm("sethi %%hi(%0), %%i7", :: "n" (foo.bar));
asm("sethi %%hi(%0), %%i7", :: "i" (foo.bar));
asm("sethi %%hi(%0), %%i7", :: "V" (foo.bar));
asm("sethi %%hi(%0), %%i7", :: "o" (foo.bar));
asm("sethi %%hi(%0), %%i7", :: "r" (foo.bar)); // I know this does not
// make any sense, but I did try it any way.
asm("sethi %%hi(%0), %%i7", :: "s" (foo.bar));
asm("sethi %%hi(%0), %%i7", :: "X" (foo.bar));

(Yes I need to modify the i7 register.. It is not a typo)

where foo is a structure and bar an element of that structure. I
request one of the gcc gurus to help me. I am in desperate situation
as I need this information for my course project. Thanks a lot in
advance. 

Wishing you all happy holidays.
Best regards,
Varadarajan .T.S.


-- 
------------------------------------------------------------------------
| Varadarajan.T.S.            |  It's not an optical illusion, it just |
| M.S. Comp Science           |              looks like one.           |
| tsv@cs.umanitoba.ca         |         #include "std_disclaimer.h"    |
------------------------------------------------------------------------
Technical Details
Message-ID: <9512212000.AA03604@nickel.cs.umanitoba.ca>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,3425fe044e4f2ce4
X-Google-Attributes: gid11318c,public
From: tsv@cs.umanitoba.CA (Varadarajan)
Subject: Urgent help needed.....
Date: 1995/12/21
Message-ID: <9512212000.AA03604@nickel.cs.umanitoba.ca>
X-Deja-AN: 122498340
distribution: gnu
sender: daemon@cis.ohio-state.edu
organization: GNUs Not Usenet
reply-to: tsv@cs.umanitoba.ca
newsgroups: gnu.gcc.help