Mail Archives: djgpp/1996/06/07/13:04:57
Brian Drum wrote:
> main() {
> asm("movl $4,%eax"
> ://No output
> ://No input
> :"%eax" );
> return 0;
> }
Instead movl $4,%eax try movl $4,%%eax.
This should work. If you only write one %, the DJGPP compiler searches
for a number after it, which refers to a operand.
Example:
main() {
int hallo;
asm("movl %0,%%eax"
:
: r (hallo)
: "%eax");
return 0;
}
This program does nothing more than fill the eax register with the value
of hallo.(THIS IS NOT EXPLICITLY TESTED , but should work)
So the %0 operand refers to the variable int hallo, because it is the
first operand (number 0) coming from outside the asm part.
Regards,
Enrico.
--
/---------------------------------------------------------------------\
|Enrico Horn Tel. 036738/41929 |
|07426 Lichta E-mail: enrico DOT horn AT prakinf DOT tu-ilmenau DOT de |
|Ortsstrasse Nr. 14 http://www.prakinf.tu-ilmenau.de/~ehorn |
\---------------------------------------------------------------------/
- Raw text -