Egghead.page Logo

What Does the RUN/STOP Key Do on the Commodore 128

The RUN/STOP key on the Commodore 128 is a essential control button used primarily to halt program execution and return control to the user. This article explores the core functions of this key, including how it interacts with BASIC commands, its role in loading tapes and disks, and its behavior when combined with the RESTORE key for system resets. Understanding these functions is crucial for troubleshooting frozen software and managing software operations on the classic hardware.

Primary Function in BASIC Mode

In the standard BASIC environment, the primary purpose of the RUN/STOP key is to interrupt a running program. When a user executes a BASIC program using the RUN command, pressing RUN/STOP will immediately cease execution. The computer will then display a BREAK message, indicating the line number where the program stopped, and return the cursor to the command prompt. This allows users to debug code, stop infinite loops, or exit a game without turning off the power.

Canceling Load and Save Operations

Beyond stopping program execution, the RUN/STOP key serves as a cancel command during data transfer operations. When loading software from a cassette tape or floppy disk drive, pressing this key will abort the process. This is particularly useful if the wrong file is being loaded or if the drive encounters an error that causes the system to hang while searching for data. Once pressed, the system will stop reading from the peripheral and return control to the keyboard.

The RUN/STOP and RESTORE Combination

One of the most critical functions involving this key is used when the system becomes unresponsive. Pressing the RUN/STOP key simultaneously with the RESTORE key triggers a hardware interrupt known as a warm start. This combination resets the I/O vectors and restores the system to a stable state without cycling the power. On the Commodore 128, this is often the safest way to recover from a crashed program or a frozen screen, preserving the memory content better than a full power cycle.

Behavior in CP/M Mode

The Commodore 128 features a unique Z80 processor mode that allows it to run CP/M software in addition to standard Commodore BASIC. In CP/M mode, the function of the RUN/STOP key changes slightly to accommodate the different operating system. Instead of a BASIC BREAK, it typically sends a control-C interrupt signal to the CP/M environment. This signals the operating system to halt the current application and return to the CP/M command interpreter, functioning similarly to a break command in other computing environments.

Importance for System Management

For owners and enthusiasts of the Commodore 128, the RUN/STOP key is more than just a pause button; it is a vital system management tool. Its ability to interrupt processes, cancel peripheral operations, and reset the system software makes it the first line of defense against software errors. Proper use of this key ensures smoother operation and protects the hardware from the stress of frequent hard resets via the power switch.