Home  Articles  Programs 

Using RAM Expansion with CP/M

CP/M has only five built-in commands. The rest are transient commands, meaning they reside on disk. To copy a file from one disk to another, for example, you must first insert the disk containing PIP.COM into the disk drive and type PIP at the A> prompt. Once the command is in memory, you can copy files back and forth between disks. A shortcut is available: you can provide the filenames when you load the command (PIP B:BACKUP.COM= A:LIFE.COM for example).

Because CP/M is a disk-intensive operating system, a slow drive will cause annoying delays. If you own a C-128, you can run CP/M with a 1541 drive, but you'll find disk access very sluggish. A 1571 is preferable for three reasons: It's faster, the disks can hold twice as much data (320K versus the 1541's 160K), and it can read other CP/M formats, such as Osborne, Kaypro, and Epson.

A SUPERFAST DISK DRIVE:

The fastest disk drive of all, however is a 1700 or 1750 RAM expansion operating as a RAM disk. A 1541 or 1571 is mechanical; the disk spins, a read/write head moves back and forth over the surface, and bits are transferred over the serial cable. The time it takes to read or write a file is limited by the speed of the mechanical parts in the drive. Memory, on the other hand, is almost instantaneous. The Commodore RAM expanders transfer data at one megabyte per second, so a 64K program loads in 1/16th second, many times faster than a 1571.

Since any program or command will load in a fraction of a second, the time it takes to read a disk is no longer a problem. After booting CP/M, you can copy all your favorite utilities to the RAM disk, which operates as drive M. Type the following lines (which assume that PIP.COM and other useful programs are on the utility disk in drive A):

pip m:=a:pip.com
m:
pip m:=*.*

The first line copies the PIP program to drive M (the expander). The second changes the default drive to M (after you've pressed RETURN, the A> prompt will change to M>). The final line uses wild cards to copy all files from drive A to drive M.

To make things even easier, you can use a word processor or line editor to type the three lines above into a file named PROFILE.SUB and copy it to your boot disk. You must also put a copy of SUBMIT.COM on the disk. When the system boots, the commands in PROFILE.SUB will automatically execute, and all the files on the disk will be copied to the expander.

With your favorite utility commands and programs in the RAM disk, you can call up any one of them almost instantaneously.

HELP IS A KEYPRESS AWAY:

The Commodore-128 CP/M disk contains a program called HELP.COM. To run it, just type HELP (with the proper disk in the drive) and then type the commands or topics about which you want to learn more. The public domain program Modem Executive (MEX.COM) and Kamasoft's program OutThink also support the HELP command. Sometimes you can access the help file by pressing the gray HELP key.

These help files are useful when you've forgotten the details of a certain command. But they're all disk-based files, and sometimes it takes ten seconds or more to find the file and display it on the screen.

If you PIP the program and the help files over to the RAM disk, the time savings are significant. Press the HELP key and the information you need is instantly there.

FAST BACKUPS:

If you own two disk drives, making backup copies of disks or programs is relatively fast. To backup a whole disk from A to B, use PIP B:=A:*.* and PIP takes care of the rest. It's not as easy with a single drive. You're forced to use the virtual drive E (the computer's memory). If you PIP E:=A:*.* you'll have to follow the prompts (INSERT DISK E, then INSERT DISK A:, INSERT DISK E, and so on). It's quite a time consuming process.

Again, the memory expanders can speed things up. If you have a single drive plus the 1700 or 1750, you can PIP all the files from A to M, switch disks, and PIP them from M to the disk in A.

DOWNLOADING AND DEBUGGING:

The are thousands of public domain CP/M programs available. Many can be found on remote CP/M (RCPM) bulletin boards throughout the country. Most RCPM boards are free or charge a modest membership fee.

Cost becomes a factor when you consider that you generally have to call long distance to access an RCPM board. The longer the call takes, the higher your long distance phone bill. One way to speed up downloads is to use the highest baud rate modem you can. The speed of your disk drive also makes a difference. If you download to disk, the terminal program will pause now and then to write the file to disk. This adds to delays which add to the connect time.

Downloading to a RAM disk cuts down on long distance charges. You can download a file directly into memory, log off, and copy the file to disk without paying extra for the time it takes to write to disk.

The RAM expanders also help if you're writing programs in a compiled language. Languages such as C and PASCAL (some of which are in the public domain) are available for CP/M. But most are compiled languages, which means that you have to load a word processor or line editor, type in the program, save it to disk, exit the editor, and run the compiler to create the program. If there are errors, you reload the editor and the source code, make the change, recompile it, and so on.

If you're trying to track down an elusive bug, it takes time to switch back and forth between the editor and compiler. If you have a RAM disk, the loading time is unnoticeable.

One final advantage of using a RAM disk is its size, especially if you have a 1750. Its 512K of available memory is bigger than a double-sided 1571 disk. With large amounts of memory, the fast access time, and a program like Turbo Pascal or dBase II, CP/M on the C-128 gives you a powerful computer system.

Reference: "Using RAM Expansion with CP/M", D. Kline, Compute!'s Gazette, March 1987 - Issue 45, Vol. 5, No. 3

.

D. Kline
01.03.1987

Keywords: CP/M, Commodore 128, RAM Expansion Unit


C64 Projects Twitter Page

İlker Fıçıcılar's CBM Page