Mail Archives: djgpp/2002/12/19/08:45:06.1
Lars O. Hansen (lars DOT o DOT hansen AT gmx DOT de) wrote:
: I have
: INTEGERVARIABLES a,b;
: I like to do
: asm OPCODE-MNEMONIC a,b
: how do I do it in djgpp?
: for example:
: int a,b;
: a=4;
: b=8;
: asm ADD b,a
: this should result in b being 12 (a+b);
asm ("add %1, %0"
: "=r" (b)
: "r" (a)
);
You may change one of the "r"s to "g" if you want, but I'm not sure it
will add (pun intended) anything to gcc's optimising.
: I am using C and am used to Intel syntax.
The most important difference is the the source and destination are
swapped.
Right,
MartinS
- Raw text -