102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. if th e so ur ce fil e d...

27
1 A\ ED A Context Editor for the CP/M System User's Guide Contents ED User's Manual Copyright 1976 Digital Research - This document is reproduced with the permision of Digital Research. IMSAI Notes on ED User's Guide Copyright 1976 IMSAI Manufacturing Corporation 14860 Wicks Boulevard San Leandro, California 94577 Made in the U. S. A. All rights reserved worldwide. 81-0000051 Rev. B

Upload: others

Post on 16-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

1 A\

ED

A Context Editor

for the CP/M System

User's Guide

Contents

ED User's Manual Copyright 1976 Digital Research - This document is reproduced with the permision of Digital Research.

IMSAI Notes on ED User's Guide

Copyright 1976 IMSAI Manufacturing Corporation 14860 Wicks Boulevard San Leandro, California 94577 Made in the U. S. A. All rights reserved worldwide.

81-0000051 Rev. B

Page 2: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

DIGITAL RESEARCH Post Office Box 579

Pacific Grove, California 93950

ED

A CONTEXT EDITOR FOR THE CP/M DISK SYSTEM

USER'S MANUAL

Copyright © Digital Research 1975,1976

Page 3: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

Table of Contents

1. ED TUTORIAL 1

1.1 Introduction to ED 1

1.2 ED Operation 1

1.3 Text Transfer Functions 1

1.4 Memory Buffer Organization 5

1.5 Memory Buffer Operation 5

1.6 Command Strings 7

1.7 Text Search and Alteration 8

1.8 Source Libraries 11

1.9 Repetitive Command Execution 12

2. ED ERROR CONDITIONS 13

3. CONTROL CHARACTERS AND COMMANDS 14

ii

Page 4: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

ED USER'S MANUAL

1. ED TUTORIAL

1.1. Introduction to ED.

ED is the context editor for CP/M, and is used to create and alter CP/M source files. ED is initiated in CP/M by typing

In general, ED reads segments of the source file given by <filename> or <filename> . <filetype> into central memory, where the file is manipulated by the operator, and subse­quently written back to disk after alterations. If the source file does not exist before editing, it is created by ED and initialized to empty. The overall operation of ED is shown in Figure 1.

1.2. ED Operation

ED operates upon the source file, denoted in Figure 1 by x.y, and passes all text through a memory buffer where the text can be viewed or altered (the number of lines which can be maintained in the memory buffer varies with the line length, but has a total capacity of about 6000 characters in a 16K CP/M system). Text material which has been edited is written onto a temporary work file under command of the operator. Upon termination of the edit, the memory buffer is written to the temporary file, followed by any remaining (unread) text in the source file. The name of the original file is changed from x.y to x.BAK so that the most recent previously edited source file can be reclaimed if necessary (see the CP/M commands ERASE and RENAME). The temporary file is then changed from x.$$$ to x.y which becomes the resulting edited file.

The memory buffer is logically between the source file and working file as shown in Figure 2.

1.3. Text Transfer Functions

Given that n is an integer value in the range 0 through 65535, the following ED commands transfer lines of text from the source file through the memory buffer to the tem­porary (and eventually final) file:

< filename>.< filetype>

<filename>

Page 5: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

Figure 1. Overall ED Operation

Source Libraries

After Edit

Note: the ED program accepts both lower and upper case ASCII characters as input from the console. Single letter commands can be typed in either case. The U command can be issued to cause ED to translate lower case alphabetics to upper case as characters are filled to the memory buffer from the console. Characters are echoed as typed without translation, however. The -U command causes ED to revert to "no translation" mode. ED starts with an assumed fU in effect,

c —> -O r —-•> +0

2

Page 6: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

Figure 2. Memory Buffer Organization

Source File

Lines

Memory Buffer

First Line 1 ,N First Linex

^Appended N

T" \ ' . x " \ v _ Lines v . — % \ ^

„ \ s \

2 N Buffered N Text \\

S N , N.\ \ * \ \ \

1 Unprocessed Free 1 Unprocessed Next Free

Source Append Memo ry

Space

1

2

3

