Est. 1981 Beginner

BBC BASIC

The structured, feature-rich BASIC dialect created for the BBC Micro that educated a generation of British programmers and pioneered inline assembly in home computing.

Created by Sophie Wilson (Acorn Computers)

Paradigm Procedural
Typing Dynamic, Weak
First Appeared 1981
Latest Version BBC BASIC for SDL 2.0 v1.43c (2026)

BBC BASIC is a dialect of the BASIC programming language designed by Sophie Wilson at Acorn Computers in 1981 for the British Broadcasting Corporation’s computer literacy initiative. Bundled in ROM with the BBC Micro, it became the first programming language for millions of British schoolchildren and programmers throughout the 1980s. Unlike the unstructured BASIC dialects common on competing home computers of the era, BBC BASIC incorporated named procedures and functions, multi-line conditional blocks, REPEAT...UNTIL loops, local variables, and a built-in inline assembler — features more commonly associated with languages like Pascal or C than with BASIC. Today BBC BASIC remains actively developed, running on everything from Raspberry Pi to web browsers via WebAssembly.

History & Origins

The BBC Computer Literacy Project

In 1979, an ITV documentary series called The Mighty Micro, presented by Dr. Christopher Evans, predicted that the coming microcomputer revolution would fundamentally reshape society. The documentary created public anxiety and political attention. The BBC responded by launching a computer literacy initiative, planning a TV series and an accompanying BBC-branded microcomputer that the public could actually buy.

The BBC’s original technology partner, Newbury Newbrain, could not meet the BBC’s capability and timetable requirements. In early February 1981, Chris Curry of Acorn Computers arranged a demonstration for the BBC of a machine that barely existed at the time — a prototype of what Acorn called the “Proton.” Sophie Wilson (then credited as Roger Wilson) had designed the BBC Micro hardware in a legendary sprint, reportedly debugging the prototype while watching the wedding of Prince Charles and Lady Diana Spencer on a small portable television. The BBC signed a contract with Acorn shortly afterwards.

Sophie Wilson and the Language Design

Sophie Wilson had already written Atom BASIC for the Acorn Atom, Acorn’s earlier home computer. For the BBC Micro, she extended that interpreter considerably. The BBC’s specification demanded a BASIC that could be used for genuine programming education, not just simple calculations and games. Wilson’s additions aligned closely with these ambitions: DEF PROC and DEF FN for named procedures and functions, REPEAT...UNTIL loops, multi-line IF...THEN...ELSE...ENDIF blocks, local variables within procedures, and a built-in inline assembler accessible between [ and ] brackets.

The resulting BBC BASIC I was packed into 16 KB of ROM and shipped with the BBC Micro in December 1981. It was demonstrably more powerful than the Microsoft BASIC found on competing machines like the Sinclair ZX Spectrum, Commodore 64, and Apple II — and unlike those dialects, it was designed so that GOTO and GOSUB were unnecessary for well-structured programs.

Wilson later co-designed the ARM processor instruction set architecture beginning in 1983, a technology now found in the vast majority of the world’s mobile devices. Both BBC BASIC and ARM share the same creator and the same hardware platform.

Design Philosophy

BBC BASIC’s design philosophy set it apart from virtually every other BASIC dialect of its era:

Structured programming without GOTO: The language provided genuine alternatives to GOTO and GOSUB. Procedures (PROC_name) and functions (FN_name) could be called by name, not by line number, encouraging programmers to think in terms of operations rather than memory locations. This aligned BBC BASIC far more closely with the structured programming movement than with the line-number-centric tradition inherited from Dartmouth BASIC.

COMAL influence: BBC BASIC’s procedural constructs and REPEAT...UNTIL syntax were influenced by COMAL (Common Algorithmic Language), a language designed to teach structured programming within a BASIC framework. The block IF...THEN...ELSE...ENDIF and named PROC constructs came from this tradition.

Inline assembly as a first-class citizen: Rather than requiring programmers to embed machine code in DATA statements (the standard approach on other platforms), BBC BASIC included a genuine inline assembler. Code between [ and ] brackets was assembled directly. This made the language genuinely useful for systems programming, hardware interfacing, and performance-critical applications — a remarkable capability for a home computer BASIC.

