Like most of the computers of the time the C64 had a very minimal operating system but it came with BASIC and booted straight into it. If you wanted to run something, you had to get a disk drive (or cassette, or cartridge, but mostly disks) and buy some software, or you'd find a program in a magazine and type it in by hand.

Try this one, it's short but fun:

10 PRINT "(CLR/HOME)"
20 PRINT CHR$(205.5 + RND(1));
40 GOTO 20

Now type RUN and press enter. Pretty cool, huh?

You can also do more advanced graphics, try this one from ComputerRetroGamer on YouTube.

Thankfully the emulator allows you to copy and then paste the program in rather than typing it all by hand. Back in the day you had to type it in and make sure you didn't make any mistakes!

10 print chr$(147)
20 ca=1024:cp=54272:r=25:co=40
30 poke 53280,0:poke 53281,0
40 forw=3to50:fori=1to12:forj=0to12:k=i+j
50 c=j+j+j/(i+3)+i*w/12
60 k1=ca+i+(co*k):i1=ca+k+(co*i):c1=cp+k1:c2=cp+i1
70 k2=ca+(co-i)+(co*(r-k)):i2=ca+(co-k)+(co*(r-i)):c3=cp+k2:c4=cp+i2
80 k3=ca+(co-i)+(co*k):c5=cp+k3:i3=ca+k+(co*(r-i)):c6=cp+i3
90 k4=ca+(co-k)+(co*i):c7=cp+k4:i4=ca+i+(co*(r-k)):c8=cp+i4
100 poke k1,81:poke c1,c:poke i1,81:poke c2,c
110 poke k2,81:poke c3,c:poke i2,81:poke c4,c
120 poke k3,81:poke c5,c:poke i3,81:poke c6,c
130 poke k4,81:poke c7,c:poke i4,81:poke c8,c
140 nextj,i,w
150 goto 10
RUN

Type (or paste) that in the emulator and then press enter.

This is just barely scratching the surface of what you can do, there are full-fledged games/programs/etc written in BASIC. You can use sound, graphics, access peripherals, and much more. There's an entire genre of music based on the SID and other sound chips, check out Chiptune.

Take a look at this guide from 1983 for some really in-depth BASIC: https://archive.org/details/How_to_Program_Commodore_64_BASIC_for_Beginners.

This guide was first published on Sep 25, 2019. It was last updated on Sep 25, 2019.

This page (C64 BASIC) was last updated on Oct 23, 2021.

Text editor powered by tinymce.