www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/20/08:03:50

Date: Wed, 20 Dec 2000 14:55:54 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Yoram Hofman <yoram AT htsol DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: BorlandC to GCC translation
In-Reply-To: <3A40A4C1.6040207@htsol.com>
Message-ID: <Pine.SUN.3.91.1001220145309.16884C@is>
MIME-Version: 1.0
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

On Wed, 20 Dec 2000, Yoram Hofman wrote:

> Can anybody help to translate this code to GCC:
> {
> union REGS r;
> struct SREGS sr;
> unsigned char *buff;
> 
> buff = farmalloc(0x05);
> 
> r.x.ax = 0xEEEE;
> r.x.bx=0xABCD;
> int86(0x15,&r,&r);
> 
> sr.es  = FP_SEG(buff);
> r.x.bx = FP_OFF(buff);
> r.x.ax = 0xEEEE;
> r.x.di = 0x4444;
> r.x.si = 0xAAAA;
> r.x.cx = 0x05;
> int86x(0x15, &r,&r, &sr);
> }
> (NOTE: values don't matter)
> I read DLGPP help about int86, but in my case I don't know which define 
> I have to choose (NAIVE_DOS_REGS or _BORLANDC_DOS_REGS)  with purpose to 
> transfer to registers my buffer address rightly .

You have read the wrong section in the FAQ.  The one which speaks 
directly about this matter is section 18.2; it also includes an example 
of working code which does something similar.

Section 18.4 explains a bit more how to move data between the transfer 
buffer and your program.

(Be sure to read the latest version of the FAQ, v2/faq230b.zip.)

- Raw text -


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