80-Bus News

  

January–March 1982, Volume 1, Issue 1

Page 25 of 55

CP/M

Uncle Dusty’s Notes for CP/M users

Dusty Pulver

When you’re in the command mode of your CP/M’ed Nascom or Gemini (i.e. when it prompts A>), typing in the name of a .COM file will cause that file to be loaded into the computer at location 100H upwards, and then the instruction at 100H will be executed. How nice it would be if you could load a program without running it, or run a previously loaded program. Well, you can. This is how.

Loading A Program

To load a program without running it, type in the program name followed by a space and ^A. CP/M will load the program, then the CCP will look at what follows the space to see what has to be put into the default file control block (FCB). Finding ^A which is an ‘illegal’ character, it will output the symbol that represents ^A (a sort of upside down L in a Nascom) followed by a ‘?’, meaning ‘I don’t understand’, and will then return to the command mode, leaving the program that you wanted loaded into memory, but unexecuted, and unaltered.

Executing A Previously Loaded Program

First of all create a new program called RUN.COM. You don’t need an assembler or anything like, just type in the following:
SAVE 0 A:RUN.COM
This will put the most wholly remarkable program in the entire universe onto the disk in drive A. It is 0 (yes, zero) bytes long, and occupies no room on the disk, apart from one of the available directory spaces. Whenever I format a new disk, this is the second program I put onto it (the first is DISKNAME.007, or whatever I’ve decided to call that disk. You can’t beat a good disk catalogue!).

When in the command mode, typing RUN will execute the program at present in memory, whether you’ve just put it there as previously described, or whether it’s something you’ve already run, but want to run again, but without the time lag caused by the program being reloaded from disk.

More amazing still, RUN.COM will accept entries for the TFCB, so if you’ve got, for instance, PIP.COM loaded, typing RUN B:=A:PROGRAM.COM[V] will copy the file PROGRAM.COM from disk A to disk B and verify it, but without the wait while PIP.COM is loaded from disk.

Apart from the time advantage when running the same program several times, but with different parameters, the main use of this program is that you can load a program, change the disks, do a ^C to ‘log in’ the new disks, and then run the program, using data on, and writing to the new disks. For instance using PIP.COM you can copy the whole of one disk to the other, even though PIP.COM is on neither of them. Also you can load a program and then save it onto another disk, without all the hassle of going through DDT or ZSID even in a single drive set-up. Just use STAT.COM to find the number of sectors a program uses, and then load the program as described. Change disks, use ^C to log in the new one, and save the program onto the new disk.

Note… RUN.COM will not work repeatedly with some programs, such as the CP/M user group’s FMAP, because they change themselves when they are run.

USING RUN.COM with MBASIC-80

Microsoft’s disk based MBASIC-80 alters itself on initialization so that if you exit the program with the command ‘SYSTEM’ or if the program crashes due to a disk error, or you not using ‘RESET’ when you change disks, you can perform a warm start by typing in RUN thereby retaining your program in memory, that a cold start would erase!

Page 25 of 55