Long, meaningful variable names: Unlike many contemporary BASIC implementations that truncated variable names to one or two significant characters, BBC BASIC allowed and encouraged descriptive names, supporting readable code.

ROM efficiency: Fitting a sophisticated interpreter into 16 KB of ROM required exceptional implementation quality. This constraint produced a lean, fast interpreter that remained notable for its execution speed decades later.

Key Features

Procedures and Functions

BBC BASIC’s most distinctive feature was its support for named, parameterized procedures and functions with local variables:

DEF PROC_Greet(name$)
  LOCAL greeting$
  greeting$ = "Hello, " + name$ + "!"
  PRINT greeting$
ENDPROC

DEF FN_Square(n)
= n * n

PROC_Greet("World")
PRINT FN_Square(7)

Procedures return with ENDPROC and functions return their value after =. Local variables declared with LOCAL are scoped to the procedure or function, preventing the global variable pollution common in other BASICs of the era.

Structured Control Flow

REM Multi-line IF block
IF score > 90 THEN
  PRINT "Excellent"
ELSE IF score > 70 THEN
  PRINT "Good"
ELSE
  PRINT "Keep trying"
ENDIF

REM REPEAT...UNTIL loop
count = 1
REPEAT
  PRINT count
  count = count + 1
UNTIL count > 10

REM WHILE...ENDWHILE (BASIC V onward)
WHILE total < 100
  total = total + input
ENDWHILE

REM CASE...OF (BASIC V onward)
CASE day OF
  WHEN 1: PRINT "Monday"
  WHEN 6, 7: PRINT "Weekend"
  OTHERWISE: PRINT "Weekday"
ENDCASE

Inline Assembler

One of BBC BASIC’s most powerful and unusual features was its built-in assembler:

REM Inline 6502 assembly (BBC Micro version)
DIM code% 20
FOR pass = 0 TO 2 STEP 2
  P% = code%
  [OPT pass
    LDA #72     ; ASCII 'H'
    JSR &FFEE   ; OSWRCH - output character
    RTS
  ]
NEXT pass
CALL code%

In the ARM versions (BASIC V/VI), the same syntax assembled ARM instructions, making it possible to write efficient mixed BASIC/assembly programs for the Acorn Archimedes. The FOR pass loop approach for two-pass assembly is an elegant solution that became idiomatic in BBC BASIC programming.

Integer Variables and Performance

Variables suffixed with % are stored as 32-bit integers, computed significantly faster than BBC BASIC’s floating-point variables:

total% = 0
FOR i% = 1 TO 1000
  total% = total% + i%
NEXT i%
PRINT total%

Graphics and Sound

BBC BASIC provided direct access to the BBC Micro’s sophisticated graphics and sound hardware:

REM Switch to high-resolution graphics mode
MODE 1

REM Draw colored shapes
COLOUR 3        : REM Set foreground color
CIRCLE 640,512,200  : REM Draw circle (BASIC V)

REM PLOT for lower-level graphics
PLOT 69, 100, 100   : REM Draw filled triangle

REM Sound synthesis
SOUND 1,-15,53,20   : REM Channel, amplitude, pitch, duration
ENVELOPE 1,3,1,0,-1,1,0,-1,126,0,0,-5,100,40

OS Integration

The * (star) prefix allowed direct operating system commands, and OSCLI provided programmatic access to the command-line interface:

*CAT              : REM List directory (like ls/dir)
*LOAD "data" 3000 : REM Load file to memory address &3000
OSCLI "SAVE myfile 1200 1300"  : REM Save memory range to file

Versions

BBC BASIC existed in numerous versions across its history:

VersionYearPlatformKey additions
BASIC I1981BBC Micro (6502)Original; procedures, functions, inline assembler
BASIC II1982BBC Micro, Acorn ElectronOPENUP, OSCLI, offset assembly, bug fixes
BASIC III~1983BBC Micro (US market variant)Added COLOR (US spelling) as alias for COLOUR, minor fixes
BASIC IV1984–1988BBC Master series (65C12)LIST IF, EXT#, EDIT, TIME$, ON PROC; Master Compact sub-versions reportedly ~30% faster math
BASIC V1987Acorn Archimedes / RISC OS (ARM)32-bit ARM; CASE...OF, WHILE, CIRCLE, ELLIPSE; no 16 KB limit
BASIC VI1988RISC OSBASIC V + IEEE 754 double-precision floating-point

