Pointer & GPC question...

Mon, 18 Aug 1997 12:05:34 +0200 (MEST)


According to Orlando Llanes:
> 
> Ok, I know you guys are gonna shoot me for this, but here goes anyway...

No.  To become shot by myself, you must do more than this.  ;-)

> My question is about Pointers, what I want to know are 3 things..
> 1) What is the format of a pointer? Is it 3 bytes (selector--1 byte,
>    base address--2 bytes)? Or is it 4 bytes?

On iX86-based machines, pointers have four bytes; all of them "offset"
(that's what you probably mean with "base address").  GPC works in just
one memory segment with a maximum length of 4GB, while 16-bit compilers
usually work in many memory segments of 64kB each.

On other machines, pointers are different; e.g. on the DEC Alpha, a
pointer has eight bytes.

> 2) If I performed pointer arithmetic that works under MS-DOS, will it
>    also work under Linux without modification?

Yes.  Provided you use GPC's pointer arithmetic as implemented in
gpc-somewhere-in-may-or-so.  Casts to `Word' and such are *not*
portable.

> 3) How do I create a generic pointer? Can I just use "Pointer"? reason
>    I ask is because I tried plain Pointer once, and it didn't work.

It works now.  :-)

> Another question I have now while we're at it, is the latest version of GPC
> posted on the FTP site? Or is it still in patched versions? I want to
> upgrade, but I don't want to mess with patches unless I could upgrade from
> 2.01  Where can I find the upgrade?

>From 2.01?  What's that?

While the official version of GPC is still 2.0, the latest beta version
that is available in binary form is gpc-970714, available via ftp at
ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/beta/binary/.  Some
patches to gpc-970714 already exist on Agnes, too, but they are no
official new beta yet.  Due to administrative problems :-(some paper war
must be resolved first - sigh)-: I am retaining more recent sources, but
some bug fixes have been posted to this list now and then ...

Hope this helps,

    Peter

 Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
 maintainer GNU Pascal [970714] - http://home.pages.de/~gnu-pascal/ [970125]


Peter Gerwinski (peter@agnes.dida.physik.NO-SPAM-PLEASE.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es