Beebug
1st November 1987
Author: Dave Somers
Publisher: Tubelink
Machine: BBC/Electron
Published in Beebug Volume 6 Number 6
Advanced Basic (TubeLink)
Do you fancy running Basic V, the latest Archimedes version of BBC Basic, on your Beeb? Dave Somers takes a look at Tubelink's Advanced Basic which enables you to do just that, within limitations.
Advanced Basic from Tubelink provides you with a version of Archimedes Basic to run on a BBC Micro. However, you must have a 6502/65C102 second (or Turbo) processor for this to function correctly. The program will also work on an Electron if you have the PMS E2P second processor, or an adaptor to enable one of the above to be used. The disc version contains a ROM image for loading into Sideways RAM, or the EPROM version can be installed as usual. In both cases a 56 page A5 typeset instruction manual is provided, and this contains details of all the facilities available.
Advanced Basic is an extension of HiBasic 87, which is the fastest and most accurate version, so a copy of this is also provided on the disc (under licence from Acorn), for loading into sideways RAM.
Entering Advanced Basic is simplicity itself with the single command *ABASIC. There is a slight pause while the code is copied over the Tube before the familiar chevron ">" prompt appears.
Advanced Basic offers most of the facilities provided by Basic V with a few exceptions - mainly due to the lack of hardware on the Beeb which is specific to the Archimedes. Commands for controlling sound such as TEMPO, BEATS, etc., cannot be used, nor the TINT command and the four parameter COLOUR commands. If you attempt to use them, an error message is given. Entry-time syntax checking for missing quotes and brackets, and operations on whole arrays are not provided either.
Why change to Advanced Basic? There are several new programming structures available, with multiple line IF-THEN-ELSE-ENDIF statements, CASE-OF-WHEN-OTHERWISE-ENDCASE blocks, WHILE-ENDWHILE loops (which are a bit like REPEAT-UNTIL loops except that the condition is tested at the top, and not the bottom), and functions and procedures can now RETURN values via their parameters (as opposed to the other versions of BBC Basic where you can only send values).
Error trapping is now easier with additional commands at your disposal. You can, for instance, trap errors and handle then within loops, functions, or procedures without losing the nesting of such loops. The error message itself can be manipulated as it is contained in a string, REPORT$, thus making error handling code very easy to implement.
One of the more useful facilities is the ability to install function and procedure libraries. When developing software, you often build up a standard set of functions and procedures that you use frequently. By using the INSTALL or LIBRARY function, you can load a program containing these into memory. However, any functions or procedures are not shown in the listing of the program, but should your program make reference to one of them, the installed file is searched, and if the function or procedure is found, it is executed.
To use any mouse commands, you will need either the AMX Super ROM or Nidd Valley's Chauffeur ROM to be present in your machine. A simple driver program has to be loaded to interface Advanced Basic with the relevant ROM before Basic V style keywords (such as MOUSE) will work. However, no attempt has been made to drive an on-screen pointer, which may lead to difficulties when trying to run programs written on the Archimedes. Enhanced graphic commands such as CIRCLE, RECTANGLE, ELLIPSE, etc., can only be used effectively on a B or B+ if the Acorn Graphics Extension ROM is fitted. No such problem exists on the Master or Compact, where such facilities are already provided.
A unique feature specific to Advanced Basic is the EDITO command. It takes the same parameters as the LISTO command, and is used to select the program format when it is converted to text for use with the Editor.
The in-built assembler is an enhanced version of that on a Beeb or Master and a host of additional options is available. You can choose to assemble code directly to memory in either the 2nd processor or I/O processor, to shadow RAM, sideways RAM, or even to a disc file. The EQUiate facility has been enhanced with EQUR to assemble a 5 byte real number, and EQUF to link in a pre-assembled file.
Like Basic V, Advanced Basic has a keyword help facility, taking the format of HELP [keyword]. Unfortunately, due to memory limitations, the help text exists on disc and needs to be placed in the current library. This results in a long pause whilst the file is searched for the text to display. One advantage of such a system is that you can append your own help text onto the end of this file. So, for example, you could detail parameters for the *FX calls. Details of the file structure are given in the manual, although you will require View to make any amendments.
A whole host of new operators has been introduced. Binary values can now be entered directly by prefixing them with "%" - akin to the way that hex numbers are prefixed with "&". Integer variables can now be shifted arithmetically any number of bits either to the left or to the right. There is also a new indirection operator to allow for the poking and peeking of real numbers.
File Transfer
A utility is provided on the disc to transfer software from Beeb to Archimedes and vice versa using the serial RS423 port.
Final Comments
Advanced Basic enables you to take advantage of many of the facilities offered by Basic V on the Archimedes at a very modest cost. Using Advanced Basic is most addictive - all those extra commands and facilities enable quite complex Basic to be written with as little fuss as possible. However, there are some limitations imposed, as not all of the facilities of Basic V are available. It should be possible to write programs in Advanced Basic that will work on the Archimedes, but not all Archimedes programs will work in Advanced Basic.
Vital Statistics
Product: Advanced Basic
Supplier: Tubelink, P.O. Box 641, London NW9 8TF. Tel: 01-205 9393
Price: £29.95 (disc only), £34.95 (disc + EPROM)