Small Commodore BASIC 2.0 Tutorial
- for small IT professionals and those, who want to be -
The C64 is equipped with a built-in BASIC interpreter. Directly after turning on the C64 the user finds himself not only in the operation system but also in the BASIC 2.0 interpreter.
The BASIC of the C64 allowed even small toddlers to write their own games in case of a lack of resupply of incoming games. Their quality may not have met professional standards - but hey! - have you ever seen a 10-year old who wrote the games for his Playstation himself? In former C64 times this was noting unusual.
The C64 is therefore still a great machine to teach basic principles of programming. The user is not facing abstract "hocus pocus" he may come in touch with modern languages of today's machines. And his first steps are often rewarded with small successes.
BASIC is a high-level language that was developed in 1964 to make it easier to develop computer programs. The term "BASIC" is an acronym which stands for "Beginners All-purpose Symbolic Instruction Code".
This easy to learn programming language conquered the whole world and is still common to solve small and medium-sized tasks. You can find free ultra-modern BASIC compilers on the Internet, e.g. as part of "Visual Studio Express".
Hello World!
To write something on the screen you can use the PRINT command. To try out the following examples you can use the C64 emulator directly here on the website or you can install C64 emulator software on your computer or mobile phone. Enter the following command on your C64:
PRINT "HELLO WORLD!"
Then press the RETURN key.
If you did everything right, the text you specified will appear in the quotation marks.
On the C64 the rows of a BASIC program have line numbers.
Type in the following program:
10 PRINT "HELLO "
20 PRINT "WORLD"
Don't be surprised that after you entered the two rows of code nothing happens on the screen. You just created your first C64 BASIC program! To run a program from memory you have to use the "RUN" command followed by the RETURN key. Afterwards you will see your text on the screen again.
Besides the possibility to write text on the screen you can use the PRINT-command to write special characters and colors.
The C64 listens
Have you ever wished for someone who would listen to you - endlessly? Someone who would never ever forget what you told him? Someone who would answer you with thoughtful words? Then the C64 is the right machine for you!
Try out the following program:
10 PRINT "HELLO, I AM THE C64"
20 PRINT "WHAT IS YOUR NAME?"
30 INPUT A$
40 PRINT "HELLO ",A$,"!"
50 PRINT "IT IS A PLEASURE TO MEET YOU!"
Start the program again using the RUN-command.
The C64 will introduce itself and you can introduce yourself. Therefore enter your name and press the RETURN-key.
As you can see, the C64 memorises your inputs and does something with it.
How does this program work?
The INPUT command stores the input of the user in a variable.
A variable is a small part of the memory of the C64 which is identified by a unique name. In our example the name of it is A$. During runtime of the program, the data the user entered is stored in this variable and the program can evaluate its contents.
"Your First Commodore 64 Program", Dr. Rodnay Zaks, SYBEX Inc.

