Xref: news2.mv.net comp.os.msdos.djgpp:4698 From: Enrico Horn Newsgroups: comp.os.msdos.djgpp Subject: Re: Newbie Inline ASM Date: Fri, 07 Jun 1996 09:43:36 +0200 Organization: Technische Universitaet Ilmenau Lines: 35 Message-ID: <31B7DDA8.1CD5@prakinf.tu-ilmenau.de> References: <31B4BF08 DOT 5FC3 AT ix DOT netcom DOT com> NNTP-Posting-Host: ipisparc4.prakinf.tu-ilmenau.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Brian Drum DJ-Gateway: from newsgroup comp.os.msdos.djgpp 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 | \---------------------------------------------------------------------/