delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/18/10:33:56

Date: Tue, 18 May 1999 13:40:47 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: leroy <leroy152 AT yahoo DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: A way of emulating a BASIC routine in C.
In-Reply-To: <373E56C8.6383CA0C@yahoo.com>
Message-ID: <Pine.SUN.3.91.990518134024.24330M-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sun, 16 May 1999, leroy wrote:

> Firstly the basic routine CALL ABSOLUTE takes a pointer to a string
> containing CPU opcodes (not ASM mnemonics), how could I emulate this in
> C?

If the opcodes are protected-mode code, you can simply reference the
array of opcodes (in assembly) via the CS selector.  CS and DS in
DJGPP have the same base address and the same limit, precisely to
allow such tricks.

If the opcodes are real-mode code, use a DPMI function, like somebody
else already told you in this thread.

> Secondly with DJGPP does the DPMI host trap all real-mode requests or
> just the ones it knows about?

First, DJGPP has no influence on how the DPMI hosts work (except for
CWSDPMI which was written as part of DJGPP).  And second, the DPMI
hosts doesn't trap ANY real-mode requests at all, it only traps Int
31h, the DPMI API interrupt, and only those calls issued in
*protected* mode.  All other software interrupts simply go to their
usual real-mode handlers.

Trapping real-mode interrupts is not DPMI host's duty, it something a
DOS extender, such as Windows, does.

- Raw text -


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