C64-Commands

From C64-Wiki

Jump to: navigation, search
Einschaltbild eines 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 programm 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 comman 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 Template:keykey 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 be 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 programe line with 241 characters or 7 lines.

  • After writing a BASIC-Command or a line number with commands Template:key has to be pushed in order store the line of commands to memory.
  • DIfferent commands within a line can be separated with a colon (:).
  • The name of variables may not consist of BASIC-keywords (see BASIC-keyword-table below)
  • Data and characters can be assigned to variables with the adequate properties.
  • A BASIC-Program may only contain the line numbers from 0 to 63999 inclusive.

[edit] BASIC-Keywords Overview

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  

[edit] Literature

German Books

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

[edit] Remark

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

Personal tools
Help and Feedback
In other languages