Previous column ComputerAnswers    Next column ComputerAnswers


ComputerAnswers Column 25


Copyright 1984-1989 Simon N Goodwin

(* SUB: Please make sure the Feedback runs this month *)


As a BBC Micro programmer I need to know the difference between versions of the Acorn BBC Micro operating system: e.g. versions 0.1, 1.0, 1.2. What is the difference between Basic 1 and Basic 2? How can I be sure that my programs will run on any version?
Kevin Murphy, Purley, Surrey.

The BBC Micro was developed in a great rush, and the first machines had an early operating system which did not really live up to the computer's specification. The RS-232 input routines were missing, tape-handling was unreliable and there was no support for disks or extra 'sideways' ROMs. Nonetheless, Acorn issued version 0.1 of the operating system until late 1982, when they produced version 1.0, available as a plug-in upgrade for a few pounds. Version 1.0 fixed most of the early bugs and supported the disk system, although a rare version 0.9 was better in some respects.

Version 1.0 was a stop-gap product. The current standard is version 1.2, which is fitted in new and middle-aged machines. OS 1.2 supports the 'tube' - Acorn's interface for extra processors - fully, and improves disk handling. The operating systems are upwards compatible, as long as you use the 'official entry points' to gain access to the ROM. Version 1.2 implements these entry points most fully, but for maximum compatibility you should obtain a copy of version 0.1 and use it to test your programs.

The first BBC Micro Basic was relatively free of bugs, and appeared in the first 100,000 machines. Acorn then produced Basic 2, which they still sell as an upgrade. This had improved file-handling and a useful new command - OSCLI - to pass parameters to the operating system. In general Basic 1 programs will run happily under Basic 2, but unfortunately Acorn has changed some of the 'tokens' used to encode the language, so weird results can crop up if programs are SAVEd on one version and LOADed on another. You can avoid this by handling programs in a rather more verbose 'ASCII' form, using (as far as I can remember) *SPOOL and *EXEC.

Acorn has produced two more versions of BBC Basic. Basic 3 was a trivial upgrade supplied with computers intended for the American market; it was also supplied with some 'second processor' expansion systems. Nowadays Basic 4 is best - this has nice new commands like ON..PROC for computed calls, improved editing and list formatting, and TIME$ to read the real-time clock. Basic 4 is the fastest yet from Acorn, especially for complicated number- crunching. It makes use of special instructions allowed by the CMOS processor in 'Turbo' and 'Master series' computers, so it won't work on earlier machines.


I need a program that will let me input music, either as coded notes or from a keyboard, transpose between keys and print out the results in the form of conventional music staves. I realise that this may be a narrow field of interest; any signposts at all would help.
Gordon Snow, New Marston, Oxford.

There are lots of systems that will do what you ask. The best choice depends upon your musical background, your application, and the capacity of your wallet! The industry tends to treat this as two linked markets. Publishers make separate 'performer' and 'composer' packages which can generally be paired as you wish.

Performer systems load and record musical notes from a musical keyboard or any instrument with a MIDI (Musical Instrument Digital Interface) port. Most modern synthesisers support MIDI; you can buy interfaces for older synths, guitars and even mouth-organs! A MIDI interface is built into the Atari ST, and available as an add-on for most other computers.

Once you've loaded the music - as you play or step by step - you need to be able to edit it. This is where the 'composer' part of the system comes in. This works like a word-processor, letting you edit music, move or transpose lines, copy sections and generally fiddle around. The results can be played back through the computer's sound chip or via the MIDI port to a synthesiser. Printouts are obtained, depending upon the package, from a pen plotter, laser copier or dot matrix printer, in descending order of quality.

The top-flight packages run on Apple's stylish but costly Macintosh system. Performer and Composer packages cost about £725 in total, plus £185 for an adapter to turn the Mac's telephone port into a MIDI interface. You'll also need a Mac Plus and an Apple printer. To find out more, contact the Mac Musos at Rod Argent's Keyboards, 20 Denmark Street London WC2 (01 379 6690).

Syndromic Music, of 24 Avenue Mews London N10, caters for Commodore 64, IBM PC and Atari ST users. The 64 was a popular tool amongst professional musicians a year ago; nowadays the pros use more expensive micros with extra memory and better graphics, but it is quite possible to get good results from a 64 plus £150 worth of add-ons.

If you can afford a bigger computer Syndromic recommended the 'Easy Track' and 'Easy Score' packages for the ST. Those programs cost £60 and £90 respectively, and produce a neat printout on an Epson or Star printer.

The neatest notation I have seen comes from a package that runs on the IBM personal computer, or 'clones' thereof. Oxford University Press distribute a PC package that converts codes into written music, precisely drawn with a pen on a plotter. It is exciting to see this system in action, although musicians may not find it particularly user- friendly. Syndromic Music (01 444 9126) have the details.

If you've already got a home computer the people to talk to are Electromusic Research (0702 335747). EMR produce cheap MIDI interfaces and dot-matrix printout software for Spectrum, Commodore 64, Acorn and Amstrad home machines.


