Date: Wed, 20 Dec 2000 14:55:54 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Yoram Hofman cc: djgpp AT delorie DOT com Subject: Re: BorlandC to GCC translation In-Reply-To: <3A40A4C1.6040207@htsol.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.)