BBC BASIC for Windows is an advanced version of BBC BASIC which is fully integrated into the Microsoft Windows™ operating environment (Windows 95, 98, Me, NT4, 2000, XP, Vista, Windows 7, 8/8.1 or 10), providing the programmer with a familiar language but with an up-to-date user interface. It combines the simplicity of BASIC with the sophistication of a modern structured language, allowing you to write utilities and games, use sound and graphics, perform calculations and create complete Windows™ applications.
If you've programmed in BASIC before, but aren't familiar with BBC BASIC, then you might like to dip into some of the tutorial chapters which cover differences between BBC BASIC and other dialects. You can also browse this manual or look up particular features which don't seem to work the way you're used to. The General Information chapter may be of particular interest.
If you are used to earlier versions of BBC BASIC (on the BBC Micro, on the Acorn Archimedes or BBC BASIC (86) on a PC) you may find the user interface somewhat unfamiliar. When you start BBC BASIC for Windows you are presented with a blank editing window into which you can type your BASIC program. Commands such as Load, Save, Chain, New and Renumber are activated by clicking with the mouse on drop-down menus or (in some cases) toolbar buttons, as is usual for Windows programs. There are also keyboard shortcuts for all the commands.
Once you have typed in, or loaded, your BASIC program you can run it by selecting the Run command from the Run menu or by clicking on the button in the toolbar. A second window will open in which appears any output from the BASIC program; error messages also appear here.
If you don't want to run a BASIC program, but simply want to enter commands for immediate execution (rather like a calculator) then select the Immediate Mode command from the Run menu, or click on the button. A second window will open into which you can type BASIC statements, in the same way as you could with previous versions of BBC BASIC.
A unique feature is the incorporation of an assembler which generates 32-bit code and accepts all 80486 instructions and some Pentium-specific instructions (except special-register and privileged instructions), including floating-point and MMX instructions. You can access the Windows™ Application Program Interface both from BASIC and from assembler code, allowing an experienced programmer to produce sophisticated applications.
The full version provides up to 512 Mbytes of user memory and allows you to create compact (typically less than 100K) stand-alone executable (.EXE) files from your BASIC programs, which will run without BBC BASIC having to be installed and without the need for any special DLLs. You can distribute such executables freely without any royalty being due.
BBC BASIC for Windows is largely compatible with Version 5 of BBC BASIC resident in the Acorn Archimedes and Iyonix computers. It also retains a high degree of compatibility with the BBC Microcomputer, including emulation of the SOUND and ENVELOPE statements, and the MODE 7 (teletext) screen mode.
In addition there are a number of major enhancements over these early versions, including data structures, an EXIT statement, PRIVATE variables, long strings, NUL-terminated strings, event interrupts, an address of operator, byte variables and arrays, a line continuation character, indirect procedure and function calls and improved numeric accuracy.
BBCWIN6.EXE has one optional command-line switch, -c, which automatically invokes the Compile utility:
Once the compile dialogue has been dismissed by the user BBC BASIC for Windows terminates.bbcwin6 -c progname.bbc
For the SOUND statement to work correctly, your processor clock speed should be 133 MHz or higher.
Version 5 | Version 6 | |
---|---|---|
Memory available for user's program, data and stack | Default approximately 1 Mbyte, maximum 256 Mbytes (depending on amount of RAM installed) | Default approximately 2 Mbytes, maximum 512 Mbytes (depending on amount of RAM installed) |
Size of BASIC program | Limited only by available memory (maximum 65535 numbered lines) | Limited only by available memory (maximum 65535 numbered lines) |
Length of program lines | Maximum 251 characters (tokenised) excluding line number | Maximum 251 characters (tokenised) excluding line number |
Integer variables | 32 bits, signed (−2147483648 to +2147483647) | 32 bits, signed (−2147483648 to +2147483647) 64 bits, signed (−9223372036854775808 to +9223372036854775807) |
Floating-point (real) variables | Default 32-bit mantissa plus 8-bit exponent (±5.9E−39 to ±3.4E38); precision
approximately 9 significant figures
Optionally 53-bit mantissa plus 11-bit exponent (±2.3E−308 to ±1.7E308); precision approximately 15 significant figures |
Default 64-bit mantissa plus 16-bit exponent (±3.4E−4932 to ±1.1E4932); precision
approximately 19 significant figures
Optionally 53-bit mantissa plus 11-bit exponent (±2.3E−308 to ±1.7E308); precision approximately 15 significant figures |
String variables | Maximum length 65535 8-bit characters | Length limited only by available memory |
Array variables | Maximum number of dimensions 255, maximum size of each dimension limited only by available memory | Maximum number of dimensions 255, maximum size of each dimension limited only by available memory |
Number of variables | Limited only by available memory | Limited only by available memory |
Length of variable names | Limited only by available memory and maximum line length | Limited only by available memory and maximum line length |
Levels of nesting | Limited only by available memory | Limited only by available memory |
Most of these programs will run using the trial version of BBC BASIC for Windows, although (depending on which programs you have run beforehand) you may need to restart the application first to free up memory. A few of them (notably ASMTEST.BBC, DLGEDIT.BBC, SEARCHBBC.BBC, SORTTEST.BBC and the file-handling demonstrations) require more than the 32K of user memory available with that version.
The example programs are located in sub-folders under the following categories:
F-?????.BBC | A set of 12 programs to demonstrate file handling. |
2048.BBC | Slide the numbered tiles to combine them in pairs until you reach a total of 2048. |
ANIMAL.BBC | A 'guess the animal' game which learns from experience (well, almost!). |
BUGGY.BBC | A 'driving' game in which you need to avoid the verges and potholes. |
DIBLEY.BBC | A puzzle in which you have to work out how to move obstacles to reach the exit. |
HANOI.BBC | Solves the 'Towers of Hanoi' problem; not really a game as the computer does all the work! |
RHEOLISM.BBC | A Tetris-like game in one (highly convoluted) line of BBC BASIC! |
SUDOKU.BBC | Plays and solves the popular number puzzle. |
TRIPLES.BBC | Move the wooden objects to create a row of three or more that are identical. |
ASMTEST.BBC | A test program for the built-in assembler. |
ASMTEST2.BBC | A program to test the assembler with floating-point instructions. |
ASMTEST3.BBC | A program to test the assembler with MMX instructions. |
ASMTEST4.BBC | A program to test the extensions supported by the ASMLIB library. |
ASMTEST5.BBC | A program to test the extensions supported by the ASMLIB2 library. |
BANNER.BBC | Displays horizontally-scrolling news headlines; uses the XMLLIB library. |
BEZIERFIT.BBC | Demonstrates fitting a polyBézier curve to multiple points; uses the GDIPLIB library. |
CALENDAR.BBC | A perpetual calendar, to demonstrate the DATELIB library. |
CLIENT.BBC | A chat client, used in conjunction with SERVER.BBC to demonstrate the SOCKLIB library. |
CONWAY.BBC | Conway's 'Game of Life' cellular automaton, using shader code to calculate its 'evolution' very quickly. |
ELLIPSEFIT.BBC | Demonstrates fitting an axis-aligned ellipse to four points; uses the GDIPLIB library. |
KERNING.BBC | A simple demonstration of how the appearance of proportional-spaced text can be improved by kerning. |
LANCHAT.BBC | A serverless chat program using UDP connections provided by the SOCKLIB library. |
MODE7DEM.BBC | A program to test and demonstrate MODE 7. |
POEM.BBC | 'Now Press Return', an interactive poem by Roger McGough (© 1981). |
PROMPTER.BBC | Smoothly scrolls text up the screen; uses the NOWAIT library. |
SCROLL.BBC | A demonstration of scrolling over a large canvas, using @ox% and @oy%. |
SERVER.BBC | A chat server, used in conjunction with CLIENT.BBC to demonstrate the SOCKLIB library. |
SHEET.BBC | A simple spreadsheet program. See the file SHEET.TXT for details. |
SORTDEMO.BBC | Graphically demonstrates different sorting algorithms and compares their speeds. |
SORTTEST.BBC | Tests and demonstrates the SORTLIB library. |
UNICODE.BBC | Demonstrates BBC BASIC for Windows' multilingual text capability. |
UNICODEP.BBC | Demonstrates multilingual text and right-to-left output to the hardcopy printer. |
ALIENS.BBC | Demonstrates the use of the IMGLIB library to load and plot rotated and scaled images. |
ANIGIF.BBC | Demonstrates displaying an 'animated GIF' graphic, using the IMGLIB library. |
BOUNCE.BBC | Coloured balls bounce across the screen; the program illustrates the use of data structures. |
CHAIN.BBC | A graphics demonstration using icons with transparent backgrounds. |
CLOCK.BBC | A very realistic analogue clock display. |
DISCO.BBC | Demonstrates the RECTANGLE SWAP statement. |
DOODLE.BBC | A simple 'etch-a-sketch' drawing program. |
ELLIPSES.BBC | Multi-coloured patterns created from rotated ellipses. |
FERN.BBC | A lifelike fractal image produced by a simple formula. |
FLASHING.BBC | Emulates the BBC Micro's flashing colours. |
FLIER.BBC | A spacecraft animation. |
FLOOD.BBC | Demonstrates the PLOT 143 (flood fill to non-background) statement. |
FLUID.BBC | A plasma-like swirling fluid, generated using the SHADERLIB library (shader code by Teqqles). |
GDIPDEM.BBC | Demonstrates the GDIPLIB anti-aliased graphics library. |
JCLOCK.BBC | An unusual clock that follows mouse movement. Loosely based on a Javascript program. |
LIGHTING.BBC | Demonstrates the use of the Direct3D lighting engine. |
MANDEL.BBC | Plots the famous fractal very quickly, using SSE instructions. |
OPENGL.BBC | A translation to BBC BASIC of an OpenGL 3D graphics demonstration program. |
PENROSE.BBC | A well known optical (and auditory) illusion! |
PERSIAN.BBC | A 'Persian carpet' graphics demonstration. |
PIECHART.BBC | Demonstrates drawing a pie-chart. |
POINTER.BBC | A demo version of a LOGO like 'turtle graphics' language. |
POLYDOTS.BBC | An animated graphics demonstration showing dots racing around polygons. |
POLYGON.BBC | A graphics demonstration program. |
PYRAMID.BBC | A demonstration of 3D graphics using the Direct3D library. |
SAUCER.BBC | A simple but effective 3D drawing. |
SCARAB.BBC | A scarab beetle-like pattern created from the behaviour of sines and cosines. |
SEASCAPE.BBC | A realistic seascape created in real-time using the SHADERLIB library (by Alexander Alekseev). |
SINE.BBC | Illustrates the 'text at graphics cursor' (VDU 5) mode. |
SLIDERULE.BBC | A demonstration of large sprites created using FN_createspritefrombmp. |
SLITSCAN.BBC | An emulation of the optical 'slit scan' technique using the SHADERLIB library (by Roy Wiggins). |
SNOWSCENE.BBC | A winter scene featuring a realistic fractal tree which is different every time. |
SPECTRUM.BBC | Proves you can display more than 16 colours at once! |
SPOTLIGHT.BBC | A demonstration of the different types of light provided by the 3D graphics library. |
SPRITES.BBC | A demonstration of BBC BASIC for Windows sprites. |
SQUARES.BBC | An attractive pattern resulting from the exclusive-or function of the horizontal and vertical coordinates. |
SURKS.BBC | A demonstration of drawing 'thick' circles using the VDU 23,23 command. |
SWIRL.BBC | A demonstration of drawing 'thick' arcs using the VDU 23,23 command. |
TEAPOT.BBC | A realistic 'tumbling teapot' animation, using D3DX8BBC.DLL. |
WHEEL.BBC | A rotating colour wheel, showing the use of *REFRESH to control animation. |
VORONOI.BBC | A shader-based demonstration of an animated Voronoi Diagram (© 2013 by Inigo Quilez). |
WORLD.BBC | A 'rotating globe' animation, demonstrating mapping a texture onto a 'curved' surface. |
CRADLE.BBC | A simulation of Newton's Cradle, which demonstrates conservation of energy and momentum. |
CRATES.BBC | Simulates crates falling under the influence of gravity and tumbling over each other. |
DANGLE.BBC | Simulates a dangling chain, which you can grab with the mouse. |
PINBALL.BBC | A working simulation of a pinball table, combining 2D physics with 3D graphics. |
PINTOGRAPH.BBC | Simulates a pantograph-like drawing engine made from Meccano™ components. |
CDPLAYER.BBC | Turns your CD-ROM drive into a simple CD player. |
ENTERTAINER.BBC | Plays the popular Scott Joplin piece while displaying an animated piano keyboard. |
METRONOME.BBC | Displays a simulated, working, metronome. |
PIANO.BBC | A polyphonic 'piano' using the PC's keyboard. |
POLLY.BBC | A demonstration of SOUND and ENVELOPE. |
SKATERS.BBC | A demonstration of four-voice music, enabled using *TEMPO. |
SOLDIERS.BBC | Plays a well known tune accompanied by a synchronised 3D animation of the subject matter! |
SPEAK.BBC | Uses the COMLIB library to access the Windows™ Text-to-Speech engine. |
TOCFUGUE.BBC | A demonstration of stereo sound using the HQSOUND library. |
TOFAIR.BBC | Another demonstration of the High Quality sound library. |
WIDOR.BBC | The Toccata from Widor's Organ Symphony number 5. |
BEEBXFER.BBC | A utility for transferring files from a BBC Micro. |
DLGEDIT.BBC | A 'visual' dialogue box editor, simplifying the design of custom dialogue boxes. |
FCONVERT.BBC | A utility for converting Acorn data files. |
ICONEDIT.BBC | A simple icon (or sprite) editing program. |
PROFILER.BBC | An execution time profiler to help tune programs for maximum speed. |
SAA505X.BBC | Lists the alternative teletext character sets in the MODE7LIB library. |
SEARCHBBC.BBC | Searches .BBC files for a specified string. |
SETTAB.BBC | Programs the TAB key in the editor to move to a specified column. |
WMF2EMF.BBC | A utility for converting .WMF files to .EMF files |
DLGDEMO.BBC | A demonstration of the creation of a dialogue box. |
GUIDEMO.BBC | A program with a Windows™-style interface. |
MDIDEMO.BBC | Demonstrates the Windows™ Multiple Document Interface. |
MENU.BBC | A demonstration of how to add a menu bar. |
MENU2.BBC | As MENU.BBC, but using a popup menu. |
MULTIDEM.BBC | Creates multiple output windows using the MULTIWIN library. |
OPTICS.BBC | Uses pushbuttons to control a graphical demonstration. |
REBAR.BBC | Creates a 'rebar' control using the WINLIB5A library. |
SOLVE.BBC | Solves simultaneous equations using the ARRAYLIB and WINLIB5 libraries. |
TEXTEDIT.BBC | A simple text editor, utilising Windows' built-in edit control. |
VSCROLL.BBC | A demonstration of the use of a scroll bar. |
WIDGETS.BBC | A demonstration of a floating tool bar, a trackbar and a progress bar. |
BBC BASIC for Windows is the Copyright © 2001-2021 of R. T. Russell. It is supplied for use on one computer at a time only. Neither the program nor its accompanying documentation may be copied for simultaneous use by the purchaser nor for use by anyone other than the purchaser.
Schools and colleges are granted permission to reproduce or adapt sections of this manual to support teaching in a classroom context.
The name BBC BASIC is used with the permission of the British Broadcasting Corporation.
The aPLib compression library is used with permission. Copyright © 1998-2014 by Joergen Ibsen, All Rights Reserved.
CONTENTS |
CONTINUE |