Complete list of commands Commodore CBM Basic V4.0 Commodore PET, CBM 3000, CBM 4000, CBM 8000, CBM 8032

Complete list of Commodore PET Basic V4.0 commands

In this article, I list the complete list of commands, functions and variables reserved for the Commodore PET Basic V4.0. The computers that use Basic V4.0 are the CBM and PET series 2001, 3000, 4000 and 8000. This is a simple compendium to remember all the commands, instructions and functions, when you already know how to use them!

Subscribe my YouTube channel ValorosoIT. Retro technology, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

Compared to BASIC v3.5 of the Commodore 16, 116 and Plus/4 et al BASIC V7 of the Commodore 128, the COMmodore PET's BASIC V4.0 has no graphical controls. In fact, the CBM 2001, CBM 3000, CBM 4000 and CBM 8000 were intended for use in the office and not for home use.

InstructionDescriptionType
ABSReturns the absolute value of a numberFunction, numerical
ANDReturns true if both conditions are trueOperator, logical
APPENDOpens the file having the specified filename, and positions the pointer at the end of the fileInstruction/command
ASCReturns the numerical value of a charFunction, numerical
ATNReturns the arctangent of a numberFunction, numerical
BACKUPCopies an entire diskette to another on a dual drive systemInstruction/command
CATALOGDisplays the disk directoryInstruction/command
CHR$Returns the character corresponding to the numberFunction, string
CLOSECloses a fileInstruction/command
CLRDeletes variables arrays, data, ...Instruction/command
CMDChanges the data output to other peripheralInstruction/command
COLLECTChecks and repairs the file system of a disk, frees inaccessible disk spaceInstruction/command
CONCATConcatenates two data filesInstruction/command
CONTResumes execution of a BASIC programCommand
COPYCopies files from one drive to another in a dual disk drive or within a single driveInstruction/command
COSReturns the cosine of an angle (rad)Function, numerical
DATAStores constant information in the program codeInstruction/command
DCLOSECloses disk fileInstruction/command
DEF FNDefines a user-defined functionInstruction

DIMAllocates space in array memory for a new arrayInstruction/command
DIRECTORYDisplays the contents of the disk directory on the screenInstruction/command
DLOADLoads a BASIC program from diskInstruction/command
BAPTISMOpens a disk file for a read and/or write operationInstruction/command
DSGets the numeric code from the current diskStatus_stringReserved variable
DS$Gets the most recent error/status code from a disk deviceReserved variable
DSAVESaves a BASIC program to a disk fileInstruction/command
ENDEnds the processing of the current programInstruction/command
EXP“e” with the power given by the argumentFunction, numerical
FNExecutes a function defined by DEF FNFunction, numerical, special
FORProgram loop start (FOR … TO … STEP … NEXT)Instruction/command
FREReturns the number of unused bytes of BASIC RAMFunction, numerical, special
GETReads one or more chars from the keyboardInstruction
GET#Reads single characters from the specified deviceInstruction/command, special
GO TOJumps to a line numberInstruction/command
GOSUBJumps to a subroutine … RETURNInstruction/command
GOTOJumps to a line numberInstruction/command
HEADERFormats a disketteInstruction/command
IFTests a condition IF … THEN or IF … GOTOInstruction/command
INPUTReads data from the keyboardInstruction

INPUT#Reads data from a file stored on peripheral deviceInstruction
INTRounds a numberFunction, numerical
LEFT$Left chars of a stringFunction, string
LENReturns the number of characters in a stringFunction, numerical
LETAssigns values in a variableInstruction/command
LISTDisplays the BASIC program in memoryInstruction/command
LOADLoads a programInstruction/command
LOGNatural logarithm with the basis eFunction, numerical
MID$Inner chars of a stringFunction, string
NEWClears RAM and programInstruction/command
NEXTProgram loop end (FOR … TO … STEP … NEXT)Instruction/command
NOTReverses true to falseOperator, logical
ONContruct ON … GOTO, ON … GOSUBInstruction/command
OPENOpens a file or a channelInstruction/command
ORReturns true if one or both conditions are trueOperator, logical
PEEKReturns the memory contentFunction, numerical
POKEChanges the content of any memory addressInstruction/command
POSDetermines the actual position of the cursorFunction, numerical, special
PRINTPrints data to the current output deviceInstruction/command
PRINT#Stores data in a fileInstruction/command

READReads constant values from DATAInstruction
RECORDPositions relative file pointersInstruction/command
REMCommentsInstruction/command
RENAMEChanges the name of a file on diskInstruction/command
RESTOREClears the pointer of the next DATA valueInstruction/command
RETURNFinishes a subroutine: GOSUB … RETURNInstruction/command
RIGHT$Right chars of a stringFunction, string
RNDGenerates a random floating point numberFunction, numerical
RUNStarts a programInstruction/command
SAVESaves a programInstruction/command
SCRATCHDeletes a file from the disk directoryInstruction/command
SGNReturns the sign of a number (-1, 0, 1)Function, numerical
SINReturns the sine of an angle (rad)Function, numerical
SPC(Sets a number of spaces into a PRINT outputFunction, string
SQRCalculates square root of a numberFunction, numerical
STGets I/O status byteReserved variable
STEPProgram loop increment/decrement (FOR … TO … STEP … NEXT)Instruction/command, special
STOPBreaks a programInstruction/command
STR$Converts numerical values or variables into a stringFunction, string
SYSCalls an assembly language subroutineInstruction/command
Follow me on Instagram channel. Retro technology, Commodore, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

TAB(Sets the cursor column into a PRINT outputFunction, string
TANReturns the tangent for a given angle (rad)Function, numerical
THENTests a condition IF … THEN (if true)Instruction/command, special
OFGets the system time (seconds/60)Reserved variable
TI$Gets or Sets the system time (HHMMSS)Reserved variable
TOProgram loop target (FOR … TO … STEP … NEXT)Instruction/command, special
USRCalls an assembly language subroutine with argumentFunction, numerical/string
VALReturns the numerical value of a stringFunction, numerical
VERIFYVerifies a saved programInstruction/command
WAITWaits for a memory location to assume specific valuesInstruction/command
+SumOperator, numerical/string
SubtractionOperator, numerical
*MultiplicationOperator, numerical
/DivisionOperator, numerical
^ExponentOperator, numerical
>GreaterOperator, logical
=EqualOperator, logical
<LessOperator, logical

On the website www.valoroso.it and on the ValorosoIT YouTube channel, I am publishing several episodes to learn how to program in Basic, with the Commodore 16, Comodore 64, Commodore 128, GwBasic, QuickBasic, QB64, Atari, etc...

YouTube: https://www.youtube.com/c/ValorosoIT
Instagram: https://www.instagram.com/valorosoit/

Subscribe my YouTube channel ValorosoIT. Retro technology, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

Do you like this page? Share it:

Posted in Retro Computer, Retro Technology and Vintage Electronics, All articles.

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *