Mail Archives: djgpp/1997/12/15/05:45:26
Matthew wrote:
>
> Im rather new to DJGPP so please excuse my ignorance here
>
> I would like to know how I would use farnspeekb for the following address.
> 0xF000FA6E which contains the 8x8 font for mode 13h in rom. The only
> example close to farnspeekb I can find is for writing to the screen
> ie _farnspokeb(0xA0000 + line_offset, color);
> Im used to writing 0xA0000000 for the screen address!
> How do I write the adress 0xF000FA6E for use with farnspeekb?
You're making the same mistake that a lot of people do when switching to
DJGPP; namely, assuming that all the world operates with 16-bit
pointers. This is not true; it's just a sad myth propagated by
textbooks that teach you Borland C and nothing else.
The address 0xF000FA6E is translated into a segment:offset pair by a
real mode compiler. The equivalent 32-bit memory address is 0xFFA6E,
AFAIK. (Somebody correct me if I'm wrong; I'm not used to thinking in
16-bit terms. :-) )
In the same vein, the 0xA0000000 16-bit pointer translates into an
absolute 32-bit address of 0xA0000.
Once you get used to it, you'll find that 32-bit addressing is a _lot_
simpler than the old way of doing things. See chapters 10, 17, and 18
of the DJGPP Frequently Asked Questions list for more eye-opening
facts. :-)
--
---------------------------------------------------------------------
| John M. Aldrich | "Courage is the complement of fear. |
| aka Fighteer I | A man who is fearless cannot be |
| mailto:fighteer AT cs DOT com | courageous. (He is also a fool.)" |
| http://www.cs.com/fighteer | - Lazarus Long |
---------------------------------------------------------------------
- Raw text -