C64-Commands

From C64-Wiki
Jump to navigationJump to search
Startup screen from the Commodore 64

The Commodore 64 has its own operating system (short: OS), which is Commodore-BASIC V2.0 (Beginner's All-purpose Symbolic Instruction Code Version 2). After turning on the C64, there are 38911 free characters (i.e.: Bytes) in the RAM-Memory (main memory). In a wider sense, all C64 commands are BASIC commands.

The BASIC interpreter reports READY. and the blinking cursor shows the user that the computer is ready for input. After a BASIC command is typed in correctly, the command will be executed; otherwise an error-message will be reported, followed by READY. and a blinking cursor again.

The BASIC-Commands can be entered directly (example: RUN to start a BASIC program) or with one or more line numbers - the last is called BASIC program. The BASIC interpreter recognises via the line numbers that a program is written. The command LIST will show the program listing. Initially, the BASIC program or a program listing is only temporarily stored in memory (RAM). When a BASIC program is to be stored permanently, it must be saved on a data media like datasette or disk with the command SAVE. After saving, a BASIC program can be loaded into memory with the BASIC command LOAD.

The BASIC interpreter works off a BASIC program line by line from the first line number (0) until the last line number (63999). The program is interrupted by any BASIC errors, the RUN/STOP key or the execution of the BASIC-Commands END, STOP, LIST or NEW executed.

Example of a BASIC program:

10 PRINT "Hello, I'm the Commodore 64 - What is your name ";:INPUT A$
20 PRINT "Hello " A$
30 END


  • Programming: a line can have 80 characters maximum (40 characters over 2 lines) - any further characters are ignored.
  • Excess length lines can be generated by using abbreviations (tokens) of the BASIC commands or with compilers. The editing of excess length lines is a problem.
1?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?
:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?

Explanation: This example demonstrates the abbreviation of the command PRINT by the token: '?'. In this way you can create a program line with 241 characters or 7 lines.

  • After writing a BASIC command or a line number with commands, RETURN  has to be pushed in order to store the line of commands in memory.
  • Different commands within a line can be separated with a colon :.
  • The name of variables must not consist of BASIC keywords (see BASIC keyword table below)
  • Data and characters can only be assigned to variables with the correct properties.
  • A BASIC program may only contain the line numbers from 0 to 63999 inclusive.

BASIC-Keywords Overview[edit | edit source]

The BASIC version 2 contains the following 71 BASIC-Keywords:

ABS AND ASC ATN CHR$ CLOSE
CLR CMD CONT COS DATA DEF
DIM END EXP FN FOR FRE
GET GET# GOSUB GOTO IF INPUT
INPUT# INT LEFT$ LEN LET LIST
LOAD LOG MID$ NEW NEXT NOT
ON OPEN OR PEEK POKE POS
PRINT PRINT# READ REM RESTORE RETURN
RIGHT$ RND RUN SAVE SGN SIN
SPC SQR STATUS (short ST) STEP STOP STR$
SYS TAB TAN THEN TIME (short TI) TIME$ (short (TI$)
TO USR VAL VERIFY WAIT  

Literature[edit | edit source]


German Books

  • Basiswissen C64
von Joachim Hänsel
Westermann Verlag, ISBN 3-14-508810-6
ein ausführliches Nachschlagewerk

Remark[edit | edit source]

This article in the German C64-Wiki "www.C64-Wiki.de" was "article of the month" in June 2006 and "article of the year" 2006.