BBC BASIC
Encyclopedia
BBC BASIC is a programming language
, developed in 1981 as a native programming language for the MOS Technology 6502
based Acorn
BBC Micro
home/personal computer, mainly by Sophie Wilson
. It is a version of the BASIC
programming language adapted for a U.K.
computer literacy project of the BBC
.
BBC BASIC, based on the older Atom BASIC (for the Acorn Atom
), extended traditional BASIC with named
. The interpreter also included powerful statements for controlling the BBC Micro's four-channel sound output and its low / high-resolution seven mode graphics display.
One of the unique features of BBC BASIC was the presence of an inline assembler allowing users to write 6502
assembly language programs. The assembler was fully integrated into the BASIC interpreter and shared variables with it. This allowed developers to write not just assembly language code, but also BASIC code to emit assembly language, making it possible to use code generation techniques and even write simple compilers in BASIC.
and Andy Hopper
(while at Cambridge University), founded Acorn Computers. Andy Hopper is now the head of the University of Cambridge Computer Laboratory
. Much of the code was developed at Cambridge University by Sophie Wilson
and her colleagues.
s.
BASIC II was used on the Acorn Electron
and BBC Micros shipped after 1982, including the BBC B+. It added the
BASIC III, was produced in both a UK version and a US
market version for Acorn's abortive attempt to enter the cross-Atlantic computer market. Apart from a few bug fixes, the only change from BASIC II was that the
BASIC IV, also known as CMOS BASIC, available on the BBC Master
and Master Compact machines, was changed to use the new instructions available in the 65SC12 processor, reducing the size of the code and therefore allowing the inclusion of
HI-BASIC: this was available in two versions, the first based on BASIC III, and the second based on BASIC IV. Both were built to run from a higher address (&B800) on the second processor, rather than the usual &8000 address on the BBC B. This allowed more program space to be available on either the external or internal 6502 Second Processors. A version was introduced to support a second Z80 processor.
Another version of BBC BASIC, called BAS128, was supplied on tape and disc with the BBC Master and Master Compact; it loaded into main RAM and used the 64 kB of Sideways RAM for user programs. This provided support for much larger programs at the cost of being a lot slower than the normal ROM-based version.
CPU and the removal of the 16kB limit on the BASIC code size many new features were added. BASIC V version 1.04 was 61kB long.
Amongst the new commands and features supported were:
The graphics commands were entirely backwards compatible, the sound less so (for example, the
assembler. BASIC V was said, by Acorn, to be "certainly the fastest interpreted BASIC in the world" and "probably the most powerful BASIC found on any computer".
BASIC VI is a version of BASIC V that supports 8 byte format real numbers (according to IEEE standard 754) as opposed to the standard 5 byte format introduced in BASIC I.
BBC BASIC V and VI were delivered as standard on the Acorn Archimedes
and the Risc PC
. A version of BBC BASIC V was also available to run on the ARM second processor
for the BBC Micro.
Current versions of RISC OS still contain a BBC BASIC interpreter.
The source code to the RISC OS 5 version of BBC BASIC V was recently released as 'shared source' by RISC OS Open
.
In addition to the version of BBC BASIC supplied with the BBC Micro
's Z80
Second processor, a Z80 based version of BBC BASIC also exists for CP/M
based systems. Until recently
no version existed for the Sinclar ZX Spectrum
, however due to efforts of J.G Harston (also responsible for a PDP-11
version), BBC BASIC for the Spectrum was released in January 2002 with many improvements made in subsequent releases.
A Zilog Z80
version of BBC BASIC was also used on the Tiki 100
desktop computer,
Cambridge Z88
portable and the Amstrad NC100
Notepad and Amstrad NC200 Notebook computers. This version has been implemented on the TI-83 Plus and TI-84 Plus series graphing calculator
s.
For PC
based systems, BBC BASIC was also implemented for DOS
as BBCBASIC (86) (which aimed for maximum compatibility with the BBC Micro) and BBasic (which concentrated on the BASIC language itself, with its own enhancements based on BASIC II).
A version of BBC BASIC integrated with the Microsoft Windows
graphical user interface
, BBC BASIC for Windows created by Richard Russell
(who also developed the Z80 and x86 versions), was released in 2001. This version is still under active development, seeing much industry use currently.
Whilst supporting nearly completely the original BBC BASIC specification (BASIC IV), the Windows version supports much of BASIC V/VI syntax as well as some advanced features of its own.
Features unique to BBC BASIC for Windows include interpreter support for record/structure types, and the ability to call Windows API
routines or those in an external DLL
. Recent versions have included advanced features comparable with languages like C
.
A GPL
clone of BBC BASIC named Brandy written in portable C
is also available.
An emulator of the BBC Micro for the Commodore
Amiga
was produced by Ariadne Software for CBM
(UK). While extremely fast, it did not emulate the 6502 at full speed so assembly code would run slower than a real BBC while BASIC programs would run much faster, unfortunately due to the way the optimized Basic and the 6502 emulation interacted, almost no commercial games would run (but well behaved code and educational software generally worked); additionally it used a slightly less precise floating-point numeric format. For a while it was bundled with a special academic package of the Amiga 500
, in the hope that schools would replace their aging BBC Bs with Amiga 500s.
A version of BBC BASIC (Z80) has also been made for the TI-83/84+ Texas Instruments calculator families by Benjamin Ryves.
A Commodore 64
version was produced by a small software house Aztec Software
in the early 80s.
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....
, developed in 1981 as a native programming language for the MOS Technology 6502
MOS Technology 6502
The MOS Technology 6502 is an 8-bit microprocessor that was designed by Chuck Peddle and Bill Mensch for MOS Technology in 1975. When it was introduced, it was the least expensive full-featured microprocessor on the market by a considerable margin, costing less than one-sixth the price of...
based Acorn
Acorn Computers
Acorn Computers Ltd. was a British computer company established in Cambridge, England, in 1978. The company produced a number of computers which were especially popular in the UK. These included the Acorn Electron, the BBC Micro, and the Acorn Archimedes...
BBC Micro
BBC Micro
The BBC Microcomputer System, or BBC Micro, was a series of microcomputers and associated peripherals designed and built by Acorn Computers for the BBC Computer Literacy Project, operated by the British Broadcasting Corporation...
home/personal computer, mainly by Sophie Wilson
Sophie Wilson
Sophie Wilson is a British computer scientist. She is known for designing the Acorn Micro-Computer, the first of a long line of computers sold by Acorn Computers Ltd, as well as the instruction set of the highly successful ARM processor.- Life and career :...
. It is a version of the BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....
programming language adapted for a U.K.
United Kingdom
The United Kingdom of Great Britain and Northern IrelandIn the United Kingdom and Dependencies, other languages have been officially recognised as legitimate autochthonous languages under the European Charter for Regional or Minority Languages...
computer literacy project of the BBC
BBC
The British Broadcasting Corporation is a British public service broadcaster. Its headquarters is at Broadcasting House in the City of Westminster, London. It is the largest broadcaster in the world, with about 23,000 staff...
.
BBC BASIC, based on the older Atom BASIC (for the Acorn Atom
Acorn Atom
The Acorn Atom was a home computer made by Acorn Computers Ltd from 1980 to 1982 when it was replaced by the BBC Micro and later the Acorn Electron....
), extended traditional BASIC with named
DEFPROC
procedures and functions, REPEAT-UNTIL
loops, and IF-THEN-ELSE
structures inspired by COMALCOMAL
COMAL is a computer programming language developed in Denmark by Benedict Løfstedt and Børge R. Christensen in 1973.The "COMAL 80 PROGRAMMING LANGUAGE REPORT" contains the formal definition of the language.- Design :...
. The interpreter also included powerful statements for controlling the BBC Micro's four-channel sound output and its low / high-resolution seven mode graphics display.
One of the unique features of BBC BASIC was the presence of an inline assembler allowing users to write 6502
MOS Technology 6502
The MOS Technology 6502 is an 8-bit microprocessor that was designed by Chuck Peddle and Bill Mensch for MOS Technology in 1975. When it was introduced, it was the least expensive full-featured microprocessor on the market by a considerable margin, costing less than one-sixth the price of...
assembly language programs. The assembler was fully integrated into the BASIC interpreter and shared variables with it. This allowed developers to write not just assembly language code, but also BASIC code to emit assembly language, making it possible to use code generation techniques and even write simple compilers in BASIC.
History
In 1978 Hermann HauserHermann Hauser
Hermann Maria Hauser, CBE FREng FinstP CPhys , is an entrepreneur who was born in Vienna, Austria but is primarily associated with Silicon Fen in England....
and Andy Hopper
Andy Hopper
Andrew Hopper CBE FRS FREng FIET is the Professor of Computer Technology and Head of the University of Cambridge Computer Laboratory and an Honorary Fellow of Trinity Hall, Cambridge.-Research:...
(while at Cambridge University), founded Acorn Computers. Andy Hopper is now the head of the University of Cambridge Computer Laboratory
University of Cambridge Computer Laboratory
The Computer Laboratory is the computer science department of the University of Cambridge. As of 2007, it employs 35 academic staff, 25 support staff, 35 affiliated research staff, and about 155 research students...
. Much of the code was developed at Cambridge University by Sophie Wilson
Sophie Wilson
Sophie Wilson is a British computer scientist. She is known for designing the Acorn Micro-Computer, the first of a long line of computers sold by Acorn Computers Ltd, as well as the instruction set of the highly successful ARM processor.- Life and career :...
and her colleagues.
BBC Micro
BASIC I, the original version, was shipped on early BBC MicroBBC Micro
The BBC Microcomputer System, or BBC Micro, was a series of microcomputers and associated peripherals designed and built by Acorn Computers for the BBC Computer Literacy Project, operated by the British Broadcasting Corporation...
s.
BASIC II was used on the Acorn Electron
Acorn Electron
The Acorn Electron is a budget version of the BBC Micro educational/home computer made by Acorn Computers Ltd. It has 32 kilobytes of RAM, and its ROM includes BBC BASIC along with its operating system....
and BBC Micros shipped after 1982, including the BBC B+. It added the
OPENUP
OSCLI keywords, along with offset assembly and bug fixes.BASIC III, was produced in both a UK version and a US
United States
The United States of America is a federal constitutional republic comprising fifty states and a federal district...
market version for Acorn's abortive attempt to enter the cross-Atlantic computer market. Apart from a few bug fixes, the only change from BASIC II was that the
COLOUR
command could also be spelled COLOR
: regardless of which was input, the UK version always listed it as COLOUR
, the US version as COLOR
. The main place that BASIC III can be found is as the HI-BASIC version for the external second processor.BASIC IV, also known as CMOS BASIC, available on the BBC Master
BBC Master
The BBC Master was a home computer released by Acorn Computers in early 1986. It was designed and built for the British Broadcasting Corporation and was the successor to the BBC Micro Model B. The Master 128 remained in production until 1993....
and Master Compact machines, was changed to use the new instructions available in the 65SC12 processor, reducing the size of the code and therefore allowing the inclusion of
LIST IF
, EXT#
as a statement, EDIT
, TIME$
, ON PROC
, | in VDU
statements and faster floating point. Bug fixes were again included.HI-BASIC: this was available in two versions, the first based on BASIC III, and the second based on BASIC IV. Both were built to run from a higher address (&B800) on the second processor, rather than the usual &8000 address on the BBC B. This allowed more program space to be available on either the external or internal 6502 Second Processors. A version was introduced to support a second Z80 processor.
Another version of BBC BASIC, called BAS128, was supplied on tape and disc with the BBC Master and Master Compact; it loaded into main RAM and used the 64 kB of Sideways RAM for user programs. This provided support for much larger programs at the cost of being a lot slower than the normal ROM-based version.
Acorn Archimedes (RISC OS)
With the move to the 32 bit ARMARM architecture
ARM is a 32-bit reduced instruction set computer instruction set architecture developed by ARM Holdings. It was named the Advanced RISC Machine, and before that, the Acorn RISC Machine. The ARM architecture is the most widely used 32-bit ISA in numbers produced...
CPU and the removal of the 16kB limit on the BASIC code size many new features were added. BASIC V version 1.04 was 61kB long.
Amongst the new commands and features supported were:
-
WHILE-ENDWHILE
-
IF-THEN-ELSE-ENDIF
-
CASE-OF-WHEN-OTHERWISE-ENDCASE
, -
RETURN
parameters in procedures, - local arrays,
- procedure libraries (
LIBRARY
,INSTALL
andOVERLAY
), -
LOCAL DATA
andLOCAL ERROR
handlers, - a relative
RESTORE
, - array operations,
- new operators,
-
STEP TRACE
, - Commands for the new sound system, mouse, graphics.
The graphics commands were entirely backwards compatible, the sound less so (for example, the
ENVELOPE
keyword from BASIC V onwards is a command which takes fourteen numeric parameters and effectively does nothing - as in older versions, it calls OS_Word 8, but that does nothing on RISC OS http://lists.cloud9.co.uk/pipermail/bbc-micro/2006-November/000257.htmlhttp://mdfs.net/Archive/BBCMicro/2006/11/19/185014.htm). The in-line in 6502 assembler was replaced by an ARMARM architecture
ARM is a 32-bit reduced instruction set computer instruction set architecture developed by ARM Holdings. It was named the Advanced RISC Machine, and before that, the Acorn RISC Machine. The ARM architecture is the most widely used 32-bit ISA in numbers produced...
assembler. BASIC V was said, by Acorn, to be "certainly the fastest interpreted BASIC in the world" and "probably the most powerful BASIC found on any computer".
BASIC VI is a version of BASIC V that supports 8 byte format real numbers (according to IEEE standard 754) as opposed to the standard 5 byte format introduced in BASIC I.
BBC BASIC V and VI were delivered as standard on the Acorn Archimedes
Acorn Archimedes
The Acorn Archimedes was Acorn Computers Ltd's first general purpose home computer to be based on their own ARM architecture.Using a RISC design with a 32-bit CPU, at its launch in June 1987, the Archimedes was stated as running at 4 MIPS, with a claim of 18 MIPS during tests.The name is commonly...
and the Risc PC
Risc PC
The RiscPC was Acorn Computers's next generation RISC OS/Acorn RISC Machine computer, launched on 15 April 1994, which superseded the Acorn Archimedes. The Acorn PC card and software allows PC compatible software to be run....
. A version of BBC BASIC V was also available to run on the ARM second processor
Tube (BBC Micro)
In computing, the Tube was the expansion interface and architecture of the BBC Microcomputer System which allowed the BBC Micro to communicate with a second processor, or coprocessor....
for the BBC Micro.
Current versions of RISC OS still contain a BBC BASIC interpreter.
The source code to the RISC OS 5 version of BBC BASIC V was recently released as 'shared source' by RISC OS Open
RISC OS Open
RISC OS Open Ltd. is a limited company engaged in computer software and IT consulting. It is managing the process of publishing the source code to RISC OS...
.
Other platforms
BBC BASIC has also been ported to many other platforms.In addition to the version of BBC BASIC supplied with the BBC Micro
BBC Micro
The BBC Microcomputer System, or BBC Micro, was a series of microcomputers and associated peripherals designed and built by Acorn Computers for the BBC Computer Literacy Project, operated by the British Broadcasting Corporation...
's Z80
Zilog Z80
The Zilog Z80 is an 8-bit microprocessor designed by Zilog and sold from July 1976 onwards. It was widely used both in desktop and embedded computer designs as well as for military purposes...
Second processor, a Z80 based version of BBC BASIC also exists for CP/M
CP/M
CP/M was a mass-market operating system created for Intel 8080/85 based microcomputers by Gary Kildall of Digital Research, Inc...
based systems. Until recently
no version existed for the Sinclar ZX Spectrum
ZX Spectrum
The ZX Spectrum is an 8-bit personal home computer released in the United Kingdom in 1982 by Sinclair Research Ltd...
, however due to efforts of J.G Harston (also responsible for a PDP-11
PDP-11
The PDP-11 was a series of 16-bit minicomputers sold by Digital Equipment Corporation from 1970 into the 1990s, one of a succession of products in the PDP series. The PDP-11 replaced the PDP-8 in many real-time applications, although both product lines lived in parallel for more than 10 years...
version), BBC BASIC for the Spectrum was released in January 2002 with many improvements made in subsequent releases.
A Zilog Z80
Zilog Z80
The Zilog Z80 is an 8-bit microprocessor designed by Zilog and sold from July 1976 onwards. It was widely used both in desktop and embedded computer designs as well as for military purposes...
version of BBC BASIC was also used on the Tiki 100
Tiki 100
Tiki 100 was a desktop home/personal computer manufactured by Tiki Data of Oslo, Norway. The computer was launched in the spring of 1984 under the original name Kontiki 100, and was first and foremost intended for the emerging educational sector, especially for primary schools...
desktop computer,
Cambridge Z88
Cambridge Z88
The Cambridge Computer Z88 is an A4-size, lightweight, portable Z80-based computer with a built-in combined word processing/spreadsheet/database application called PipeDream, along with several other applications and utilities, such as a Z80-version of the BBC BASIC programming language.The Z88...
portable and the Amstrad NC100
Amstrad NC100
The Amstrad NC100 was an A4-size, portable Z80-based computer, released by Amstrad in 1992. It featured 64 KB of RAM, the Protext word processor, various organiser-like facilities , a simple calculator, and a version of BBC BASIC.Its screen was small, eight rows by 80 columns, and not backlit, but...
Notepad and Amstrad NC200 Notebook computers. This version has been implemented on the TI-83 Plus and TI-84 Plus series graphing calculator
Graphing calculator
A graphing calculator typically refers to a class of handheld calculators that are capable of plotting graphs, solving simultaneous equations, and performing numerous other tasks with variables...
s.
For PC
IBM PC compatible
IBM PC compatible computers are those generally similar to the original IBM PC, XT, and AT. Such computers used to be referred to as PC clones, or IBM clones since they almost exactly duplicated all the significant features of the PC architecture, facilitated by various manufacturers' ability to...
based systems, BBC BASIC was also implemented for DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...
as BBCBASIC (86) (which aimed for maximum compatibility with the BBC Micro) and BBasic (which concentrated on the BASIC language itself, with its own enhancements based on BASIC II).
A version of BBC BASIC integrated with the Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
graphical user interface
Graphical user interface
In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...
, BBC BASIC for Windows created by Richard Russell
Richard T. Russell
Richard Thomas Russell is the creator of the BBC Basic for Windows programming language and the author of the Z80 and MS-DOS versions of BBC BASIC....
(who also developed the Z80 and x86 versions), was released in 2001. This version is still under active development, seeing much industry use currently.
Whilst supporting nearly completely the original BBC BASIC specification (BASIC IV), the Windows version supports much of BASIC V/VI syntax as well as some advanced features of its own.
Features unique to BBC BASIC for Windows include interpreter support for record/structure types, and the ability to call Windows API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...
routines or those in an external DLL
Dynamic-link library
Dynamic-link library , or DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems...
. Recent versions have included advanced features comparable with languages like C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
.
A GPL
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....
clone of BBC BASIC named Brandy written in portable C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
is also available.
An emulator of the BBC Micro for the Commodore
Commodore International
Commodore is the commonly used name for Commodore Business Machines , the U.S.-based home computer manufacturer and electronics manufacturer headquartered in West Chester, Pennsylvania, which also housed Commodore's corporate parent company, Commodore International Limited...
Amiga
Amiga
The Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...
was produced by Ariadne Software for CBM
Commodore International
Commodore is the commonly used name for Commodore Business Machines , the U.S.-based home computer manufacturer and electronics manufacturer headquartered in West Chester, Pennsylvania, which also housed Commodore's corporate parent company, Commodore International Limited...
(UK). While extremely fast, it did not emulate the 6502 at full speed so assembly code would run slower than a real BBC while BASIC programs would run much faster, unfortunately due to the way the optimized Basic and the 6502 emulation interacted, almost no commercial games would run (but well behaved code and educational software generally worked); additionally it used a slightly less precise floating-point numeric format. For a while it was bundled with a special academic package of the Amiga 500
Amiga 500
The Amiga 500 - also known as the A500 - was the first “low-end” Commodore Amiga 16/32-bit multimedia home/personal computer. It was announced at the winter Consumer Electronics Show in January 1987 - at the same time as the high-end Amiga 2000 - and competed directly against the Atari 520ST...
, in the hope that schools would replace their aging BBC Bs with Amiga 500s.
A version of BBC BASIC (Z80) has also been made for the TI-83/84+ Texas Instruments calculator families by Benjamin Ryves.
A Commodore 64
Commodore 64
The Commodore 64 is an 8-bit home computer introduced by Commodore International in January 1982.Volume production started in the spring of 1982, with machines being released on to the market in August at a price of US$595...
version was produced by a small software house Aztec Software
Aztec Software
Aztec Software is a software company founded by Martin Hooley and Richard Green in the eary 80s. The company was based in a small yorkshire town called Mirfield before moving to Ravensthorpe, Dewsbury....
in the early 80s.
External links
- http://www.bbcbasic.org/
- http://www.rtrussell.co.uk/
- http://mdfs.net/bbcbasic/
- TI-83+ and TI-84+ implementation of BBC BASIC
- The Amstrad NC Users' Site
- Ebook programming guide with interfacing methods
- Programmers' Reference (wiki)