Home
ed: a context editor for the cp/m disk system user's
Contents
1. lt 1f gt tz INSERT cr 1f AS 6 2L T cr move up two lines NOW IS ECL and type 65535 lines ahead of CP TIME TO cr lf NOW IS THE INSERT lt cr gt lt 1f gt 7 cr move down one line NOW IS THE cr lf and type one line INSERT PE TIME TO cr lf Ep INSERT lt cr gt lt 1f gt 1 7 Text Search and Alteration ED also has a command which locates strings within the memory buffer The command takes the form cr nF ere CR La where c through cy represent the characters to match followed by either a lt cr gt or control z ED starts at the current position of CP and attempts to match all k characters The match is attempted n times and if E the CP is moved directly after the character c If the n matches are not successful the CP is not moved rom its initial position Search strings can include fl control 1 which is replaced by the pair of symbols lt cr gt lt lf gt The control z is used if additional commands will be typed following the tz The following commands illustrate the use of the F command Command String Effect Resulting Memory Buffer l B T lt cr gt move to beginning en NOW IS THE cr lf and type entire buffer TIME FOR crX lf ALL GOOD MEN cr lf 2 FS T lt cr gt find the end of NOW IS I E the string s T 3 FI zOTT find the next I NOW IS THE lt cr gt lt lf gt and type to the CP then type the TI ep FOR lt cr gt lt
2. inserts Ene 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 form lt cr gt n M 1 2 C Ce where CjC23 Cy represent a string of ED commands not inclu ding potes M command ED executes the command string n times if n gt 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 MFGAMMA z S5DIDELTA zOTT cr or equivalently MSGAMMA zDELTA zOTT cr 12 2 ED ERROR CONDITIONS On error conditions ED prints the last character read before the error along with an error indicator unrecognized command gt 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 O 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 t
3. 1 gt remainder of the i ALL GOOD MEN lt cr gt lt l gt current line TIME FOR 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 CC C tz or 1 CHO Zen ER SE where c through c are characters to insert If the inser tion string is terminated by a tz the characters cy through cQ are inserted directly following the CP and the CP is moved directly after character Cp The action is the same if the command is followed by a lt cr gt except that a lt cr gt lt lf gt is automatically inserted into the text following character CQ Consider the following command sequences as examples of the F and I commands Command String Effect Resulting Memory Buffer BITHIS IS 4z lt cr gt Insert THIS IS THIS IS NOW THE lt cr gt lt lf gt at the beginning of the text TIME FOR lt cr gt lt 1f gt ALL GOOD MEN lt cr gt lt 1f gt FTIME z 4DIPLACE z lt cr gt THIS IS NOW THE lt cr gt lt 1 gt find TIME and delete PLACE N FOR lt cr gt lt lf gt it then insert PLACE ALL GOOD MEN lt cr gt lt lf gt 3F0 z 3DSDICHANGESt lt cr gt gt THIS IS NOW THE lt cr gt lt 1f gt find third occurrence PLACE FOR lt cr gt lt 1f gt of O ie the second ALL CHANGES co de O in GOOD delete l previous 3 characters then insert CHANGES 8CISOURCE cr move back 8 characters THIS IS NOW THE lt cr g
4. DIGITAL RESEARCH Post Office Box 579 Pacific Grove California 93950 408 373 3403 ED A CONTEXT EDITOR FOR THE CP M DISK SYSTEM USER S MANUAL COPYRIGHT 1976 1978 DIGITAL RESEARCH Copyright 1976 1978 by Digital Research All rights reserved No part of this publication may be reproduced transmitted transcribed stored in a retrieval system or trans lated into any language or computer language in any form or by any means electronic mechanical magnetic optical chemical manual or otherwise without the prior written permission of Digital Research Post Office Box 579 Pacific Grove California 93950 Disclaimer Digital Research makes no representations or warranties with respect to the contents hereof and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose Further Digital Research reserves the right to revise this publication and to make changes from time to time in the content hereof without obligation of Digital Research to notify any person of such revision or changes Table of Contents ED TUTORIAL a o l l Introduction to ED 1 2 ED Operation 1 3 Text Transfer Functions 1 4 Memory Buffer Organization 1 5 Memory Buffer Operation 1 6 Command Strings 1 7 Text Search and Alteration 1 8 Source Libraries 1 9 Repetitive Command Execution ED ERROR CONDITIONS au CO
5. NTROL CHARACTERS AND COMMANDS 11 o yuon r EP H m e uU D OH 13 14 ED USER S MANUAL La 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 lt filename gt ED lt filename gt lt filetype gt In general ED reads segments of the source file given by lt filename gt or lt filename gt lt filetype gt 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 l 1 2 ED Operation ED operates upon the source file denoted in Figure l 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 an
6. d Figure 3 Logical Organization of Memory Buffer Memory Buffer lt cr gt lt lf gt current line CL lt cr gt lt lf gt last line 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 nA lt cr gt nW lt cr gt write the first n lines of the memory buffer to the temporary file free space Shift the remaining lines n l through MP to the top of the memory buffer Increment TP by n E lt cr gt 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 lt cr gt 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 file is created equivalent to issuing an E command followed by a reinvocation of ED using x y as the file to edit O lt cr gt return to original file The memory buffer is emptied the temporary file id deleted and the SP is returned to position 1 of the source file The effects of the previous editing commands are thus nullified Q lt cr gt quit edit with no file alterations return to CP M There are a number of special cases to consider If the integer n is omitted in any ED command where an integer is allowed then 1 is assumed Thus the commands A and W append one line and write 1 li
7. d 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 Figure 1 Overall ED Operation Source Libraries Temporary Source Append Write A W File File x Memory Buffer After Edit E New Source File X Y 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 U in effect Figure 2 Memory Buffer Organization Source File Memory Buffer Temporary File 1 First Line 2 N Appended Buffered x 3 Unprocessed yo Free Next Source Append Memor Write ES Y Space Lines Space l L m n anm ew e omen a L an mm a em vw i ILL ed e
8. e 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 That 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 Ox is provided however to empty the transferred line file Note that upon normal completion of the ED program through Q or E the temporary LIB file is removed If ED is aborted through ctl C the LIB file will exist if lines have been transferred but will generally be empty a subsequent ED invocation will erase the temporary file Due to common typographical errors ED 1 4 requires several potentially disas terous commands to be typed as single letters rather than in composite commands The commands E end H head O original Q quit must be typed as single letter commands ED 1 4 also prints error messages in the form BREAK x AT c where x is the error character and c is the command where the error occurred
9. h 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 Effect Resulting Memory Buffer l B2T cr move to beginning ep NOW IS THE lt cr gt lt l gt of buffer and type gt lines TIME FOR lt cr gt lt 1f gt NOW IS THE ALL GOOD MEN lt cr gt lt l gt TIME FOR 2 5C0T lt cr gt move CP 5 charac NOW CIN THE lt cr gt lt lf gt ters and type the beginning of the line NOW I de 2L T lt cr gt move tw lines down NOW IS THE lt cr gt lt lf gt and type previous TIME FOR lt cr gt lt 1f gt line xx TIME FOR ALL GOOD MEN lt cr gt lt lf gt 4 L K lt cr gt move up one line NOW IS CTA delte 65535 lines which follow 5 I lt cr gt insert two lines NOW IS THE lt cr gt lt lf gt TIME TO cr of text x INSERT lt cr gt TIME TO lt cr gt
10. ied then n l is assumed Finally if a plus sign is AS but none is specified then is assumed iB lt cr gt move CP to beginning of memory buffer if and to bottom if nC lt cr gt move CP by tn characters toward front of buffer if counting the cr lf as two distinct characters tnD lt cr gt delete n characters ahead of CP if du and behind cP if minus tnK lt cr gt kill ie remove tn ihes 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 ters before CP remain if is specified while the characters after CP remain if is given in the command inL cr if n 0 then move CP to the beginning of the current line if it is not already there if n 0 then first move the CP to the beginning of the current line and then move it to the beginning of the line which is n lines down if or up if The CP will stop at the top or bottom of the memory buffer if too large a value of n is specified tnT lt cr gt If n 0 then type the contents of the current line up to CP If n 1 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 gt l and is given type the previous n lines up to the CP The break key can be depressed to abort long type outs tn lt cr gt equivalent to nLT whic
11. ll 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 499 Combining the two line reference forms the command 345 400T for example is interpreted as move to absolute line 345 then type through absolute line 440 Note that absolute line references of this sort can precede any of the standard ED commands A special case of the V command fV 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 ED 1 4 also includes a block move facility implemented through the nxn 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 general the user can reposition the eurrent 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 ean be retrieved by simply typing which is the trivial case of the library read command In this case the entire transferred set of lines is read into the memory buffer Not
12. ne respectively In addition if a pound sign is given in the place of n then the integer 65535 is assumed the largest value for n which is allowed Since most reasonably sized source files can be contained entirely in the memory buffer the command A is often issued at the beginning of the edit to read the entire source file to memory Similarly the command W writes the entire buffer to the temporary file Two special forms of the A and W cr represents the carriage return key commands are provided as a convenience The command OA fills the current memory buffer to at least half full while OW writes lines until the buffer is at least half empty It should also be noted that an error is issued if the memory buffer size is exceded The operator may then enter any command such as W which does not increase memory require ments The remainder of any partial line read during the overflow will be brought into memory on the next successful append 1 4 Memory Buffer Organization The memory buffer can be considered a sequence of source lines brought in with the A command from a source file The memory buffer has 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 charac
13. o 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 lt cr gt where x is the file being edited Then remove the primary file ERA x y lt cr gt and rename the BAK file REN xX y x BAK lt cr gt The file can then be re edited starting with the previous version 13 3 CONTROL CHARACTERS AND COMMANDS The following table summarizes the control characters and commands available in ED Control Character te te i l u z rubout break Function system reboot physical lt cr gt lt 1f gt not 14 actually entered in command logical tab cols 1 8 15 24 logical cr lf in search and substitute strings line delete string terminator character delete discontinue command e g stop typing Command Function nA append lines B begin bottom of buffer inC move character positions nD delete characters E end edit and close files normal end nF find string H end edit close and reopen files I insert characters nJ place strings in juxtaposition nK kill lines inL move down up lines nM macro definition nN find next occurrence with autoscan O retu
14. rn to original file inP move and print pages quit with no file changes R read library file nS substitute strings inT type lines tg translate lower to upper case if U no translation if U nw write lines nZ sleep tn lt cr gt move and type tnLT 15 Appendix A ED 1 4 Enhancements The ED context editor contains a number of commands which enhance its usefulness in text editing The improvements are found in the addition of line numbers free space interrogation and improved error reporting The context editor issued with CP M 1 4 produces absolute line number prefixes when the V 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 If 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 In 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 E 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 In particular the line numbers wi
15. sferred to the temporary file A final line editing function called the juxtaposition command takes the form Cr n J e Aa alas De did5 d tz 81955959 ka with the following action applied n times to the memory buffer search from the current CP for the next occurrence of the string C1C25 C If found insert the string Apd gt and move 1G to oliow dg Then delete all characters following CP up to but not including the string ej 21 leaving CP directly after dm If e e2 e NI TE La found then no deletion is made If the current line is ens IS THE TIME lt cr gt lt 1f gt Then the command JW ZWHAT tz 1l cr Results in NOW WHAT ch lt cr gt lt 1f gt Recall that l represents the pair lt cr gt lt 1f gt in search and substitute strings It should be noted that the number of characters allowed by ED in the F S N and J commands is limited to 100 symbols 1 8 Source Libraries ED also allows the inclusion of source libraries during the editing process with the R command The form of this command is 11 R fitus or R fif ge f ser where fjfo f 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 lt cr gt is issued by the operator ED reads from the file MACRO LIB until the end of file and automatically
16. t lt lf gt and insert the line SOURCE lt cr gt lt lf gt se PLACE FOR lt cr gt lt lf ALL SOURCE lt cr gt lt l1f gt Quies ene ED also provides a single command which combines the F and I commands to perform simple string substitutions The command takes the form cr n S GO AE die es yo and has exactly the same effect as applying the command string Cr F CC e tz xDId d sd L gt 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 end of buffer or until the substitution has been performed n times As a convenience a command similar to F is provided by ED which automatically appends and writes lines as the search proceeds The form is n N Cy Core CL s which searches the entire source file for the nth occurrence of the string CjC2 cy recall that F fails if the string cannot be found in the current buffer The operation of the 10 N 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 the 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 tran
17. ters 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 lt cr gt ED then accepts any number of input lines where each line terminates with a lt cr gt the lt 1f gt is supplied automatically until a control z denoted by z is typed by the operator The CP is positioned after the last character entered The sequence I lt cr gt NOW IS THE lt cr gt TIME FOR lt cr gt ALL GOOD MEN lt cr gt tz leaves the memory buffer as shown below NOW IS THE lt cr gt lt 1f gt TIME FOR lt cr gt lt 1f gt ALL GOOD MEN lt cr gt lt 1f gt 2 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 t the command can be unsigned or have an optional preceding plus or minus sign As before the pound sign 4 is replaced by 65535 If an integer n is optional but not suppl
Download Pdf Manuals
Related Search
Related Contents
Philips Connector HR3935 "user manual" 取扱説明書 (4.1MB) 透くん01* jp .indd エコアシストチェア Hansgrohe 04214920 Instructions / Assembly PC Média Center H301-NIKON-NZ100-200-500-N Copyright © All rights reserved.
Failed to retrieve file