6502 by dbhqGitHub

All machines

Electron

1983, Acorn, 6502, 2 MHz.

Acceptance test ElectronAcceptanceTests: 4 passing.

It models the keyboard, the picture in screen modes 0 to 6, the one-bit sound, and the cassette, with tapes as UEF files, on OS 1.00 and BBC BASIC 2.

An original Acorn Electron from the front left and above, on a blue cloth: a cream case with a dark grey panel across the top bearing the acorn electron name and a green acorn, and a cream keyboard with keyword legends on its keys, ESCAPE and BREAK in the top row and a long space bar.
Photograph: an original Acorn Electron, taken 18 February 2018.By simon.inns. Source: commons.wikimedia.org. Licence: CC BY 2.0. Changes: resized and converted to WebP for this page.

The machine

The picture is the machine's own, pixel for pixel, as the model of its ULA draws it, in the television's shape. It models the picture, not a television: no scan lines, glow or curve.

With the screen focused, your keyboard types into the Electron, each key by its place, and the machine's own keys below take a tap or a click. Tab moves on, so the page never keeps the keyboard.

The Electron runs in your browser and needs JavaScript. Without it, the page and the program below are shown, but nothing runs.

Sound is off.

The cassette recorder

No tape in the recorder.

Motor off.

To save: press Blank tape, type SAVE "NAME" and press RETURN, then RETURN again when the machine says RECORD then RETURN. When the prompt is back, Save tape downloads the tape as a .uef file. To load: drop a .uef tape image on the page, or press Insert a tape, then type LOAD "" and press RETURN. The file is read in this tab and is not uploaded anywhere. A tape the machine cannot read is refused with the reason, and the tape that was in stays in.

A tape plays at the Electron's own pace, as a cassette does, and nothing is sped up.

How long a tape takes

In the machine's own test on 5 October 2026, saving a one-line program took 10.76 seconds of the Electron's time, from RETURN to the motor stopping, and loading it back 5.56 seconds (the journal has the run). Most of that is the steady tone the OS writes before and after a program. The program itself goes at 1,200 baud, 120 bytes a second, in blocks of 256 bytes with a short tone between them.

The ROMs are Acorn's: OS 1.00 and BBC BASIC 2. Their position is documented, not cleared: no licence or permission from any holder was found. Full rights: Whose ROMs these are.

Try it

Press Start, then type these lines, pressing Return after each. The acceptance test types the same program, from the same file, so the two cannot disagree.

10 FOR I=1 TO 5
20 PRINT "HELLO ";I
30 NEXT I
RUN

The screen should then show:

HELLO 1
HELLO 2
HELLO 3
HELLO 4
HELLO 5

The machine starts with CAPS LOCK on, as the real one does, so letters come out as capitals. Some symbols are not where a PC keyboard has them: the table of symbols says where each one is.

The Electron's BASIC is the BBC Micro's, byte for byte, so this program prints the same on both. Then save it to tape and load it back, as the cassette recorder says.

The keyboard

Each key on your keyboard presses the Electron's key in the same place, so the symbols are where the Electron has them, not where your keyboard prints them. Backspace and Delete are DELETE, Enter is RETURN, End is COPY, the arrow keys are the cursor keys and Esc is ESCAPE. The Break button, or the Pause key, is BREAK. Your keyboard presses every key the Electron has, so no key is on the on-screen keys only.

The on-screen keys under the screen have every key, for a phone, a tablet or a mouse. Tap SHIFT or CTRL and it stays down for the next key you tap, so SHIFT then 2 types a double quote; tap it again to let go without typing.

CAPS LK and FUNC are one key on the Electron. On screen, tap it and then another key, and that key is pressed with FUNC: FUNC and a digit is a function key, and FUNC and a letter types a BASIC keyword (FUNC and K types CHAIN). Tap it twice instead and it is pressed alone, which turns CAPS LOCK on or off. Your own Caps Lock key does that too.

Where each symbol is
Where the symbols are
To typeOn the ElectronOn your keyboard
!SHIFT and 1Shift and 1
"SHIFT and 2Shift and 2
#SHIFT and 3Shift and 3
$SHIFT and 4Shift and 4
%SHIFT and 5Shift and 5
&SHIFT and 6Shift and 6
'SHIFT and 7Shift and 7
(SHIFT and 8Shift and 8
)SHIFT and 9Shift and 9
*SHIFT and :Shift and '
+SHIFT and ;Shift and ;
,,,
---
...
///
::'
;;;
<SHIFT and ,Shift and ,
=SHIFT and -Shift and -
>SHIFT and .Shift and .
?SHIFT and /Shift and /
@SHIFT and 0Shift and 0

About the Electron

What is modelled, and what is not

Not modelled, each part with an issue that says what it would take:

  • The Plus 1 and its cartridge slots: issue 57
  • The Plus 3 and its disc drive: issue 58
  • The joystick and printer ports: issue 59
  • 300 baud and non-standard tapes: issue 60
The photograph of the original, and its credit

Credited as its source gives it.

An original Acorn Electron from the front left and above, on a blue cloth: a cream case with a dark grey panel across the top bearing the acorn electron name and a green acorn, and a cream keyboard with keyword legends on its keys, ESCAPE and BREAK in the top row and a long space bar.
Photograph: an original Acorn Electron, taken 18 February 2018.By simon.inns. Source: commons.wikimedia.org. Licence: CC BY 2.0. Changes: resized and converted to WebP for this page.
Whose ROMs these are

The two ROMs are Acorn's: the operating system, OS 1.00, and BBC BASIC 2, byte for byte the BBC Micro's BASIC. The operating system's own text says (C) 1983 Acorn Computers Ltd., and BASIC's (C)1982 Acorn. Who holds that copyright now was not established, and no licence or permission from any holder was found. Our copy of the operating system comes from the elkjs repository at a pinned commit, and BASIC is the BBC Micro's copy, from jsbeeb's ROM folder; elkjs is licensed GPL-2.0 and says nothing about the ROMs, so that licence is not a licence for them. Both are kept in this repository under roms/ with where they came from, and checked by SHA-256 each time they are read. The position is documented, not cleared: if a rights holder asks, the ROMs will be removed.

  • OS 1.00, the operating system: the copy in the repository, SHA-256 b63f851d79498f598999d923b7c9f62e2525c34f0b9cd2d4b328b89d622dcda4
  • BBC BASIC 2, the BBC Micro's file: the copy in the repository, SHA-256 45bd55dc0f6f0f8f1fe9e2481de7def206565eec8f600ba3068b849ca4132079

The ROMs are kept in the repository, in roms/, with where they came from. The site checks each against its hash when it is built, and serves them beside the emulator.