Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!ames!amdahl!pacbell!att!lzaz!lznv!psc From: psc@lznv.ATT.COM (Paul S. R. Chisholm) Newsgroups: comp.sys.ibm.pc Subject: Re: How do I point to the frame buffer? Summary: paragraph is not address Keywords: C, far pointers, frame buffer,ibm pc Message-ID: <1391@lznv.ATT.COM> Date: 1 Jul 88 02:23:14 GMT References: <2784@juniper.UUCP> Organization: AT&T Lines: 26 < "Would you buy a used operating system from these guys?" > In article <2784@juniper.UUCP>, dan@juniper.UUCP (Dan Galewsky) writes: > Could someone please tell me how to set up a pointer to the frame buffer > on my PC's CGA from Microsoft C? I know that the frame buffer starts at > 0xb800. So I tried the following : > > far char *Screen; > Screen = (char *)0Xb800; Dan Galewsky, {...}sun!austsun!galewsky, galewsky%asc@sdr.slb.com The frame buffer starts at B800:0000, which would be 0xB8000 if the 8088 had a linear address space. It doesn't. The right way to do this in MS or Turbo C is #include far char * const Screen = MK_FP( 0xB800, 0 ); (The "const" is optional; it tells the compiler that Screen is a constant, and that no one should be allowed to muck with it.) Comments? -Paul S. R. Chisholm, {ihnp4,cbosgd,allegra,rutgers}!mtune!lznv!psc AT&T Mail !psrchisholm, Internet psc@lznv.att.com I'm not speaking for my employer, I'm just speaking my mind.