delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/03/02/04:20:17

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Sat, 02 Mar 2002 10:58:24 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: captainpita AT aol DOT com (Captainpita)
Message-Id: <1438-Sat02Mar2002105823+0200-eliz@is.elta.co.il>
X-Mailer: emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9
CC: djgpp AT delorie DOT com
In-reply-to: <20020301223126.15546.00000921@mb-fi.aol.com>
(captainpita AT aol DOT com)
Subject: Re: Questions about using __dpmi_int()
References: <20020301223126 DOT 15546 DOT 00000921 AT mb-fi DOT aol DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: captainpita AT aol DOT com (Captainpita)
> Newsgroups: comp.os.msdos.djgpp
> Date: 02 Mar 2002 03:31:26 GMT
> 
>   I have abandoned "segread" and int86 and have gone thru section 18.2 to
> understand what is going on so I can migrate my program to DJGPP. The example
> in 18.2 shows how to get data FROM a DOS interrupt, but how do you pass
> data TO a DOS interrrupt?

The same as in the example, but you need to use dosmemput to put the
data into the transfer buffer before calling __dpmi_int.

Please don't limit your reading to what's in the FAQ: the library
reference for the functions mentioned in the FAQ has additional
information, which the FAQ does not try to replace.

> 1.) How do I get the data to send into the "transfer buffer"  which points to
> DS:DX.

Use `dosmemput'; see section 18.4 of the FAQ for more details.

> inregs.x.ds = __tb >>4;      
> inregs.x.dx = __tb & 0X0f;
> 
> 2.)  The data segment (DS) appears to be the transfer buffer shifted to the
> right by        four bits. Is this true forever?

For the transfer buffer, yes.  The value of __tb is simply SEGMENT*16
+ OFFSET, where SEGMENT and OFFSET are, respectively, the segment and
the offset of the real-mode address of the transfer buffer.

> 3.)  The offset (DX) appears to be the transfer buffer "anded" with 0X0F. Is
> this also       true forever? 

Yes, for the transfer buffer.

- Raw text -


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