www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/09/06:26:26

Date: Sun, 9 Feb 1997 13:16:08 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: JuneSmith <106363 DOT 3644 AT compuserve DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Help passing pointers to intdosx.
In-Reply-To: <32FB1913.457B@compuserve.com>
Message-ID: <Pine.SUN.3.91.970209131017.859A-100000@is>
MIME-Version: 1.0

On Fri, 7 Feb 1997, JuneSmith wrote:

> "If you use int86x or intdosx for a DOS or BIOS function supported by
> them, then just put the address of your buffer into the register which
> expects the offset (regs.x.di) and forget about the segment.  These
> functions are processed specially by the library, which will take care
> of the rest."

Use int86 and intdos instead of int86x and intdosx.  That's what the FAQ 
wants to say, but it doesn't tell this clearly enough.  Thanks for 
pointing that out, I will make it more explicit in the next release.

> 	However, the following code doesn't use the di register.

Come on, DI was only an example...

This should work (it works for me):

#include<dos.h>
int main(void)
{
	union REGS pregs;
	char Message[20] = "PC Intern$";

	pregs.h.ah = 0x09;
	pregs.x.dx = (int)Message;
	intdos (&pregs, &pregs);
	return 0;
}

Personally, I suggest you stay away from int86 and intdos; use __dpmi_int 
instead.  This way, you don't have to worry which functions of which 
interrupts are or aren't supported.

- Raw text -


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