Skip to content

Programming in BASIC

BASIC is the language your ACE speaks the moment it finishes booting. There is nothing to install and nothing to set up. The OK on the screen is the language waiting for you.

This half of the guide teaches it from the beginning. You do not need to have programmed before. You do need an ACE switched on in front of you, or the emulator open, because every page here has something to type.

How to read this

Work through Part I in order. Each chapter is short, builds on the one before it, and ends with a program you can run.

Then keep Part II to hand. It's the half you flip to at one in the morning when you can't remember whether MID$ counts from 0 or 1 — every keyword, every error message, and an example of each.

Everything here is typed in upper case

The ACE's keyboard has no lower case, so BASIC doesn't either. Type it as it's printed and you'll be fine.

The shortest possible program

If you have not typed anything into the machine yet, start here:

PRINT 6 * 7
 42

OK

You just wrote a program. It ran the moment you pressed Enter, which is the first thing the next chapter is about.

Part I — Learning it

ChapterWhat you get out of it
Typing it inLine numbers, RUN, LIST, and editing what you wrote
Numbers and variablesStoring things, and what the machine can count to
Showing thingsPRINT properly: columns, tabs, and neat output
Asking questionsINPUT, and what happens when the answer is nonsense
Making decisionsIF, THEN, ELSE, and the truth trap
Going around againFOR, NEXT, STEP
SubroutinesGOSUB, RETURN, and menus with ON
ArraysDIM, and holding a lot of numbers at once
Working with wordsCutting up and gluing together text
Lists in the programDATA, READ, RESTORE
Your own functionsDEF FN
Sound and videoCLS, LOCATE, COLOR, SOUND, VOL
Sticks and keysINKEY, JOY, PAUSE, WAIT
Saving your workSAVE, LOAD, BSAVE, and the memory card
Time and memory that lastsTIME, DATE, NVRAM
Reaching the machinePEEK, POKE, SYS, BANK
When it goes wrongSTOP, CONT, and reading an error
Programs worth typingEight finished programs, including a game

Part II — Looking it up

PageWhat's in it
Every keywordAll 85 of them, with a working example each
Every error messageWhat it means, and what to do about it
What BASIC does with your memoryWhere programs, variables and strings live

Written for BIOS v1.5. Released under the MIT License.