-------- Original Message -------- Objet: Re: Absolute in Pascal Date: Thu, 15 Jun 2000 12:33:10 +0200 De: Maurice Lombardi <Maurice.Lombardi@ujf-grenoble.fr> A: Penza Kenneth at MITTS <kenneth.penza@magnet.mt> Références: <JA8AAAAABE1ZiAABYQABlXwdgctU@magnet.mt> Penza Kenneth at MITTS a écrit :
I am tring to compile a unit that defines some bios variable which does compile under TP 7.0. However when I use gpc I get the following messages.
bios.pas:18: warning: variables at absolute adresses may cause problems bios.pas:18: missing semicolon bios.pas:18: parse error before `:'
Part of the coding is as follows. INTERFACE CONST BiosSeg = $40;
VAR ScrnCols : BYTE ABSOLUTE BiosSeg :$4a;
1 - djgpp is a linear frame 32 bits system. It does not know about Segment:Offset addresses. 2 - djgpp is a protected mode system libe BP (not TP): The address even in BP would be Selector:Offset instead of Segment:Offset. You would need to replace Const BiosSeg=$40 by Const BiosSeg=seg0040 (BP takes care to put the correct selector instead of $40 in seg0040). 3 - there are a lot of functions to address physical memory in the djgpp's libc: look at _dpmi... functions by info libc. But probably the simplest would be to look to _far* functions (_farpeekb etc...) to peek/poke values at such addresses with a minimum effort. You just have to declare these functions in your pascal program with asmname to make them known, e.g. function farpeekb(selector:ShortWord; offset:MedWord): byte; asmname "_farpeekb"; please read carefully the explanation in the _far* section of the info libc on how to use these functions (get selectors...) Hope this helps -- Maurice Lombardi Laboratoire de Spectrometrie Physique, Universite Joseph Fourier de Grenoble, BP87 38402 Saint Martin d'Heres Cedex FRANCE Tel: 33 (0)4 76 51 47 51 Fax: 33 (0)4 76 51 45 44 mailto:Maurice.Lombardi@ujf-grenoble.fr