Third-party and modern implementations significantly extended the platform reach:

  • BBC BASIC for Windows (Richard T. Russell, 2001): 80x86 Windows implementation with Windows API and DLL access
  • BBC BASIC for SDL 2.0 (Richard T. Russell, 2015–present): Open-source, cross-platform; supports Windows, macOS, Linux, Raspberry Pi OS, Android, iOS, and web browsers via WebAssembly. Current version: v1.43c (February 5, 2026)
  • BBC BASIC Console Mode (2020): Command-line version including Raspberry Pi Pico support
  • Brandy BASIC / Matrix Brandy BASIC: Open-source C implementations targeting Linux and Raspberry Pi

Evolution

BBC BASIC’s evolution tracked the hardware it ran on. The 6502 versions (I through IV) were constrained by the 16 KB ROM and the 6502 processor’s architecture but represented a remarkably capable interpreter for their constraints. The jump to BASIC V for the Acorn Archimedes in 1987 was dramatic: the 32-bit ARM processor removed the 16 KB code size limit, enabled the ARM inline assembler, and allowed the introduction of higher-level control structures like CASE...OF and WHILE...ENDWHILE. Acorn’s marketing was not understated — they described BASIC V as “certainly the fastest interpreted BASIC in the world.”

When the Acorn platform declined in the 1990s, BBC BASIC might have disappeared entirely. Richard T. Russell’s continuing work on the Z80 ports and subsequent BBC BASIC for Windows preserved the language outside the Acorn ecosystem. The release of BBC BASIC for SDL 2.0 in 2015 transformed the language from a legacy system into a genuinely modern, cross-platform tool. The SDL 2.0 version adds 3D graphics, anti-aliased drawing primitives, shader support, and an integrated Box2D physics engine while maintaining high compatibility with original BBC Micro behavior, including MODE 7 Teletext emulation, SOUND, and ENVELOPE.

Current Relevance

BBC BASIC occupies an unusual position in 2026: it is simultaneously a historical artifact of immense cultural significance and an actively maintained programming language with a current release. The open-source BBC BASIC for SDL 2.0 continues to receive updates, runs on contemporary hardware and operating systems, and has a community of users who appreciate both its historical character and its practical capabilities.

The RISC OS 5 project open-sourced BBC BASIC V under the Apache 2.0 license in 2018, making the original ARM implementation freely available for study and adaptation. Richard T. Russell open-sourced the Z80 version in 2019.

For educators, BBC BASIC remains compelling: its structured constructs make it more pedagogically sound than many introductory languages, and its immediate, interactive nature provides quick feedback. For retro enthusiasts and hobbyists, it offers an authentic way to experience BBC Micro-era computing on modern hardware. The Raspberry Pi Pico support (via Console Mode) creates a particularly interesting bridge between the language’s roots in 1980s educational computing and contemporary embedded hardware.

Why It Matters

BBC BASIC’s significance extends well beyond its technical features. At its peak in the mid-1980s, the BBC Micro ran BBC BASIC in reportedly approximately 80% of UK schools (primary and secondary combined). The language was the first contact with programming for an entire generation. Many of the people who built the UK tech industry, the UK games industry (historically one of the world’s largest), and related fields got their start in BBC BASIC on school BBC Micros.

The game Elite — arguably the most technically ambitious game of its era — was built in BBC BASIC with inline assembly. Sophie Wilson, who created BBC BASIC and wrote the Acorn Archimedes version, also co-designed the ARM processor instruction set: the two most consequential things to come out of Acorn Computers share a creator. The structured, educationally-motivated BASIC and the processor architecture now found in billions of mobile devices are part of the same story.

For historians of computing, BBC BASIC is a case study in how deliberate design choices in a language — choosing structured constructs over GOTO, including a genuine inline assembler, demanding meaningful variable names — can shape the habits and expectations of programmers for decades.

