HiSoft Pascal is a Pascal compiler for the TS 2068, adapted from the version for the ZX Spectrum. Its sign-on reads “Hisoft Pascal Timex 2068 – 30/11/84” and “Copyright Hisoft 1983,84”. Programs are typed into its built-in line editor and compiled to Z80 machine code in memory, which then runs at machine code speed; on start-up it asks for the size of the symbol table (“Table Size?”). It implements most of standard Pascal, including records, packed arrays, CASE, WITH, FORWARD declarations and GOTO with labels, with REAL and INTEGER arithmetic and functions such as SQRT, ARCTAN, ROUND, TRUNC and ENTIER.
For the Sinclair hardware it adds PEEK, POKE, ADDR, SIZE, USER (call machine code), INLINE (machine code within a Pascal program), INCH (read a key), PAGE, RANDOM, MARK and RELEASE for the heap, TOUT (tape output), and HALT. Run-time errors are reported with messages such as “Index too High”, “/ by Zero” and “Halt at PC=”.
Program Analysis
Tape Contents
hploader: a one-line BASIC loader that sets the colours, loads the compiler and starts it withRANDOMIZE USR 27000.hptimex: the compiler, editor and run-time library, 18,500 bytes at 26990.TURTLE(saved twice): the Pascal source of a turtle graphics library, ready to load into the editor.
The TURTLE Library
TURTLE defines procedures in the style of Logo: PENUP, PENDOWN, FWD, BACK, LEFT, RIGHT, TURN, SETHD, SETXY, VECTOR and ARCR, plus INK, PAPER and a screen COPY. The turtle’s position and heading are kept as REAL variables, and moves are worked out with SIN and COS. Plotting, line drawing and the copy are done by short INLINE machine code sequences that call routines in the ROM, and CHECK stops the program with “Out of limits” if the turtle leaves the 256 × 176 screen. It is a worked example of how HiSoft Pascal’s INLINE can reach the computer’s own graphics.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
