Beebug


Oxford Pascal
By Oxford Computer Systems
BBC Model B

 
Published in Beebug #33

Oxford Pascal

Oxford Computer Systems have produced a challenge to Acornsoft's ISO Pascal for the Beeb. Pascal expert John Maher checks it out.

The BBC Micro now has four versions of Pascal, together with at least two others which will run on second processors only (TDI's UCSD P-System Pascal and Borland's Turbo Pascal). However, of the four alternatives for first processor operation neither Acornsoft's restricted version, called S-Pascal, nor the very non-standard Pascal-T ('Tiny Pascal') can be recommended, so that for most people the choice will be between 'ISO' Pascal from Acornsoft and OCSS's 'Oxford' Pascal.

There are two versions of Oxford Pascal, one for cassette operation, the other for use with discs, and it does operate on the 6502 second processor, though it will not run on the Electron yet. Supplied with the Oxford system are a 50 page manual, a 16K ROM and a cassette or 40 (or 80) track disc. The system is claimed to work with both Basic I and II, and with all known DFSs.

The Editor

Pascal text files are entered in Oxford Pascal with a simple line editor, which is a slightly extended version of BBC Basic's editor. Programs are given line numbers, then AUTO, LIST, NEW, RENUMBER, DELETE are supplemented by commands to FIND and to CHANGE text in the file. The commands DISK and RESIDENT are used to move between disc and memory resident compilations.

Whilst the editor is adequate for entering programs, Pascal really needs a good text editor. I found myself using the ISO Pascal editor, or Wordwise for entering Oxford Pascal programs. The ISO Pascal editor is really excellent, very much like hardware. By comparison the Oxford Pascal editor is very limited. However, Oxford Pascal only occupies one Sideways ROM slot, whereas ISO Pascal occupies two, one of which includes the editor. Otherwise Oxford Pascal has a nice line editor which is quite adequate for simple programs.

Compilation

As with ISO Pascal, compilation is to an intermediate code known as p-code. The ROM contains an interpreter for the p-codes (occupying 10K of ROM), this interprets the p-code as the program runs. P-code is very efficient so far as space is concerned, faster than Basic, but not as fast as machine code.

Two compilers are supplied for the disc version of Oxford Pascal, one is memory resident, leaving just over 13K space for the source program and object (p-code) files, while the other is disc-based so that 23K is left (both compilers use mode 7). The cassette version only works with the resident compiler, which of course restricts program size drastically. Both Oxford and ISO Pascal allow you to chain in large source files during compilation from disc. However, Oxford Pascal also makes it possible to build larger programs since (similar to BBC Basic) program chaining of code files is possible. Chaining is an important and very useful facility, since it enables segmentation of large programs. During chaining the Pascal global variables are maintained so that programs can communicate with each other. The only trick required is to set up identical constant and variable declarations in the programs.

Linking And Loading

Oxford Pascal provides two very useful additional facilities over ISO Pascal. A 'linker' enables you to compile several Pascal source files, and then to link them into the final program - this opens up the possibility of having a library of code files. Whilst the procedure for doing this is a little complicated, I found that it worked satisfactorily.

The 'locate' command enables the programmer to prepare a disc file which can be run independently of Oxford Pascal's ROM, this is 'locate' provides a run time system for the program. Since OCSS make no copyright claims on such programs, this is a very useful facility.

'Locate' has a second function whereby code from a compiled program can be set up to work from a chosen position in the memory. The ROM is still needed for this form of operation, and programs can be loaded and run from the Basic operating system, so that 'mixed' Pascal and BBC Basic (and assembly language) is possible, and there is a facility for passing parameters between such programs. In assembly language, parameters are passed on the Pascal stack.

My overall impression of the Oxford Pascal compiler was that, whilst it is slightly faster than that for ISO Pascal, it is not quite as good. It does not have the range of options available with ISO Pascal, its error messages are weaker, and because it does not stop at each error message a lot of consequential errors appear. I found myself reverting to the ISO Pascal compiler in debugging programs.

Benchmarks

On average Oxford Pascal carries out the PCW Pascal benchmarks about 7% slower than ISO Pascal. However, there are some curious individual variations. WHILE and REPEATs are much faster in ISO Pascal, but the arithmetic, maths and algebraic operations are faster in Oxford Pascal. Note that MAXINT in Oxford Pascal is 32767, whereas in ISO Pascal it is 2147483647. The different integer sizes will affect the benchmarks. Reals occupy five bytes in both Pascals.

Pascal Extensions

Both Acornsoft ISO Pascal and Oxford Pascal provide language extensions. Oxford Pascal's extensions are somewhat more numerous than those for ISO Pascal, comprising hexadecimal constants, hexadecimal input and output, peek and poke, bit manipulation of integers with 'and', 'or', 'xor', 'shl', 'shr'.

Another interesting form of memory access, an 'origin' procedure, to deal with setting a pointer to a particular memory location, is not explained very well in the manual but looks useful. For instance, it should be possible with the aid of this to transfer picture files between disc and screen very rapidly.

Oxford Pascal provides pre-declared procedures for the sound, envelope, move, draw, plot, mode and gcol Basic commands. A pseudo-random number generator is provided, giving numbers between 0 and 255.

One major region in which Oxford Pascal does gain over ISO Pascal is in string input. Both Pascals require that strings are set up as 'packed array[1..n] of char', but whereas a whole string can be read in Oxford Pascal, a character by character input is needed for ISO Pascal.

The User Manual

This is a slim paper-bound book. It is adequate, but not very well indexed or arranged. It also contains a number of textual and factual errors or omissions. In trying to provide a beginners' guide to Pascal, and a description of Oxford Pascal and the Operating System and editor, it tries to do too much in too short a space. However, I do not rate the ISO Pascal manual very highly either! Newcomers to Pascal could benefit from P.J.Brown's excellent little book Pascal From Basic, which comes with the ISO Pascal system.

The program manual provides three simple program examples which also appear on the disc. Some more examples are desirable, in particular to provide more information on program chaining, location and linking. An example of how to use assembly language via the Basic inline assembler would also be very useful.

Overall Impression

Oxford Pascal lives up to quite a lot of the 'hype' in its adverts, and now that many of the bugs in early versions have been eliminated, has much to recommend it.

John Maher

Other BBC Model B Game Reviews By John Maher


  • Turbo Pascal Front Cover
    Turbo Pascal
  • UCSD Pascal Front Cover
    UCSD Pascal