delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/15/05:45:26

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Geting 8x8 text from rom?
Date: Sun, 14 Dec 1997 21:20:39 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 36
Message-ID: <34944DA7.73C3@cs.com>
References: <34938c5f DOT 0 AT pusher DOT student DOT adelaide DOT edu DOT au>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp243.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019