A&B Computing
1st May 1983Categories: Letter | Machine Help | BASIC ROM Differences | Questions & Answers (BBC)
Author: Jeremy Ruston
Published in A&B Computing 1.01
Each issue our resident expert, Jeremy Ruston, will answer a selection of technical queries which are causing you problems
Disc Commands
Q. My BBC Micro has recently been upgraded with a disc interface. I hope to get some drives soon, but the interface came without a manual, so I don't know how. Also, I can't see how to use my old cassettes. I hope you can help me over these matters.
A. To answer your second query first, to use your old cassettes you must do two things. The first is to tell the computer to load programs from cassette rather than your (non-existent) disc drive. This can be done in two ways. The easiest way is to keep the Space Bar pressed down while you press Break. This will initialise the 1200 baud cassette system (in the same way, pressing 'D' whilst doing a Break initialised the disc filing system, and 'N' initialised the Econet filing system). If you want to use 300 baud cassettes, type *TAPE3. Once the computer has been instructed to use the cassette filing system, you must tell it to reclaim the area of memory normally used by the disc filing system by typing PAGE=&E00. This releases the normal cassette complement of memory.
These two steps are all that is required. (It is worth pointing out that the disc interface 'steals' 3K of memory from the user, by giving PAGE a default value of &1900 Hex. A useful fact, omitted from the disc User Guide, is that PAGE can be lowered to &1100 Hex quite safely, provided all you do with the disc system is SAVE and LOAD programs - in other words, if you use data files, you must leave PAGE at &1900 Hex.)
The disc interface does not come with a manual for the rather dubious reason than "non BBC drives cannot be guaranteed to work with the BBC Microcomputer". To get drives fitted to your computer, you must contact a dealer. Any dealer will fit the drives for you, and many of them sell drives much cheaper than the 'official' BBC drives. There is another reason for doing this - because you did not buy the official drives, you were not supplied with the BBC Utilities disc, which contains the vital program to enable you to format discs, without which the system is unusable.
However some dealers might be prepared to let you have one of these formatting programs. Alternatively, The Computer Users Club has its own utilities disc, which contains their own formatting program, which closely resembles the Acorn version, (The other programs on the disc are not of the highest standard, but are worth having.)
ASL A Bug?
Q. I have been having a great deal of trouble with the BBC assembler. A section of code looking like this in one of my programs refuses to work
ACC=&80
ASL ACC
A. The reason this will not work is due to an obscure 'feature' of the assembler. The assembler instruction ASL operates in a number of addressing notes. One of these is Accumulator addressing, as in "ASL A", which logically shifts left the Accumulator. However, the assembler reads all "ASL" instructions followed by the letter "A" as being "ASL A", and assumes anything following the "A" is a comment. Thus, your example becomes, in the assembler's mind, "ASL A / CC". The solution to this is to use "ASL (ACC)".
This way of commenting assembler programs, without using the backslash, is actually rather neat, but being undocumented, it has led to a number of problems, like the above.
Operating System Evolution
Q. I am very confused by the plethora of different ROMs and EPROMs fitted to BBC Micros. Exactly what are the differences between the operating systems and between BASIC I and BASIC II? I am sure there must be others who are similarly concerned.
A. The different operating systems have caused the most problems. When the BBC Micro first came out, what was effectively a provisional operating system was supplied. This was known as OS EPROM 0.10, soon to be followed by the same thing in ROM. Version 0.10 was really pretty terrible (but Acorn are taking an odd line on this, and will not automatically replace it for those stuck with it). Its major defects were a number of weird bugs and the inability to cope with plug-in ROMs, speech, discs or the RS423 interface. It was followed by a number of versions like 0.87, 0.49 and so on, which never achieved wide circulation, but which are nevertheless present. These were capable of supporting most peripherals, but were somewhat bug-ridden. The major breakthrough came with version 1.0, which was sent out with the early disc systems (in EPROMs).
Version 1.1 followed, but only small numbers made their way to the public. Version 1.2 is the new final version, and is now available in ROM. Most users will not notice what operating system they use, but it is worth obtaining 1.2, since many of the more serious software houses are beginning to issue programs which require its use.
The disc filing system has also appeared in a number of versions, but the differences are not significant.
The first version of BASIC sent out with the machines has been designated issue 1. It was more or less perfect, but contained a number of silly bugs:
- ELSE did not work in ON...GOTO/GOSUB statements.
- INSTR where the second argument is longer than the first caused chaos.
- Statements such as 'EVAL("TIME")' did not work.
- ABS with a positive integer argument often returned a string.
- Changing MODE did not reset COUNT.
There are others, but they only arise in odd circumstances. BASIC II avoids these bugs, and adds one new command and some new assembler features. The new command is OSCLI, which takes a string argument, and passes it to the operating system. This allows you to use statements such as OSCLI "KEY "+STR$(T%)+"hello", i.e. commands normally used with the asterisk prefix can be written in such a way that the parameters of the OS commands are not known at run time. (Both BASICs provide an undocumented command which is very useful when using OSCLI, or its BASIC I equivalent (see User Guide p. 463). This is STR$(X%), which returns a string of hexadecimal characters equivalent to X%. Thus, one can write 'OSCLI "LOAD "+FILE$+" "+STR$ = (SPACE%)".
The new assembler features are even more useful. EQUB, EQUD, EQUW and EQUS can be used to insert bytes, double bytes, 32-bit words and strings directly into assembly language programs. In addition, OPT now has a range from 0-7, the top bit allowing the code to be put at O%, rather than P%. This makes it possible to assemble code at a place other than where it will be executed.
The new BASIC really deserves an article to itself!
Flickering Modes On Contec TV
Q. The picture of my BBC Micro flickers terribly when in MODES 0-6. Will this damage my Contec TV?
A. No damage will result, but you may still like to eliminate the flicker by typing '*TV 0,1' before you enter any of the above modes.
View Vs. Wordwise
Q. Would you recommend View over Wordwise for simple word processing?
A. View and Wordwise are (currently) the only proper word-processing programs available for the BBC Micro. Both come in ROM, and both require operating system 1.0 or greater. There, the similarities end.
Wordwise> is 8K long, while VIEW is a full 16K. Thus, VIEW is definitely more complex and more capable. Given that, there are still a lot of factors to consider when deciding between them. Being simpler, Wordwise is probably easier to use. Thus, you must offset capabilities with ease of use, then the decision is up to you. If you have ever used WordStar on CP/M computers, you will feel at home with View, because View can be viewed (?) as a usable version of the same. As a point of interest, I am using Wordwise at the moment, and experiencing no problems. I use Wordwise for all writing.
Printer Recommendation
Q. Which printer should I buy for my BBC Micro?
A. I am not in a position to say "rush out and buy XYZ printer", for the simple reason that I only have experience of a limited number of printers. Most people seem to use the Epson MX-80 myself included - which is a reliable and versatile workhorse.
The NEC range has fervent supporters, and it appears to be a good buy. The Seikosha range is cheap but the typeface does not appear very legible. A last minute contender is the Olivetti ink jet printer, marketed by Acorn (Olivetti also make the BBC single disc drive). The ink jet is as quiet as you could wish and handles high-resolution graphics as competently as the others, but the typeface seems to let it down a little. Long term reliability has yet to be seen, but I should look closely at it.
WHILE WEND Dropped?
Q. Why is there no 'WHILE WEND' construction in BBC BASIC?
A. I can only guess at the answer to this question, but the following explanation seems as likely as any other.
First, I had better describe what 'WHILE WEND' means. The 'WHILE-WEND' construction is part of the armoury of Pascal, and as such is expected in structured BASIC. It is similar to 'REPEAT-UNTIL' except that the terminating condition follows the word 'WHILE' and thus appears at the top of the loop, rather than the bottom. The action of the loop is that when the word 'WHILE' is encountered, the expression following it is evaluated. If the condition is TRUE, the program continues in the normal way, but remembers where the word 'WHILE' appeared and jumps back to this spot when the word 'WEND' is encountered. If the condition is FALSE, it jumps over the body of the loop, to the statement after the word 'WEND'. Thus, the construction carries out code until a condition is met, but by virtue of having the condition at the start of the loop, the entire contents of the loop can be skipped if required. This makes it very useful in a number of circumstances.
To hazard a guess at why it does not appear in BBC BASIC (even though it was mentioned in the early language specifications of 1981), I think that the interpreter would have problems when situations like the following arose:
WHILE condition
IF another condition THEN
WEND
WEND
In these circumstances, if the initial condition is false, which 'WEND' statement does the computer jump to? The obvious solution is to jump to the start of the IF statement, but if some of the variables in the 'IF' statement's condition are defined between the 'WHILE' and the 'IF' statement, a 'No such variable' message would have to be issued. All this would lead to the situation where 'WHILE' would only work some of the time in the way the programmer intended, which would be mightily confusing. I imagine that Acorn decided that to avoid the confusion, the construction should be left out entirely, which would appear to be a wise decision.
This article was converted to a web page from the following pages of A&B Computing 1.01.