delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/01/10/00:08:39

From: Charles Sandmann <sandmann AT new-orleans DOT NeoSoft DOT com>
Subject: Re: Accessing absolute addresses in memory (>1M) and ports.
To: hvb AT netrix DOT com
Date: Mon, 9 Jan 1995 21:11:46 -0600 (CST)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

> How do I map to the 0xd000 page of the low 1MB area then?

Use the conventional memory selector and #include <sys/farptr.h>
Example, to write an "A" in reverse video directly to the color screen:
   _farpokew(_go32_info_block.selector_for_linear_memory, 0xb8000, 0x7041);
There are byte and word versions for peek and poke.  If you compile with
optimization, they inline great.  There are also even more optimal
versions if you do a lot of access, read the farptr.h for details.

These routines can also be used with the memory blocks returned from
DPMI for the extended memory device accesses, but you will need to
set up a selector to point to them.  Use movedata() in go32.h to move
large blocks of data quickly.   

- Raw text -


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