www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/01/01:05:12

Date: Tue, 31 Jan 95 22:19:29 EST
From: peprbv AT cfa0 DOT harvard DOT edu (Bob Babcock)
To: 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: Writing to screens etc
Reply-To: babcock AT cfa DOT harvard DOT edu

> >    _farsetsel(_go32_info_block.selector_for_linear_memory);
> >    _farnspokeb(0xa0017,0x14);
> 
> (1) Should `0xa0017' be `0x0017' or `0xa0000017'?

0xa0017 is correct.  farnspokeb() takes a linear address which is 16*segment
register + offset.

> (2) Do I have to call farsetsel() once per program, or every time I write to
> the screen?

farsetsel() loads a selector into the fs register.  Gcc doesn't ever use this
register, nor do the library routines, so in theory you can set it once and
forget it.  In practice, it's probably safer to assume that you need to call
farsetsel() again after making any sort of system call.  Comments in
sys/farptr.h say essentially this.

- Raw text -


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