delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/06/14:40:01

From: "Campbell, Rolf [SKY:1U32:EXCH]" <moscoop AT americasm01 DOT nt DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Inline asm
Date: Mon, 06 Mar 2000 12:43:46 -0500
Organization: Nortel Networks
Lines: 35
Message-ID: <38C3EE52.EC9DC2A9@americasm01.nt.com>
References: <ZYQw4.7893$6b1 DOT 126890 AT news1 DOT online DOT no>
NNTP-Posting-Host: wmerh0tk.ca.nortel.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.72 [en] (X11; I; HP-UX B.10.20 9000/785)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Martin F. Johansen" wrote:

> Does Inline asm work in djgpp?

Yes.

> I tried:
>
> asm MOV AX,0013h
> asm INT 10h
>
> asm{
>     MOV AX,0003h
>     INT 10h
> }
> The only thing i got was an error message:
> Error: parse error before `MOV'

DJGPP doesn't support Intel syntax for ASM.  And, there's a better way
to do that anyways:
(Warning: untested code.  I'm writting this from memory, so if it's not
correct, it's close)

__dpmi_regs regs;
memset(&regs, 0, sizeof(regs));  //I think this is optional for this
specific example
regs.x.ax = 0x13;
__dmpi_int(0x10, &regs);


--
(\/) Rolf Campbell (\/)



- Raw text -


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