Micro Vibe

My Micro Hobby Projects

  • Increase font size
  • Default font size
  • Decrease font size
Home CPM 80 Using CPM CPP Commands

CPP Commands

Print

 

This page contains information on using the built in CPP shell commands provided by the CPM 2.2 operating system. The CPP is the portion of the CPM operating system that provides a user interface. When a user wants to execute a command or load and run a binary program, the name of the command as well as its parameters are input at the current console device one command at a time. When a command completes the CPP portion of CPM will display a prompt on the current console device indicating that the system is ready to execute the next command.  All executable programs stored on disk must have a file extension of ".COM". 

 USER command: The USER command is used to select the current user area code. The user area code can have a value from 0 to 15. On a cold boot the CPM system defaults to user area code 0. The user area code applies to all disk drives mounted and any file created will be saved under the current user area code. The DIR command will only display files in the current user area code. Only programs in the current user area code can be executed.

> USER 9 -- set the current user area code to 9. > USER 0 -- set the current user area code back to the default value of 0.
The STAT.COM program is used to display the currently selected user area code as well as all the user area codes that contain files.
> STAT USR: -- displays the current user area code as well as the codes for all user areas that contain files.
The PIP.COM program can copy files from any user area code to the current user area code using the "G" option on the source file name.
> PIP STAT.COM=STAT.COM[G0] -- copy STAT.COM from user area code 0 to the current user area code .
The problem with using PIP.COM to copy files from one user area to another is there is no simple way to copy the PIP.COM program to the user area code we want to copy files to. Using DDT.COMand the SAVE CPP command it is posible to copy PIP.COM to another user area
copypip To copy the PIP.COM program to another user area use the DDT.COM program to load PIP.COM into memory. Next you reboot CPM using the "G0" command in DDT. Once CPM reboots you change to the user area PIP.COM is to be saved and then use the SAVE command to save the memory image of PIP.COM to a file. The following image shows how this is done.
DIR command: The DIR command is used to list the names of files stored in the current user area of the selected disk. The DIR command excepts one parameter. When the DIR command is executed with no parameter, a list of all the file names in the current user area of the currently selected disk are displayed. If a file name is specified as the parameter to the DIR command the file name will be listed if the file is found or the DIR command will return "NO FILE" if the file does not exist in the current user area. Wild-card characters can be used in the file name parameter to the DIR command to filter the displayed file names. Files with the SYS file attribute are not displayed in a DIR listing use the STAT.COM program to display files with the SYS file attribute.
> DIR *.* --find all files on the selected disk in the current user area. > DIR F*.COM --find all files on the selected disk in the current user area that start with "F" and have a ".COM" extension. >DIR B:PRG???.* --find all files on the "B" disk in the current user area that are six letters long and start with "PRG".
Note: See the USER command section for information on setting the current disk user area. ERA command: The ERA command is used to delete a file or a group of files from a mounted disk. The ERA command takes one parameter, the name of the file to delete. If the specified file exists it will be deleted from the disk. The file name parameter can contain wild-card characters in this case all files that match will be deleted. Only files in the current user area can be deleted. The file name parameter may specify a drive letter to delete a file on a disk other then the current disk. If the file to be deleted is not found the ERA command returns the "NO FILE" error message. Files with the SYS attribute will be deleted by the ERA command. Any attempt to deleted a file with the read only attribute will cause an error message and when a key is pressed CPM will restart. The command "ERA *.*" will delete all files in the current user area of the selected disk. The "*.*" parameter is the only time the ERA command will ask before deleting files. Once a file is deleted it can not be restored.
> ERA DATA.TMP -- delete the file DATA.TMP from the currently selected disk in the current user area. > ERA B:*.* -- delete all files from disk "B" in the current user area. > ERA A:*.TMP -- delete all files with the extension ".TMP" from disk "A" in the current user area.
REN command:The REN command is used to rename a file or a group of files on the selected disk. The REN command takes two file names as parameters; the first is the new file name, the second parameter contains the original file name. The two file name parameters are separated by a single equals ("=") character. The new file name and the original file name may both contain wild-card characters. If a file already exists on the selected disk that matches the new file name the operation will fail. If the file to be renamed has the read-only attribute the rename command will fail. The REN command will only affect files in the current user area code.
> REN DATA.TXT=DATA.DAT -- rename the file DATA.DAT on the default disk in the current user area to DATA.TXT. > REN *.OLD=*.DAT -- rename all the files with a .DAT extension on the default disk in the current user area to a file extension of .OLD. > REN SKBIOS2.*=B:SKBIOS.* -- rename all files on the B disk in the current user area code with the file name SKBIOS to SKBIOS2 and retain the old file extension.
TYPE command:The TYPE command copies a text file to the current console device. The TYPE command requires one parameter, the name of the file to copy to the console device. The Ctrl-Q and Ctrl-S characters can be used to start and pause the copy operation. Any other character sent to the console device will abort the copy. The file name parameter may include a drive specifier but should not contain any wild-card characters.
> TYPE SKBIOS.ASM -- copy the text file SKBIOS.ASM in the current user area code on the default disk to the current console device. > TYPE B:SKBIOS.PRN -- copy the text file SKBIOS.ASM in the current user area code on the B disk to the current console device.
SAVE Command:The SAVE command is used to save the contents of the cpu memory space to a disk file. The save command takes two parameters; the first parameter is the number of 256 byte pages to save starting from address 100h (256), the second parameter is the name of the file to save the binary memory image to. The maximum value for the number of pages is 255. The file name parameter can specify a disk identifier and must not contain wild-card characters.
Last Updated on Saturday, 26 June 2010 09:13