Date: Tue, 18 May 1999 13:40:47 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: leroy 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.