ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/10/12:00:33

From: "Tarad" <tarad AT 3awebcon DOT com>
Subject: Problem with inline asm in DJGPP
Newsgroups: comp.os.msdos.djgpp
Message-ID: <01bdc475$efbcfdc0$6559f482@s-64584>
Lines: 37
Organization: A Customer of Tele2
Date: Mon, 10 Aug 1998 15:46:46 GMT
NNTP-Posting-Host: 130.244.89.101
NNTP-Posting-Date: Mon, 10 Aug 1998 17:46:46 MET DST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hya, just begun learining assembler and tried to do this:
---=== asm.c ===---
#include <conio.h>
#include <stdio.h>

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. :-)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019