Yellow Pig's BBC Computer Pages

The BBC Master 512

Extra Info Index | GEM Config | FIDDLOAD | Key Correspondence
Control Sequences | Disk Formats | Screen | Interrupts | XIOS | The Tube

About the 512 | Outline | Bibliography | Problems | Software | Photos | Index

Key Correspondence

When you look at a BBC Master 512 and a "normal" PC-compatible computer, perhaps the first thing you notice is that the keyboards are different. If you look slightly closer, you see that there is more to this difference than just the colour!

The original PC keyboard had 83 keys, and many laptops still have keyboards similar to this. Most desktop PCs sold in the UK have a keyboard based on the standard "enhanced" keyboard with 102 keys, though there are often a few extras on modern ones. (The American version had 101 keys, lacking the "£" symbol.)

If you count the keys of a BBC Master you will find there are 93 of them. However this is a little deceptive because, unlike on a PC, the two Shift keys are wired together so a program cannot tell them apart. Also the BBC's Break key is nearer to a PC's reset button than to one of its standard keys. We have to say, then, that to all intents and purposes the Master's keyboard has 91 keys. This seems to put it somewhere between the two basic varieties of PC keyboard.

The 512 co-processor can also be run perfectly well using a Model B or B+ as host. This has a keyboard with only 72 keys (again not counting Break and the second Shift key). This is fewer than any PC, and can occasionally be limiting.

The operating system of the Master 512 was designed to make the keyboard operate as closely as possible to that of a true PC. On the whole this was done fairly logically, but there were a few oddities. A key correspondence chart was provided as part of the 512 package, but it did not include everything (and often got lost). This web page lists all the differences between the values generated by the keys of the Master 512 and those of a PC. If you have a Model B or B+ as host, then you have exactly the same keys as on a Master, except for the numeric keypad.

There is one complication. On a true PC running under MS-DOS there are two different functions that programs can use to read the value of a keypress. The "old" method works on all keyboards but it will not recognise certain keys and combinations (eg it will not detect presses of F11 or F12). The "new" method will only work with the enhanced keyboard and it will recognise certain other keypresses. Some programs test whether a machine has an enhanced keyboard, and they will use the appropriate method of reading it. The 512's keyboard looks like an "old style" PC keyboard to these programs, but a few values normally only obtainable with the enhanced keyboard can be generated on the 512. These are all noted in what follows.

Note that there is a further method of reading the keyboard, which is to read the hardware directly rather than through DOS. Programs that do this will not work at all on the 512, because the physical hardware is very different from a true PC (though they sometimes will work if you are running PCCE). It is mainly "arcade" games and "pop-up" programs which use this technique.

It is worth remembering that a keypress on a PC returns two values – an ASCII value and a scan code. For most "normal" keypresses (numerals, letters, punctuation symbols) the ASCII value is non-zero, and most programs ignore the scan codes for these. Other keypresses (function keys, cursor keys, Alt combinations, etc) generate an ASCII value of 0. For these the scan code becomes important.

Many programs allow you to re-define keys to your own preferences. This file may help you to do the job, since often you have to specify the keys by their "PC-values".

The remainder of this file is a list of all the non-obvious ways in which the Master 512's keyboard differs from a PC's.

We start with the one that every user knows, and the others that most users will have found out:

         The Master 512's "Copy" key corresponds to the PC's "Alt".
  In what follows this is referred to as Copy(Alt).
    The Master's "Shift Lock" works like the PC's "Num Lock". It reverses the effect of "Shift" on every key of the numeric keypad (except for "*"). The "Shift Lock" LED is lit if "Num Lock" is on.
    "Delete" on the Master's main keyboard works like "Back-space" on the PC. The keypad "Delete" is the same as the PC's "Delete".
    The BBC has 10 function keys, numbered f0 to f9. By contrast, PCs usually have either 10 or 12 function keys, numbered F1 to F10 or F12. To make the correspondence as simple as possible, the BBC's f0 key works like a PC's F10 key.
    The BBC's brown "arrow" keys work like the PC's when unshifted. With "Shift", "up" and "down" become "Pg Up" and "Pg Down", "left" and "right" rather oddly become "Ctrl-Left" and "Ctrl-Right".

