X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Message-ID: <3C6B401E.F74E6A4D@yahoo.com> From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Need help with FP_SEG and FP_OFF References: <3C6B356D DOT 710D406F AT charter DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 51 Date: Thu, 14 Feb 2002 09:11:50 GMT NNTP-Posting-Host: 12.90.167.151 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1013677910 12.90.167.151 (Thu, 14 Feb 2002 09:11:50 GMT) NNTP-Posting-Date: Thu, 14 Feb 2002 09:11:50 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Altaf wrote: > > 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. > > /****************************************/ > 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"); > } > /******************************/ I think (and I am only guessing) that you need to clearly define what that function does. Having done that you may find that "info gprof" will lead you the rest of the way. And you may well find that you can get rid of a lot of the code in your application. -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net) Available for consulting/temporary embedded and systems. (Remove "XXXX" from reply address. yahoo works unmodified) mailto:uce AT ftc DOT gov (for spambots to harvest)