Timeline

1981
BBC signs contract with Acorn Computers in February; Sophie Wilson designs BBC BASIC, extending her earlier Atom BASIC with structured programming constructs
1981
BBC Micro launches in December with BBC BASIC I in ROM, a 16 KB interpreter with procedures, functions, and inline 6502 assembly
1982
BBC BASIC II released with OPENUP and OSCLI keywords and bug fixes; the BBC TV series 'The Computer Programme' begins airing in January, spreading BASIC literacy across the UK
1983
Acorn Electron ships with BBC BASIC II; Richard T. Russell produces the first Z80/CP/M ports of BBC BASIC; Granny's Garden educational game published for BBC Micro schools
1984
BBC BASIC IV (CMOS BASIC) created for the BBC Master series, adding LIST IF, EXT#, EDIT, TIME$, and ON PROC commands; later Master Compact revisions reportedly achieved approximately 30% faster mathematical routines
1984
Elite published by Acornsoft in September; David Braben and Ian Bell use BBC BASIC with inline assembly to deliver a landmark 3D space trading game in 32 KB of RAM
1986
BBC Master series launches in January with BBC BASIC IV; over half a million BBC Micros now in UK homes and schools
1987
Acorn Archimedes launches in June with BBC BASIC V, a 32-bit ARM implementation rewritten by Sophie Wilson — Acorn claimed it was 'certainly the fastest interpreted BASIC in the world'
1988
BBC BASIC VI released for RISC OS (reportedly around 1988), identical to BASIC V but with IEEE 754 8-byte double-precision floating-point replacing the 5-byte format
2001
Richard T. Russell releases BBC BASIC for Windows v1.00a on October 1, bringing the language to 80x86 Windows PCs with Windows API access
2018
RISC OS Open releases the BBC BASIC V source code under the Apache 2.0 license as part of the RISC OS 5 open-source initiative
2019
Richard T. Russell open-sources his Z80 port of BBC BASIC
2020
BBC BASIC Console Mode released for command-line use on Windows, macOS, and Linux; Raspberry Pi Pico support was added in 2021 after the Pico hardware became available
2026
BBC BASIC for SDL 2.0 v1.43c released on February 5; the cross-platform interpreter runs on Windows, macOS, Linux, Raspberry Pi, Android, iOS, and web browsers via WebAssembly

Notable Uses & Legacy

Elite (Acornsoft, 1984)

David Braben and Ian Bell used BBC BASIC combined with inline 6502 assembly to create Elite, the groundbreaking 3D space trading game, on a BBC Micro with just 32 KB of RAM. The BBC Micro version reportedly sold approximately 100,000 copies, and the game went on to define an entire genre.

UK School Computing (1980s)

By the mid-1980s the BBC Micro had reportedly reached approximately 80% of UK schools (primary and secondary combined), making BBC BASIC the de facto first programming language for a generation of British programmers. The BBC's Computer Literacy Project and accompanying TV series used BBC BASIC as its teaching vehicle.

Granny's Garden (4Mation Educational Resources, 1983)

One of the most widely remembered BBC Micro educational programs, Granny's Garden was described by its publisher as 'the reason many teachers decided that computers had a real place in education' — a testament to what BBC BASIC-powered software achieved in primary classrooms.

Acorn Archimedes Development (1987–1990s)

BBC BASIC V shipped as the primary development environment for the Acorn Archimedes, used by hobbyists and professionals alike to write applications for RISC OS. Its ARM inline assembler made it uniquely suitable for performance-sensitive work.

BBC BASIC for SDL 2.0 (2015–present)

Richard T. Russell's modern cross-platform implementation is used by educators, retro enthusiasts, and developers on Windows, macOS, Linux, Raspberry Pi, Android, iOS, and browsers via WebAssembly. It includes an integrated Box2D physics engine and approximately 150 example programs.

Language Influence

Influenced By

Acorn Atom BASIC COMAL ALGOL 60 Microsoft BASIC

Influenced

ARM development environment

Running Today

Run examples using the official Docker image:

docker pull
Last updated: