System information

1.6.5 ED Command
Syntax:
ED ufn
The ED program is the CP/M system context editor that allows creation and alteration of ASCII
files in the CP/M environment. Complete details of operation are given in Section 2. ED allows
the operator to create and operate upon source files that are organized as a sequence of ASCII
characters, separated by end-of-line characters (a carriage return/line-feed sequence). There is no
practical restriction on line length (no single line can exceed the size of the working memory)
that is defined by the number of characters typed between carriage returns.
The ED program has a number of commands for character string searching, replacement, and
insertion that are useful for creating and correcting programs or text files under CP/M. Although
the CP/M has a limited memory work space area (approximately 5000 characters in'a 20K CP/M
system), the file size that can be edited is not limited, since data are easily paged through this
work area.
If it does not exist, ED creates the specified source file and opens the file for access. If the source
file does exist, the programmer appends data for editing (see the A command). The appended
data can then be displayed, altered, and written from the work area back to the disk (see the W
command). Particular points in the program can be automatically paged and located by context,
allowing easy access to particular portions of a large file (see the N command).
If you type the following command line:
ED X.ASM
the ED program creates an intermediate work file with the name
X.$$$
to hold the edited data during the ED run. Upon completion of ED, the X.ASM file (original file)
is renamed to X.BAK, and the edited work file is renamed to X.ASM. Thus, the X.BAK file
contains the original unedited file, and the X.ASM file contains the newly edited file. The
operator can always return to the previous version of a file by removing the most recent version
and renaming the previous version. If the current X.ASM file has been improperly edited, the
following sequence of commands reclaim the backup file.
1.6 Transient Commands CP/M Operating System Manual
1-35