Temporary File

N First Line\ * r\"

\ Processed N s s v \

\ Text \ \ \ \

TP

Next Write

Free File

Space

Figure 3. Logical Organization of Memory Buffer

Memory Buffer

first line

current line CL

last line

—<cr><lf>

•<cr><lf >

/N— —<cr><lf> cp

<cr><lf>

Page 7: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

nA<cr>* - append the next n unprocessed source lines from the source file at SP to the end of the memory buffer at MP. Increment SP and MP by n.

nW<cr> - write the first n lines of the memory buffer to the temporary file free space. Shift the remaining lines n+1 through MP to the top of the memory buffer. Increment TP by n.

E<cr> - end the edit. Copy all buffered text to temporary file, and copy all un­processed source lines to the temporary file. Rename files as described previously.

H<cr> — move to head of new file by performing automatic E command. Temporary file becomes the new source file, the memory buffer is emptied, and a new temporary fiie is created (equivalent to issuing an E command, followed by a reinvocation of ED using x.y as the file to edit).

0<cr> - return to original file. The memory •j '*'s ^Ptied, the temporary file 15 eieted, end the SP is returned to positron 1 of the source file. The a Previous editing commands are thus nullified.

* * " return to CP/M. ~ file alterations,

intege?^ t0 consider- If the

thSn 1 is assumed. Thus^the inte^er is one line and write 1 iin<= nus'.the commands A and W appenc pound sign (#) is given ?A '

