Mail Archives: djgpp/1997/03/26/22:12:12
Neil Stone (Neil_Stone AT CyberServices DOT Com) wrote:
: SteelGolem wrote:
: >
: > asm( "mov %1, %0": "=i(var2)": "i(var1)" );
:
: I don't know that much about assembler but what I have read is that for
: one thing the above code won't work. In AT&T syntax you have to specify
: the size of what you are moving. So the above would be:
:
: asm("movw %1, %0": "=i(var2)": "i(var1)");
:
: movw = 2 bytes, movb = 1 byte, movl = 4 bytes. There is also pushb,
: pushw, etc.
Don't you mean:
asm("movw %1, %0": "=i" (var2): "i" (var1));
Mind the '(var[12])' outside the double quotes. I'm not an expert, but i
_have_ used it like this before. Or can it be used both ways?
--
Groeten, Michel. http://www.cs.vu.nl/~mdruiter
\----/==\----/
\ / \ / "Life is cool.", Beavis.
\/ \/
- Raw text -