Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!megatek!spot!hollen From: hollen@spot.megatek.uucp (Dion Hollenbeck) Newsgroups: comp.sys.ibm.pc Subject: Re: Where is the paralell port??? Message-ID: <424@megatek.UUCP> Date: 13 Dec 88 20:57:27 GMT References: <10690@s.ms.uky.edu> Sender: news@megatek.UUCP Lines: 24 From article <10690@s.ms.uky.edu>, by simon@ms.uky.edu (Simon Gales): > In article <464@octopus.UUCP> pete@octopus.UUCP (Pete Holzmann) writes: >>be ignored. LPT1 is at whatever I/O address is stored in the 16 bits at >>40:8, LPT2 at 40:0a, etc. >> >>unsigned far *lpts = 0x00400008L; /* Define a pointer to the LPT ports */ >>unsigned LPT1Base = lpts[0]; >> > > should be: > > unsigned far *lpts = 0x00000408L; /* Addr = Segment * 16 + Offset */ > unsigned Lpt1Base = lpts[0]; > WRONG, WRONG, WRONG. The original poster was correct. FAR or HUGE pointers are stored by MSC and TURBO C as 16bits of segment and 16bits of offset, hence 0x0040:0008 make up the segment:offset far pointer. Dion Hollenbeck (619) 455-5590 x2814 Megatek Corporation, 9645 Scranton Road, San Diego, CA 92121 seismo!s3sun!megatek!hollen ames!scubed/