On the whole, the keys on the numeric keypad which have corresponding keys on the numeric keypad of a PC work in the same way on the different machines. These are the number keys, "Return" (becomes "Enter"), "Delete", "+", "-", "*" and "/". (Some PC keyboards do not have a second "/" key.)

   When unshifted the number keys are "arrow" keys, "Pg Up", "Pg Down", "Home", "End" and "Insert" (according to the pattern on the supplied chart – the same layout as on a standard PC).
  With Shift (or Shift Lock (= Num Lock)), these keys work as numbers.
  Shifting the keypad "Delete" turns it into "." as on a standard PC. (The BBC's keypad has a separate "." key, the PC's does not.)

Note that Pressing "Shift keypad *" returns the ASCII value 183. Why it does this I have no idea – it is quite different from anything on a PC, and is the only keypress combination which returns a ASCII value greater than 127. (Maybe it is a bug!)

  "Ctrl" with all these keys works as it does on a PC with an old style keyboard (except that "/" and "*" still return a value – same as the unshifted form).
  Copy(Alt) works with the numbers in the same way as Alt on a PC – hold the key down and enter a decimal number, then when you release the key you have entered a keypress with the number as its ASCII value.
  Copy(Alt) has no effect on the non-numeric keys of the keypad, except for "*" which returns the value it would on an enhanced keyboard.
    As noted above, on the 512 programs cannot distinguish between the two "Shift" keys. Pressing either of them is equivalent to pressing both "Shift" keys on a PC. The second status byte (which allows a program to separate the two "Ctrl" keys and the two "Alt" keys) is not implemented at all on the 512, but the old style PC keyboard only had one Ctrl and one Alt key, so few programs use the possible distinctions.

Because of the different arrangement on the keys of the punctuation and other symbols, a few keys return slightly odd values with Copy(Alt). Ones you may not have come across, all yielding ASCII value 0, are:

      Copy(Alt) ^ corresponds to    Alt ` (reverse apostrophe) (scan code 41)
  Copy(Alt) @ "   "   Alt ' (scan code 40)
  Copy(Alt) _ "   "   Alt = (scan code 131)

In addition to these, there are a few rather strange correspondences involving combinations with Ctrl and Copy(Alt). These all yield keypress values normally only obtainable on an enhanced keyboard (except for Ctrl-Home). All give an ASCII value of 0. They are:

      Ctrl Left-arrow corresponds to    F11 (scan code 133)
  Ctrl Right-arrow "   "   F12 (scan code 134)
  Copy(Alt) Left-arrow "   "   Shift F11 (scan code 135)
  Copy(Alt) Right-arrow "   "   Shift F12 (scan code 136)
  Copy(Alt) Up-arrow "   "   Ctrl F11 (scan code 137)
  Copy(Alt) Down-arrow "   "   Ctrl keypad + (scan code 144)
  Copy(Alt) Escape "   "   Ctrl Home (scan code 119)
  Apart from those just listed, other keypress values normally only obtainable on the enhanced keyboard of the PC cannot be achieved with the Master 512.
    One key which does not normally exist on a PC is the keypad "#". When unshifted or with "Shift" or "Copy(Alt)" it toggles the "Scroll Lock" setting. However, unlike a true PC's "Scroll Lock" key, it also returns a value (ASCII 0, scan code 70) – one that does not exist on a normal PC keyboard. Pressing "Ctrl" with the keypad "#" is equivalent to the PC's "Ctrl-Break" (which works rather like "Ctrl-C").

In addition to the keypad # key mentioned above, two key combinations produce keypress values (again with ASCII value 0) which do not occur on normal PC keyboards. These are:

      Copy(Alt) :   giving   scan code 42
  Copy(Alt) Space " scan code 57

Extra Info Index | GEM Config | FIDDLOAD | Key Correspondence
Control Sequences | Disk Formats | Screen | Interrupts | XIOS | The Tube

About the 512 | Outline | Bibliography | Problems | Software | Photos | Index