| www.delorie.com/archives/browse.cgi | search |
| From: | "Andrew Crabtree" <andrewc AT rosemail DOT rose DOT hp DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Problems with inline asm!? |
| Date: | Wed, 4 Mar 1998 09:08:53 -0800 |
| Organization: | Hewlett Packard |
| Lines: | 20 |
| Message-ID: | <6dk1qv$576$1@rosenews.rose.hp.com> |
| References: | <Pine DOT OSF DOT 3 DOT 95 DOT 980304135930 DOT 9125A-100000 AT dec1> |
| NNTP-Posting-Host: | ros51675cra.rose.hp.com |
| Mime-Version: | 1.0 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
CD (CeDric) wrote in message ...
> asm("lea ax,[eax+eax*4]");
> asm("move [es:di],al");
Here are some tips. Full documentation is available, check the faq for
details
1) Instructions must have a size suffix
2) Operands go src, dst instead of dst,src
3) Memory references are 'disp (base,index,scale)'
4) Registers must be preceded with a % (must use 2 %s to escape properly in
inline)
5) Immediates must be preceded with a $
Example (untested)
movl $5, 20(%eax,%esi,2)
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |