Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!husc6!bloom-beacon!ftp!jbvb From: jbvb@ftp.COM (James Van Bokkelen) Newsgroups: comp.sys.ibm.pc Subject: Re: Bug in MSC 4.0 small/medium libraries? Summary: FP_SEG doesn't imply a cast of any sort... Message-ID: <387@ftp.COM> Date: 24 Oct 88 19:35:53 GMT Article-I.D.: ftp.387 References: <2509@silver.bacs.indiana.edu> Organization: FTP Software Inc., Cambridge, MA Lines: 25 In article <2509@silver.bacs.indiana.edu>, creps@silver.bacs.indiana.edu (Steve Creps) writes: > > There seems to be a bug in or related to the intdosx() routine in > MSC 4.0, in the SMALL and MEDIUM models. > Given the following code: > .... > <>findfirst(filespec, attr) > <>char *filespec; > <>unsigned int attr; > <>{ > <> regs.h.ah = 0x4e; > <> regs.x.cx = attr; > <> regs.x.dx = FP_OFF(filespec); > <> sregs.ds = FP_SEG(filespec); Look carefully at the definitions of FP_SEG & FP_OFF in DOS.H. They assume the pointer they are working on is 32 bits long, which is only true in the "large data" models. If you need one routine which works in all models, the simplest fix is probably to put in an explicit cast to "char far *" and continue to use FP_OFF & FP_SEG. Intel. Segments. Ennnnhhhh....... James VanBokkelen FTP Software Inc.