         CP/M 3 User's Guide                                                     6.3 ED Operation

         6.3 ED Operation

           With ED, you change portions of a file that pass through a memory buffer.  When
         you start ED with one of the preceding commands, this memory buffer is empty.  At
         your command, ED reads segments of the source file, for example MYFILE.TEX,
         into the memory buffer for you to edit.  If the file is new, you must insert text into
         the file before you can edit.  During the edit, ED writes the edited text onto a tempo-
         rary work file, MYFILE.$$$.

           When you end the edit, ED writes the memory buffer contents to the temporary
         file, followed by any remaining text in the source file.  ED then changes the name of
         the source file from MYFILE.TEX to MYFILE.BAK, so you can reclaim this original
         material from the back-up file if necessary.  ED then renames the temporary file,
         MYFILE.$$$, to MYFILE.TEX, the new edited file. The following figure ill           -ustrates
         the relationship between the source file, the temporary work file, and the new file.

         Note: when you invoke ED with two filespecs, an input file and an output file, ED
         does not rename the input file to type BAK; therefore, the input file can be Read-
         Only or on a write-protected disk if the output file is written to another disk.








         9 DIGITAL RESEARC'HR"
                                                                                                  6-3



                                                                                                      AN

    6.3 ED Operation                                                CP/M 3 User's Guide






                                         SOURCE
                                         LIBRARIES





            SOURCE     -APPEND                 (R)     WRITE        TEMPORARY
              FILE             (A)                      (W)              FILE
          MYFILE. TEX                                                MYFILE. $$$

                                         MEMORY
                                          BUFFER


        AFTER                                                       AFTER
         EDIT    (E)                                                  EDIT  (E)

                               INSERT                TYPE
                                 (1)                   (T)




            BACKUP                                                       NEW
              FILE                                                     SOURCE
          MYFILE. BAK                                                    FILE
                                                                     MYFILE.  TEX

                                                                               AN C5.

                            Figure 6-1.  Overall ED Operation

      In the preceding figure, the memory buffer is logically between the source file and
    the temporary work file.  ED supports several commands that transfer lines of text
    between the source file, the memory buffer, and the temporary, and eventually final,
    file.  The following table lists the three basic text transfer commands that allow you
    to easily enter the editor, write text to the temporary file, and exit the editor.



    6-4                                                             OED] DIGITAL RESEARCH"'
        CP/M 3 User's Guide                                               6.3 ED OperaU'on

                              Table 6-1.  Text Transfer Commands
        Command                                        Result

            nA             Append the next n unprocessed source lines from the source file
                           to the end of the memory buffer.

            nW             Write the first n lines of the memory buffer to the temporary
                           file free space.

            E              End the edit. Copy all buffered text to the temporary file, and
                           copy all unprocessed source lines to the temporary file.  Rename
                           files.


        6.3.1 Appending Text into the Buffer
         When you start ED and the memory buffer is empty, you can use the A (append)
        command to add text to the memory buffer.

        Note: ED can number lines of text to help you keep track of data in the memory
        buffer.  The colon that appears when you start ED indicates that line numbering is
        turned on.  Type -V after the ED prompt to turn the line number display off.  Line
        numbers appear on the screen but never become a part of the output file.

        The V (Verify Line Numbers) Command

         The V command turns the line number display in front of each line of text on or
        off.  The V command also displays the free bytes and total size of the memory buffer.
        The V command takes the following forms:

            V) -V, ov








        FI-0 DIGITAL RESEARCH T.Ii
                                                                                          6-S



                                                                                               IN

    6.3 ED Operation                                                   CP/M 3 Uscr's Guide

      Initially, the line number display is on.  Use -V to turn it off.  If the memory buffer
    is empty, or if the current line is at the end of the memory buffer, ED represents the
    line number as five blanks.  The OV command prints the memory buffer statistics in
    the form:

        free/total

    where free is the number of free bytes in the memory buffer, and total is the size of
    the memory buffer.  For example, if you have a total of 48,253 bytes in the memory
    buffer and 46,652 of them are free, the OV command displays this information as
    follows

    46652/4B253

    If the buffer is full, the first field, which indicates free space, is blank.

    The A (Append) Command

      The A command appends, copies, lines from an existing source file into the mem-
    ory buffer.  The A command takes the following form:

        nA

    where n is the number of unprocessed source lines to append into the memory buffer.
    If a pound sign, #, is given in place of n, then the integer 65,535 is assumed.  Because
    the memory buffer can contain most reasonably sized source files, it is often possible
    to issue the command #A at the beginning of the edit to read the entire source file
    into memory.

      When n is 0
                    @ ED appends the unprocessed source lines into the memory buffer
       11 the buffer is approximately half full. If you do not speci    n, ED appends one
    unt              I                                               fy
    line from the source file into the memory buffer.

    6.3.2 ED Exit
      You can use the W (Write) command and the E (Exit) command to save your
    editing changes.  The W command writes lines from the memory buffer to the new
    file without ending the ED session.  An E command saves the contents of the buffer
    and any unprocessed material from the source file and exits ED.




                                                                       ICE] DL(,ITAL RESEARCH"'
    6-6
         CP/M 3 User's Guide                                                    6.3 ED Operation

         The W (Write) Command

          The W command writes lines from the buffer to the new file.  The W command
         takes the form:

             nW

         where n 1, he number of lines to be written from the beginning of the buffer to the
         end of the new file.  If n is greater than 0, ED writes n lines from the beginning of
         the buffer to the end of the new file.  If n is 0, ED writes lines until the buffer is half
         empty.  The OW command is a convenient way of making room in the memory buffer
         for more lines from the source file.  If the buffer is full, you can use the OW command
         to write half the contents of the memory buffer to the new file.  You can use the #W
         command to write the entire contents of the buffer to the new file.  Then you can use
         the OA command to read in more lines from the source file.

         Note: after a W command is executed, you must enter the H command to reedit
         the saved lines during the current editing session.

         The E (Exit) Command

           An E command performs a normal exit from ED.  The E command takes the form:

             E

         followed by a carriage return.

           When you enter an E command, ED first writes all data lines from the buffer and
         the original source file to the $$$ file.  If a BAK file exists, ED deletes it, then renames
         the original file with the BAK filetype.  Finally, ED renames the $$$ file from file-
         name.$$$ to the original filetype and returns control to the operating system.

           The operation of the E command makes it unwise to edit a back-up file.  When vou
         edit a BAK file and exit with an E command, ED erases your original file because it
         has a BAK filetype.  To avoid this, always rename a back-up file to some other filetype
         before editing it with ED.

         Note: any command that terminates an ED session must be the only command on
         the line.




           [)[(.1-I'AL. RESLAR('H"'
                                                                                                  6-7

    6.4 Basic Editing Commands                                         CP/M 3 User's Guide

    6.4 Basic Editing Commands

      The text transfer commands discussed previously allow you to easily enter and exit
    the editor.  This section discusses the basic commands that edit a file.

      ED treats a file as a long chain of characters grouped together in lines.  ED displays
    and edits characters and lines in relation to an imaginary device called the character
    pointer (CP).  During an edit session, you must mentally picture the CP's location in
    the memory buffer and issue commands to move the CP and edit the file.

      The following commands move the character pointer or display text in the vicinity
    of the CP.  These ED commands consist of a numeric argument and a single com-
    mand letter and must be followed by a carriage return.  The numeric argument, n,
    determines the number of times ED executes a command; however, there are four
    special cases to consider in regard to the numeric argument:

        m   If the numeric argument is omitted, ED assumes an argument of 1.
        0   Use a negative number if the command is to be executed backwards through
            the memory buffer.  The B command is an exception.
        m   If you enter a pound sign, #, in place of a number, ED uses the value 65,535
            as the argument.  A pound sign argument can be preceded by a minus sign to
            cause the command to execute backwards through the memory buffer, -#.               I
        0   ED accepts 0 as a numeric argument only in certain commands. In some
            cases, 0 causes the command to be executed approximately half the possible
            number of times, while in other cases it prevents the movement of the CP.








                                                                      E DIGITAL RESEARCH"'
    6-8

       CP/M 3 User's Guide                                      6.4 Basic Editing Commands

         The following table alphabetically summarizes the basic editing commands and
       their valid arguments.

                              Table 6-2.  Basic Editing Commands
          Command                                         Action

         B                      Move CP to the beginning (B) or end (-B) of the memory
           -B
                                buffer.

         nC, -nC                Move CP n characters forward (nC) or backward (-nC)
                                through the memory buffer.

         nD, -nD                Delete n characters before (-nD) or after (nD) the CP.

         I                      Enter insert mode.

         Istring CTRL-Z         Insert a string of characters.

         nK, -nK                Delete (kill) n lines before the CP (-nK) or after the CP
                                (nK).

         nL, -nL                Move the CP n lines forward (nL) or backward (-nL)
                                through the memory buffer.

         nT. -nT                Type n lines before the CP (-nT) or after the CP (nT).

         n, -n                  Move the CP n lines before the CP (-n) or after the CP (n)
                                and display the destination line.


         The following sections discuss ED's basic editing commands in more detail.  The
       examples in these sections illustrate how the commands affect the position of the
       character pointer in the memory buffer.  Later examples in Section 6.5, "Combining
       ED Commands," illustrate how the commands appear at the screen.  For these sec-
       tions, however, the symbol ' in command examples represents the character pointer,
       which you must imagine in the memory buffer.





       [17a@ 1)1(,ITAt.  RESEAR(:H"'
                                                                                          6-9

       6.4 Basic Editing Commands                                          CP/M 3 User's Guide

       6.4.1 Moving the Character Pointer

          This section describes commands that move the character pointer in useful incre-
       ments but do not display the destination line.  Although ED is used primarily to
       create and edit program source files, the following sections present a simple text as
       an example to make ED easier to learn and understand.

       The B (Beginning[Bottom) Command

          The B command moves the CP to the beginning or bottom of the memory buffer.
       The B command takes the following forms:

            Bi -B

       -B moves the CP to the end or bottom of the memory buffer; B moves the CP to the
       beginning of the buffer.

       The C (Character) Command

         The C command moves the CP forward or backward the specified number of
       characters.  The C command takes the following forms:

            nC, -nC

       when n is the number of characters the CP is to be moved.  A positive number moves
       the CP towards the end of the line and the bottom of the buffer.  A negative number
       moves the CP towards the beginning of the line and the top of the buffer.  You can
       enter an n large enough to move the CP to a different line.  However, each line is
       separated from the next by two invisible characters: a carriage return and a line-feed,
       represented by <cr><If>.  You must compensate for their presence.  For example, if
       the CP is pointing to the beginning of the line, the command 30C moves the CP to
       the next line:

            Emily Dickinson said,<cr><If>
            "I fin-d ecstasy in living -<cr><If>








                                                                         100 DIGITAL RESEARCH@'@
       6-10

         CP/M 3 User's Guide                                        6.4 Basic Editing Commands

         The L (Line) Command

         -The L command moves the CP the specified number of lines.  After an L command,
         the CP always points to the beginning of a line.  The L command takes the following
         forms:

              nL, -nL

         where n is the number of lines the CP is to be moved.  A positive number moves the
         CP towards the end of the buffer.  A negative number moves the CP back toward the
         beginning of the buffer.  The command 2L moves the CP two lines forward through
         the memory buffer and positions the character pointer at the beginning of the line.

              "I find ecstasy in living -<cr><If>
              the mere sense of living<cr><If>
              is joy enough." <cr><If>

           The command -L moves the CP to the beginning of the previous line, even if the
         CP originally points to a character in the middle of the line.  Use the special character
         0 to move the CP to the beginning of the current line.

         The n (Number) Command

           The n command moves the CP and displays the destination line.  The n command
         takes the following forms:

              n, -n

         where n is the number of lines the CP is to be moved.  In response to this command,
         ED moves the CP forward or backward the number of lines specified, then prints
         only the destination line.  For example, the command -2 moves the CP back two
         lines.

              Emily Dickinson said,<cr><If>
              "'I find ecstasy In living -<cr><If>
              the mere sense of living<cr><If>
              is Joy enough."<cr><If>





         l@o DL(;ITAL RESEARCH
                                                                                            6-11

    6.4 Basic Editing Commands                                         CP/M 3 User's Guide

       A further abbreviation of this command is to enter no number at all. In response
    to a carriage return without a preceding command, ED assumes a n command of 1
    and  moves the CP down to the next line and prints it, as follows

         Emily Dickinson said,<cr><If>
         "I find ecstasy in living -<cr><If>
         the mere sense of living < cr> < If >

       Also, a minus sign, -, without a number moves the CP back one line.

    6.4.2 Displaying Memory Buffer Contents

       ED does not display the contents of the memory buffer until you specify which
    part of the text you want to see.  The T command displays text without moving the
    CP.

    The T (Type) Command

       The T command types a specified number of lines from the CP at the screen.  The
    T command takes the forms

         nT, -nT

    where n specifies the number of lines to be displayed.  If a negative number is entered,
    ED displays n lines before the CP.  A positive number displays n lines after the CP.  If
    no number is specified, ED types from the character pointer to the end of the line.
                                           ton no matter how many lines are typed.  For
    The CP remains in its original posit'
    example, if the character pointer is at the beginning of the memory buffer, and you
    instruct ED to type four lines (4T), four lines are displayed at the screen, but the CP
    stays at the beginning of line 1.

         ^Emily Dickinson said,<cr><If>
         "I find ecstasy in living -<cr><If>
         the mere sense of living<cr><If>
         is joy enough."<cr><If>

       If the CP is between two characters in the middle of the line, a T command with
    no number specified types only the characters between the CP and the end of the
    line, but the character pointer stays in the same position, as shown in the following
    memory buffer example:

    "I find ec'stasy in livin!g

                                                                       ,o@c DIC;ITAL RESEAR(,H"'
    6-12

         CP/M 3 User's Guide                                 6.4 Basic Editing Commands

                                                                           a CTRL-S to
         Whenever ED is displaying text with the T command, you can enter
                                         I
         stop the display, then press any key when you are ready to continue scrolling.  Enter
         a CTRL-C to abort long type-outs.

         6.4.3 Deleting Characters

         The D (Delete) Command

          The D command deletes a specified number of characters and takes the forms:

            nD, -nD

         where n is the number of characters to be deleted.  If no number is specified, ED
         deletes the character to the right of the CP.  A positive number deletes multiple
         characters to the right of the CP, towards the bottom of the file.  A negative number
         del etes charac ters to the left of the CP, towards the top of the file. If the character
         pointer is positioned in the memory buffer as follows

             Emily Dickinson said,<cr><If>
             "I find ecstasy in living -<cr><If>
             the mere sense of living<cr><If>
             is joy enough."<cr><If>

         the command 6D deletes the six characters after the CP, and the resulting memory
         buffer looks like this:

             Emily Dickinson said,<cr><If>
             "I find ecstasy in living -<cr><If>
             the mere sense of I'tving<cr><If>
             is 'Joy'."<cr><If>

           You can also use a D command to delete the <cr><If> between two lines to join
         them together.  Remember that the <cr> and <If> are two characters.








         -foi DIGITAI, RESEARCH"'
                                                                                     6-13

    6.4 Basic Editing Commands                                       CP/M 3 User's Guide

    The K (-Kill) Command

      The K command kills or deletes whole lines from the memory buffer and takes the
    forms:

        nK, -nK

    where n is the number of lines to be deleted.  A positive number kills lines after the
    CP. A negative number kills lines before the CP.  When no number is specified, ED
    kills the current line. If the character pointer is at the beginning of the second line,

         Emily Dickinson said,<cr><If>
         "'I find ecstasy in living -<cr><If>
         the mere sense of living<cr><If>
         is joy enough." <cr><If >

    then the command -K deletes the previous line and the memory buffer changes:

        "'I find ecstasy in living -<cr><If>
         the mere sense of living<cr><If>
         is joy enough."<cr><If>

                I I                    I   a K command kills only the characters from
      If the CP is in the middle of a line,,
    the CP to the end of the line and concatenates the characters before the CP with the
    next line.  A -K command deletes all the characters between the beginning of the
    previous line and the CP.  A OK command deletes the characters on the line up to the
    CP.

      You can use the special # character to delete all the text from the CP to the
    beginning or end of the buffer.  Be careful when using #K because you cannot reclaim
    lines after they are removed from the memory buffer.

    6.4.4 Inserting Characters into the Memory Buffer

    The I (Insert) Command

      To insert characters into the memory buffer from the screen, use the I command.






                                                                     -101 1)1(1'1 I A [, R ESEA R('H
    6-14

       CPIM I U,,,r', Guide                                       6.4 Basic Editing Commands

       If you enter the command in upper-case, ED automatically converts the string to
       upper-case.  The I command takes the forms:

           I
           Istring'Z

         When you type the first command, ED enters insert mode.  In this mode, all key-
       strokes are added directly to the memory buffer.  ED enters characters in lines and
       does not start a new line until you press the enter key.

       A>ED B:QUDTE.TEX

          NEW FILE
               :  *i
             1:    Eiytil>, Dickinson saidt
             2:     "I find ecstas), in litjing -
             3:     the ftlere sense of livi)7-4
             4:    is io>, el-)Ouglh",
                     7
             5:

       Note: to exit from insert mode, you must press CTRL-Z or ESC.  When the ED
       prompt, *, appears on the screen, ED is not in insert mode.

         In command mode, you can use CP/M 3 command line-editing control characters.
       In insert mode, you can use the control characters listed in Table 6-3.

                            Table 6-3.  CP/M 3 Line-editing Controls
         Command                                         Result

         CTRL-H             Delete the last character typed on the current line.

         CTRL-U             Delete the entire line currently being typed.

         CTRL-X             Delete the entire line currently being typed. Same as CTRL-U.

         Backspace          Remove the last character.


         1)1(,I'I'Al. RLSLAR(I'll"'                                                        6-15

    6.4 Basic Editing Commands                                        CP/M 3 User's Guide


     When entering a combination of numbers and letters, you might find it inconve-
    nient to press a caps-lock key if your terminal translates the upper-case of numbers
    to special characters.  ED provides two ways to translate your alphabetic input to
    upper-case without affecting numbers.  The first is to enter the insert command letter
    in uppercase: 1. All a] habetics entered during the course of the capitalized corn-
                           p
    mand, either in insert mode or as a string, are translated to upper-case.  If you enter
    the insert command letter in lower-case, all alphabetics are inserted as typed.  The
    second method is to enter a U command before inserting text.  Upper-case translation
    remains in effect until you enter a -U command.

    The Istring'Z (Insert String) Command

      The second form of the I command does not enter insert mode.  It inserts the
    character string into the memory buffer and returns immediately to the ED prompt.
    You can use CP/M 3's line-editing control characters to edit the command string.

      To insert a string, first use one of the commands that position the CP.  You must
    move the CP to the place where vou want to insert a string.  For example, if you
    want to insert a string at the beginning of the first line, use a B command to move
    the CP to the beginning of the buffer.  With the CP positioned correctly, enter an
    insert string, as follows

    i In 1870 t ' Z

      This inserts the phrase "In 1870," at the beginning of the first line, and returns
    immediately to the ED prompt.  In the memory buffer, the CP appears after the
    inserted string, as follows

        In 1870,' Emily Dickinson said, <cr><If >

    6.4.5 Replacing Characters

    The S (Substitute) Command

      The S command searches -the memory buffer for the specified string, but when it
    finds it, automatically substitutes a new string for the search string.  Whenever you
    enter a command in upper-case, ED automatically converts the string to upper-case.
    The S command takes the form:

                     in 'Znew string
         nssearch str' g




    6-16                                                               i@o DIGITAI, RLSLAR(@H"'

       CP/M 3 User's Guide                                        6.4 Basic Editing Commands

       where n is the number of substitutions to make.  If no number is specified, ED
       searches for the next occurrence of the search string in the memorv buffer.  For
       example, the command

       semily DicKinson'ZThe Poet

       searches for the first occurrence of "Emily Dickinson" and substitutes "The poet." In
       the memory buffer, the CP appears after the substituted phrase, as follows

           The poet' said, <cr>< If>

         If upper-case translation is enabled by a capital S command letter, ED looks for a
       capitalized search string and inserts a capitalized insert string.  Note that if you com-
       bine this command with other commands, you must terminate the new string with a
       CTRL-Z,


       6.5 Combining ED Commands

         It saves keystrokes and editing time to combine the editing and display commands.
       You can type any number of ED commands on the same line.  ED executes the
       command string only after you press the carriage return key.  Use CP/M 3's line-
       editing controls to manipulate ED command strings.

         When you combine several commands on a line, ED executes them in the same
       order they are entered, from left to right on the command line.  There are four
       restrictions to combining ED commands:

           s   The combined-command line must not exceed CP/M 3's 128 character
               maximum.
           0   If the combined-command line contains a character string, the line must not
               exceed 100 characters.
           0   Commands to terminate an editing session must not appear in a combined-
               command line.
           m   Commands, such as the 1, J, R, S, and X commands, that require character
               strings or filespecs must be either the last command on a line or must be
               terminated with a CTRL-Z or ESC character, even if no character string or
               filespec is given.



         Dl(,'ITAL, RESEAR(:H"'
                                                                                            6-17

     6.5 Combining ED Commands                                        CP/M 3 User's Guide

      While the examples in the previous section show the memory buffer and the posi-
     tion of the character pointer, the examples in this section show how the screen looks
     during an editing session.  Remember that the character pointer is imaginary, but you
     must picture its location because ED's commands display and edit text in relation to
     the character pointer.

     6.5.1 Moving the Character Pointer
      To move the CP to the end of a line without calculating the number of characters,
     combine an L command with a C command, L-2C.  This command string accounts
     for the <cr><If> sequence at the end of the line.

      Change the C command in this command string to move the CP more characters
     to the left.  You can use this command string if you must make a change at the end
     of the line and you do not want to calculate the number of characters before the
     change, as in the following example:

           1-. * T
           1: Emily DicKinson saidt
           I   *L-7CT
     s a i d t

     6.5.2 Displaying Text
      A T command types from the CP to the end of the line.  To see the entire line, you
     can combine an L command and a T command.  Type Olt to move the CP from the
     middle to the beginning of the line and then display the entire line.  In the following
     example, the CP is in the middle of the line.  OL moves the CP to the beginning of
     the line.  T types from the CP to the end of the line, allowing you to see the entire
     line.

           3: *T
     sense of living
           3: *OLT
           3: the mere sense of living
           3 -. *                                                                              I
       The command OTT displays the entire line without moving the CP.

     6-18                                                              ri-07 DIGITAL RLSEAR(.H[%@

      cp,m I User's Guide                                    6.5 Combining ED Commands

        To verify that an ED command moves the CP correctly, combine the command
      with the T command to display the line.  The following example combines a C
      command and a T command.

            2: *8CT
      ecstasy in living -
            2:  *


            4:  *B*T
            1: Emily DicKinson saidt
            2: "I find ecstasy in living -
            3: the mere sense of living
            4:    is joy enoulh."
            1: *

      6.5.3 Editing

        To edit text and verify corrections quickly, combine the edit commands with other
      ED commands that move the CP and display text.  Command strings like the one
      that follows move the CP, delete specified characters, and verify changes quickly.

      1. *15C5DOLT
      1: Emily DicKinsont
      1: *

        Combine the edit command K with other ED commands to delete entire lines and
         'fy the correction quickly, as follows
      verl            I     I

      1: *2LZX'B#T
      1: Emily DicKinson saidt
      2: "I find ecstasy in living -
      1 : *

        The abbreviated form of the I (insert) command makes simple textual changes.  To
      make and verify these changes, combine the I command string with the C command
      and the OLT command string as follows.  Remember that the insert string must be
      terminated by a CTRL-Z.

      1 : *2OCi t o a f ri eii d 'ZOL T
      1: Emily DicKinson said to a friends
      1:

      i-@Dl(.'l ['AL RLSLAR(]H

     6.6 Advanced ED Commands                                        CP/M 3 User's Guide

     6.6 Advanced ED Commands

      The basic editing commands discussed previously allow you to use ED for all your
     editing.  The following ED commands, however, enhance ED's usefulness.

     6.6.1 Moving the CP and Displaying Text

     The P (Page) Command

      Although you can display any amount of text at the screen with a T command, it
     is sometimes more convenient to page through the buffer, viewing whole screens of
     data and moving the CP to the top of each new screen at the same time.  To do this,
     use ED's P command.  The P command takes the following forms:

         nP, -nP

     where n is the number of pages to be displayed.  If you do not specify n, ED types
     the 23 lines following the CP and then moves the CP forward 23 lines.  This leaves
     the CP pointing to the first character on the screen.

       To display the current page without moving the CP, enter OP.  The special character
     0 prevents the movement of the CP.  If you specify a negative number for n, P pages
     backwards towards the top of the file.

     The n: (Line Number) Command

       When line numbers are being displayed, ED accepts a line number as a command
            'fy a destination for the CP.  The line number command takes the following
     to speci        1
     form:

         n:

     where n is the number of the destination line.  This command places the CP at the
     beginning of the specified line.  For example, the command 4: moves the CP to the
     beginning of the fourth line.

       Remember that ED dynamically renumbers text lines in the buffer each time a line
     is added or deleted.  Therefore, the number of the destination line you have in mind
     can change during editing.




     6-20                                                            KM DIGITAL RFSEARCH Tll

       CPIM I User's Guide                                       6.6 Advanced ED Commands

       The :n (Through Line Number) Command

         The inverse of the line number command specifies that a command should be
       executed through a certain line number.  You can use this command with only three
       ED commands: the K (kill) command, the L (line) command, and the T (type) com-
       mand.  The :n command takes the following form:

            :ncommand

       where n is the line number through which the command is to be executed.  The :n
       part of the command does not move the CP, but the command that follows it might.

         You can combine n: with :n to specify a range of lines through which a command
       should be executed.  For example, the command 2::4T types the second, third, and
       fourth lines:

       1 :  *2: :4T
       2: "I find ecstasy in living -
       3: the mere sense of living
       4:    is joy enough."
       2: *

       6.6.2 Finding and Replacing Character Strings

         ED supports a find command, F, that searches through the memory buffer and
       places the CP after the word or phrase you want.  The N command allows ED to
       search through the entire source file instead of just the buffer.  The J command
       searches for and then juxtaposes character strings.

       The F (Find) Command

         The F command performs the simplest find function; it takes the form:

           nfstring

       where n is the occurrence of the string to be found.  Any number you enter must be
       positive because ED can only search from the CP to the bottom of the buffer.  If you
       enter no number, ED finds the next occurrence of the string in the file.  In the follow-
       ing example, the second occurrence of the word living is found.

       1: *2flivinY
       3: *

       foi DIGITAI, RESEARCH"
                                                                                          6-21

     6.6 Advanced ED Commands                                            CP/M 3 User's Guide

      The character pointer moves to the beginning of the third line where the second
     occurrence of the word "living" is located.  To display the line, combine the find
     command with a type command.  Note that if you follow an F command with another
     ED command on the same line, you must terminate the string with a CTRL-Z, as
     follows

     1 : *""? f I i t) i n -4 "ZO1 t
     3: *the triere se)ise of litjin.4

      It makes a difference whether you enter the F command in upper- or lower-case.  If
     you enter F, ED internally translates the argument string to upper-case.  If you specify
     fl ED looks for an exact match.  For example, Fcp/m 3 searches for CP/M 3 but
     fcp/m 3 searches for cp/m 3, and cannot find CP/M 3.

      If ED does not find a match for the string in the memory buffer, it issues the
     message,

     BREAK 11#11 AT

     where the symbol # indicates that the search failed during the execution of an F
     command.

     The N Command

       The N command extends the search function beyond the memory buffer to include
     the source file.  If the search is successful, it leaves the CP pointing to the first char-
     acter after the search string.  The N command takes the form:

         nnstring

     where n is the occurrence of the string to be found.  If no number is entered, ED
     looks for the next occurrence of the string in the file.  The case of the N command
     has the same effect on an N command as it does on an F command.  Note that if you
     follow an N command with another ED command, you must terminate the string
     with a CTRL-Z.



     6-22                                                                 9 DIGITAL RESEARCH   Tll

       CP/M 3 User's Guide                                        6.6 Advanced ED Commands

         When an N command is executed, ED searches the memory buffer for the specified
       string, but if ED does not find the string, it does not issue an error message.  Instead,
       ED automatically writes the searched data from the buffer into the new file.  Then
       ED performs a OA command to fill the buffer with unsearched data from the source
       file.  ED continues to search the buffer, write out data,, and append new data until it
       either finds the string or reaches the end of the source file.  If ED reaches the end of
       the source file, ED issues the following message:

       BREAK "*" AT

         Because ED writes the searched data to the new file before looking for more data
       in the source file, ED usually writes the contents of the buffer to the new file before
       finding the end of the source file and issuing the error message.

       No,e: you must use the H command to continue an edit session after the source file
       is exhausted and the memory buffer is emptied.

       The i Uuxtapose) Command

         The j command inserts a string after the search string, then deletes any characters
       between the end of the inserted string to the beginning of the a third delete-to string.
       This juxtaposes the string between the search and delete-to strings with the insert
       string.  The J command takes the form:

           njsearch string'Zinsert strin@Zdelete-to string

       where n is the occurrence of the search string.  If no number is specified, ED searches
       for the next occurrence of the search string in the memory buffer.  In the following
       example, ED searches for the word "Dickinson", inserts the phrase "told a friend"
       after it, and then deletes everything up to the comma.

       I - **T
       1: Emily DicKinson saidt
       2: "I find ecstasy in living -
       3-.   the mere of living
       4 :   is joy enough#"
       1:  *jDickinson'Z told a friend"Zp
       I : *01 t
       1: Emily DicKinson told a friend#
       I : *


       [K DIGITAL RESEAR(H"'                                                               6-23

     6.6 Advanced ED Commands                                          CP/M 3 User's Guide

      If you combine this command with other commands, you must terminate the
     delete-to string with a CTRL-Z or ESC, as in the following example.  If an upper-
     case j command letter is specified, ED looks for upper-case search and delete-to
     strings and inserts an upper-case insert string.

      The i command is especially useful when revising comments in assembly language
     source code, as follows

     23G: SORT            LXI        Ht SW          ;ADDRESS TOGGLE SWITCH
     236: *j;"ZADDRESS Si4lTCH TOGGLE"Z'L"ZOLT
     236: SORT            LXI        Ht SW          ;ADDRESS SWITCH TOGGLE
     236: *

       In this example, ED searches for the first semicolon and inserts ADDRESS SWITCH
     TOGGLE after the mark and then deletes to the <cr><If> sequence, represented by
     CTRL-L.  In any search string, you can use CTRL-L to represent a <cr><If> when
     the phrase that you want extends across a line break.  You can also use a CTRL-1 in
     a search string to represent a tab.

     Note: if long strings make your command longer than your screen line length, enter
     a CTRL-E to cause a physical carriage return at the screen.  A CTRL-E returns the
     cursor to the left edge of the screen, but does not send the command line to ED.
     Remember that no ED command line containing strings can exceed 100 characters.
     When you finish your command, press the carriage return key to send the command
     to ED.

     The M (Macro) Command

       An ED macro command, M,, can increase the usefulness of a string of commands.
     The M command allows you to group ED commands together for repeated execu-
     tion.  The M command takes the following form:

         nmcommand string

     where n is the number of times the command string is to be executed.  A negative
     number is not a valid argument for an M command.  If no number is specified, the
     special character # is assumed, and ED executes the command string until it reaches



     6-24                                                              R DIGITAL RESEARCH"'

        CP/M 3 User's Guide                                       6.6 Advanced ED Commands

        the end of data in the buffer or the end of the source file, depending on the com-
        mands specified in the string.  In the following example, ED executes the four com-
        mands repetitively until it reaches the end of the memory buffer:

                     I : *mf I i vi nY"Z-BdiLi (iinY"ZOI t
                    2: "I find ecstasy in Living -
                    3: the mere sense of Living

              BREAK 11*11 AT 'Z

          The terminator for an M command is a carriage return; therefore, an M command
        must be the last command on the line.  Also, all character strings that appear in a
        macro must be terminated by CTRL-Z or ESC.  If a character string ends the corn-
        bined-command string, it must be terminated by CTRL-Z, then followed by a <cr>
        to end the M command.

          The execution of a macro command always ends in a B R E A K           message, even
        when you have limited the number of times the macro is to be performed, and ED
        does not reach the end of the buffer or source file.  Usually the command letter
        displayed in the message is one of the commands from the string and not M.

          To abort a macro command, press a CTRL-C at the keyboard.

        The Z (Sleep) Command

          Use the Z command to make the editor pause between operations.  The pauses give
        you a chance to review what you have done.  The Z command takes the following
        form:

            nZ

        where n is the number of seconds to wait before proceeding to the next instruction.

          Usually, the Z command has no real effect unless you use it with a macro com-
        mand.  The following example shows you how you can use the Z command to cause
        a brief pause each time ED finds the word TEXT in a file.

        A >*fn f I i v i nf "ZOt t I Oz


          DICITAI. RESEAR(H"'                                                               6-25

    6.6 Advanced ED Commands                                                CP/M 3 User's Guide

    6.6.3 Moving Text Blocks
      To move a group of lines from one area of your data to another, use an X
    command to write the text block into a temporary LIB file, then a K command to
    remove these lines from their original location, and finally an R command to read
    the block into its new location.

    The X (Transfer) Command

      The X command takes the forms:

         nX
         nXfilespec'Z

    where n is the number of lines from the CP towards the bottom of the buffer that
    are to be transferred to a file.  Therefore, n must always be a positive number.  The
    nX command with no file specified creates a temporary file named X$$$$$$$.LIB.
    This file is erased when you terminate the edit session.  The nX command with a file
         'fied creates a file of the specified name.  If no filetype is specified, LIB is assumed.
    speci                              I
    This file is saved when you terminate the edit session.  If the X command is not the
    last command on the line, the command must be terminated by a CTRL-Z or ESC.
    In the following example, just one line is transferred to the temporary file:

    1    *X

    1:   *Emily DicKinson saidt
    1     k t
            I f i ri d e c s t as Y i n       v i n 9

      If no library file is specified, ED looks for a file named X$$$$$$$.LIB. If the file
    does not exist, ED creates it.  If a previous X command already created the library
    file, ED appends the specified lines to the end of the existing file.

      Use the special character 0 as the n argument in an X command to delete any file
    from within ED.







                                                                            Flul DIGITAL RESEARCH"'
    6-26

           CP/M 3 User's Guide                                         6.6 Advanced ED Commands

           The R (Read) Command

             The X command transfers the next n lines from the current line to a library file.
           The R command can retrieve the transferred lines.  The R command takes the forms:

               R
               Rfilepsec

             If no filename is specified, X$$$$$$$ is assumed.  If no filetype is specified, LIB is
           assumed.  R inserts the library file in front of the CP; therefore, after the file is added
           to the memory buffer, the CP points to the same character it did before the read,
           although the character is on a new line number.  If you combine an R command with
           other commands, you must separate the filename from subsequent command letters
           with a CTRL-Z as in the following example where ED types the entire file to verify
           the read.

           1 : *41
             : *R'ZB*T
           1: "I find ecstasy in living -
           2: the mere sense of living
           3:    is joy enough."
           4:    Emily Dickinson said#

           6.6.4 Saving or Abandoning Changes: ED Exit
             You can save or abandon editing changes with the following three commands.

           The H (Head of File) Command

             An H command saves the contents of the memory buffer without ending the ED
           session, but it returns to the head of the file.  It saves the current changes and lets you
           reedit the file without exiting ED.  The H command takes the following form:

           H

           followed by a carriage return.






           P Dl(;ITAI.  RESEAR(:H
                                                                                                 6-27

    6.6 Advanced ED Commands                                              CP/M 3 User's Guide

      To execute an H command, ED first finalizes the new file, transferring all lines
    remaining 'in the buffer and the source file to the new file.  Then ED closes the new
    file, erases any BAK file that has the same file specification as the original source file,
    and renames the original source file filename.BAK. ED then renames the new file,
    which has had the filetype $$$, with the original file specification.  Finally, ED opens
    the newly renamed file as the new source file for a new edit, and opens a new $$$
    file.  When ED returns the * prompt, the CP is at the beginning of an empty memory
    buffer.

      If you want to send the edited material to a file other than the original file, use the
    following command:

    A>ED filespec differentfilespeo

      If you then restart the edit with the H command, ED renames the file differentfile-
    name.$$$ to differentfilename.BAK and creates a new file of differentfilespec when
    you finish editing.

    The 0 (Original) Command

      An 0 command abandons changes made since the beginning of the edit and allows
    you to return to the original source file and begin reediting without ending the ED
    session.  The 0 command takes the form:

        0

    followed by a carriage return.  When you enter an 0 command, ED confirms that
    you want to abandon your changes by asking

    0 (Y/N)?

      You must respond with either a Y or an N; if you press any other key, ED repeats
    the question.  When you enter Y, ED erases the temporary file and the contents of the
    memory buffer.  When the * prompt returns, the character pointer is pointing to the
    beginning of an empty memory buffer, just as it is when you start ED.







                                                                         0 1)1(;ITAL RESEAR(:H"'
    6-28

         CP/M 3 User's Guide                                     6.6 Advanced ED Commands

         The Q (Quit) Command

          A Q command abandons changes made since the beginning of the ED session and
         exits ED.  The Q command takes the form:

            Q

         followed by a carriage return.

          When you enter a Q command, ED verifies that you want to abandon the changes
         by asking

         Q (Y/N)?

          You must respond with either a Y or an N; if you press any other key, ED repeats
         the question.  When you enter Y, ED erases the temporary file, closes the source file,
         and returns control to CP/M 3.

         Note: you can enter a CTRL-Break or a CTRL-C to return control immediately to
         CP/M 3. This does not give ED a chance to close the source or new files, but it
         prevents ED from deleting any temporary files.

         6.7 ED Error Messages

          ED returns one of two types of error messages: an ED error message if ED cannot
         execute an edit command, or a CP/M 3 error message if ED cannot read or write to
         the specified file.  An ED error message takes the form:

             BREAK "x" AT c

         where x is one ,f the symbols defined in the following table and c is the command
         letter where the error occurred.








         -Vu DIGITAL RESEAR(,H"'
                                                                                          6-29

    6.7 ED Error Messages                                             CP/M 3 User's Guide

                               Table 6-4.  ED Error Symbols
     Symbol                                       Meaning

                     Search failure.  ED cannot find the string specified in a F, S, or N
                     command.

        ?c           Unrecognized command letter c. ED does not recognize the indi-
                     cated command letter, or an E, H@ 0, or Q command is not alone
                     on its command line.

        0            No. LIB file. ED did not find the LIB file specified in an R command.

        >            Buffer full. ED cannot put anymore characters in the memory buffer,
                     or string specified in an F, N, or S command is too long.

        F-           Command aborted. A keystroke at the keyboard aborted com-
                     mand execution.

        F            File error. Followed by either disk FULL or DIRECTORY FULL.


      The following examples show how to recover from common editing error condi-
    tions.  For example

    BREAK ">" AT A

    means that ED filled  the memory buffer before completing the execution of an A
    command. When this    occurs, the character pointer is at the end of the buffer and no
    editing is possible.  Use the OW command to write out half the buffer or use an 0 or
    H command and reedit the file.

    BREAK "*" AT F

    means that ED reached the end of the memory buffer without matching the string in
    an F command.  At this point, the character pointer is at the end of the buffer.  Move
    the CP with a B or n: line number command to resume edit'
                                                                 ing.

    BREAK "Fll AT F
    DISK FULL


                                                                      !Foj 1)1(,I'I'At RUSEAR(]H@'I
    6-30

        CP/M 3 User's Guide                                              6.7 ED Error Messages

          Use the OX command to erase an unnecessary file on the disk or a B#Xd:buffer.sav
        command to write the contents of the memory buffer onto another disk.

        BREAK "F" AT n
        DIRECTORY FULL

          Use the same commands described in the previous message to recover from this file
        error.

          The following table defines the disk file error messages ED returns when it cannot
        read or write a file.

                            Table 6-5.  ED Diskette File Error Messages
          Message            Meaning

          CP/M Error on d:                  Read/Dnl Y Fi le
          BDOS Function = NN                File =FILENAME,TYP

                             Disk d: has Read-Only attribute.  This occurs if a different disk
                             has been inserted in the drive since the last cold or warm boot.

             FILE IS READ ONLY **

                             The file specified in the command to invoke ED has the R/O
                             attribute.  ED can read the file so that the user can examine it,
                             but ED cannot change a Read-Only file.


                                           End of Section 6







        @@ol 1)1(',ITAL- RESEARCH"'                                                          6-31

                                         ppenaix

                                CP/M 3 Messages



          Messages come from several different sources.  CP/M 3 can display error messages
       when the Basic Disk Operating System (BDOS) returns an error code.  CP/M 3 can
       also display messages when there are errors in command lines.  Each utility supplied
       with CP/M 3 has its own set of messages.  The following table lists CP/M 3 messages
       and utility messages.  If you are running an application program, you might see
       messages other than those listed here.  Check the application program's documenta-
       tion for explanations of those messages.

          The messages in Table A-1 might be preceded by ERROR:.  Some of them might
       also be preceded or followed by the filespec of the file causing the error condition.
       Sometimes the input line is flagged with an up arrow T , to indicate the character
       that caused the error.  In this case,, the message, E r r o r a t t h e ', precedes the
       appropriate error message.  Some of the messages are followed by an additional line
       preceded by INPUT:, OPTION:, or DRIVE: followed by the applicable error message.

                                  Table A-1.  CP/M 3 Messages
         Message            Meaning

         As s i in a P as s wo r d t o t h i s f i 1

                            SET.  A password mode has been selected for this file but no
                            password has been assigned.

         Aux i 1 i a ry de v i c e re d i rec t i on not imp 1 emen ted

                            GET and PUT.  AUXIN and AUXOUT cannot be redirected to
                            a file.

         B ad c h a rac t e r t re - en t e r

                            GENCPM.  The character entered was not a number.


       R DL(,ITAL RLSEARCH                                                                 A-1

   A CP/M 3 Messages                                               CP/M 3 User's Guide

                                 Table A-1. (continued)

     Message            Meaning

     Bad close,

                        SAVE.  An error occurred during the attempt to close the file,
                        probably because the file is write-protected.

     Bad Lo sr i c al De v i ce As s i sinment ;                                            I
                        DEVICE.  Only the following logical devices are valid: CONIN:,
                        CONOUT:, AUXIN:, AUXOUT:, LST:.

     BAD PARAMETER

                        PIP.  You entered an illegal parameter in a PIP command.  Retype
                        the entry correctly.

     Bad Passwo rd ,                                                                        I
                        RENAME.  The password supplied by the user is incorrect.

     BanK one not al lowed.

                        GENCPM.  Bank 1 cannot be defined as available during sys-
                        tem generation.

     B au d r at e c ann o t b e s e t f o r t h i s d e v i c e

                        DEVICE.  Only physical devices that have the SOFT-BAUD
                        attribute can have their baud rates changed.  To check the attri-
                        butes of the physical device, type DEVICE physical-dev.





   A-2                                                               DIGITAL RESEARCHT"

         CPIM I U,er's Guid,,                                              A CP/M 3 Messages

                                       Table A-1. (continued)
           Message            Meaning

           BreaK "x" at c

                              ED. "x" is one of the symbols described below and c is the
                              command letter being executed when the error occurred.
                                     Search failure.  ED cannot find the string specified in an
                                     F, N, or S command.
                                     Unrecognized command letter c. ED does not recogn'
                                                                                            ize
                                     the indicated command letter, or an E, Hi 0, or Q com-
                                     mand is not alone on its command line.
                              0      The file specified in an R command cannot be found.
                              >      Buffer full. ED cannot put any more characters in the
                                     memory buffer, or the string specified in an F, N, or S
                                     command is too long.
                              E      Command aborted. A keystroke at the console aborted
                                     command execution.
                              F      Disk or directory full. This error is followed by either
                                     the disk or directory full message.  Refer to the recovery
                                     procedures listed under these messages.

           CANNOT CLOSE:
           Cannot close f i le
           CANNOT CLOSE      FILE.
           CANNOT CLOSE      DESTINATION FILE - f i 1 espec

                              GENCOM, HEXCOM, LIB-80".  LINK-80, MAC, PIP, RMAC,
                              SUBMIT.  An output file cannot be closed.  This can occur if the
                              disk is removed before the program terminates.

           Cannot delete f i le ,

                              GENCOM.  CP/M cannot delete a file.  Check to see if the COM
                              file is Read-Only or password-protected.



         fr@ DIGITAL RESEARCH"'                                                             A-3

   A CP/M 3 Messages                                              CP/M 3 User's Guide

                                Table A-1. (continued)
    Message            Meaning
    Cannot    h av e b o t h c re at e and acc e s s t i me s t amps

                       SET.  CP/M 3 supports either create or access time stamps, but
                       not both.

    Cann o t I ab e 1 a d r i v e w i t h a f i 1 e re f e r en c e d

                       SET.  SET does not allow mixing of files and drives.

    CANNOT OPEN SOURCE FILE

                       HEXCOM.  The HEX file is not on the specified drive(s).

    C ann o t r e d i re c t f rom B I OS o                                               I

                       GET, PUT.  This message is displayed as a warning only if the
                       system has an invalid BIOS.

    Cannot set both RO and RW.

                       SET.  A file cannot be set to both Read-Only and Read-Write.

    Cannot set both SYS and DIR.

                       SET.  A file cannot be set to both SYS and DIR.

    CAN -T DELETE TEMP FILE

                       PIP.  A temporary $$$ file already exists which is Read-Only.
                       Use the SET command to change the attribute to Read-Write,
                       then erase it.








                                                                  (9 DIGITAL RESEAR(H["
   A-4

    A CP/M 3 Messages                                                     CP/M 3 User's Guide

                                     Table A-1. (continued)
      Message             Meaning
      CORRECT ERROR t TYPE RETURN OR CTRL-Z

                          PIP.  A hex record checksum was encountered during the trans-
                          fer of a hex file.  The hex file with the checksum error should
                          be corrected, probably by recreating the hex file.

      CPMLDR e r ro r      f a i 1 e d t o o Pen CPM3 , SYS

                          CPMLDR.  The system file CPM3.SYS is missing.

      CPMLOR e r ro r      f a i 1 ed t o read CPM3 . SYS

                          CPMLDR.  An error occurred while reading CPM3.SYS.

      CP/M Error an       d: DisP, I/O
      BDOS Function = xx File = filespec

                          CP/M displays the preceding message if the disk is defective or
                          improperly formatted (wrong density).

      CP/M Error on       d : I ri v a 1 i d D r i v e
      BDOS F un c t i on = x x F i 1 e = f i I e s Pe c

                                                        ing message when there is no disk
                          CP/M 3 displays the preced'
                          in the drive, the drive latch is open, or the power is off.  It also
                          displays the message when the specified drive is not in the
                          system.

      CP/M E r ro r o n   d: Read/Only DisK
      BDOS Function = xx File = filespec

                          CP/M 3 does not allow you to erase, rename, update, or set
                          attributes of a file residing in a Read-Only drive.  Use the SET
                          command to set the drive attribute to Read-Write.



     A-6                                                                  h DIGITAL RESEAR(H"'

       CPIM I U,er', Guilc                                                  A CP/M 3 Messages


                                        Table A-1. (continued)

          Message             Meaning

          CP/M Error on       d: Read/Only File
          BDOS Function = xx File = filespec

                              CP/M 3 does not allow you to erase, rename, update, or set
                                  'butes of a file that is Read-Only.  Use the SET command to
                              attri
                              set the file attribute to Read-Write.

          Date and Time       Stamping Inactive,,

                              DIR.  The DATE option was specified, but the disk directory
                              has not been initialized with date/time stamping.

          DESTINATION IS R/O t DELETE (Y/N)?

                              PIP.  The destination file specified in a PIP command already
                              exists and it is Read-Only.  If you type Y, the destination file is
                              deleted before the file copy is done.  If you type N, PIP displays
                              the message **NOT DELETED** and aborts the copy
                              operation.

          Dev ice Re ass i gnment Not Suppo rte d
          Ent e r new ass i !Inment o r hi t RETURN.

                              DEVICE.  A device assignment is invalid.

          D i re ct o r Y a 1 re ad Y re - f o rmat t e d .

                              INITDIR.  The directory already has date/time stamping.








           Dl(;I-FAI, RESLARCH"'                                                              A-7

   A CP/M 3 Messages                                                  CP/M 3 User's Guide

                                  Table A-1. (continued)
           e            Meaning
    0 i r e c t c) r Y f ti I I
    DIRECTORY FULL

                        ED. There is not enough directory space for the file being writ-
                        ten to the destination disk.  You can use the OXfilespec com-
                        mand to erase any unnecessary files on the disk without leaving
                        the editor.
                        SUBMIT.  There is not enough directory space on the tempo-
                        rary file drive to write the temporary file used for processing
                        SUBMIT files.  Use the SETDEF command to determine which
                        drive is the temporary file drive.  Use the ERASE command to
                        erase unnecessary files or set the temporary file drive to a dif-
                        ferent drive and retry.
                        LIB-80, LINK-80.  There is no directory space for the output or
                        intermediate files.  Use the ERASE command to remove unnec-
                        essary files.
                        GENCPM.  There is no directory space for CPM3.SYS.
                        HEXCOM.  There is no directory space for the output COM
                        file.

    D i r e c t o ry n e e d s t o b e re f o rm at t e d f o r d a t e / t i me s t amps

                        SET. A date/time option was specified, but the directory       has
                        not been initialized for date/time stamping.  Use the INITDIR
                        command to initialize the directory for date/time stamping.

    DISK FULL

                        ED. There is not enough disk space for the output file.  This
                        error can occur on the E, H, W, or X commands.  If it occurs
                        with X command, you can repeat the command prefixing the
                        filename with a different drive.






                                                                      17C DIGITAL RESEARCH"'
  A-8

       CP/M 3 User's Guide                                              A CP/M 3 Messages

                                     Table A-1. (continued)
         Message           Meaning
         DISK READ
         DISK REID ERROR:
         Disk read error: f ilespec
         D I SK READ ERROR - f i 1 e s Pe c

                           GENCPM, HEXCOM, LIB-80, LINK-80, PIP.  The disk file
                           specified cannot be read.

         DISK WRITE.
         Disk Write Error
         DISK WRITE ERROR:
         DISK WRITE ERROR - f ilespec

                           HEXCOM,- LIB-80, LINK-80, PIP, SUBMIT.  A disk write
                           operation cannot be successfully performed probably because
                           the disk is full.  Use the ERASE command to remove unneces-
                           sary files.

         Do Y ou want an oth e r f i 1 e? ( Y/N

                           PUT.  Enter Y to redirect output to an additional file.  Other-
                           wise, enter N.

         Drive def ined twice in search Path

                           SETDEF.  A drive can be specified only once in the search path
                           order.

         Drive Read Only

                           ERASE, RENAME.  The specified file is on a Read-Only drive
                           and cannot be erased or renamed.

         D r i v e s P e c i f i e d h as n o t b e en d e f i n e d ,

                           GENCPM.  The drive specified has not been defined yet.  Buffer(s)
                           have not been allocated for the drive.


         DIGITAL RESEARCH"'                                                             A-9

    A CP/M 3 Messages                                              CP/M 3 User's Guide

                                 Table A-1. (continued)
     Message            Meaning
     D u P 1 i c a t e RSX i ri h e a d e r . R e P 1 a c i n !I o I d b v n e w
     T h i s f i I e w a sn o t u s e d

                        GENCOM.  The specified RSX is already attached to the COM
                        file.  The old one is discarded.

     Dupl i cate input RSX .                                                              I

                        GENCOM.  Two or more RSXs of the same name are specified.
                        GENCOM uses only one of the RSXS.

     Equals (=) delimiter missing at line NN+

                        GENCPM.  The equal sign is missing in the specified line.

     END OF F ILE t 'Z t ?

                        PIP encountered an unexpected end-of-file during a HEX file
                        transfer.

     En d o f 1 i n e e x P e c t e d

                        DEVICE, GET, PUT, SETDEF.  The command typed does not
                        have any further parameters.  An end-of-linc was expected.  Any
                        further characters on the line were ignored.

     E r r o r at en d o f 1 i n e :                                                      I

                        DEVICE, GET, PUT, SETDEF.  The error detected occurred at
                        the end of the 'input line.

     E r ro r o n I i n en n n n n :

                        SUBMIT.  The SUBMIT program displays its messages in the
                        preceding format, where nnnnn represents the line number of
                        the SUBMIT file.  Refer to the message following the line num-
                        ber for explanation of the error.


                                                                   !'Ol Dl(;ITAI- RLSLAR(:I I
   A-10

         CP/M 3 User's Guide                                               A CP/M 3 Messages

                                        Table A-1. (continued)
          Message             Meaning
          FILE ERROR

                              ED. Disk or directory is full, and ED cannot write anything
                              more on the disk.  This is a fatal error, so make sure there is
                              enough space on the disk to hold a second copy of the file
                              before invoking ED.

          Fi le al read,/     ex i sts  Del ete it? ( Y/N)
          ti le al ready      exists     delete (Y/N)?

                              PUT.  Enter Y to delete the file.  Otherwise the program
                              terminates.
                              RENAME.  The above message is preceded by filespec.  You
                              have asked CP/M 3 to create or rename a file using a file
                                  'ficat'on that is already assigned to another file.  Either delete
                              speci   I                                            I
                              the existing file or use another file specification.

          Fi le cannot f it into GENCPM buf f e r: f i lename , SPR

                              GENCPM.  There is not enough memory to generate a system.

          Fi le ex ists t     e rase i t

                              ED. The destination filename already exists when you are plac-
                              ing the destination file on a different disk than the source.  It
                              should be erased or another disk selected to receive the output
                              file.

          FILE IS READ/ONLY
          File is Read Only

                              ED. The file specified in the command to invoke ED has the
                              Read-Only attribute.  ED can read the file so that you can
                              examine it, but ED cannot change a Read-Only file.
                              PUT.  The file specified to receive the output is a Read-Only
                              file.


         E, DIGITAL RESEARCH"'
                                                                                          A-11

    A CP/M 3 Messages                                                 CP/M 3 User's Guide

                                   Table A-1. (continued)

           ge            Meaning
      F ILE NAME ERROR:

                         LIB-80.  The form of a source filename is invalid.

      F i 1 e n o t f o un d .
      F I LE NOT F OUND - f i 1 e s p e c

                         DUMP, ED, GENCOM, GET, PIP, SET.  An input file that you
                         have specified does not exist.  Check that you have entered the
                         correct drive specification or that you have the correct disk in
                         the drive.

      F i rs t s u bm i t t e d f i 1 e mu s t b e a COM f i 1 e

                         GENCOM.  A COM file is expected as the first file in the com-
                         mand tail.  The only time GENCOM does not expect to see a
                         COM file in the first position of the command tall is when the
                         NULL option is specified.

      FIRST COMMON      NOT LARGEST:

                         LINK-80.  A subsequent COMMON declaration is larger than
                         the first COMMON declaration for the indicated block.  Check
                         that the files being linked are in the proper order, or that the
                         modules in a library are in the proper order.

      HELP.  DAT not on current d rive .

                         HELP.  HELP cannot find HELP.DAT file to process.

      Ille!lal command tail.

                         DIR.  The command line has an invalid format or option.







                                                                      9 DIGITAL RESEARCH"'
    A-12

        CP/M 3 User's Guide                          A CP/M 3 Messages

                             Table A-1. (continued)

          Message      Meaning
          Illegal Format Value#

                       DIR.  Only SIZE and FULL options can be used for display
                       formats.

          Illegal Global/Local Drive Spec Mixin!(#

                       DIR.  Both a filespec with a drive specifier and the DRIVE option
                       appears in the command.

          I 1 1 e 9 a 1 f i 1 en ame .

                       SAVE.  There is an error in the filespec on the command line.

          I 1 1 e -4 a 1 Op t i o n o r M o d i f i e r,

                       DIR.  An invalid option or abbreviation was used.

          I I 1 e!g a I d at e / t i m e s P e c i f i c at i on .

                       DATE.  Date/time format is invalid.

          I n c o r re c t f i 1 e s Pe c i f i c at i o n .

                       RENAME.  The format of the filespec is invalid.

          INDEX ERROR:

                       LINK-80.  The index of an IRL contains invalid information.

          Insufficient Memory
          INSUFFICIENT MEMORY:

                       GET, LINK-80, PUT, SUBMIT.  There is not enough memory
                       to allocate buffers, or there are too many levels of SUBMIT
                       nesting.



        P DIGITAL RESEARCH"
                                                               A-13

   A CP/M 3 Messages                                                   CP/M 3 User's Guide

                                   Table A-1. (continued)
     Message             Meaning
     I n v a 1 i d ASC I I c h a r ac t e r

                         SUBMIT.  The SUBMIT file contains an invalid character (OFFH).

     I n v a 1 i d c h a r ac t e r at 1 i n e NN .

                         GENCPM.  The character must be a number.

     Invalid command.

                         GET and PUT.  The string or substring typed in the command
                         line was not recognized as a valid command in the context
                         used.

     Invalid delimiter.

                         DEVICE, GET, PUT, SETDEF. The delimiter,                or space,
                         - was not valid at the location used.  For example, a [ was
                         used where an = should have been used.

      I NYAL I D DEST I NAT I ON:

                         PIP.  An invalid drive or device was specified.

      INYALID DIGIT - f i I espec

                         PIP.  An invalid hex digit has been encountered while reading a
                         hex file.  The hex file with the invalid hex digit should be cor-
                         rected, probably by recreating the hex file.

      Invalid drive.

                         SETDEF.  The specified drive was not a valid drive.  Drives rec-
                         ognized by SETDEF are * (default drive) and A to P.
                         GENCPM, TYPE.  Valid drives are A to P.


    A-14                                                               JE DIGITAL RESEARCH"

       CP/M 3 User's Guide                                             A CP/M 3 Messages

                                    Table A-1. (continued)
         Message           Meaning
         I n v a 1 i d d r i v e i !In o r e d a t I i n e NN

                           GENCPM.  Valid drives are A to P.

         I n v a 1 i d d r i v e n ame ( U s e A t 5 t C t c r D )

                           COPYSYS, GENCPM.  Only drives A, B, C and D are valid
                           destination drives for system generation.

         Invalid File,
         INVALID FILENAME
         Invalid f ile name.
         Inval id Fi lename .
         Inval id f i le specif icat ion .

                           ED, ERASE, GENCOM, GET, PIP, PUT, SET, SUBMIT, TYPE.
                           The filename typed does not conform to the normal CP/M 3
                           file naming conventions.

         INVALID FORMAT

                           PIP.  The format of your PIP command is illegal.  See the
                           description of the PIP command.

         INVALID HEX DIGIT.

                           HEXCOM.  An invalid hex digit has been encountered while
                           reading a hex file.  The hex file with the invalid hex digit should
                           be corrected by recreating the hex file.

         I n v a 1 i d n umb er .

                           DEVICE.  A number was expected but not found, or the num-
                           ber was out of range; numbers must be from 0 to 255.



       9 DIGITAI- RESEAR(:H"'                                                        A-15

    A CP/M 3 Messages                                                CP/M 3 User's Guide

                                  Table A-1. (continued)

      Message            Meaning
      I n v a 1 i d o P t i o n .

                         DEVICE and GET.  An option was expected and the string
                         found was not a device option or was not valid in the context
                         used.
                         SETDEF.  The option typed in the command line is not a valid
                         option.  Valid options are DISPLAY, NO DISPLAY, NO PAGE,
                         ORDER, PAGE, TEMPORARY.

      I n v a 1 i d o p t i an o r mo d i f i e r,

                         DIR, GET, PUT.  The option typed is not a valid option.

      INVALID PARAMETER:

                         MAC, RMAC.  An invalid assembly parameter was found in
                         the input line.  The assembly parameters are printed at the con-
                         sole up to the point of the error.

      I n v a 1 i d P a r am e t e r v a r i ab 1 e a t 1 i n e NN ,

                         GENCPM.  The parameter variable does not exist.  Check spelling.

      INVALID PASSWORD
      Invalid Password or Passwords not allowed.

                         ED, PIP.  The specified password is incorrect, or a password
                         was specified, but the file is not password-protected.

      I n v a 1 i d Ph Y s i c a 1 d e v i c e .                                              I

                         DEVICE.  A physical device name was expected.  The name founc
                         in the command string does not correspond to any physical
                         device name in the system.


    A-16                                                             0 DIGITAL RESEARCH,'

       CP/M 3 User's Guide                                             A CP/M 3 Messages

                                     Table A-1. (continued)
         Message           Meaning
         INVALID REL FILE:

                           LINK-80.  The file indicated contains an invalid bit pattern.
                           Make sure that a REL or IRL file has been specified.

         Inval id RSX type,

                           GENCOM.  Filetype must be RSX.

         I n v a I i d SCB o f f s e t ,

                           GENCOM.  The specified SCB is out of range.  The SCB offset
                           range is OOH-64H.

         INVALID SEPARATOR

                           PIP.  You have placed an invalid character for a separator
                           between two input filenames.

         INVALID SOURCE

                           PIP.  An invalid drive or device was specified.  AUX and CON
                           are the only valid devices.

         I n v a 1 i d t y P e f o r ORDER o P t i on .

                           SETDEF.  The type specified in the command line was not COM
                           or SUB.

         I n v a 1 i d SYM f i 1 e f o rm at

                           XREF.  The filename.SYM file input to XREF is invalid.

         I NVAL ID USER NUMBER

                           PIP.  You have specified a user number greater than 15.  User
                           numbers are in the range 0 to 15.


      To DIGITAL RESEARCH"'
                                                                                     A-17

   A CP/M 3 Messages                            CP/M 3 User's Guide

                        Table A-1. (continued)
    Message       Meaning
    I n v a 1 i d w i I d c a rd .

                  RENAME.  The filespec contained an invalid wildcard
                  specification.

    Invalid wild  c a r d i n t h e FC B n am e o r t y P e f i e 1 d

                  GENCOM.  GENCOM does not allow wildcards in filespecs.

    LOAD ADDRESS  LESS THAN 1004

                  HEXCOM.  The program origin is less than 100H.

    MAIN MODULE ERROR:

                  LINK-80.  A second main module was encountered.

    Make e r ro r

                  XREF.  There is not more directory space on the specified drive.

    Memo ry c o n f I i c t - c ann o t t r i m s e !Imen t #

                  GENCPM.  The defined memory segment overlaps another
                  segment.

    Memo ry c an f I i c t - s e imen t t r i mme d

                  GENCPM.  The defined memory segment overlaps with other
                  segments.

    MEMOR'( OYERFLOW:

                  LINK- 80. There is not enough memory to complete the link
                  operation.




                                               - 9 DIGITAL RESEARCH"'
    A-18

      CP/M 3 User's Guidc                                          A CP/M 3 Mcssages

                                   Table A-1. (continued)
        Message           Meaning
        M i n i m um n um b e r o f b u f f e r s i s I

                          GENCPM.  The first drive must have at least one buffer defined.

                   D e 1 i m i t e r o r Un r e c o in i z e d 0 p t i o n .

                          ERASE.  The ERASE command line format is invalid.

                    Pa ramete r va ri ab I e at 1 in e NN .

                           GENCPM.  The line is missing a variable name.

         M i s s i n 9 1 e f t P a r e n t h e s i s ,

                           GENCOM.  The SCB option must be enclosed by a I
                           parenthesis.

         Missing ri ght Parenthes is

                           GENCOM.  The SCB option is not enclosed with a right
                           parenthesis.

                     SCB value.

                            GENCOM.  The SCB option requires a value.

                    an f our d rives specif ied .

                            SETDEF.  More than four drives were specified for the drive
                            search chain.

           MULTIPLE DEFINITION:

                            LINK-80.  The specified symbol is defined in more than one of
                             the modules being linked.


          [oDo DICITAL RESEAR(-H@"                                                   A-19

      CP/M 3 User's Guide                                           A CP/M 3 Messages

                                   Table A-1. (continued)
       Message           Meaning
       M i n i mum n umb e r o f b uf f e r s i s

                         GENCPM.  'Me first drive must have at least one buffer defined.

       M i s s i n !I D e 1 i m i t e r o r Un r e c o in i z e d Opt i on .

                         ERASE.  The ERASE command line format is invalid.

       M i s s i n!l Pa rame t e r v a r i ab 1 e at 1 i n e NN ,

                         GENCPM.  The line is missing a variable name.

       M i s s i n 91 1 e f t Pa re n t h e s i s .

                         GENCOM.  The SCB option must be enclosed by a left
                         parenthesis.

       Missing ri !Iht Parenthesis

                         GENCOM.  The SCB option is not enclosed with a right
                         parenthesis.

       Missing SCB value.

                         GENCOM.  The SCB option requires a value.

       Mo re t h an f o u r d r i v e s s P e c i f i e d t

                         SETDEF.  More than four drives were specified for the drive
                         search chain.

       MULTIPLE DEFINITION:

                         LINK-80.  The specified symbol is defined in more than one of
                         the modules being linked.


      EIF DIGITAT. RESEARCH'-                                                     A-19

     A CP/M 3 Messages                                                  CP/M 3 User's Guide

                                    Table A-1. (continued)

       Message             Meaning
       n ?

                           USER.  You specified a number greater than fifteen for a user
                           area number.  For example, if you type USER 18, the screen
                           displays 18?.

       No d i recto ry     label exists.

                           SHOW.  The LABEL option was requested but the disk has no
                           label.

       N o d i re c t o ry s P a c e
       NO DIRECTORY        SPACE -filespec

                           COPYSYS, GENCOM, MAC, PIP, RMAC, AND SAVE.  There
                           is not enough directory space for the output file.  Use the ERASE
                           command to remove unnecessary files on the disk and try again.

       No disk space .     SAVE. There is not enough space on the disk for the output
                           file.  Use the SHOW command to display the amount of disk
                           space left and use the ERASE command to remove unnecessary
                           files from the disk, or use another disk with more file space.

       No f i le
       NO FILE:
       NO FILE - f i lespec

                           DIR, ERASE, LIB-80, LINK-80, PATCH, PIP, RENAME, TYPE.
                           The specified file cannot be found in the specified drive(s).

       No HELP.HLP f ile on the def ault drive .

                           HELP.  The file HELP.HLP must be on the default drive.


      A-20                                                              H DIGITAI. RESEARCH"'

      CP/M 3 User's Guide                            A CP/M 3 Messages

                            Table A-1. (continued)

       Message       Meaning

       NO INPUT FILE PRESENT ON DISK

                     DUMP.  The file you requested does not exist.

       No memo ry

                     There is not enough memory available for loading the specified
                     program.

       No modi f i e r f o r th i s apt ion



       NO MODULE:    GENCOM. A modifier was specified but none is required.



                     LIB-80.  The indicated module cannot be found.

       No mo r e s p a c e i n t h e h e a d e r f a r RSX s o r SCB
       initialization.

                     GENCOM. The header has room for only 15 entries, or the
                     combination of RSXs and SCBs exceed the maximum.

       No apt i ons spee i f i e d ,

                     SET.  Specify an option.

       No PRN f i 1 e ,

                     XREF.  The file filename.PRN is not present on the specified
                     drive.

       No Records Exist

                     DUMP.  Only a directory entry exists for the file.


     E DIGi-rAL RESEAR(.H"'                                     A-21

   A CP/M 3 Messages                                        CP/M 3 User's Guide

                             Table A-1. (continued)

    Message           Meaning
    N o s o u r c e f i 1 e o n d i s K

                      COPYSYS.  The file CPM3.SYS is not on the disk specified.

    NO SOURCE FILE PRESENT:

                      MAC, RMAC.  The source file cannot be found on the specified
                      drive.

     NO SPACE

                      SAVE.  There is no space in the directory for the file being
                      written.

     No 'SUB ' f i 1 e f ound

                      SUBMIT.  The SUB file typed in the command line cannot be
                      found in the drive search process.

     No such f i 1 e to rename .                                                  I

                      RENAME.  The file to be renamed does not exist on the speci-
                      fied drive(s).

     No SYM f i le

                      XREF.  The file filename SYM is not present on the specified
                      drive.

     NON-SYSTEM FILE(S) EXIST

                      DIRS.  If nonsystem (DIR) files reside on the specified drive,
                      DIRS displays this message.





                                                             fc DL(,ITAL RESEAR(H"'
    A-22
      CPIM 3 User's Guilc                                         A CP/M 3 Messages

                                  Table A-1. (continued)
       Message           Meaning
       N o t e n a u 9 h a v a i 1 a b 1 e m e m o r Y
       N o t En a u I h M e m o r Y
       N o t En a u!l h M e m o r Y f o r S o r t

                         DIR,, INITDIR.  There is not enough memory for data or sort
                         buffers.

       N o t e n a u!l h r a o m i n d i r e c t o r Y

                         INITDIR.  There is not enough remaining directory space to
                         allow for the date and time extension.

       NOT FOUND

                         PIP.  PIP cannot find the specified file.

       Not renamed t f i 1 espeo read only .

                         RENAME.  The specified file cannot be renamed because it is
                         Read-Only.

       OPEN FILE NONRECOVERABLE

                         PIP.  A disk has the wrong format or a bad sector.

       0 Pt i on on 1 y I o r I r i v e s ,

                         SET.  The specified option is not valid for files.

       0 Pt i on re q u i re s a f i 1 e re f e r en c e .

                         SET.  The specified option requires a filespec.

       Ou t o f d at a s Pac e .

                         COPYSYS.  The destination drive ran out of space during the
                         transfer of the CPM3.SYS file.


        [)[(;ITAI, RESLAR('VL                                                   A-23

     A CP/M 3 Messages                                            CP/M 3 User's Guide

                                 Table A-1. (continued)

       Message           Meaning

       0 p t i o n s n o t !f r a u P e d t o 9 e t h e r

                         DIR.  Options can only be specified within one set of brackets.

       0 u t P u t F i 1 e E x i s t s t E r a s e i t .

                         The output file specified must not already exist.

       OUTPUT FILE READ ERROR:

                         MAC, RMAC.  An output file cannot be written properly,
                         probably because the disk is full.  Use the ERASE command to
                         delete unnecessary files from the disk.

       OYERLAPPING SEGMENTS:

                         LINK-80.  LINK-80 attempted to write a segment into memory
                         already used by another segment.

       P a!Ye an d n o P are o Pt i on s e 1 e c t e d
       No Pa!fe in effect#

                         SET.  The preceding options are mutually exclusive.

       P a r ame t e r E r ra r

                         SUBMIT.  Within the SUBMIT file of type SUB, valid parame-
                         ters are $0 through $9.

       Pa s s wo rd E r ro r

                         DUMP, ERASE, GENCOM, TYPE.  The password is incorrect.

       Physical Device Does Not Exist.

                         DEVICE.  The specified physical device is not defined in the
                         system.



     A-24                                                         @D DIGITAL RESEAR(H"'

