Mail Archives: djgpp/1999/05/16/11:38:15
leroy wrote:
> Hi all,
> I'm writing a BASIC to C converter for DJGPP, I'm wondering about two
> things.
> 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?
>
> Secondly with DJGPP does the DPMI host trap all real-mode requests or
> just the ones it knows about?
> If it does could I implement a BASIC Call absolute routine, written for
> real-mode and would it run in pmode without having to modify anything?
I'm working on a program to convert QuickBasic into C++. I just started a
few days ago, so I don't have much other than variable declarations, for
loops, do-loop's supported. But I think I know how to solve your problem.
AFAIK, you can't just call 16-bit code and expect it to run accordingly
from protected mode. The way around this is to use
#include <dpmi.h>
int __dpmi_simulate_real_mode_procedure_retf(__dpmi_regs *_regs);
What I would do is allocate some DOS memory, then fill it with the array
that CALL ABSOLUTE is passed, then fill in the '_regs' struct (including
CS:IP) and call the function. That should do what you want.
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT HotMail DOT com
ICQ: 32959047
- Raw text -