Acorn BBC BASIC
BBC BASIC is the BASIC interpreter built into the BBC Micro, written by Sophie Wilson at Acorn Computers. It is a 16 kB sideways language ROM combining a line editor, a keyword tokeniser and de-tokeniser, a statement interpreter, an expression evaluator with full operator precedence, integer and 40-bit floating-point arithmetic, string handling, and variable storage. BBC BASIC is renowned for its structured-programming features — named procedures and functions (PROC/FN) with local variables, REPEAT/UNTIL loops, and IF/THEN/ELSE — and for its built-in 6502 assembler, which lets machine code be written inline and assembled directly from a BASIC program. Version II is the most widely used BBC Micro release.
Annotated Disassemblies
| Version | Memory Map | Changes |
|---|---|---|
| Acorn BBC BASIC II | Memory map |
Analyses
- Arbitrary lvalues as formal PROC/FN parameters (BASIC II)
A BBC BASIC capability, present from BASIC I through BASIC V: a DEF FN/DEF PROC formal parameter may be any assignable location — an array element, or a byte (?), word (!) or string ($) indirection onto memory — because the parameter binder reuses parse_lvalue, so binding such a formal is a scoped assignment to that location.
References
ROM image
- BBC BASIC II in The BBC Micro ROM LibraryThe exact ROM image catalogued by tobylobster's ROM library, identified by MD5.
Sources consulted
- tobylobster's BBC Micro MOS disassemblytobylobster's fully annotated disassembly of the BBC Micro MOS — a reference for the OSBYTE / OSWORD / vector-call semantics and zero-page / workspace names BBC BASIC relies on.
- The Advanced BASIC ROM User Guide (Colin Pharo)A detailed reference to the internals of the BBC BASIC ROM: zero-page usage, the keyword table, the interpreter loop, variable storage, and the floating-point routines.
- BBC Microcomputer System User Guide (John Coll)The official BBC Micro user guide. Much of it documents the BBC BASIC language: statements, functions, operators, and the assembler.
- J.G. Harston's BBC BASIC source reconstructionA multi-target reconstruction of the BBC BASIC source that reassembles (with the BBC BASIC assembler) to byte-identical ROMs, with zero-page maps and entry/exit documentation. The primary external source of BBC BASIC II labels.
- tobylobster's BBC BASIC tokeniser/detokeniserA Python BBC BASIC tokeniser and detokeniser — a clean reference for the keyword/token table and the tokenising rules.
Further reading
- hoglet's BBC BASIC 4r32 disassemblyA byte-identical disassembly of BBC BASIC 4r32. A later, reorganised cousin of BASIC II, useful for cross-referencing structure and label names.