In addition, if a 65535 is assumed (the larqest v3i"aCe-p0f n' then the integer Since most reasonably sized qo lue f°r n which is allowed), entirely in the memory buffer "fh8 files can be contained at the beginning of the edit- ne conmiand #A is often issued o memory. Similarly, the cnmm r^a<ii t^le entire source file to the temporary file. Two JW Writes the entire buffei

special forms of the A and W

*<cr> represents the card,, carnage-return key

4

Page 8: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

commands are provided the current memory buffer to at leaq^h i command OA fills writes lines until Se bSffer ? ? half-full, while OW should also be notedthatIn • St half empty* Jt

buffer size is exceded The nS?,1S lssued if the memory command (such as W) which doe>?may then enter any ments Th^ ra™^ i wnich does not increase memory require-overflow wil^^S S 25 any Partial ldne read during the append? brought into memory on the next successful

1.4. Memory Buffer Organization

iinoIhK mem°fy. buffer can be considered a sequence of source lines brought in with the A command from a source file. The rp^hT Juffer haf an associated (imaginary) character pointer CP which moves throughout the memory buffer under command of the operator. The memory buffer appears logically as shown in Figure 3 where the dashes represent characters of the source line of indefinite length, terminated by carriage-return (<cr>) and line —feed (<lf>) characters, and represents the imaginary character pointer. Note that the CP is always located ahead of the first character of the first line, behind the last character of the last line, or between two characters. The current line CL is the source line which contains the CP.

1.5. Memory Buffer Operation

Upon initiation of ED, the memory buffer is empty (ie, CP is both ahead and behind the first and last character) . The operator may either append lines (A command) from the source file, or enter the lines directly from the console with the insert command

I<cr>

ED then accepts any number of input lines, where each line terminates with a <cr> (the <lf> is supplied automatically), until a control-z (denoted by tz is typed by the operator. The CP is positioned after the last character entered. The sequence

I<cr> NOW IS THE<cr> TIME FOR<cr> ALL GOOD MEN<cr> t z

leaves the memory buffer as shown below

5

Page 9: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

NOW IS THE<cr><lf> TIME FOR<cr><lf> ALL GOOD MEN<cr><lf>A

f =P 1

Various commands can then be issued which manipulate the CP or display source text in the vicinity of the CP. The commands shown below with a preceding n indicate that an optional unsigned value can be specified. When preceded by ±, the command can be unsigned, or have an optional preceding plus or minus sign. As before, the pound sign (#) is replaced by 65535. If an integer n is optional, but not supplied, then n=l is assumed. Finally, if a plus sign is optional, but none is specified, then + is assumed.

±B<cr> - move CP to beginning of memory buffer if +, and to bottom if -.

±nC<cr> - move CP by ±n characters (toward front of buffer if £), counting the <cr><lf> as two distinct characters

±nD<cr> - delete n characters ahead of CP if plus and behind CP if minus.

±nK<cr> -

±nL<cr> -

kill (ie remove) ±n lines of source text using CP as the current reference. If CP is not at the beginning of the current line when K is issued, then the charac-

before CP remain if + is specified, while the characters after CP remain if -is given in the command.

if n=0 then move CP to the beginning of the current line (if it is not already £««) ff then first move ' the CP to e beginning of the current line, and

then move it to the beginning of the line which is n lines down (if +) or up

^ * J.T*\e cp w^ll stop at the top or bottom of the memory buffer if too large a value of n is specified.

6

Page 10: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

nT<cr> If n 0 then type the contents of the current line up to CP. if n=l then type the contents of the current line from CP to the end of the line. If n>l then type the current line along with n-1 lines which follow, if + is specified. Similarly, if n>l and - is given, type the previous n lines, up to the CP. The break key can be depressed to abort long type-outs.

±n<cr> - equivalent to ±nLT, which moves up or down and types a single line

1.6. Command Strings

Any number of commands can be typed contiguously (up to the capacity of the CP/M console buffer) , and are executed only after the <cr> is typed. Thus, the operator may use the CP/M console command functions to manipulate the input command:

Rubout remove the last character

Control-U delete the entire line

Control-C re-initialize the CP/M System

Control-E return carriage for long lines without transmitting buffer (max 128 chars)

Suppose the memory buffer contains the characters shown in the previous section, with the CP following the last character of the buffer. The command strings shown below produce the results shown to the right

Command String

1. B2T<cr>

Effect

move to beginning of buffer and type 2 lines: "NOW IS THE TIME FOR"

Resulting Memory Buffer

NOW IS THE<cr><1f>

TIME FOR<cr><lf>

ALL GOOD MEN<cr><lf>

2. 5C0T<cr> move CP 5 charac­ters and type the beginning of the line II XT^T.T T "

NOW I /N, S THE<cr><lf> fcPl

7

Page 11: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

3. 2L-T<cr> move two lines down and type previous line "TIME FOR"

NOW IS THE<cr><lf>

TIME FOR<cr><lf>

ALL GOOD MEN<cr><lf>

4. -L#K<cr> move up one line, delte 65535 lines which follow

NOW IS THE<cr><lf>

I<cr> TIME TO<cr> INSERT< cr> tz

insert two lines of text

NOW IS THE<cr><lf>

TIME TO<cr><lf>

INSERT<cr><lf>

-2L|T<cr> move up two lines, and type 65535 lines ahead of CP "NOW IS THE"

NOW IS THE<cr><lf>

TIME TO<cr><lf>

INSERT<cr><lf>

7. <cr> move down one line and type one line "INSERT"

NOW IS THE<cr><lf>

TIME TO<cr><lf>

INSERT<cr><lf>

1.7. Text Search and Alteration

ED also has a command which locates strings within the memory buffer. The command takes the form

6«kii\dc.p

nF C]c2. • c, (•;;>} hvSff+.hlr-thr°ugh ck represent the characters to match followed dosS™ J 2r contro1^2*. ED starts at the current match is iLZl I** attemPts to matc^ all k characters. The match is attempted n times, and if successful i-h^ tp is

not^uccessful ^aractef niches are Search strinas'na S • 1moved from its initial position, by the pair of ' WhiCh is rePlaced

*The control—z is used if arM-s-n following the tz. • nai commands will be typed

8

Page 12: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

commSd/0110"1"9 COnm*nds illustrate the use of the P

Command String

1. B#T<cr>

2. FS T<cr>

Effect

move to beginning and type entire buffer

find the end of the string "S T"

Resulting Memory Buffer

NOW IS THE<cr><lf>

TIME FOR<cr><lf>

ALL GOOD MEN<cr><lf>

NOW IS T ̂^HE<cr><lf>

3. FItzOTT find the next "I" and type to the CP then type the remainder of the current line: "TIME FOR"

NOW IS THE<cr><lf>

TI /\ME FOR<cr><lf> fop I

ALL GOOD MEN<cr><lf>

An abbreviated form of the insert command is also allowed, which is often used in conjunction with the F command to make simple textual changes. The form is:

I c. c_. . . c + z or 12 n

I c.c0 c <cr> 12 n

where C]_ th rough cn are characters to insert. If the inser­tion string is terminated by a + z, the characters C]_ thro ugh cn are inserted directly following the CP, and the CP is noved directly after character cn. The action is the same if the command is followed by a <cr> except that a <cr><lf> is automatically inserted into the text following character

Consider the following command sequences as examples x^" ,* emsfcci

-n* of the F and I commands:

Command String

BITHIS IS +z<cr>

Effect

Insert "THIS IS " at the beginning of the text

Resulting Memory Buffer

THIS IS HOW THE <cr><lf>

TIME FOR<cr><lf>

ALL GOOD MEN<cr><lf>

9

Page 13: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

FTIME+z-4DIPLACEtz<cr>

find "TIME" and delete it; then insert "PLACE"

THIS IS NOW THE<cr><lf>

PLACE TV FOR<cr><lf>

ALL GOOD MEN<cr><lf>

3FOtz-3D5DICHANGESl2<cr>

find third occurrence of "0" (ie the second "0" in GOOD), delete previous 3 characters; then insert "CHANGES"

THIS IS NOW THE <cr><lf>

PLACE FOR<cr><lf>

ALL CHANGES^<cr><lf>

-8CISOURCE<cr> move back 8 characters and insert the line "SOURCE< cr> <1f >"

THIS IS NOW THE<cr><lf>

PLACE FOR<cr><lf>

ALL SOURCE < cr> <1f>

CHANGES<cr><lf>

ED also provides a single command which combines the F and I commands to perform simple string substitutions. The command takes the form

n S c1c2.. cktz . -d m

and has exactly the same effect as applying the command string

F 01c2...Vz-kDId1d2...dm

a total of n times. That is, ED searches the memory buffer starting at the current position of CP and successively sub­stitutes the second string for the first string until the en o u er, or until the substitution has been performed n times.

pn ,.,??? convenience, a command similar to F is provided by nrncaiS^ automatically appends and writes lines is the seaich proceeds. The form is

n N c1c2...c {"} which searches the entire source file for the nth occurrence of the string clC2...ok (recall that F fails i? the st^ina cannot be found m the current buffer). The operation of the

10

Page 14: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

j command is precisely the same as F except in the case that the string cannot be found within the current memory buffer. In this case, the entire memory contents is written (ie, an automatic #W is issued) . Input lines are then read until tae buffer is at least half full, or the entire source file is exhausted. The search continues in this manner until the string has been found n times, or until the source file has been completely transferred to the temporary file.

A final line editing function, called the juxtaposition command takes the form

n J c.c_...c, iz d.d_...d + z e-,e„...e 12 k 12 m 12 q f<cr>^

I t z;

with the following action applied n times to the memory buffer: search from the current CP for the next occurrence of the string c^c2...C].. If found, insert the string d1,d2..-/dm, and move CP to follow dm. Then delete all characters following CP up to (but not including) the string e^ , e2, • . • e^, leaving CP directly after c^. If e1,e2, eQ cannot be found, then no deletion is made. If the current "line is

NOW IS THE TIME<cr><lf> £p|

Then the command

£ JW tzWHATt ztl<cr> I a ct Z ( >

Results in

NOW WHAT <cr><lf>

L.t

Recall that 4 represents the pair <cr><lf> in search and

lbstitute strings)^ number of characters allowed , E^ in ?he Snd J commands is limited to 100 symbols.

1.8. Source Libraries

-.i „ +-v,m in clusion of source libraries during >e editing p'roc=o-and. The form of this

'mmand is

11

Page 15: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

R f.f0..f tz or 12 n

R f,f-••f <cr> 12 n

where fif2-*fn is the name of a source file on the disk with as assumed filetype of 'LIB'. ED reads the specified file, and places the characters into the memory buffer after CP, in a manner similar to the I command- Thus, if the command

RMACRO<cr>

is issued by the operator, ED reads from the file MACRO.LIB until the end-of-file, and automatically inserts the charac­ters into the memory buffer.

1.9. Repetitive Command Execution

The macro command M allows the ED user to group ED com­mands together for repeated evaluation. The M command takes the fo rm:

n M c1c2. . .ck ^

where C]_C2...C]C represent a string of ED commands, not inclu­ding another M command. ED executes the command string n times if n>l. If n=0 or 1, the command string is executed repetitively until an error condition is encountered (e.g., the end of the memory buffer is reached with an F command) .

As an example, the following macro changes all occur­rences of GAMMA to DELTA within the current buffer, and types each line which is changed:

MFGAMMAtz-5DIDELTAtzOTT<cr>

or equivalently

MSGAMMA+zDELTAtzOTT<cr>

12

Page 16: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

2. ED ERROR CONDITIONS

°n error conditions, ED prints the last character read before trie error, along with an error indicator:

? unrecognized command

> memory buffer full (use one of the commands D,K,N,S, or W to remove characters), F,N, or S strings too long.

# cannot apply command the number of times specified (e.g., in F command)

0 cannot open LIB file in R command

Cyclic redundancy check (CRC) information is written with each output record under CP/M in order to detect errors on subsequent read operations. If a CRC error is detected, CP/M will type

PERM ERR DISK d

where d is the currently selected drive (A,B,...). The oper­ator can choose to ignore the error by typing any character at the console (in this case, the memory buffer data should be examined to see if it was incorrectly read) , or the user can reset the system and reclaim the backup file, if it exists. The file can be reclaimed by first typing the con tents of the BAK file to ensure that it contains the proper information:

TYPE X.BAK<cr>

where x is the file being edited. Then remove the primary file:

ERA x.y<cr>

and rename the BAK file:

REN x.y=x.BAK<cr>

The file can then be re-edited, starting with the previous

version.

13

Page 17: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

3. CONTROL CHARACTERS AND COMMANDS

The following table summarizes the control characters and commands available in ED:

Control Character

+ c

+ e

ti

+1

+u

tz

rubout

break

Function

system reboot

physical <cr><lf> (not actually entered in command)

logical tab (cols 1,8, 15,...)

logical <crxlf> in search and substitute strings

line delete

string terminator

character delete

discontinue command (e.g., stop typing)

14

Page 18: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

1

9

Command

nA

±B

±nC

±nD

E

nF

H

I

nJ

±nK

±nL

nM

nN

0

±nP

Q

R

nS

±nT

± u

nW

nZ

±n<cr>

/

Function

append lines

begin bottom of buffer

move character positions

delete characters

end edit and close files (normal end)

find string

end edit, close and reopen files

insert characters

place strings in juxtaposition

kill lines

move down/up lines

macro definition

find next occurrence with autoscan

return to original file

move and print pages

quit with no file changes

read library file

substitute strings

type lines

translate lower to upper case if U, no translation if -U write lines

sleep

move and type (±nLT)

ru*»MA>c. He liu4

15

Page 19: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

I

-

i

I

.

Page 20: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

CP/M User Guide 11/17/76

IMSAI notes on ED: A Context Editor for the CP/M Disk System User Guide

ED is a character-oriented text editor with a great deal of power at makes it superior to numbered-line editors. ED allows the

user to correct or change characters within a line without having to re-enter the entire line. Also, ED is able to change all occur­ences of a character or character string with a single command. A search may be made for a character or symbol and all occurances can be printed with a single command string. Additionally, file lengths are not limited to available RAM sizes.

ED, then, while initially more complicated than typical line editors, provides features beyond the capacity of line editors. ED's cap­abilities makes it a highly—usable and powerful edbor, well-suited for use in a Floppy Disk System.

1.2.1 Enhancements in ED Operation

To edit a file on a specified disk drive, you may include the drive name in the file designator, as in

ED B:PROG.ASM

