Egghead.page Logo

How to Save a Program to Disk on the Commodore 128

Saving your work on the Commodore 128 is a fundamental skill for any user of this classic 8-bit computer, ensuring that your BASIC programs or machine language code are preserved on floppy disk for future use. This guide outlines the necessary hardware setup, the specific BASIC commands required to write data to a 1541 or 1571 disk drive, and the proper syntax to ensure your files are stored correctly without errors. By following these steps, you will learn how to securely transfer data from the computer’s memory to physical media using the standard Commodore DOS commands.

To begin the saving process, you must first ensure that your Commodore 1571 or 1541 disk drive is powered on and connected to the expansion port of the Commodore 128. Insert a formatted disk into the drive and close the latch firmly. Once the drive light stops flashing, indicating the disk is ready, you can proceed to the BASIC command prompt. If you are currently running a program, you should return to the ready prompt by typing NEW or pressing the reset button, keeping in mind that resetting will clear your memory, so only do this if you have the code ready to save from memory.

The primary command for storing data is SAVE. The basic syntax requires you to specify the filename in quotation marks followed by the device number. For the standard disk drive configuration, the device number is 8. To save a program named “MYGAME”, you would type SAVE "MYGAME",8 and press the Return key. The drive light will illuminate as the computer writes the data to the disk, and the ready prompt will return once the operation is complete. It is important to note that filenames are case-sensitive within the Commodore DOS environment and should adhere to the PETSCII character set.

After saving, it is good practice to verify that the program was written correctly. You can do this by using the VERIFY command with the same syntax used for saving, such as VERIFY "MYGAME",8. This compares the data on the disk with the data currently in memory without reloading it. If you wish to load the program back into memory later, you would use the command LOAD "MYGAME",8. Once loaded, typing RUN will execute the program. Mastering these commands allows you to build a personal library of software on physical disks, preserving your creations on this vintage hardware platform.