www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/08/11:11:39

To: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Cc: DJGPP AT sun DOT soe DOT clarkson DOT edu
Subject: Re: using _farns*() (was: Re: Funny error in class)
Date: Wed, 08 Feb 95 14:28:26 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>

> please what do I use as the argument of _farsetsel()
> and what do I use as the `offset' argument of _farns*()?

You should call _farsetsel(_go32_conventional_mem_selector()),
then call _farns*() with the linear address of the memory
location you want to peek/poke.  The linear address is given
by lin_addr = 16*segment + offset, where segment and offset
are from the real-mode segment:offset pair of a far pointer.
Confused?  Here are some examples:

> (1) the color text screen

lin_addr = 0xb8000 + <offset of character from start of video buffer>

> (2) the monochrome text screen

Likewise, but the base address is 0xb0000

> (4) the lower end of the RAM (real addresses 0 to (say) 0x10000),

lin_addr = 0 to 0x10000

The case of graphics screen is explained in my FAQ, question 10.5.

- Raw text -


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