I have a Sinclair QL, and would like to know whether it is possible to enter data into Basic by editing a default value. The Archive database has this facility, but I don't want to learn a new language. The QL's INPUT statement requires you to re-type the entire entry - you can't 'pick up' and modify the old value.
D Valente, Clarkston, Glasgow.

The facility you describe is not built in to the QL's Superbasic, but extensions for the interpreter are widely available. 'Turbo Toolkit', from Digital Precision (01 527 5493) provides a stack of useful commands, including EDIT%, EDIT$ and EDITF. These functions display any string on the screen and allow it to be edited like a Basic line. You can set the maximum field length at will; the result is automatically checked, to prevent 'error in expression' reports, and returned as an integer, string or number. Turbo Toolkit costs £24.95; the EDIT functions are only a small part of the package, which contains another 60 commands and over a hundred example programs. DP are at 222 The Avenue, London E4 9SE.

Breakthrough Software (0763 45482) advertise similar functions called GETN and GETF, but these are only available as 'extras' when you purchase other items; I haven't had a chance to test them.


Part of the keyboard on the Amstrad PCW 8256 can be converted to a numeric pad by pressing ALT with RELAY. Unfortunately this prevents the rest of the keyboard being fully used under CP/M - for example, the letter 'M' cannot be typed. Is it possible to switch the numeric keyboard on and off with a programmable command?
Alan Ratcliffe, Stocksfield, Northumberland.

Amstrad do not know of any way to turn the pad on from a program, although a keen hacker ought to be able to work out a POKE to do it. The PCW does all its keyboard scanning and decoding in software, so the system presumably keeps a record of the meaning of each key.

Apparently late versions of CP/M Plus support this feature, but Amstrad - understandably - say that the missing control is 'not a bug' so you're not entitled to a free upgrade. You can get the required effect by re-programming the keys with SETKEYS, although this is not as easy as using a software switch. Alternatively it would not be too difficult to convert key-codes as they are read into your program.


I am about to buy a new computer. I am attracted to the IBM PC, or one of its compatibles, but one point confuses me. In the IBM family there are the PC, XT and AT. It seems that these are not 100 per cent compatible, and this also applies to the various 'IBM clones'. Am I correct and, if so, what is the difference between the three models?
Richard J Fullford, Fallingbostel, West Germany.

The original 1981 IBM PC had a very limited basic configuration, with no disks, little memory and Basic in ROM. Most people bought an expanded system, so IBM scrapped the original simple PC hardware when they launched the XT, an expanded model equipped with a hard disk. Modern IBM PCs are just XTs without the hard disk card, so the PC and XT are almost totally compatible.

The PC and the XT both use 320K floppy disks and a simple processor called an 8088. This is a version of the Intel 8086, an early 16 bit microprocessor, which is adapted to use a slow but cheap eight-bit data bus. In other words, the XT's processor can only transmit and receive data one character at a time, albeit very quickly. Many clones, such as the Amstrad PC 1512, use the full 16-bit 8086, which transmits 16 bits - two characters - at a time. Apart from this difference the 8088 and the 8086 are very similar - virtually the only difference is the speed of operation.

Another way of speeding up a computer is to change the 'clock speed' - the pulse that determines when the processor must perform the next step in a computation. The PC and XT use a clock speed of 4.77 Mhz, whereas the Amstrad and other 'clones' run at 8 MHz - eight million pulses a second. It is NOT sensible to compare the clock speed of machines unless they have the same processor and type of memory, because the amount of work done in each step varies wildly between different processors.

Once you've exhausted the potential of the 8086 you must use a more powerful processor to get extra performance. Intel's 80186, 80286 and 80386 processors are successive attempts to remove bottlenecks in the crude 8086 design. Each version is faster and - inevitably - a little less compatible than the one before. Current system software does not make full use of the quirks of these beefed-up chips.

IBM's PC AT uses the 80186 processor but complicates things by packing 80 concentric tracks onto each floppy disk, rather than 40 as on the PC. You can read and format 40 track disks on either machine (the AT can skip alternate tracks). Compatability is still rather uncertain, and things go wrong if you try to write data with a different type of system to that which formatted the disk.

There are several other things that can affect compatibility. For instance, a genuine IBM uses certain fixed codes to control the display and the serial port, and some of these are different on the Amstrad PC. That doesn't matter if you use the hardware and software supplied, but you can run into problems if you try to plug in a new graphics board (which can't turn off Amstrad's circuitry) or your new software tries to talk to IBM components directly. Well-behaved software will communicate via a built-in program called the BIOS (Basic Input Output System), which translates requests to allow for the quirks of a particular design. Some BIOS programs work better than others...

The only way to ensure the compatibility of a machine is to test it with your chosen software or hardware. If you're not sure what programs you're going to use, Lotus'Symphony and Microsoft's Flight Simulator are good generic tests - they both flog the hardware to death!


Could you please tell me if the following algorithm about cryptography is a new one, or a reinvention of the wheel?

