Alternative Computer Languages for the ZX81: Partial Pascal

Authors

Publication

Pub Details

Date

Pages

See all articles from The Sinc Times v4 n1

PASCAL was inverted by Nicklaus Winth in the 1960s to be used as a programming teaching lanquage. PASCAL (named for the fasous French mathenatician Blaise Pascal) was intended to eliminate the serious faults of BASIC while retaining the ease of use for which Basic is famous.

Semper Software, the purveyors of Partial Pascal, are quick to point out that nobody, including themselves, have figured out how to put full standard PASCAL into 16K of memory. What they have done, however, is to fit a very good subset of PASCAL into the 16K of memory commonly available for the ZX81/TS1000.

You will recall from ay first article of this series that BASIC is an interpreted (read that S-L-0-W) language that does not lend itself well to structured programming. PASCAL, being a compiled language, executes quickly. Since PASCAL calls labelled procedures; defines variables; incorporates looping functions (such as DO-WHILEs); and has recursion ability, it qualifies quite handily as a “structured” programming language.

What are the advantages of Partial PASCAL over standard Sinclair BASIC?

The main advantage of Partial PASCAL comes from the fact that it is structured, and can therefore prepare the experienced BASIC programmer, or even the unjaded novice programmer to produce professional quality structured code. However, there are other advantages to Partial PASCAL besides learning good programaing techniques.

Firstly, Partial PASCAL is compiled, and it is faster than BASIC. Using the same counting prograa that was used in my first article on Compiled BASIC, let’s see how fast Partial PASCAL really is.

To recap, the BASIC program was:

10 REM SIMPLE COUNTING PROGRAM 
20 FAST
30 LET C=0
40 LET C=C+1
50 IF C=32768 THEN GOTO 70
60 GOTO 40
70 PRINT "DONE"
80 STOP

The equivalent PASCAL program is:

PROGRAM COUNTING(INPUT,OUTPUT); 
VAR COUNTER:INTEGER;
BEGIN COUNTER:=1;
WHILE COUNTER<32768 DO BEGIN
COUNTER:=COUNTER+1
END;
WRITE("DONE")
END.

The BASIC program takes 4 minutes 10.8 seconds to execute. The Partial Pascal program runs about three times faster at 1 minute 34.8 seconds to execute.

Secondly, Partial PASCAL comes with a great full screen editor to use in constructing your programs. The editor is full-function, featuring complete cursor novement; pageup/down; delete/insert lines and characters; progran printout frow the editor (without leaving the editor!); save to tape (again without leaving the editor); duplicate lines, and graphic mode. Whew! For a ainute there I thought I was programming on a mainframe!

Thirdly, Partial PASCAL comes with a very complete manual which is actually a pretty good text on the PASCAL lanquage, as vell as a very coplete guide to using Partial PASCAL.

Another great feature of the software is the way in which it makes optimal use of the ever-present tape recorder. In Partial PASCAL all output to tape is in the form of files, with filenames and extensions. A directory of what is on tape 15 available. Since only the compiled object (machine code) is needed at run-tine, loading a program only takes a few seconds! Unless you have a very large program, the load time is no faster than a disk drive! Also with Partial PASCAL programs which exceed the available memory can be written, compiled, and run because memory is saved to tape automatically as needed!

With Partial PASCAL the user can specify the desired output devices at run time just as you would on a professional systems. Running your ZX81/TS1000 under Partial PASCAL is the closest you can get to the feel of a business-type computer systee on the little black box.

Ok, obviously I like Partial PASCAL. But nothing is perfect. Partial PASCAL does have some drawbacks.

Firstly, Partial PASCAL has no floating-point math capability. Like the BASIC copiers we discussed in the first article, Partial PASCAL is limited to integer math. The remainder of a division can be returned by the MOD command, however, so to some extent this drawback can be programmed around.

Secondly, until the user is familiar with the package, Partial PASCAL can be frustrating to use. This is a result of the many bells and whistles the package presents. But, because the documentation is so well done, the familiarization period is short. Please do read the manual and follow the examples. If you apply the learning aids provided with the documentation, you will have no trouble.

Thirdly, if speed alone is your main consideration you would be better off to buy a BASIC compiler (a la my first article) which will run over 60 times faster than BASIC, and 16 times faster than Partial PASCAL. But if 4 times more execution speed (equivalent to running in Sinclair BASIC FAST mode, but without losing the video) is enough for you, you will be happy with Partial PASCAL.

All in all, I have been very satisfied with the package. Although the package is not cheap at $30, it is a quality product which has been well developed and is thoroughly supported. Even die-hard ZX81/TS1090 fans will admit that these machines have some serious limitations, but Partial PASCAL has been well designed to maximize the ZX81/TS1000 performance.

Products

 

Downloadable Media

 
Scroll to Top