delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/09/21/21:56:10

Date: Wed, 21 Sep 1994 18:38:07 -0700 (PDT)
From: Gordon Hogenson <ghogenso AT u DOT washington DOT edu>
Sender: Gordon Hogenson <ghogenso AT u DOT washington DOT edu>
Reply-To: Gordon Hogenson <ghogenso AT u DOT washington DOT edu>
Subject: far pointers
To: djgpp AT sun DOT soe DOT clarkson DOT edu

What is the proper usage of the _farsetsel() function ?
Initially, I thought I could just load a segment, i.e.,

main()
{
  _farsetsel(0xb800);
  /* .... */
}

but that generates a General Protection Fault.  So then I
tried the following program:

#include <stdio.h>
#include <go32.h>
#include <sys/farptr.h>

int main()
{
   unsigned long i;
  
   _farsetsel(_go32_conventional_mem_selector());
   for (i = 0xb8000; i < 0xa0000; i++)
     _farnspokew(i, 0x0700 | 65); 
}

I expected the text screen to be filled with the letter 'A'.
However, nothing happened, the program runs and finishes with no
discernible effect.

 _farpeekb(0x40,0x4a) works just fine, returning the
screen width from the BIOS data area.

Any suggestions?

Gordon


- Raw text -


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