C128 Basic 7.0 Commands
The Commodore 128 features two different processors, making it effectively three computers in one. It supports the following operating modes:
- C64 Mode – Uses the 8502 CPU with a 40-column display, providing full compatibility with Commodore 64 software
- C128 Mode – Also powered by the 8502 CPU, this mode supports both 40- and 80-column displays and unlocks the advanced features of the C128
- CP/M Mode – Runs on the Z80 CPU with support for both 40- and 80-column displays, allowing access to a wide range of CP/M software
C128 BASIC Version 7.0 – Expanded Capabilities
Commodore BASIC 7.0 includes over 140 built-in commands, significantly expanding the language's power compared to earlier versions. It adds specialized commands for handling graphics, sound, and animation, making it easier to create interactive programs.
Here are a few examples of BASIC 7.0 commands:
BASIC FUNCTIONS |
COMMAND |
EXAMPLES |
Display the Disk Directory |
CATALOG |
CATALOG D0 [Ddrive number] |
Display the contents of the Disk Directory |
DIRECTORY |
DIRECTORY D0 [Ddrive number -CTRL +S pauses display} DIRECTORY "A*" Lists all files starting with an "A" (using wildcard character "*") |
Load a program |
LOAD |
LOAD "*",8 loads the first file LOAD "$",8 loads the disk directory. |
Load a program from the floppy disk |
DLOAD |
DLOAD "FILE1" |
Switch to C64 mode (compatibility mode) |
GO64 |
GO64 |
Set C128 CPU at 2 Mhz |
FAST |
FAST |
Set C128 CPU at 1 Mhz |
SLOW |
SLOW |
Enter C128 machine language monitor |
MONITOR |
MONITOR |
Clear memory (RAM) |
NEW |
NEW Same in C64 |
SCREEN MANAGEMENT |
|
|
Clear the screen |
SCNCLR |
SCNCLR Same as CLR in C64 Basic |
Select text, bitmap, or split-screen display |
GRAPHIC |
GRAPHIC 2, 1 GRAPHIC <mode> For the parameter Mode:
|
Display the current graphic mode |
RGR |
RGR (x) X is the Graphic Mode as follows:
|
Select colors for background, foreground, and characters |
COLOR |
COLOR X,C X as follows: · 0: background · 1: foreground · 2: multicolor 1 · 3: multicolor 2 · 4: border C is the color (1-16): · Black 1 · White 2 · Red 3 · Green 6 · Blue 7 · Yellow 8 · Orange 9 |
FILE MANAGEMENT |
|
|
Format a floppy disk |
HEADER |
HEADER "DISK",IGD,D0 Formats new disk in drive 0 of floppy device 8. HEADER "DISK",D0 Quick header of an already formatted disk in drive 0 of floppy device 8. |
Copy an entire floppy disk to another (dual drives) |
BACKUP |
BACKUP D0 TO D1 |
Copy files from one floppy drive to another (single/dual drives) |
COPY |
COPY D1 TO D0 Copy the whole disk in drive 1 to the disk in drive 0 (dual-drive) COPY D0,"FILE 1" TO D1,"FILE 2" Copy a file from drive 0 to drive 1 with new filename. |
Rename a file on floppy disk |
RENAME |
RENAME D0, "NAME1" TO "NAME2" Change the name of the file from "NAME1" to "NAME2" in drive D0 |
Delete a file from a floppy disk |
SCRATCH |
SCRATCH "FILE1" SCRATCH "FILE1, FILE2" The first command deletes 1 file, the second 2 files |
Open a file |
OPEN |
|
Close a file |
CLOSE |
|
Repair the file system of a floppy disk and free some space |
COLLECT |
COLLECT D1 On Drive 1 |
PROGRAM MANAGEMENT |
|
|
Run a program |
RUN |
|
Load/Run a program in the form of a binary file |
BOOT |
BOOT "FILE1" BOOT "FILE1", D0, U9 |
End a program |
END |
|
Break a program |
STOP |
|
Save a program |
SAVE |
|
Save a program to a floppy disk |
DSAVE |
|
Verify a saved program |
VERIFY |
VERIFY "FILE1" |
Monitor the latest error number |
IS |
|
Monitor the error message of an error number |
ERR$ |
|
SOUND MANAGEMENT |
|
|
Set the sound volume between 0 and 15, where 15 is the maximum and 0 is off |
VOL |
VOL 15 VOL 0 |
Set the speed of the music played |
TEMPO |
TEMPO t where t is a digit between 0 and 255 |
Set the SID (sound chip) filter parameters |
FILTER |
FILTER cf, lp, bp, hp, res
|
Output musical notes & sound effects |
SOUND |
|
Defines an instrument envelope |
ENVELOPE |
|
Play musical notes |
PLAY |
PLAY "CDEFGAB" This plays the notes C, D, E, F, G, A and B in the piano envelope, which is envelope 0 |
CP/M MODE
The C128 has two CPU’s. The CP/M Mode uses the Z80 microprocessor, providing access to the CP/M Version 3.0. There are also some additional capabilities added by Commodore. CP/M Mode features include:
- Disk-based CP/M 3.0 System
- Thousands of popular commercial and public domain software programs available to the C128 user
- Z80 processor running at 2.04 MHz with 128K bytes of RAM (and up to 640K)
- 40-column (VlC II chip) and 80-column screen output (8563 chip)
- Ability to redefine almost any key
- Emulate several terminals (Lear-Siegler ADM31, ADM3A)
- Supporting various MFM disk formats (IBM, Kaypro, Epson, Osborne)
Basic CP/M Commands
- Dir (Displays the contents of the floppy disk)
- Rename (Rename a file)
- Erase (Delete a file)
- Help (Help is a feature that has different topics available)
- Date (Displays the Date)
- Format (Format a floppy disk for CP/M use)
- Type (To display a text file on screen -For example... type filename.txt)
- Pip (Program that copies files in CP/M)
■ Links:
- · C64 Wiki:
https://www.c64-wiki.com/wiki/Category:BASIC_7.0
- · Commodore 128 Programmer’s Reference Guide:
https://www.pagetable.com/docs/Commodore%20128%20Programmer's%20Reference%20Guide.pdf
- Commodore.ca
https://www.commodore.ca/manuals/128_system_guide/sect-07b.htm#7.3.2.1
■ Commodore 128 Basic Commands
BinaryValue.com