Sinclair Library

Beyond BASIC

Programming: Assembler/Mcode · ZX-Spectrum 48K · 1 players · English

Sinclair Research Ltd · 1984 · Pound sterling 9.95

Inlay - Front 1 of 2
Inlay - Front
Not rated yetSign in to rate it

Discussion

Nobody has started a thread about this yet.

Start a thread

Play

Documents

Files and rights

Distribution permission is on record, granted to another archive rather than to this one. Screens and pictures are copied here; everything else links to the archive that holds it.

  • AllowedSinclair Research Ltd → WorldOfSpectrum

Credits

Sign in to credit somebody, or say what these people did.

Scores

In the magazines

  • Sinclair User #311984 · Gilbert Factor5/10
  • Personal Computer News #461984 · Overall Value3/5

Elsewhere on the web

  • WorldOfSpectrum 1 votes9.00

In the magazines 20

Big K #9Dec 1984 · p.69

Big K

Fin Fahey

THE EXTENDED SPECTRUM Fin Fahey checks out a smattering of utility programs for Old Rubber Keys. System Software, as we old computer industry hacks call programming tools, is hardly destined to set the world alight. It smacks of hard work and late night sessions over a hot keyboard and seems light years away from the glamour and fun of, say, a new Melbourne House adventure release. But for people interested in stretching their minds, and their machines, some of these trusty workhorses may well turn out to have hearts of gold. But why go beyond the facilities offered by Sinclair BASIC? (One may well ask.) Quite simply, no machine, and particularly no BASIC interpreter, fills all the needs of the budding programmer, and for a lot of requirements like arcade games, just hasn't got the speed. There area fair number of - packages which just add a few useful commands to BASIC extensions r programmer's toolkits, these generally give you the sort of goodies you've always needed to develop your BASIC programs. There's no line Renumber command on the Spectrum, and for this you'll have to buy a toolkit. The same goes for many other 'system' commands. Trace, to give you a continuous listing of program lines being executed, Map, to tell you which variables have been specified, and Block Delete, so you can get rid of more than one line at a time, to name but a few. Super Toolkit, from Nectarine, has all of these plus such things as a Crunch command, to get all those useless spaces and REMs out of your program before running. It clocks up a total of 12 commands, as does Toolkit from IMS Software, which includes an Auto line-numbering routine. Slightly fewer facilities on CP Software's Spectrum Extended BASIC, only 10 commands in this case, and the only one unique to this package is Find, which will look fora specific string text in your program. CP, however also do Supercode, a machine code toolkit, incorporating a hundred off-the-shelf machine code routines. These include an impressive range of scrolling effects, high-resolution diagonal scroll, low-resolution shutter and ripple scrolls and many others. There are four sound effects generators too, but the truly impressive thing is that you can include CP's code in your own BASIC and machine code programs, an amazing bit of altruism. Each routine has full in-program documentation and a demo mode shows you what they can do. It's got to be good value. From off-the-shell machine code to creating your own. If you've decided that BASIC's too slow for your program design, then you'll probably want to write machine code. Some people seem quite happy programming this byte by byte as BASIC POKEs, but for really effective development you'll need an assembler. Assemblers allow you to put Z80 code in assembly language, a much more understandable form, even though it's a lot more obscure looking than BASIC. A good assembler will allow you to specify addresses and constants as meaningful labels which makes the code a lot easier to follow. In such a symbolic assembler, the JP instruction (equivalent of BASIC GOTO) could be rendered JP LOOP instead of giving an actual address, say JP $4000. But before actually using one of these things, you may need to learn what it's all about. To help you, there are a number of tutorial programs, and some of these actually allow you to set up and test code. Sinclair's Beyond BASIC offers a tutorial on the internal structure of the Z80 plus lessons on each assembler instruction. These are illustrated with simple moving graphics. There is an experimenter section where you can watch the effects of your own code on memory and registers. Sadly, this one doesn't cover the entire instruction set. More complete is New Generation's Machine Code Tutor. This comes on two cassettes and covers everything. Once again, you can write your own code and 'run' it on a diagrammatic simulator. Although this is rather harder work than Sinclair's, I think it gives a closer feeling to using an actual assembler. Dream Software also have a simulator. This has much nicer printed documentation than the other two, but unfortunately it describes an imaginary chip which resembles the Z80 in many respects. I think that this may be unnecessarily confusing, but as long as its borne in mind, the transition to the real chip shouldn't be too hard. So now you can get down to some real coding... Sinclair themselves market the Zeus Assembler, which allows full symbolic instructions. Lines of code are entered much as in BASIC, and editing is similar, so this should be an easy one for beginners to move to. Picturesque's Editor/Assembler, on the other hand, has a rather better editor than the Spectrum, but the key response seemed a bit slow to me. This latter program is very tolerant about the format in which you enter code. Very different from these two is Oasis Software's Spectre Macro-assembler, and I certainly wouldn't recommend this one for beginners. It's a very professional product, but using it is more like learning a new computer language than anything else. It doesn't use Z80 instructions directly; they have to be set up as procedure definitions much as in high-level languages like Forth or Pascal. This makes it very powerful, since it's just like building your own interpreter. But, as I say, not for newcomers. An indispensable tool when developing machine code is some sort of Monitor. A Monitor provides easy ways of getting at memory, moving it, changing it, searching it for particular values, that sort of thing. You can also usually get dumps of Z80 register values and step through a machine code program. The Zeus assembler has a reasonable monitor with it, but Sinclair do a more extensive version as a separate product. This also allows you to Disassemble code, which means to translate machine code back to assembly format. Useful for looking at the ROM, but maybe you'd be better off buying one of the 'Spectrum ROM disassembled' type books which also give explanatory notes. Picturesque's Editor/Assembler has no attached monitor and you have to buy theirs separately, although both programs can be loaded at the same time. Agai, there's a disassembler. Assembly language isn't the only way of getting fast code. Scope II, from ISP, is a simple language aimed at producing fast machine-code animation. The makers call it a medium-level language, as it's mid-way between BASIC and assembler. I feel it's rather closer to machine code, but it's certainly a lot easier to use. Once you've written code in SCOPE II, it is boiled down by the program to machine code routines, which can be run without Scope being present, so you develop commercial products, or give copies of your games to your friends without fear of committing piracy. This process of boiling down machine code is known as compilation, and it's possible to do it to BASIC. The only BASIC compiler we had available to look at was Softek's. This is certainly fast. From running a few simple loops, it looks roughly about 150-200 times faster than interpreted BASIC. It does have some serious drawbacks, though. For one, there a quite a few BASIC functions it can't translate, floating-point arithmetic and arrays among them. More seriously, compiled programs will not run without Softek's run-time routines being present. Unfortunately, the company is being quite prickly about this, and are claiming that if you develop your program and compile it with their program. then they've suddenly acquired a share in it, Whatever the legal position, this seems a little dubious to me, and it's certainly a discouragement to using Softek's product for commercial development. The final approach to fast code is to use Forth. This high-level language is closer to machine code than BASIC, and for most purposes runs up to ten times faster. Not spectacular maybe, but it can make a difference. The speed saving is nice, but it's not really the central point about Forth. The language takes a fundamentally different approach to BASIC, and one which provides a much sounder design discipline. It would certainly be easier to write good machine code after a grounding in it. Forth is known as a 'procedure-oriented' language. That means there's no more complaining about there not being a command in BASIC to do something. If it's not there in Forth, then you just write your own command, which is compiled into the language vocabulary. Although you can theoretically do this in BASIC by using subroutines, compiled procedures are much faster and easier to use. Forth is easier to structure too. There are at least four versions of Forth available on the Spectrum. It's hard to decide between them, but Melbourne House's Abersoft Forth is the only one recognised by the independent Forth interest Group. Sinclair also do a Forth which to my relatively untutored mind seemed much the same, both in terms of speed and usability. Both versions have minimal printed documentation, since they rely on the user going out and acquiring a Forth manual. The sad thing about Forth is that. unless you're a fan of the ill-fated Jupiter Ace, you can't market any of your programs since they won't run without someone else's product. While on the subject of languages, Logo has been stirring up interest as a teaching language, particularly for younger children. Unfortunately, the version I looked at, Snail Logo by CP Software, really merited its name. Logo is high-resolution graphics oriented, and the user commands a 'turtle', or in this case a snail, to draw shapes on the screen. The CP interpreter turned out to be written in BASIC, so every command is interpreted twice. Slow? I can't imagine anyone, adult, or child, having the patience to work through the manual, let alone use it. Something of a weirdie, but one I find particularly fascinating, is Micro -Prolog, from Sinclair. Prolog represents yet another direction in new languages, and is particularly suited for Artificial Intelligence and linguistic purposes. Its very odd to use after command oriented type languages like BASIC, or even Forth, because a program in Prolog (it stands for PROgramming in LOGic) is mostly a way of organising data, not of setting up a fl ow of commands. Now I've got the point, I want to know more about this one. Sinclair Micro-Prolog's documentation isn't bad either. Dr Ming back to the problem of generating programs, if you're an adventure game writer, you haven't really got one, The Quill, from Gilsoft, and Dream's Dungeon Builder can both be used to generate adventures of any complexity. We've reviewed them before, and they're both good value. Dungeon Builder has the edge in user-friendliness, and can be used to add graphics to adventures, while Quill has a more mechanistic approach. Both Gilsoft and Dream are perfectly happy for people to market games produced with their packages. Right on! On which cheery note I'll roll the credits and fade to black, but not before noting that this is far from being a complete survey, so if you've discovered an utterly wonderful, or unspeakably awful bit of useful/useless software in this field let us know. BASIC EXTENSIONS: SUPER TOOLKIT from NECTARINE TOOLKIT from IMS Software SPECTRUM EXTENDED BASIC from CP Software Price: £9.95 SUPERCODE from CP Software Price: £9.95 MACHINE CODE TUTORIALS: BEYOND BASIC from Sinclair Price: £9.95 THE COMPLETE MACHINE. CODE TUTOR from New Generation Software Price: £7.95 MACHINE-CODE FOR BEGINNERS from Dream Software Price. £0.00 ASSEMBLERS: ZEUS ASSEMBLER from Sinclair Price: £12.95 EDITOR/ASSEMBLER from Picturesque Price: £8.50 SPECTRE MAC-MON from Oasis Software Price: £14.95 MONITORS: MONITOR/DISASSEMBLER from Sinclair Price: £12.95 SPECTRUM MONITOR from Picturesque Price: £7.50 COMPILER from Softek Price: £9.95 LANGUAGES: SCOPE II from ISP Price: £11.95 FORTH from Sinclair Price: £14.95 ABERSOFT FORTH from Melbourne House Price. £14.95 SNAIL LOGO from CP Software Price: £9.95 MICRO-PROLOG from Sinclair Price: £24.95 ADVENTURE GENERATORS: THE QUILL from Gilsoft Price: £11.95 DUNGEON BUILDER from Dream Software Price: £9.95