The sender and receiver each have an identical large array with the alphabet, plus a 'garbage' character, randomly distributed throughout. In other words, the array contains 27 disjoint sets. To encipher a message the sender picks symbols as required from the array, deleting entries as they are used and transmitting the array index for each entry. The indices of 'garbage' characters are scattered through the data at random. To decipher the message the receiver simply uses the indices to look up letters at corresponding positions in the array. Garbage characters are ignored. With this method there is no frequency distribution of any kind.
G. Costopoulos, Athens, Greece.

This is a well-known technique, I'm afraid, although the idea of the 'garbage character' does add a little spice. Your array plays the part of a conventional code-book, as used by diplomats and soldiers for centuries. It is a fairly effective system as long as the books are kept secret and the users have plenty of time to encode and decode messages.

Your computerised solution speeds up the technique, as did the German 'Enigma' code machine. Enigma was a clever mechanical implementation of your idea: its mechanism simulated several small code-books used in succession. The Enigma code was cracked at Bletchley Park during the Second World War, by people who helped to develop the modern computer.

Your final statement is correct, but only if the random function which you refer to repeatedly is totally unpredictable. Most computer 'random number generators', although good enough for games and simple probabilistic programming, would let you down.

There are many other ways to encypher data. Two classic books about code are 'Elementary Cryptoanalysis' by Abraham Sinkov, and 'Cryptoanalysis' by Helen Gaines. There's no shortage of other titles if you can't find these.


We are working on a word-processor for the Commodore 128, and would like to konw if it is possible to program the machine to display 80 columns on a TV screen. We are working in both 64 and 128 mode.
Dane Young, Hallstahammar, Sweden.

As you must realise, the 80 column display built in to the 128 will only drive an expensive RGB monitor. The normal TV display only produces 40 characters on each line, but it is possible to increase this with some fairly simple machine code software. Basic is fast enough for experimentation but unlikely to be able to keep up with a typist.

Normally, each character is displayed in an eight by eight 'pixel' grid of points. The machine can show 320 pixels across each line of the screen, so resolution is limited to 320/8 = 40 characters. To get more characters you must reduce the width of each one.

You need a gap of at least one point between one letter and the next, and three points is an absolute minimum width to represent the entire character set recognisably, so you can fit 80 characters on a line if you use four pixels per character, squashing two re-defined characters into one space on the 40 column screen. It is quite practical to mix the two formats.

You must define a new narrow character set, and write a small machine code program to mask groups of patterns corresponding to text into the display memory. This technique is used to give many Spectrum word processors a 64-column display with only 256 points on a line. The characters will look a little ragged, but they should be clearly readable as the TV is displaying no more points than usual.


LABELS AND THE EP44. Several readers have come to the rescue of Leslie Fahidy, who was having trouble addressing envelopes with a Brother EP-44 printer. John R. Bradley swears by 'Butterfly perforated gummed address labels', which are available from most stationers. Martin Lipman's missive was neatly printed with a standard carbon ribbon on glossy paper labels. He warns that the print-head can be damaged if thick envelopes are stuffed into the EP-44. Alan Chivers explains that the printer is not designed to put pressure on the paper, as it works by thermal transfer. He says that 'only the cheapest envelopes seem to be thin enough to give a satisfactory result.' Alan recommends W.H Smiths' brown envelopes, or the white ones supplied with cheap greetings cards.

ANDROMEDA ZITA: Michael Parker has sent a telex to say that he used to work for the makers of this machine as Software Manager. He has a copy of the unreleased program to format disks, and can be contacted on 01 351 2468, or One to One Email MBX MIKEP. Thanks also to Vic Dorman, who wrote in offering the formatted disks he was left with when his Zita Alfa 'died aged 15 months'.

SILENT 700: A Squires has written in offering manuals for C.A Salter's Silent 700 printer. Unfortunately, Mr. Salter, I've mislaid your address, for which I apologise. Please write again if you still need information.

DOT MATRIX STENCILS: D.G Bell has sent in a clearly printed newsletter, 'The Eagle of the North' to prove that duplicating stencils can be cut with a dot matrix printer. David uses an NEC 8023 with unbranded stencils, although Gestetner recommend their 'Memory 4' range. The trick, apparently, is to leave an old, dry fabric ribbon in the machine while stencil-cutting.

COLOUR, CHROMA and CHROMINANCE: Mr. R.A Ashworth has contacted me in writing and at the PCW show, offering extra information about colour displays, discussed in the September PCW. Mr. Ashworth works in the surface colour business and found the TV industry terms in my reply rather alien. After some research he has found that displays use TWO chrominance signals internally. These represent the difference in level between the luminance and two out of three of the primary RGB signals (it is easy to compute the third). This format makes it simple to drive a variety of display phosphors. Users can still work with red, green and blue intensities, as I stated in my answer - the conversion is handled by the display circuits.

HELP NEEDED: Patrick Nevison needs information about the 24 switches inside a DLE-SB 2123D modem. Marshall P Brown has an Oberon Omnireader, but no documentation or software for his Apple 2 Plus. Sadly, Oberon have gone out of business. Please write to PCW if you can help.

Link to the top of this document    Link to the main index
Previous column ComputerAnswers    Next column ComputerAnswers