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..
- 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.
- 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.
- 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]
Hi,
Sorry to bother you all, but I'm having some trouble getting the above to work. I am using gpc as a cross compiler from i586-unknown-linux to m68k-coff and everything is looking great. I'm trying hard to get Oregon Pascal code to compile, [ has anyone else had to use this variant, UNIV parameters / loophole, ref etc. ? ], anyhow here is a code fragment :
PROGRAM test (input, output) ;
PROCEDURE print_str (name: PACKED ARRAY [lo..hi: integer] OF Char) ; {a} {PROCEDURE print_str (name: String) ;} {b} BEGIN writeln ('lo : ',lo,'Hi : ',hi) ; {a} {writeln (name) ;} {b} END ;
BEGIN print_str ('Hello Mate') ; END.
It compiles to object fine with the {b} labeled code in, but the {a} labeled code causes a crash :
m68k-coff-gpc -c test.pas
m68k-coff-gpc: Internal compiler error: program gpc1 got fatal signal 6
Is this perhaps one section of the ISO 10206 spec. that isn't implemented yet ? or am I doing something extremely daft :-)
Oh, and while I'm being stupid I'm having problems creating a 32bit unsigned type which is quite important for the embedded application. There is probably a far better way of doing it than this :
TYPE ulong = 0..16#FFFFFFFF ;
As this apparently shows that :
./p.def1:14: subrange bounds are not of the same type
Thanks in advance for any help, its a great project, keep up the good work.
Regards,
Michael Meeks.