Table of Contents

COMMODORE 8-BIT DISK DRIVE LOADING BASICS:

By Larry Anderson larry@portcommodore.com

for the Silicon Realms BBS - (209) —=—- (300-2400 baud)

You would think that loading a program from the disk drive would be an easy method, but as you probably know by now there is alot to understand to load some programs. This tutorial will help you on loading files properly with just about any hardware you may have.

AIDS:

First let me mention the various aids that help you effectively use your Commodore computer with a disk drive.

DOS Wedge

This is the program that comes on your Commodore Test/Demo disk (which is packaged with the disk drive). The wedge adds commands to list the directory and send disk commands without a lot of typing. The main disadvantage is that every time you want to use the wedge, you must load it in before doing anything else.

Fast-Loader Cartridges

After a disk drive and printer, this is probably the next 'Must Have' on your wish list. Not only does it have the features of the DOS Wedge, it also has the capability of loading your programs many times faster than normal. The newer super-utility cartridges also add fast saving, screen printing, program freezing, etc. There usually is a price to be paid, sometimes in the price tag, and later in the compatibility with programs. Some of the older carts can cause damage to files due to the differences in disk drive programming, some will only work with the 1541, and all have a remote chance of not loading your programs (for those cases, you will have to disable or remove the cartridge). All in all the fast-loaders are a superior value, and the super carts for those looking for more features or a wider variety of drives supported.

Special Chips and Ad-In Boards

Similar to cartridges except they are installed inside the computer and disk drive(s). Older models required special cables other than the serial cable. The newer ones are a superior value with usually ALL disk drive functions speeded up, though check the capability and if you can disable them without opening the computer!

PET 4.0, B-128, Commodore 128, Plus/4, and C-16 BASICs

These computers have an expanded BASIC (one referred to as BASIC 4.0) that include disk drive specific commands. The 128 also has a built-in fast-loader for use with the 1571 and 1581 (when the computer is in 128 mode)

LOADING:

The first command to know is how to load a program, there are two ways to load a program, one is the standard relocating load, the second, is the un-relocated load. Here is the format of the load command:

LOAD"file name",8,1

The first word, LOAD, tells the computer that you wish to fetch something off a device and put it in memory. Next there is a double quotation mark, this tells the computer to read-in a file name. The file name is next, the name can bea maximum of 16 characters consisting of numbers and letters (some punctuation can be used but may cause problems). The name must match one of a file on the disk else the computer will tell you the file is not found. The second quotes let the computer know you finished the name, and next you will find a ,8, this is to tell the computer to load the program from the disk drive, without it the computer will load off tape. The last part, the ,1, (Which pertains to the VIC, 64, B-128, Plus/4 Commodore-16, and 128) determines how the program will load, with out it, the computer will assume the program is in BASIC and will load it into BASIC memory regardless where it was saved from (this is to allow you to load BASIC programs from other Commodore computers). With the ,1, the computer will load the program to the same area of memory it was recorded from, which is necessary for graphics, subroutines, special loaders, etc.

After entering your load command the computer will do one of three things, start the program, print READY., or do nothing. If it starts you are ok, if it prints READY, enter in RUN to see if the program will run. If the computer does nothing after a few seconds or prints syntax error after running, it may be you loaded the program improperly (add or delete the ,1), some programs are not meant to be loaded by the user so you may have to try another program. Other programs may needed to be started by using a SYS command, usually you will know these by the file name, such as “WEDGE 49152”, which may mean to load the program with a ,1 then after it says ready, enter SYS 49152.

DISK FUNCTIONS AND COMMANDS:

The Directory:

On almost every formatted disk there is a directory of the files contained on the disk. to view the directory of the disk in the drive, type one of the following:

(if you have a fast-loader Cartridge)

$

(if you are using a DOS Wedge or for other fast-loaders)

@$  or  >$

(if you are using a PET 4.0, B-128, Plus/4, Commodore 16, or a 128 in 128 mode)

DIRECTORY or DI(SHIFT-R)

(if you are using an older PET, 64, or VIC-20)

LOAD"$",8  (DO NOT add the ,1)
LIST

All functions except the last will leave the contents of the BASIC memory intact if you were using it, the last overwrites the memory with the directory of the disk. So if you are entering in or editing a program, SAVE it to disk or tape before LOADing the directory.

Here is an Example Directory:

0 "GREAT GAMES DISK" GD 2A      (line 1)
27   "STAR TREK"        PRG     (line 2)
5    "HIGH SCORES"      SEQ     (line 3)
1    "PAC-GUY"          PRG     (line 4)
68   "-PAC-GUY"         PRG     (line 5)
100  "MAZES"            REL     (line 6)
10   "EXTRA STUFF"      USR     (line 7)
453 BLOCKS FREE.                (line 8)

using a dual disk drive and the directory is from a disk in drive #1, then it would be 1. The name of the disk is next, the disk was given this name when the user formatted the disk. The two characters after the name are the disk's identifier (ID), it is used by the drive to tell one disk from another so it will not overwrite any information on the wrong disk (that is why it is important to use different IDs when formatting disks). Last on line 1 is the format identifier, disks formatted on other Commodore drives (usually 2020 and 2040 drives) may have a different identifier, if they do the drive will not allow you to write to that disk (in case the change in version may alter the format of the disk), of course you can re-format it and loose all the current data.

the size of the file in blocks, these blocks are in 254 character segments, the last block in a file may not use all 254 characters though. Next is the file name, the name can be up to 16 characters in length, some users use special control characters to make their name unreadable to prevent copying. Finally on the lines is the file type identifier, the only easily loaded file type is the program file (PRG), most others are accessed by other programs.