Sinclair User #31Oct 1984 · p.515/105/10

Sinclair User

Gilbert Factor 5/10

John Gilbert 5/10

STIMULATING SIMULATORS Machine code tutors take the agony out of assembler language by simulating the workings of the Z-80A processor. John Gilbert attends the tutorial. BEYOND BASIC Memory: 48K Price: £9.95 THE COMPLETE MACHINE CODE TUTOR Memory: 48K Price: £14.95 SPECTROSIM Memory: 48K Price: £7.95 ZX SPECTRUM ASSEMBLER Memory: 16/48K Price: £7.95 SPECTRE MAC-MON Memory: 48K Price: £14.95 SUPERCODE II Memory: 16/48K Price: £9.95 Until recently the term 'utility' has been used by software companies to mean any product which handles machine code, such as assemblers, disassemblers and toolkits. Those products help you to exploit the potential of the Spectrum giving enhanced graphics and sound and also provides aids for writing Basic programs such as line or block delete, memory available and REMkill. The utility market has, however, expanded to include programs which provide you with information on how to use machine code or assembler language. Those programs could be classified as educational but most of them also include utility routines which simulate the Spectrum Z-80A microprocessor and allow you to experiment with machine code in an environment controlled by the program so that any errors do not cause a crash. The first of such programs to be released was Beyond Basic produced by Sinclair Research with the help of Incognito Software. The back of the cassette package primes the purchaser for an adventure into the world of assembly language in which they will be guided by the Spectrum through the intricate workings of the Z80 processor. It is also claimed that the program will "take the agony out of machine code". That may be true but it also puts the agony into loading the program from cassette. Of the samples received at Sinclair User only one would load and that was after it had been coaxed through the tape deck several times. Unfortunately, the crashes made it evident that most of Beyond Basic has, ironically, been written in slow-moving Basic. It therefore has a greater tendency to crash and is slower and less polished than if the program had been written in machine code. Once loaded, the package displays four options, three of which correspond to sections of the program which deal with lessons and examples of assembly language and the fourth sends the machine back into Basic. The last option is pointless as you can go back into Basic at any time by pressing the BREAK key. The first section explains how information is stored within the Spectrum and provides details on the machine registers through which information is passed to and from the other chips and in which the results of calculations are stored. At first no machine code instructions are explained. The author provides a set of pseudo-instructions which are not Basic or machine code commands but bridge the gap between the two languages. You might think that is a good idea but could get confused when real assembly language instructions are introduced and the pseudo-instructions are discarded. The second section on the tape give a brief rundown of standard assembler mnemonics. The rundown is a little brief and explanations which would require a whole chapter in a book on the same subject are given only one or two screens. The final part of the tutor involves writing and running your own machine code program using the Beyond Basic version of a Z-80 simulator. Once the program has been entered you can watch how the registers and internal memory change as each instruction is effected. When it has run you can edit the lines of code and watch sections of your program run if de-bugging is necessary. The potential of a real simulator and effective lessons in machine code seems to have eluded Incognito with Beyond Basic. Sinclair Research states that the philosophy behind the package is one of simplicity. It is not simple to use, its style is not simple to learn from and it is certainly not simple to load. The Complete Machine Code Tutor, from New Generation Software, is unlike Beyond Basic in one respect: it is sample to use. It provides a series of 33 lessons covering all aspects of assembly language programming together with a powerful simulator program on which you can run examples and write your own routines without fear of fatal crashes. The simulator makes the package better than a book and the lessons are comprehensive enough to help even the beginner who has failed to learn from other texts. The package also succeeds because it does not adopt the style of the huge tomes about machine code which so often take pride of place in bookshops. It is also more helpful than a book as it draws attention to any ideas that you have failed to understand in a lesson. The package is very user-friendly in that respect and if an error does occur the computer not only locates and explains it but also gives you the opportunity to try again with some help from the Spectrum. It is hard to crash the Tutor, even when loading one of the lessons. If a tape-loading error occurs the Spectrum will not crash, which is the case with Beyond Basic, but a message is displayed on the screen showing that an error has occured and asking if you still want to load the next lesson. If not the package returns to the main menu of the previous set of lessons. The Complete Machine Code Tutor provides an excellent introduction to assembly language. It may not give the necessary spur to beginners who want to give up Basic and become machine code programmers but it will give an extra push to those who are already committed to going through the agony of learning machine code from a book. The same cannot be said of Spectrosim, from Shiva Software. As with Beyond Basic it is written in Sinclair Basic which, of course, the program is attempting to encourage users to replace with machine code. The package is a Z-80 simulator but has none of the power or attraction of its rival from New Generation. While The Complete Machine Code Tutor can handle 16-bit registers as well as eight-bit in its simulator, Spectrosim can only handle the eight-bit registers from A-D. No mention is made of the E, F, G, H, and L registers which all have special jobs within the Z-80. That means that the true power of the chip is not simulated. New Generation have an excuse for cutting back its simulator on the grounds of memory restrictions but Shiva has none. If the author could not get a full simulator to fit into 32K using Basic he should perhaps take lessons from his own book and write it in machine code to make it fit within the Spectrum RAM. That would have been better than releasing a product which many intermediate Basic programmers could write. The main menu of Spectrosim provides nine options, the titles of which may prove confusing to the beginner. For instance, the term 'load' is used twice in the menu. The first option is 'Load program'. You might think that you have to reach for the tape recorder and the LOAD key but the author means that you should start typing in a program from the keyboard. There is also a Tape-Load option but even someone with some knowledge of computer buzzwords might get confused at the terminology. The other main display within Spectrosim is one in which the contents of the Z-80 registers and flags are shown together with the current program name and the number of instructions which have been processed so far by the simulator. It is immediately obvious that only three of the six main system flags can be used by the simulator and those are Carry, Zero, and Sign. They are the most important of the flags that you can change but the omission of the others is a gross oversight. The best aspect of the package is the 44-page booklet included as an aid to working the simulator. It includes the assembly language instructions which can be used with the simulator, some of which do not correspond to Z-80 assembly mnemonics. It is, however, more helpful than the program could ever be in showing the potential of Z-80 code. Once you have finished learning about machine code you will need an assembler or monitor to help you put your program into the Spectrum. One of the only assemblers available for both the 16K and 48K machines as the ZX Spectrum Machine Code Assembler from McGraw Hill. The software allows the use of full standard Z-80 mnemonics and also includes the usual time-saving devices to make the computer assemble at a given address and define blocks of data or text strings within a program. If you make an error the program provides adequate error messages and allows you to correct the usual mistakes which often occur when you are learning about machine code. Unfortunately the way in which you have to write assembly language programs is made difficult by the program and errors are bound to creep into even an expert's program. The assembly code has to be typed into REM statements within a Basic program. That may seem to make the job easier but, without the neat display of a full screen editor with which most assemblers are equipped, your code will soon turn into a jumble of instructions. The other problem with the assembler is the instructions, or lack of them. The purchaser is supplied with eight pages of text which give a quick introduction to the program and a few example routines. It is written in a style that few beginners would understand and few experts will bother to read. The assembler may be as powerful as most others on the market but it will lose customers when they learn that the instructions are so sparse and the program is so unfriendly. If the assembler from McGraw-Hill does not sound enchanting then you might be more inclined to buy Spectre-Mac-Mon, a complete machine code development system from Oasis Software. The publisher has given it a grand name and the product certainly deserves it. The package includes a 48K assembier and a 16K monitor both of which are microdrive-compatible. Spectre-Mac, the Editor/Assembler, is the most impressive part of the package. The full-screen editor allows up to 254 characters on one line and will scroll sideways to the left when the cursor reaches the righthand side of the screen. The assembler includes commands which cover any eventuality, including searching code files, deleting blocks of lines, merging and copying files and replacing one part of a file with new code. There is also a help option which will give you the key names of all the commands available through the assembler without the need to look through the well-written manual. Spectre-Mac will also allow you to personalise commands so that you can replace the Z-80 instruction set with one of your own. That would be helpful if you had learnt assembly code programming from a book that did not use standard mnemonics. The tailoring of commands to your own needs is the icing on the cake as far as Spectre-Mac is concerned. It is an excellent product in its own right, but the addition of a monitor of an equally high standard on a separate tape makes the package even more attractive. Spectre-Mon provides disassembly functions on both ROM and RAM with the ability to run machine code programs, stepping through them one instruction at a time. Oasis has produced a powerful package which provides all the utilities which could be reasonably asked for by a machine code programmer. If, however, you do not want to write your own machine code routines you may want to use a toolkit such as SuperCode II from CP software. That package includes 120 routines which can be used either when writing programs or within them. It covers utilities for sound graphics, error trapping of Basic programs and program protection. Supercode also includes a novel routine for entering and replaying a voice or music with the aid of a microphone or tape recorder. The authors have thought of everything a Basic programmer might want to do in machine code but cannot.

