This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: asm assembly syntax
- To: edwede at stl082 dot magnetek dot com
- Subject: Re: asm assembly syntax
- From: "Patrick J. Fay" <pfay at acl dot lanl dot gov>
- Date: Sun, 25 Jan 1998 01:52:27 -0700 (MST)
- cc: gnu-win32 at cygnus dot com
- Reply-To: "Patrick J. Fay" <pfay at acl dot lanl dot gov>
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".