Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!cg-atla!fredex From: fredex@cg-atla.UUCP (Fred Smith) Newsgroups: comp.lang.c Subject: Re: absolute address pointer in MS C 5.1 Keywords: absolute address pointer Message-ID: <8213@cg-atla.UUCP> Date: 1 Jan 90 03:50:03 GMT References: <5850@sdcc6.ucsd.edu> Reply-To: fredex@cg-atla.UUCP (Fred Smith) Organization: Agfa Compugraphic Division Lines: 31 In article <5850@sdcc6.ucsd.edu> bruno@sdcc10.ucsd.edu (Bruce W. Mohler) writes: >I'm trying to print out a series of characters at an >absolute address (up in the F000:xxxx ROM) from inside >of an MS C 5.1 program. > >This doesn't work for me: > > char far *machine_id = (0xFFFFE); /* F000:FFFE */ > >Bruce W. Mohler >Systems Programmer (aka Staff Analyst) >bruno@sdcc10.ucsd.edu >voice: 619/586-2218 Try this: char far *machine_id; FP_SEG (machine_id) = 0xf000; FP_OFF (machine_id) = 0xfffe; while (loop_condition) printf ("%c", *machine_id++); In Microsoft C this is the prescribed method of setting a far pointer. I must admit that such usage of these two macros is rather obscure, but that IS the way to do it. Fred