Sender: nate AT cartsys DOT com Message-ID: <3592CB4F.1419C970@cartsys.com> Date: Thu, 25 Jun 1998 15:12:31 -0700 From: Nate Eldredge MIME-Version: 1.0 To: oonly AT mailexcite DOT com CC: djgpp AT delorie DOT com Subject: Re: djgpp assmebly question References: <359298DF DOT 17A1 AT mailexcite DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Bob Berkawitz wrote: > > I can't get this code to work. I compile it with this command: > gcc file.c -o file.exe > I get this error: > file.c:6: invalid 'asm': operand number missing after %-letter > > Here is the code. > void main() > { > asm("movl $0, %ecx" > :/*no input*/ > :/*no output*/ > :"%ecx"); > } > > Line six is the line that says: > :"%ecx"); > Thanks in advance Remove the `%' sign in the clobber list; it's not needed there. (Only the assembler needs it, and the assembler never sees the clobber list.) You may also need to double the `%' in the actual asm statement, since GCC uses that for operand constraints normally. And, `main' should return `int'. -- Nate Eldredge nate AT cartsys DOT com