Also, there is provision to edit a file from one disk drive and put the new file on the other disk drive. This is done by typing the destination drive name and a colon after the the source file designator, separated by a space, as in

ED A:PROG.ASM B:

When the edit initiated by the above command is complete, the updated file PROG.ASM will be on drive B and the old file on drive A will have been renamed to PROG.BAK,

If the "H" command is used (this command completes the cur­rent edit and starts over; see section 1.3), then PROG.ASM w±2.1 be put on drive A, any old PROG.ASM or PROG.BAK on this drive will be deleted, and the file as updated before the "H" command will appear as PROG.BAK on drive B. Additional "H"'s will alternate between disks in a similar manner. Upon exit from ED ("E" command), the disk containing the latest version of the file will be currently logged disk.

The purpose of the above is to provide a means of editing files larger than half the cpaacity of a diskette, i.e., files which are too large for the current version and the .BAK version to fit on the same diskette

©1977 IMSAI MFG. CORP. San Leandro, CA. Made in the U. S. A.

All rights reserved worldwide.

ED 1 -

Page 21: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

I

'

.

,

.

.

Page 22: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

CP/M User Guide 11/17/76

1.6 Command Strings

Some more useful cases:

0K deletes from the beginning of the line to the character pointer.

K deletes from the character pointer to the end of the line including the<cr><lf>.

0TT types the current line, regardless of where the character pointer is in it.

jfztztexttz deletes from the character pointer up to, but not including, the text.

An example of the "J" command:

Jone^Ztwc^Zthre^1 Z

meaning "put 'two' between the next 'one' and the following 'three', replacing whatever text is already there.

3. Control Characters and Commands

When in insert mode (i.e., after I<cr>) , ̂ C, and do not work. Instead, the character goes into the buffer and input continues. becomes a <cr><Lf>in the buffer.

Any character will cause the editor to stop typing. Rubout is recommended and the break key should not be used as it may send garbage characters.

ts will cause the editor to "freeze" while typing, allowing study of the CRT screen. A second JS or any character will cause typing to continue.

ED 1 - 2

©1977 IMSAI MFG. CORP. San Leandro, CA. Made in the U. S. A,

All rights reserved worldwide.

Page 23: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

"

.

-.

1

Page 24: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

