Mail Archives: djgpp/2002/02/13/22:48:32
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f
|
Message-ID: | <3C6B356D.710D406F@charter.net>
|
Date: | Wed, 13 Feb 2002 22:56:29 -0500
|
From: | Altaf <aladhani AT charter DOT net>
|
Organization: | Alpha Network Solution (www.alphanetsolution.com)
|
X-Mailer: | Mozilla 4.78 [en] (Windows NT 5.0; U)
|
X-Accept-Language: | en
|
MIME-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
Subject: | Need help with FP_SEG and FP_OFF
|
Reply-To: | djgpp AT delorie DOT com
|
Hello troubleshooter,
I have just started to port an old 16bit code to DJGPP'c gcc compiler.
I have a small segment of code which I can not port. I ueses SREGS
structure.
Here is an example. If someone can look at it and let me know how to
translate into DJGPP's. I have been reading FAQ section 17.6 and 18.2
and more. BUT I am still not being able to solve the mystery of
register.
My problem area is:
FP_SEG and FP_OFF(). DJGPP does not have these two functions.
Can I write my own? OR Can I somehow translate them into DJGPP.
Will appreciate all the help
Sincerely,
Altaf
/****************************************/
int someFn(someStruct *profileptr)
{
union REGS inregs, outregs ;
struct SREGS segregs ;
unsigned char *fdata ;
fdata = (char *)profileptr ; /* some very important data*/
printf("fdata in setprofile: [%s] \n", fdata);
printf("fdata in setprofile: [%s] \n", fdata);
inregs.h.ah = 0x44 ;
inregs.h.al = 0x03 ;
inregs.x.bx = handle ; /* file handle */
segregs.ds = FP_SEG( fdata ) ; /* MY problem line */
inregs.x.dx = FP_OFF( fdata ) ; /* MY problem line */
inregs.x.cx = SETPROFILE ;
intdosx( &inregs, &outregs, &segregs ) ;
printf("End of setprofile \n");
}
/******************************/
- Raw text -