delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/05/24/08:47:57

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
To: DJGPP AT SUN DOT SOE DOT CLARKSON DOT EDU
Date: Wed, 24 May 1995 12:29:22 BST
Subject: Re: accessing conventional memory addresses

  I asked re using _farpeekb() etc, and dj AT delorie DOT com (DJ Delorie) replied
(Subject: Re: accessing conventional memory addresses):-

> _go32_conventional_mem_selector() is a reference to the
> _go32_info_block.selector_for_linear_memory value ... You should use [it]
> if you want faster access; it's still a single memory reference and if the
> value should change, you would automatically get the new value. DJ

  which I tried, and it works - except that when I #include _farpeekb() etc
thus:-

#include <pc.h>
#include <go32.h>
#include <sys/farptr.h>
#define uns unsigned
#define SEL _go32_info_block.selector_for_linear_memory
/*-----*/
main(){short c; uns int addr; _farpokew(SEL,addr,c);}

the `extern inline' sequences in djgpp\include\sys\farptr.h made gcc swear
thus: "t$.cc(.text+0x1c): undefined reference to `_farpokew(unsigned short,
unsigned long, unsigned short)'", and to get my program to work I had to copy
djgpp\include\sys\farptr.h into my program, and in that copy delete the
`extern' words (and delete the `-ns-' functions, which I wasn't using). Then
my program worked OK.

- Raw text -


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