User (iuiae 11/.1/76

Additional Commands

P Page. Equivalent to 24L24T.

nP Pages as above n times.

-P Equivalent to -24L24T. Displays the previous page.

-11P Displays n previous pages.

Equivalent to 24T. Displays the first 'page' of the buffer 0P

nZ Causes a pause. Xf n=»17, the time—out is about 10 seconds. For example:

10MP8Z<cr> Pages 10 times with a pause between typeouts allowing time to sudy the output on the CRT terminal.

B0PM20ZP<cr> Displays the entire buffer, pausing between pages. Hit any key to stop the process to make a correction or to regain control on completion.

ED Semi—Bugs

ED has some inconsistencies which do not interfere seriaously with its usefulness. Most of the inconsistencies will be remedied in future releases.

a. Control Character Echoing

Tabs sometimes echo as "fT" and sometimes as spaces, how­ever they go into the file correctly. Other control characters (includingfC) do not echo at all in insert mode nor print visibly with a T command. Nevertheless, f they are typed in inadvertantly, they will go into £^0 -p-f t (3 and confuse the assembler (which also wxll not print them visibly).

Also typing ̂ Z to terminate an insert may erase the screen of a Lear-Sigler ADM-3 CRT terminal. This may be remedied by opening the cover of the terminal and switching the "DISABLE-CLEAR SCREEN" switch to "DISABLE".

b. 0A

Aon ends only until the buffer is one-fourth full and ^ not append at all even after 0W. Use 100A instead.

ED 1 -©1977 IMSAI MFG. CORP.

e-t a I t in tho I J . S. A.

Page 25: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

CP/M User Guide 11/17/76

<f>L is always translated to <cr><lf>, even outside the the contexts where it is useful (i.e., search commands). Thus, ED will not put form feeds into files.

d. 0TT

Sometimes this command will type an extra <cr><lf> at the position of the character pointer. If in doubt as to the file's contents, use 0LT or L-T instead.

10. ED known Bugs

a. N Command

If an "N" command is given as the first command after starting ED, it will sometimes indicate a search failure without actually reading any text from the file. To avoid this problem, give, say, "10A" before the "N" command.

b. Bug Relating to Cross-disk Editing

When editing from a file on one drive to a file on the other drive, as described in section 1.2.1 above, make sure there is not already a file with the same name on the destination disk. If there is such a file, you will loose the results of your edit. This is definitely a bug and will be corrected in a future release.

©1977 IMSAI MFG. CORP San Leandro, CA. Made in the U." S. A.

All rights reserved worldwide.

(

ED 1 - 4

Page 26: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

Appendix A: F.D 1.4 Enhancements

The ED context editor co ntains a number of commands which enh ance its usefulness in text editing. The improvements are found in the addition of line numbers free sp&ce interrogation, and improved error reporting.

, Ihe„?°nt^Xt .fditT°.r 155116(3 with% Cp/M lA Produces absolute line number prefixes when the \ (Verify Line Numbers) command is issued. Following the V command, the line number is displayed ahead of each line in the format:

nnnnn:

where nnnnn is an absolute line number in the range 1 to 65535. I f the memory buffer is empty, or if the current line is at the end of the memory buffer, then nnnnn appears as 5 blanks.

The user may reference an absolute line number by preceding any command by a number followed by a colon, in the same format as the line number display. I n this case, the ED program moves the current line reference to the absolute line number, if the line exists in the current memory buffer. Thus, the command

345 :T

is interpreted as "move to absolute line 345, and type the line." Note that absolute line numbers are produced only during the editing process, and are not recorded with the file. I n particular, the line numbers will change following a deleted or expanded section of text.

The user may also reference an absolute line number as a backward or forward distance from the current line by preceding the absolute line number by a colon. Thus, the command

:400T

is interpreted as "type from the current line number through the line whose absolute number is 400." Combining the two line reference forms, the command

345::400T

for example, is interpreted as "move to absolute line o45, then type through absolute line 400." Note that absolute line r eferences of this sort c an precede any of the standard ED commands.

A special case of the V command, "0V", prints the memory buffer statistics in the form:

free/total

where "free" is the number of free bytes in the memory buffer (in decimal), and "total" is the size of the memory buffer.

Page 27: 102679413...qu en tl y wr it te n back to di sk af te r al te ra ti on s. If th e so ur ce fil e d oe s not ex is t bef ore ed it in g, it is cr ea ted by E D and i nitializ ed to

ED 1.4 also includes a "block move" facility implemented through the X (Xfer) command. The form

nX /

transfers the next n lines from the current line to a temporary file called

X$$$$$$$.LIB

which is active only during the editing process. In g eneral, the user can reposition the current line reference to any portion of the source file and transfer lines to the temporary file. The transferred line accumulate one after another in this file, and can be retrieved by simply typing:

R

which is the t rivial c ase of the library re ad command. In t his c ase, the entire transferred set of lines is read into the memory buffer. Note that the X command does not remove the transferred lines from the memory buffer, although a K command can be used directly after the X, and the R command does not empty the transferred line file. T hat is, given that a set of lines has been transferred with the X command, they can be re-read any number of times back into the source file. The command

0X

is provided, however, to empty the transferred line file.

U?0n n0rm®1 c°mPletion of the E D program through Q or E , the tempoiaiy LIB file is removed. If ED is aborted through ctl-C, the LIB file will exist

will erase^he^em^ora^^He) ^ em?ty (* Subse<^nt ED inV0Cati°n

terous ̂ maX'rnbet5^PffiCrin^0tetteM rethw "than S°Veral POt.rtiaUy "'T The commands leixers, rether than in composite commands.

E (end), H (head), O (original), Q (quit)

must be typed as single letter commands.

ED 1.4 also prints error messages i n the form

BREAK "x" AT c

where x is the e rror c haracter, and c is t hp ^ ^ the command where the error occurred.