delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/16/18:16:19

Date: Mon, 16 Mar 1998 17:53:18 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp AT delorie DOT com
Subject: Re: Syntax of "asm" statement
In-Reply-To: <#91fpOOU9GA.243@upnetnews02.moswest.msn.net>
Message-ID: <Pine.SUN.3.91.980316175036.15756A-100000@is>
MIME-Version: 1.0

On Mon, 16 Mar 1998, DeHackEd wrote:

> movl $13h, %eax
> int $10h
> 
> 3) You can't call real mode interrupts from a protected mode program.

Yes, you can, if the specific function of the real-mode interrupt doesn't 
need pointers to buffers.  If the function is only register-based, like 
in the above case, it will work.

> You can
> try the following and it will work, though most people prefer to use the DPMI
> calls for safety. This code is a little more portable.
> 
> #include <dos.h>
> 
> void set_mode13h()
> {
>     union REGS regs;
>     regs.x.ax = 0x13;
>     int86(0x10, &regs, &regs);
> }

Calling `int86' boils down to issuing the very same `INT' instruction.  
Look in the library sources and see for yourself.

- Raw text -


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