Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!ucbvax!ucsfcgl!cgl.ucsf.edu!kneller From: kneller@cgl.ucsf.edu (Don Kneller) Newsgroups: comp.sys.ibm.pc Subject: Re: Microsoft Quickc - Pointers to arbitrary memory location Message-ID: <11135@cgl.ucsf.EDU> Date: 12 Sep 88 18:23:08 GMT References: <666@dogie.edu> <1920@titan.camcon.co.uk> Sender: daemon@cgl.ucsf.edu Reply-To: kneller@socrates.ucsf.edu.UUCP (Don Kneller) Organization: UCSF Computer Graphics Lab Lines: 28 In article <1920@titan.camcon.co.uk> mrh@camcon.co.uk (Mark Hughes) writes: >From article <666@dogie.edu>, by dorl@vms.macc.wisc.edu (Michael Dorl - MACC): >> I've been trying to reference screen memory directly from Quickc. >> The stuff I've tried looks something like this >> >> char far *p; >> >> p = (char far *)0xb8000; >> >Try defining a macro like:- > >#define fp(a) ( (( (long)(a) & 0xf0000 )<< 12) | ( (long(a) & 0xffff ) ) > MSC supplies the macros you need with FP_SEG and FP_OFF, which can be used to get the segment and offset of far (32-bit) pointers. They can also be used to SET the segment and offset: FP_SEG(p) = 0xB800; FP_OFF(p) = 0; and away you go with p[0], p[1], etc. The macros are in dos.h. - don ----- Don Kneller UUCP: ...ucbvax!ucsfcgl!kneller INTERNET: kneller@cgl.ucsf.edu BITNET: kneller@ucsfcgl.BITNET