Mail Archives: djgpp/1996/05/20/04:53:04
watcom353 AT aol DOT com wrote (Subject: graphics):-
> I use int 10h to set the video mode like this: union REGS regs;
> regs.w.ax=mode; int386(0x10,®s,®s); That works fine. ... But I can't
> get a pixel on the screen. I've tried unsigned char *scr=0xa000; with many
> different amounts of 0s after the a. But I always get a GPF. How can I write
> to the screen. ...
The screen address 0xa0000 (with 4 zeros) is an absolute (real mode) address,
but if you write e.g. `char *scr=0xa000; scr[0]=7;' in Gnu C/C++ you are
writing to the protected mode address *0xa0000, which is a different animal.
(0xa000 with 3 zeros is the <segment> address of the screen: full address =
segment_address * 16 + offset.)
- Raw text -