delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/22/05:00:46

Date: Thu, 22 Jun 2000 11:43:56 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Lanugo of the wandering souls <lanugo AT SCEMOCHISPAMMAflashmail DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Calling an interrupt from inline assembly
In-Reply-To: <AX945.19934$Q7.498542@news-east.usenetserver.com>
Message-ID: <Pine.SUN.3.91.1000622114334.24311G-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 21 Jun 2000, Lanugo of the wandering souls wrote:

> This is my problem: I need to call an INT instruction (I do not know nearly
> anything about assembly, I'm just copying some code found on a website,
> written for another compiler), but when I write
> 
>  asm ("mov %ax, $0x13" : "int $0x10");
> 
> the compiler does not work properly due to a parse error befor ).

You don't need assembly for this.  Here's how to say this in C:

  #include <dpmi.h>

  __dpmi_regs r;

  r.x.ax = 0x0013;
  __dpmi_int (0x10, &r);


That's it!  See sections 17.8 and 18.1-18.5 of the DJGPP FAQ for more
details about how to call real-mode services from a DJGPP program.

- Raw text -


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