Message-ID: <35D15066.F081F88@geocities.com> From: Merlin MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Problem with inline asm in DJGPP References: <01bdc475$efbcfdc0$6559f482 AT s-64584> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 52 Date: Wed, 12 Aug 1998 08:23:51 GMT NNTP-Posting-Host: 196-cy-wpg.ilos.net NNTP-Posting-Date: Wed, 12 Aug 1998 03:23:51 CDT Organization: MBnet Networking Inc. To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk The syntax for djgpp's asm is at&t style... you'll have to learn to use it...or use nasm.. although at&t's it's not much different from intels...pretty much just flip the source and dest. to use asm you'll need to use: asm("code goes here with \n separating each line":outputs:intputs:modified registers/flags); thats about it.... Tarad wrote: > Hya, just begun learining assembler and tried to do this: > ---=== asm.c ===--- > #include > #include > > int main() > { > int xpos, ypos; > > do > { > clrscr(); > > asm > { > MOV AX,0x3 > INT 0x33 > MOV xpos,CX > MOV ypos,DX > } > > printf("X position: %d",xpos); > printf("\nY position: %d",ypos); > > } > while(!kbhit()); > > return 0; > } > > And of course I got errors (like with everything I do it seems). > asm.c: In function `main': > asm.c:13: parse error before `{' > asm.c: warning: unused variable `xpos' > > What's up now? Can't I use inline assembler in DJGPP? > Thanks. :-)