Read it at Sinclair User Magazine Online

Personal Computer News #46Jan 1984 · p.543/53/54/54/53/53/53/5

Personal Computer News

Features 3/5

Documentation 3/5

Performance 4/5

Usability 4/5

Reliability 3/5

Overall Value 3/5

Ted Ball 3/5

NAME: Beyond Basic APPLICATION: Tutorial on fundamentals of assembly language SYSTEM: ZX Spectrum, 48K PRICE: £9.95 PUBLISHER: Sinclair Research FORMAT: Cassette LANGUAGE: Basic OUTLETS: Retail/Mail order BASIC PRINCIPLES This Spectrum program on machine code and assembly language may be too elementary says Ted Ball. Beyond Basic is a tutorial and simulaBtion program for the 48K Spectrum, designed as an easy introduction to some of the fundamental ideas behind machine code and assembly language. FEATURES Beyond Basic divides into three sections. The first two contain the tutorial material, which consists of a mixture of text and animated diagrams. The first covers how a computer is organised as a microprocessor with RAM and ROM, an explanation of the microprocessor registers and their use in some simple machine code instructions, as well as an animated demonstration of what happens in the memory and the micro-processor when a simple machine code program is running. The second section has more detail of the microprocessor registers and some of the simpler assembly language instructions for the Spectrum's Z80 microprocessor. Animated diagrams show what these assembly language instructions do. Finally, the last section, Experimentor, allows you to type in assembly language programs, using the instructions described in the second part of Beyond Basic. You can then run your program one instruction at a time, noting how each affects the registers and memory. You can also save programs on tape and load them back. PRESENTATION The cassette and a small booklet come in a colourfully labelled box. The booklet tells only how to set up the Spectrum and load the tape, and what the program is for. All the tutorial material is in the program. IN USE The program is menu-driven, with clear prompts on the screen, but one annoying feature is that in some menus you just have to press a key to move on while in others you have to press a key and then press the ENTER key. Beyond Basic is straightforward to use when working through the two tutorial sections in order: you just press a key to get to the next screen. However, when using the Experimentor section it is very tedious to refer to the other sections. You must go through the whole first section in order, and you can't get out of it before the end. In the second section, the Assembler Command Tutor, you can look up the explanation of a single instruction, but if you only want the screen that lists the instructions available you still have to go through one of the explanatory screens before you can get back to Experimentor. The editor for typing in and altering assembly language programs is very simple, allowing you only to insert, delete or replace whole lines, but it is adequate for the short programs you would want to try out. Beyond Basic is designed to teach the fundamental principles behind using machine code rather than teach assembly language programming, and the concepts introduced in the program have deliberately been kept simple. It does explain the principles simply and you should be able to work quickly through the tutorial sections and into the Experimentor whether you haven't studied machine code at all, or you have started on a textbook and had difficulty understanding it. There are, however, some points where Beyond Basic needs some improvement, without destroying its simplicity. Near the beginning it tells you that RAM addresses in the Spectrum run from 0 to 16K or 0 to 48K, which could cause problems for you later on as the RAM addresses actually start at 16K and go up from there. One basic topic not mentioned is the relation between machine code and assembly language. Many people have more difficulty understanding this than any of the topics that are covered in Beyond Basic. More guidance in using the Experimentor section of the program properly would be helpful. The question usually asked about the simple assembly language instructions explained in Beyond Basic is not 'what do they do?' but 'what can you do with them?' What is required is two or three example programs in the instruction booklet for you to type in and run, and some suggestions for simple programs that you can write yourself using the limited instruction set available in Beyond Basic. RELIABILITY On the whole, Beyond Basic is reliable, ignoring wrong keys in the menus as it does and telling you when you have typed in an incorrect assembly language instruction. However, there were two bugs in the Experimentor section. The first bug is minor - if you type in something like 'LD A,' where there should be something after the comma, it treats it as 'LD A,0'. The second bug is more serious: instructions of the form 'LD A,A'. 'ADD A,A'. 'CP A', 'SUB A' don't work properly. Executing one of these instructions leaves a dash or a blank as the value of A, and sometimes executing the next instruction gives a screen full of nonsense. VERDICT Beyond Basic goes a long way towards introducing fundamental ideas behind assembly language, but not quite far enough to justify a price of £9.95. It could be greatly improved, at little or no extra production cost, by including some reference information and some programming ideas in the instruction booklet.

Advert12
Feature2
Review2
News/Note1

Related

Tags
g225

Reviews from people here

Sign in to write about this, or make an account. It takes a minute and lets you correct the catalogue too.

This entry89% complete

No description recorded.

Sign in to correct or add to this.

See what has changed about this entry

Share this entry

Hold the rights to this and want it taken down?