delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/09/25/23:18:22

Date: Sun, 25 Sep 94 22:09:31 EDT
From: peprbv AT cfa0 DOT harvard DOT edu (Bob Babcock)
To: OKRA AT max DOT tiac DOT net
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: es:di points to....
Reply-To: babcock AT cfa DOT harvard DOT edu

>   I've got to do two things with es:di.  First I have to get it to point 
> to a function I want called by a real-mode function, and second I have to 
> get it to point to an array of data.

Here's a code fragment setting some registers and calling a real-mode
function (it happens to be a time-slice release function)

	_go32_dpmi_registers go32_regs;

	go32_regs.x.cs = slicer_info.rm_segment;
	go32_regs.x.ip = 0;
	go32_regs.x.ss = go32_regs.x.sp = 0;
	_go32_dpmi_simulate_fcall(&go32_regs);

DOS memory is allocated by _go32_dpmi_allocate_dos_memory() and the function
code or data can be transfered to this DOS memory by using dosmemput().
If you need to call a protected mode function from real mode, I believe you
need to use _go32_dpmi_allocate_real_mode_callback_iret() or ..._retf() (this
is not something I've ever needed to do).

- Raw text -


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