Subject: Re: asm assembly syntax
From: [email-masked] (Patrick J. Fay)

25 Jan 1998 00:57:21 -0800
Message-ID: <[email-masked]>
Reply-To: "Patrick J. Fay" <[email-masked]>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
To: [email-masked]
Cc: [email-masked]

Hello Ed,
You wrote:
> the visual C++ syntax is__asm {
>        lea eax,[edx]GLcontext.Current.ByteColor[0]            
> }
> the gnu would be
> __asm__ ("       lea eax???????        ");

I don't think you can put a variable name like that into gnu asm.
You need a regular address, not a variable name. (I hope I'm wrong.)
The gnu lea syntax is:
       leal   $0x0(%edx),%eax   
   #where edx is the address that '[edx]GLcontext.Current.ByteColor[0]'
resolves to.
Note that gnu asm reverses the order of operands. 
One way to learn gnu asm is to take a C subroutine that does something
close to what you want, compile it, and then do:
objdump -d  --line-numbers --source mysub.obj (or mysub.o)
If you are working with masm, you can compile the masm routine with
  ml /c /coff /Zi /Zd tst.c
then:
  objdump -d --line-numbers --source tst.obj will show you the 
original masm lines along with the gnu assembler equivalent.
Pat

Patrick Fay, Ph.D., Intel Corp.            email:   [email-masked]
Los Alamos National Lab                    wk:         (505) 665-9141
CTI M.S. B296                              fax:        (505) 667-5921
Los Alamos NM 87545    ASCI-RED http://www.acl.lanl.gov/~pfay/teraflop

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".