Re:A couple quick questions invloving GNU Pascal: Books, Accessing memory and Ports
Quote
> program foo;
> uses crt; <---legal in TP & BP ;GNU ???
Parts of CRT are ported in a library `BO5'. Check the
`contrib' subdirectory of the GNU Pascal distribution at
ftp://kampi.hut.fi/jtv/gnu-pascal/. From the BO5 file
`djgpp.icl' you can also learn about direct memory access etc.
It should not be too difficult to write a CRT Unit for
GNU Pascal using the stuff already in BO5. Any volunteer
out there?
Quote
> and another thingy: TP & BP don't make OBJ's,the linking is automatic.Is
> this a feature of Pascal or just the borland products?
It is a *mis*feature of Borland Pascal that it cannot produce `.obj'
files and thus you cannot access functions written in Borland Pascal,
say, from Borland C. However automatic linking *is* a feature of
Borland Pascal; use the commmand-line option `--automake' to get this
with GNU Pascal.
Quote
> Can I link GNU Pascal code in GCC progs?
Yes. Just take care of the Capitalization Of The First Letter In
Each External Pascal Identifier. E.g., if you have a Unit
Unit Foo;
Interface
Function FooBar ( Var Bar: Integer ): Boolean;
Implementation
(* ... ! *)
end.
then you can use the Function `FooBar' from C using the following
header `foo.h':
#define BOOLEAN char
extern BOOLEAN Foobar ( int *bar );
Note that this does not only work on DOS (with DJGPP or EMX) but
on *any* platform supported by GNU Pascal.
Hope this helps,
Peter
e-mail: peter.gerwin...@uni-essen.de
home address: D\"usseldorfer Str. 35, 45145 Essen, Germany
WWW: http://agnes.dida.physik.uni-essen.de/~peter/