Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!network.ucsd.edu!celit!soledad!keck From: keck@sea.com (Jon Keck) Newsgroups: comp.os.msdos.programmer Subject: Re: Finding the MCGA in Quick C 2.01 Message-ID: <1990Aug21.003359.12923@sea.com> Date: 21 Aug 90 00:33:59 GMT References: <9042@uhccux.uhcc.Hawaii.Edu> <36267@ut-emx.UUCP> <2060@cod.NOSC.MIL> Organization: Systems Engineering Associates Lines: 34 In article <2060@cod.NOSC.MIL> bmarsh@cod.nosc.mil.UUCP (William C. Marsh) writes: >Lots of people post code that looks like: >> unsigned char far *mem; >> >> mem = 0xA000:0000; >> *(mem + offset) = val; > >Could we please stop using code that looks like this? This is very unportable >to other 80x86 C compilers! If you use the provided services in the compiler >(either MSC style or TurboC style) then there is a good chance it will work >elseware (Plus, it's easier to understand). > >Examples (Using the above): > >MSC: > > FP_SEG(mem) = 0xA000; > FP_OFF(mem) = 0x0000; > >TurboC: > > MK_FP(mem, 0xA000, 0x0000); From the Turbo C 2.0 Reference Guide, p. 251, the syntax of the MK_FP macro is void far *MK_FP(unsigned seg, unsigned ofs); -- John Keck INTERNET:keck@sea.com UUCP:...!ucsd!soledad!keck VOICE:619/581-6181 Systems Engineering Associates, 2204 Garnet Ave Suite 203, San Diego CA 92109 ----------------------------------------------------------------------------- "Much speech leads inevitably to silence. Better to hold fast to the void."