blocks (chunks of 254 bytes). This value may be misleading on Commercial programs, it is best not to store files on commercial disks unless the program documentation says it's ok.

LET'S GO THROUGH THE DIFFERENT TYPES OF FILES AND WHAT THEY ARE FOR:

PRG: program file

Program files are copies of areas of the computer's memory. Most program files can be LOADed and RUN, but some are recordings of special areas of memory for other programs to use, hence you cannot make them operate by themselves.

SEQ: sequential access data file

Sequential files are mainly used to store text and numbers, which are used by word processors and many other programs that store data. They cannot be LOADed or ran.

REL: relative access data file

Relative files also store text and numbers but in a special way, they are divided into chunks called records, and a program can examine any record anywhere without having to read through the file to find the record. This file type is used primarily for data bases and mailing list applications.

USR: user defined file

The most rare file, this is a file designed to be used in a certain way with certain programs. Such files are used in GEOS, but not all USR files are GEOS files. These also cannot be loaded and ran.

random access files

This is not really a file, but information stored on the disk without a directory entry. On commercial disks you may see only one program on the disk, but when you run the program, it keeps getting the information from the disk not by files, but by reading the information directly from the blocks on the disk. Writing to a disk that contains random files, may destroy important information that a program needs to operate.

LOCATING RUNNABLE PROGRAMS:

To find a RUNable program from a directory sometimes is not easy, some directories may not have any at all. Let's go through our sample directory and find some runnable programs.

First we now know that only program (PRG) files would work when loaded, so lines 1,,3,6,7, and 8 are not the ones we want. “Star TREK” is a BASIC game and can be loaded with just a ,8 and then by entering RUN after loaded. “PAC-GUY”, on the other hand is also a program, but it is called a boot program, boot programs LOAD and RUN any necessary files (in this case “-PAC-GUY”). The name boot comes from the word BOOTSTRAP, which is from “putting on your boots by the BOOTstrap”. Unless the files listings were moved around, the boot program usually is the first program file on a disk directory, or a in a list of similar named files in the directory. Some boot files will automatically load and run by just loading them with a ,1, others may be in BASIC and need you to enter RUN to start them after loading. On disks that contain a menu or only one program (as in commercial disks), you can tell the computer to load the first file from the disk without even knowing the name use this: LOAD“?*”,8,1 (you may omit the ,1 if this doesn't work).

HERE IS A GOOD PROCEDURE TO TRY TO GET FILES LOADED:

  1. Try LOADing the file with a ,8,1
    if it does not RUN or say READY, then go to step 3
  2. If it says READY., enter RUN and see if it works.
    if it does not work, try this:
  3. Try loading it just with a ,8
  4. Enter RUN
    if it does not work or say READY. then this file is probably not user runnable.
  5. if it says READY. and the file had a number in it's name, enter SYS (number

that was in the name), if this does not work, that's the best you can do.

If you are certain you can run that file, bring it to a knowledgeable fellow user, they're sure to make it work, or tell you why it won't.

OTHER WAYS OF LOADING FILES:

LOAD"?*",8,1 and RUN:

On some fast-loaders

press COMMODORE-RUN/STOP
or sometimes SHIFT-RUN/STOP

On the Plus/4, Commodore 16, B-128, and PET 4.0,

press SHIFT-RUN/STOP

LOAD"(file name)",8 and RUN

Wedge and some fast-loaders:

[left arrow symbol](file name)

128 in 128 mode:

RUN"(file name)

LOAD"(file name)",8

Wedge, and some fast-loaders:

/(file name)

PET 4.0:

DLOAD"(file name)"

LOAD"(file name)",8,1

Wedge and some fast-loaders:

%(file name)

B-128, 128 in 128 mode, Plus/4, Commodore-16, and 4.0 PETs

DLOAD"(file name)"

PETS cannot relocate BASIC files when loading like later Commodore computers do, so BASIC programs written on other Commodores may not be able to load without some extra effort.

EASY WAYS OF LOADING FILES:

To really save time for those not adept at typing cryptic filenames, here are some quickie tips to load a file:

Wildcards:

The disk drive understands other characters besides just the filename, these are called wildcards and are: * and ?. “*” (asterisk) allows you to truncate a file name, by entering “PAC*” as the filename, the drive will select the first file that starts with PAC and attempt to load it, if it is not a program it will say file not found. you can use ? instead of certain characters say you want to load a file and are not sure whether it is named TICKER or TOCKER you can load it with T?CKER and it will load the first match of the characters present. You can combine wildcards, just make sure the * is the last character. If you try load just * it will load the last accessed file (unless the disk has been changed, then it will load the first file). Just using ? will load files of certain lengths, and using ?* will load the first file on the disk (the disk translates it to find the first file with any character in its name).

Directory Loads:

After you list a directory on the screen, move the cursor up to the line on the directory with the name of the file you want to load, replace the block count with the load command, and move the cursor over to the other side of the name, add the device number and loading extension (if necessary) and remove the file type designation, then press RETURN. example:

12   "PROGRAM"         PRG
LOAD "GAME",8,1
53   "DATA"            SEQ

Once the program is loaded, press SHIFT-CLR/HOME to clear the screen and enter RUN (if necessary).

When using a wedge or a fast-loader, you do not need to remove the file type id on the right, just enter the /, *, or % and make sure there are no more block size numbers. example:

/    "GAME"            PRG

LOADING BASIC PROGRAMS FROM NEWER COMPUTERS ON TO THE PETS:

Loading a BASIC program for a newer Commodore computer onto a PET is not an easy process due to the design of the PETs operating system. Check out my PET FAQ for details on how to load/convert files.