CP/M User Areas

The CP/M (Control Program for Microcomputers) operating system has a single directory for storing files on a disk. It does not have a directory structure (or directory tree) as in other modern operating systems. However, it allows organizing files into user areas, within the same directory. As the name suggests, this feature is particularly useful when multiple users use the same computer and storage device for their own personal files. Then, each user will employ his/her own user area for the files. This feature is also useful for organizing different files into "pseudo-directories".

CP/M supports 16 user areas, with numeric values from 0 to 15. By default, the operating system boots into user area 0. The user area can be manually changed with the "USER" command. Examples:

By default there are no files in a new user area. System files are available in user area 0. When the user command is entered, the new user area is set at operating system level, for all drives. This means that system files (including transient commands) are no longer available. Usually, PIP.COM will be copied to a new user area in order to allow transferring other files as needed.

How to transfer PIP.COM to a new user area ?

Since by default no transient commands are available in a new user area, the procedure for copying PIP (or other commands) is by loading it into memory (using DDT) and then using the resident command "SAVE" to store it on disk in the new user area.

Commands:


Selects an user area. The default user area is 0. Possible values range from 0 to 15. A user area can be used to store user files in separate spaces, when multiple users are using the same computer, or to organize the files. Transfer between user areas can be done with PIP. Examples:

8. PIP

The main purpose of the PIP ("Peripheral Interchange Program") command is to copy files. However, it accepts also devices (such as CON:, PRN:, etc.) as input/output. This allows for other usage scenarios, like creating a file, printing a file, displaying a file, etc. Examples:

9. MOVCPM

10. SYSGEN

MOVCPM and SYSGEN allow creating a new CP/M system disk for a different memory size (the default memory size used in CP/M 2.2 is 20Kb). MOVCPM alone can create a new in-memory CP/M system for a new memory size. SYSGEN allows saving the in-memory system or just copying an existing system disk. The parameters are not checked, a command like "MOVCPM 128" may cause the system to hang. A generated SYSGEN disk may refuse to boot. The commands should be used with care and a copy of the original system disk should always be kept. Examples:

11. STAT

Displays disk and file information; allows setting file attributes; allows assigning peripherals. Examples:

12. LOAD

Reads a file in Intel HEX format and produces an executable COM file. Examples:

13. DDT

This is the CP/M debugger. Allows debugging executable files. An executable file is loaded at address 0100H. When exiting the debugger, the debugged file remains loaded, therefore it can be saved using the SAVE command. Examples:

14. ED

This is the CP/M line editor. Allows basic editing operations for files. Operations are performed by using commands (for example "I" for insert, "1:100T" display first 100 lines, "Q" exits the editor). Text entering is ended with CTRL+Z, returning to the editor command interface. Examples:

15. SUBMIT

Allows for command batching. Multiple commands are stored in a file (usually with a .SUB extension) and can be submitted for batch processing with the SUBMIT command. Command line parameters can be accessed within the batch file with $1 ... $n. The SUBMIT command actually creates a file called "$$$.SUB" on the current disk that contains the batched commands. This file will be executed when the CP/M system is booted or reloaded from the current disk. If created on the B: drive for example, the file $$$.SUB will not be executed until the disk is inserted in the A: drive and the system is loaded from it. When a new file is submitted, the contents of $$$.SUB is overwritten. Examples:

16. XSUB

This command is useful in a .SUB file to redirect console input to the following lines in the .SUB file. Following an XSUB command, the .SUB file should contain first the command to be executed and on the following lines the input for the executed command.

17. DUMP

Displays the contents of a file in hexadecimal. Examples:

More from this site

Useful external resources