Date: Sun, 1 Mar 1998 16:18:29 -0800 (PST) Message-Id: <199803020018.QAA20625@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: "Peter Jakubowicz" , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: newbie function question Precedence: bulk At 01:44 2/28/1998 -0800, Peter Jakubowicz wrote: >Hi, >Wld someone be kind enough to tell me why this doesn't compile w/ gcc. I >know other ways to plot a point in 16 colors. I'm actually just curious what >is wrong here and too addled to figure it out myself >Thank you > > >void plot(int x, int y, int color) >{ > #define graph_out(index,val) {outp(0x3CE,index);\ > outp(0x3CF,val);} > int dummy,mask; > char far * address; > address = (char far *) 0xA0000000L + (long)y * xres/8L + > ((long)x / 8L); Because you're not in real mode any more. :) Such absolute pointer accesses don't work from protected mode, and GCC has no such thing as a `far' keyword. See section 17.7 of the FAQ for ways to access conventional memory. Nate Eldredge eldredge AT ap DOT net