This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: asm assembly syntax


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:   pfay@co.intel.com
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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]