Mail Archives: djgpp/2000/12/20/08:03:50
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 -