Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!usc!elroy.jpl.nasa.gov!jato!mars.jpl.nasa.gov!kaleb From: kaleb@mars.jpl.nasa.gov (Kaleb Keithley) Newsgroups: comp.sys.ibm.pc Subject: Re: POKE, PEEK, FAR POINTER Keywords: ON a AT with Microsoft C Message-ID: <2886@jato.Jpl.Nasa.Gov> Date: 20 Feb 90 23:46:13 GMT References: <848@dukempd.phy.duke.edu> <8389@cg-atla.UUCP> Sender: news@jato.Jpl.Nasa.Gov Reply-To: kaleb@mars.UUCP (Kaleb Keithley) Organization: Jet Propulsion Laboratory, Pasadena, CA. Lines: 28 In article <8389@cg-atla.UUCP> fredex@cg-atla.UUCP (Fred Smith) writes: >In article <848@dukempd.phy.duke.edu> fang@dukempd.phy.duke.edu (Fang Zhong) writes: >> Here is something I have tried and it did not work. >> unsigned far *addr; >> unsigned seg, offset, byte; > >> addr = NULL; >> addr += seg*16 + offset; >> *addr = byte; >MIcrosoft C has a pair of macros called FP_SEG and FP_OFF which are >FP_SEG(addr) = (segment value); >FP_OFF(addr) = (offset value); Another way to set a far * is as follows assuming, say you want to look at VGA screen memory at A000:0000 unsigned far *addr; addr = (unsigned far *)A0000000; I always thought the FP_SEG and FP_OFF macros were to get the segment/offset components from some initialized far pointer. Chewey, get us outta here! kaleb@mars.jpl.nasa.gov Jet Propeller Labs Kaleb Keithley