Hi minixers and pascalers,
here comes the first public pascal compiler and pascal debugger/interpreter
for Minix 16-Bit. It is developed for Prof. Dr. Tanenbaum's Minix 1.6.25,
1.6.30 and the newest version 1.7.0. It does NOT work under Minix 1.5.
This package is copyrighted by Henrik Quintel 1994, 1995 but you can give
the package away to your friends without anything. This package contains
no source code. But in the future all my publications will contain the source
code. I think this will happen, when I have 'learned' to program a compiler
which understands a OOP-language under a 16-Bit Operating-System like Minix.
I am working on it.
This package contains the following files :
-------------------------------------------
file what it is div.
-------------------------------------------
qpascal compiler executable
Qpas small driver shell script
qpascal_cpp preprocessor executabale
pas_as assembler executable
pas_ld linker executable
pas_ncrtso.o lib opject-code
paslib.o lib object-code
pas_libd.a lib object-code
pas_libc.a lib object-code
pas_libfp.a lib object-code
pas_libe.a lib object-code
pas_end.a lib object-code
pas_cv conversion executable
Qdb small driver shell script
qdebugger debugger /
interpreter executable
physik.pas testprogram pascal-source
README this file ascii-text
qpas man-page ascii-text
qdb man-page ascii-text
A very important thing is that the size of qdebugger is 20000.
If you are missing something in the package, please let me know immediately !
Not implemented are the following features :
Filehandling
Packed array
Packed records
'Set of'-construct
Here is an example to port a set-of construct to an array construct.
var a, b: set of [1..10]
=> const lwb=1; upb=10;
type set10 = array [lwb..upb] of boolean;
var a, b: set10
a:= (1; 4; 6);
=> for i:= lwb to upb do a[i]:= false;
a[2]:=true; a[4]:=true; a[6]:=true;
a:=a*b
=> procedure intersect(a,b:set10; var res: set10);
var i: integer;
begin
for i:=lwb to upb do res[i]:= a[i] and b[i];
end;
intersect(a, b, a);
...
How can you get the package ?
Make a ftp to ftp.cs.vu.nl
Directory : minix/pascal
set bin
set hash
set prompt
mget *
-------------------------------------------
On your system do the following:
(QCK = Quintel's Compiler Kit)
Then make a dirrectory in /usr (cd /usr ; mkdir pascal ; cd pascal)
Put the file QCK.tar there.
Uncompress the file. (uncompress QCK.tar.Z)
Then extract the tar file QCK.tar (tar xvf QCK.tar)
After extracting there are four directories :
1. compiler
2. debugger
3. test
4. man
In the first directory is the compiler and in the second the debugger.
Make (cd test). Here you find the file testsuite.tar.
Make (tar xvf testsuite.tar and you have extracted the testsuite.
So you can see how programming in pascal.
In the man directory is this file and the man pages.
Copy the following files in the mentioned directories
qpascal /usr/bin
Qpas /usr/bin
qpascal_cpp /usr/lib
pas_as /usr/lib
pas_ld /usr/lib
pas_ncrtso.o /usr/lib
paslib.o /usr/lib
pas_libd.A /usr/lib
pas_libc.A /usr/lib
pas_libfp.A /usr/lib
pas_libe.A /usr/lib
pas_end.A /usr/lib
pas_cv /usr/lib
Qdb /usr/bin
qdebugger /usr/bin
qpas /usr/man/man1
qdb /usr/man/man1
Of course you can install the files where you want. But then you have to
change all the PATH in Qpas and in Qdb.
IF YOU HAVE PROBLEMS WITH INSTALLING OR PROBLEMS WITH
COMPILING OR DEBUGGUNG/INTERPRETING YOUR PASCAL-PROGRAMS
SEND ME THE FOLLOWING FILES :
Your PASCAL-PROGRAM (hallo.pas)
The .qcpp file (hallo.qcpp)
The assembler output (hallo.as)
The object file (hallo.o)
If possible the outputfile (output)
TRY *******NNEEVVEERR********* to make changes inside the
OBJECT FILES WHICH ARE DISTRIBUTED.
If I have forgotten a file or have you any questions for
the standard-pascal or how to use, install the compiler, debugger/interpreter,
FEEEEEEL FREE and mail to me.
Example for the compiler (use the file physik.pas)
Starting the compiler :
Qpas physik (You do not have to write qpas newton.pas, but if you want so,
you can change it in qpas.)
Starting and working with the debugger :
(The words in the brackets are only commets by me)
qdb physik
(You will see the listing)
Command ? break 15 (Press Enter)
Command ? (Press Enter)
Enter new number (0 to quit) : 9 (Press Enter)
Breakpoint
At 15: If number = 0
Command ?
9.00000 3.0000
5.000000 66.67%
3.400000 13.33%
3.023530 0.78%
3.000092 0.00%
3.000000 0.00%
Enter new number (0 to quit) : (Press CTRL-C)
(Now you see a heart)
(Press Enter)
(There are two error messages - ignore them :-))
Command ? assign number := 16
Command ? show sqrt(number)
4
Command ? pi/number
****Error : undefinded identifier.
****Error : Incompatible types.
Command ? where
At 15: if number = 0
Command ? step
Command ?
At 15 if number = 0
Command ?
At 18: if number < 0
Command ?
At 22: sqroot := sqrt(number)
Command ?
At 23: writeln (number : 12 : 6, sqroot: 12 : 6)
16.000000 4.0000000
Command ?
At 24 : writeln
Command ?
At 26 : root := 1
Command ? unstep
Command ? trace
Command ? (Here you will see a lot of information)
...
Enter new number (0 to quit) : <13> 36
Breakpoint
At 15 : If number = 0
(Press CTRL-C like at the beginning of the session. You will see a heart)
(Press Enter)
Command ? untrace
Command ? store root
Command ? watch
Variables being watched:
root (store)
Command ? break
Statement breakpoints at:
15
Command ?
36.000000 6.000000
..... (There are a lot of stores now)
Enter new number (0 to quit) : 0
(Exit...)
Here are the commands for the debugger:
Command: break (number)
breakpoint at each one of them.
Command: break
Print the line numbers of all the breakpoints.
Command: unbreak (number)
Remove the breakpoint from the statement beginning on line (number).
Command unbreak
Remove all breakpoints from all statements.
Command: trace
Turn on statement tracing.
Command: untrace
Turn off statement tracing.
Command: entry
Turn on tracing of procedure and function entries
Command: unentry
Turn off tracing of procedure and function entries.
Command: exit
Turn on tracing of procedure and function exits.
Command: unexit
Turn off tracing of procedure and function exits.
Command: step
Turn on single-stepping
Command: unstep
Turn off single stepping
Command: fetch (variable)
store (variable)
watch (variable)
Command: show (expression)
Print the value of expression.
Command: assign (variable) := (expression)
(See example)
Command: where
Print the line number followed by the text of the statement to be executed next.
Killing the program
The kill command terminates the program execution.
Command: kill
If you have questions about the commands or the usage, mail to me.
At the moment I program :
an ansi c compiler
a modula-2 compiler
a new assembler / loader
a new lib
a forth interpreter
BTW, I make some brainstorming sessions to produce a compiler/interpreter
which understands the concepts of an OOP-language.
If you have ideas or tips, feel free and mail to me.
If someone has ideas or something else please write to me !
SPECIAL THANKS FOR SUPPORT TO THE FOLLOWING PERSONS :
Prof. Dr. Andrew S. Tanenbaum ast@cs.vu.nl
Kees J. Bot kjb@cs.vu.nl
--
quintel@nibelung.Worms.Fh-Rpl.DE | compilers for Minix
------------------------------------------------------
compilerwriters use cat > a.out ...