[{"TitleName":"HiSoft Pascal 4","Publisher":"HiSoft","Author":"","YearOfRelease":"1983","ZxDbId":"0008255","Reviews":[{"Issue":{"Name":"ZX Computing Issue 8, Aug 1983","Price":"£1.85","ReleaseDate":"1983-07-22","Editor":"Roger Munford","TotalPages":148,"HasCoverTape":false,"FlannelPanel":"ZX Computing\r\nVol. One\r\nNumber Eight\r\nAug/Sept 1983\r\n\r\nEditor: Roger Munford\r\nAdvertising Manager: Miriam Roberts\r\nManaging Editor: Ron Harris\r\nManaging Director: T J Connell\r\n\r\nOrigination and design by MM Design & Print, [redacted]\r\nPublished by Argus Specialist Publications Ltd, [redacted]\r\n\r\nZX Computing is published bi-monthly on the fourth Friday of the month. Distributed by: Argus Press Sales & Distribution Ltd. [redacted]. Printed by: Henry Garnett Ltd., Rotherham.\r\n\r\nThe contents of this publication including all articles, designs, plans, drawings and programs and all copyright and other intellectual property rights therein belong to Argus Specialist Publications Limited. All rights conferred by the Law of Copyright and other intellectual property rights and by virtue of international copyright conventions are specifically reserved to Argus Specialist Publications Limited and any reproduction requires the prior written consent of the Argus Specialist Publications Ltd.\r\n\r\n©Argus Specialist Publications Limited 1983"},"MainText":"How would you like to write programs in a language very much like BASIC and then run them at machine code speeds? It is now a very practical suggestion with the release of a full Pascal compiler for the 48K ZX Spectrum by the British company Hi-Soft.\r\n\r\nBefore I look at the Spectrum version, let me give you a little history of Pascal. It is a very young language, born in 1969 when a leading computer scientist called Wirth decided that ALGOL, the then leading academic language, was getting too complex. He designed Pascal specifically to teach good programming practices. It is now available in many forms on disc-based machines, but there are very few implementations on cassette driven micros.\r\n\r\nPascal is very similar to BASIC in many ways, certainly much closer than languages like FORTH, LISP, assembly or PILOT. It is generally a much better language.\r\n\r\nThis version of Pascal is a very high quality product comprising some 20K of machine code for the compiler, editor and run-time package. It completely compiles a Pascal program into Z80 machine code which runs very fast indeed. Try filling an array of 7,000 elements in half a second, or summing up the numbers one to 20000 in seven! Obviously one could write faster programs using an assembler, but try assembling A = LOG(SIN (B/180 * 22/7) - 10.45) - 8/2.2234!\r\n\r\nWhen the compiler package is loaded it starts in the editor, allowing the programs to be typed in, or loaded from tape. Hi-Soft have been very cunning with their editor as it completely bypasses the Spectrum's single-key entry system. Programs are entered line by line just like BASIC with a line number at the start of each line:\r\n\r\n10 PROGRAM DAVE;\r\n20 VAR I,J:INTEGER;\r\n30 BEGIN\r\n40 J: = 0 ; FOR i: = 1 TO 100 DO\r\n50 J: = J + 1;\r\n60 WRITELN ('J = ', J:5)\r\n70 END.\r\n\r\nThe line numbers are at the start of each line for purposes of the editor only, they have no bearing on the program. Commands are included to do the equivalent (in BASIC) of AUTO, DELETE and RENUMBER as well as searching and moving. There is also quite comprehensive commands involved with line editing which can do find, insert, replace and delete on one line.\r\n\r\nOverall, the editor is not as good as a screen editor, but it is the next best thing and for anyone used to Sinclair editing it is a significant improvement.\r\n\r\nThe editor only changes the 'Source code', ie the program as it looks above. Once a program has been compiled into machine code (or object code as it is known) it can only be changed by changing the source code and re-compiling.\r\n\r\nSource code can be saved onto tape and it's quick to do so because Hi-Soft uses tokens (just like BASIC) to represent reserved words, eg PROGRAM and iNTEGER only occupy 1 byte each in internal storage. When source code is loaded into RAM it appends onto the end of any existing code; this makes the creation and use of libraries much more convenient.\r\n\r\nOne problem with the editor is that there is no keyboard beeping. I tried unsuccessfully to get it to work, even writing a short program to POKE 23609 with 255, but to no avail. As soon as I exited from Pascal to BASIC the beeping started working again.\r\n\r\nCompilation is the process which converts source code to object code. There are two ways of doing this in Hi-Soft Pascal: the first is for debugging purposes, and keeps both source code and object code in RAM at the same time to speed up the EDIT-COMPILE-TEST cycle. When testing is complete the specially compiled object code can be dumped out to tape so that it will automatically LOAD and RUN as a stand-alone program.\r\n\r\nIf a syntax error is discovered during compilation then the choice is given of stopping and going into the editor at the faulty line, or listing other errors. Pascal is typical of compiled languages in that one error early on can generate lots later.\r\n\r\nCompiling is a very quick process, but it will be slowed down if the compiler provides a listing at the same time. The Spectrum 'write character' routines are not terribly fast, so if the compiler listing is disabled then the compilation takes place in a short period of time and instantaneously for small programs.\r\n\r\nThere are seven compiler options which determine whether or not certain checks will be incorporated into the machine code. They check such things as overflow in integer addition/subtraction, or checking if array references go out of bounds. The idea of these checks is to include them while testing and debugging and then remove them in the finished program. Some of the other options are used to control compiler listing or printing.\r\n\r\nTape and I/O facilities are included for the program to store variables on tape and read them back in. It is non-standard for Pascal but is very powerful as just one statement can write out or read in any variable from one character up to a very large array.\r\n\r\nThe I/O ports used on the Spectrum can be read and written to by use of the INP function and the OUT procedure.\r\n\r\nA statement similar to INP, I (OUT(X,C) is used to output a character byte C to port X.\r\n\r\nStatements and functions are included to allow reading from and writing to RAM. Again non-standard for Pascal, these are taken from BASIC and are PEEK and POKE. Both are much more versatile than their BASIC equivalents as they can work with single characters up to entire arrays. For example, POKE (£AOOO, 'DAVID BOLTON') will deposit 12 characters in RAM from A000 onwards.\r\n\r\nAs well as the statements described above, there are a couple of features which are useful for the machine code programmer.\r\n\r\nINLINE is a statement which permits machine code to be directly embedded into the Pascal program. It is followed by a list of decimal or hexadecimal integers which represent the machine code.\r\n\r\nUSER is a function which is similar to BASIC'S USR, and permits calls to machine code routines external to the program. For example with the Spectrum, there are lot of useful ROM calls which can be incorporated into programs.\r\n\r\nNote that addresses can be also given in hexadecimal form; this is a more useful representation than decimal for integers, because any integer higher than 32767 must be given in negative form.\r\n\r\nThis is a very impressive product, and certainly one that could be of benefit to any Spectrum programmer once he/she has mastered BASIC and wants to advance.\r\n\r\nThe compiler is fast at its job and produces very quick machine code, and together with the ability to have machine code incorporated in the program should mean that there are not tasks which are better done in assembler than Pascal.\r\n\r\nNaturally there are some negative aspects, nothing's perfect, but I consider them fairly minor.\r\n\r\nApart from machine code speed, integer and real arithmetic, better data structuring, recursive procedures and functions, there is also for matted output where you can specify how numbers are written out, with rounding.\r\n\r\nFor the price of £25 you get the complete compiler/editor and a 60 page reference manual. This is not a teaching manual, so if you are unfamiliar with Pascal I would recommend purchase of a good book. The manual mentions a few at the back.","ReviewerComments":[],"OverallSummary":"","Page":"71,72","Denied":false,"Award":"Not Awarded","Reviewers":[{"Name":"David Bolton","Score":"","ScoreSuffix":""}],"ScreenshotText":[],"BlurbText":[],"TranscriptBy":"Chris Bourne","ReviewScores":null,"CompilationReviewScores":[]},{"Issue":{"Name":"Personal Computer News Issue 4, Apr 1983","Price":"","ReleaseDate":"1983-04-08","Editor":"Cyndy Miles","TotalPages":90,"HasCoverTape":false,"FlannelPanel":"CHARACTER SET\r\n\r\nEditorial\r\nEditor: Cyndy Miles\r\nAssistant Editor: Geof Wheelwright\r\nProduction Editor: Keith Parish\r\nSub-Editor: Peter Worlock\r\nNews Editor: Margaret Coffey\r\nNews Writers: David Guest, Wendy Pearson\r\nSoftware Editor: Shirley Fawcett\r\nSystems Editor: Max Phillips\r\nHardware Editor: Richard King\r\nPeripherals Editor: Ian Scales\r\nListings Editor: Sandra Grandison\r\nEditor's Assistant: Harriet Arnold\r\nArt Director: Jim Dansie\r\nArt Editor: Jimmy Egerton\r\nArt Assistant: Dolores Fairman\r\nPublishing Manager: Fiona Collier\r\n\r\nAdvertising\r\nAdvertisement Manager: Mark Eisen\r\nAssistant Advertisement Manager: Nic Jones\r\nSenior Sales Executive: Sue Hunter\r\nSales Executives: Robert Stallibrass, Matthew Parrot, Bettina Williams, Simon Treasure, Ian Whorley, Sarah Barron\r\nProduction Manager: Brian Humphrey\r\nMicroshop Production: Eva Wroblewska\r\nAdvertisement Assistant: Jenny Dunne\r\nSubscription Enquiries: Simon Maggs\r\nSubscription Address: [redacted]\r\nEditorial Address: [redacted]\r\nAdvertising Address: [redacted]\r\n\r\nPublished by\r\nVNU Business Publications\r\n[redacted]\r\n© VNU 1983. No material maybe reproduced in whole or in part without written consent from the copyright holders.\r\nTypeset by Quickset, [redacted]\r\nPrinted by Chase Web Offset, [redacted]\r\nDistributed by Seymour Press, [redacted]\r\n\r\nCover photography by Ian McKinell."},"MainText":"NAME: Hisoft Pascal 4T Compiler\r\nAPPLICATION: Pascal Programming\r\nSYSTEM: Spectrum 48K\r\nPRICE: £25\r\nPUBLISHER: Hisoft\r\nFORMAT: Cassette\r\nLANGUAGE: Z80 m/c (source)\r\nOTHER VERSIONS: None\r\nOUTLETS: Hisoft, Swindon [redacted]\r\n\r\nCOMPILE WITH ME...\r\n\r\nDavid Janda looks at a Pascal compiler that brings structured programming to the Spectrum.\r\n\r\nHisoft's' Pascal 4T compiler is both a Pascal compiler and a screen editor for the 48K Sinclair Spectrum. The advertising blurb for it says, 'now you and your children can learn to program in an efficient and structured way by using Pascal...'\r\n\r\nOf course, there's more to structured programming than just using a structured language, but Spectrum owners who realise the limitations of Sinclair Basic should still welcome the chance to program in a modular fashion.\r\n\r\nIt's a chance to switch to a compiled language which is really very different from Basic. This short but typical Pascal program illustrates this.\r\n\r\nPROGRAM DEMO;\r\nVAR I : iNTEGER;\r\nBEGIN\r\nFOR I := i TO 10 DO\r\nWRITELN(I,'Personal Computer News.');\r\nEND.\r\n\r\nThe HP4T package contains a screen editor for the Spectrum. This editor is not a separate file; it is part and parcel of the compiler. Its purpose is to allow you to enter and correct source code before compiling it.\r\n\r\nThe editor is line-oriented, so each line of Pascal must be preceded by a line number - numbers are either generated for you, or you may type them in.\r\n\r\nWhen HP4T is loaded from tape, the editor is entered automatically. You have 16 commands including those allowing you to enter text, display, SAVE, and LOAD it. More commands allow you to RUN your compiled program or alter a line of text.\r\n\r\nYou can SAVE the object code on cassette and then RUN the program later without needing to have the compiler present in the Spectrum. This is done by the compiler SAVEing the run-time system just before the program itself, which is SAVED in a special tape format.\r\n\r\nYou can also SAVE the Pascal source code onto tape, and this will allow you to build up a large program over a period of time.\r\n\r\nThe Pascal itself is a subset of the original Jensen and Wirth-defined language, with a number of extensions. Original Pascal has no commands like PEEK and POKE to access the system's memory, but they are included in HP4T. There is also INCH, which causes the keyboard to be scanned, and ENTER, which is similar to Basic's INT function. And the compiler will support the Sinclair ZX printer.\r\n\r\nHP4T does have some limitations. Files cannot be supported, since file handling is difficult on cassette. This could, however, be remedied when the Sinclair microdrive arrives. Passing FUNCTIONS and PROCEDURES as parameters is also not allowed, and many Pascal programmers will miss this sorely.\r\n\r\nPRESENTATION\r\n\r\nThe 60-page manual that comes with the package is quite comprehensive. Notes in the front detail the implementation-dependent features of this package, then the main section describes Pascal language features such as syntax, functions and procedures. I found it a little vague in places.\r\n\r\nIN USE\r\n\r\nThe compiler executes automatically as soon as you LOAD it. It then asks you: 'TopofRAM?', 'topofRAMfor'T'?'. and 'Table size?'.\r\n\r\nThese questions are a little daunting at first, but the manual does warn you about them. If you simply hit the return key to answer each one, the compiler sets default values.\r\n\r\nThe editor is now automatically invoked. I found it quite good, and any illegal commands I tried to enter result in a message of 'Pardon?' You can use the editor to enter your program, then enter a command to compile it.\r\n\r\nIf your source code contains any errors, the compiler stops and displays \"ERROR\", followed by an upwards arrow pointing at the offending piece of code. There are no messages describing what type of error you have made, but an error number allows you to look it up in the manual. Error messages will appear during RUNning if, for example, you don't have enough memory.\r\n\r\nThe package itself is very flexible. If you don't like the text editor, you can always use your own to create and alter source code. You can reset the top of RAM to allow you to add extensions to the compiler, or to store machine code programs to be RUN from Pascal.\r\n\r\nIt is also very fast, and this will be one of the main attractions as far as many people are concerned. I did a test count from 1 to 10000, and this was completed in less than a second. This is a lot faster than Sinclair Basic.\r\n\r\nRELIABILITY\r\n\r\nThe compiler turned out to be very robust indeed. My first attempt to crash the system while LOADing the compiler failed miserably. So did attempts to enter bad data to editing commands.\r\n\r\nThe documentation gives details of how to re-enter the compiler should you accidentally enter to Basic. Nevertheless, two problems did creep up occasionally.\r\n\r\nWhen listing the source-code the machine would sometimes 'hang up' resulting in me having to reset the machine. And although you should have the option to carry on compiling when the compiler comes across an error, this option didn't always work and resulted in a reset.\r\n\r\nI also found that some programs I SAVED to tape failed to LOAD, despite my changing tape recorders. I think this is due to the format in which the compiler SAVES object-code programs.\r\n\r\nVERDICT\r\n\r\nHP4T Pascal provides the Spectrum user with the ability to program in another language besides Basic - that must be good. This version is faithful to the original and you will therefore have few problems moving on to another Pascal system. However, the price does seem a little high.","ReviewerComments":[],"OverallSummary":"","Page":"55","Denied":false,"Award":"Not Awarded","Reviewers":[{"Name":"David Janda","Score":"4","ScoreSuffix":"/5"}],"ScreenshotText":[{"Text":"A typical Pascal syntax diagram - this one maps out the ways in which you can use Pascal's wide range of data types."}],"BlurbText":[],"TranscriptBy":"Chris Bourne","ReviewScores":[{"Header":"Features","Score":"5/5","Text":""},{"Header":"Presentation","Score":"3/5","Text":""},{"Header":"Performance","Score":"5/5","Text":""},{"Header":"User Interface","Score":"4/5","Text":""},{"Header":"Reliability","Score":"3/5","Text":""},{"Header":"Overall Value","Score":"4/5","Text":""}],"CompilationReviewScores":[]}]}]