Porting the New Profil Compiler and the Post-Procssors to UNIX
In July 1991, I was working then for Digital Precision, I have ported the New Profil Compiler and the Post-Processors to UNIX.
The New Profil Compiler was a 12,000 lines program written in Pascal and running on a WICAT computer with the MCS operating system.
To speedup the input and output, the compiler used the low-level operating system calls to perform buffered I/O.
Porting the program to the UNIX operating system was straightforward and easy for me.
All I had to do was to NULL terminate all the strings in the Pascal program and to write in C a module implementing the I/O routines specific to UNIX.
All I had to do was to NULL terminate all the strings in the Pascal program and to write in C a module implementing the I/O routines specific to UNIX.
The final executable was finally build from a Pascal source program and linked with a library of I/O routines that I wrote in C to replace the MCS system calls. In other words, I was calling C functions from a Pascal program. This is an excerpt from the compiler main source file illustrating how the interface was declared:
/*****************************************************************************/
/* Interface with C procedures defined in "wicatio.c". */
/*****************************************************************************/
procedure wi_read (var filedesc : text;
var buf : char;
nbrec : integer;
var nbread : integer); external;
procedure wi_open (var filename : string;
var mode : string;
var filedesc : text;
var status : integer); external;
procedure wi_close (var filedesc : text); external;
Pictures
The following pictures illustrate what is a WICAT mini-computer and a Silicon Graphics workstation:
Picture 1. A WICAT Computer. |
Picture 2. An SGI Personal IRIS Workstation ($50,000.00) in 1991. |
No comments:
Post a Comment