INMC 80 News |
June/July/August 1980 · Issue 1 |
| Page 31 of 48 |
|---|
Notes on the steps towards implementation of a “Tiny” Pascal for Nascom.
The best known of all Tiny Pascal compilers is that published in BYTE, Sept./Oct./Nov 1978, by Chung and Yuen. This is designed to be implemented on a North Star with floppies, and is written in Basic! (Ugh!). It can however be made to run on a Nascom with 8k Basic. The main changes involve the Functions – North Star Basic allows multiple line functions, Nascom does not, but the change is easy. In the original, FNG (x,y,z,) is defined with a multiple line definition – for Nascom load three variables not used eleswhere, say e.g. G1, G2, G3, then GOSUB the line where you have repeated the body of the FNG (x,y,z,) definition (Using Gl, G2, G3, as the variables). Each call to the function is replaced by a line consisting of Gl=value 1: G2=value 2 G3=value 3: GOSUB LINENO. This is quite effective in the case of FNG, the code generation function, and can be done on the fly, as you enter the program. The two error functions can be handled similarly. The notes in the back of the Nascom Basic Manual on string format conversions between one system and another are most useful, as North Star uses a different convention for MID$ commands. The program as published in Byte can be fitted in less than 20K – less than 16K if comments are deleted.
The Basic program as published in Byte produces pseudo (p)
codes for an ideal machine. Unfortunately Byte no longer make available
the Pcode to 8080
conversion program, so one will have to be written.
Then to compile a Pascal program there will be two stages – use the
16/20K basic program to produce a Pcode listing, and then use a Pcode
to 8080/
This combination of Basic/
I would be interested to correspond with anyone else working along these lines.
(Ed: We have seen a Pascal for the Nascom advertised and we hope to get a copy for review shortly.)
| Page 31 of 48 |
|---|