IMD 1.16: 28/05/2007 16:23:47 -FOG/UTL008         XREF ASM !"#$%&'(XREF COM)*DISK DOC +!9"=1=~#$MO@_? $>1O>0O*#"&o ڌ |ă{0O? Nonstandard disk parameter block error $*=!ͼ:\2?Bitmap 2.2 as of 12/17/81 $2:=2:_"^#V#"*##~ҥڥ?Allocated disk block size is $2!)=w̓? bytes per block $*:_+0`#~goz ʩʮò``:O{_zW {oz>O2 :A-FOG/UTL008BMAP COMBMAP7/11ASMMBMAP7/11COMTYPER COMTYPER DOC TED COM TED DOC7  ; ; BITMAP for CP/M 2.0+ as of 7/11/80 ; ; ; Lauren Guimont ; 14211 8th Avenue South ; Seattle, Washington 98168 ; ; ; ;The bitmap idea is based upon Ward Christensen's original ; bitmap program, which refused to run on 2.0+ systems. ; After giving his program a quick going over with SID, I ; decided it would be easier to rewrite it than to try and ; patch it for 2.0, 2.1, 2.2. ; ; ; ***** EQUATES ***** ; base equ 0  ; 'normal' CP/M bdos equ base+5 ; jump to bdos ochar equ 2 ; bdos console output sdsk equ 14 ; select disk curdsk equ 25 ; current disk gtaloc equ 27 ; get allocation address dskpar equ 31 ; get disk parameters fcb equ base+5ch ; file control block ; ; ; org base+100h ; start of TPA ; lxi h,0 ; clear HL dad sp O?: R/W Space $:*=#)̓?k $!ͷ’P͌Q!ͷªP}QxQ!ͷ͓G@Q! ͷ y͓Gþ!ͷ ͓Q!ͷ  ate all registers pop b pop d pop h ret ; return to caller ; crlf call inlprt ; use in line print db 0dh,0ah,'$' ; ...for cr & lf ret qu $ ; our own stack oldsp ds 2 ; old stack from ccp ; inlprt: ; in line print xthl ; HL to stack...pointer to HL inlprt1 mov a,m ; get a charact ; return to caller ; one push psw ; save Acc mvi a,'1' ; print a '1' to console call conout ; do it pop psw ; restore Acc ret ;er inx h ; increment the pointer cpi '$' ; endmark? jz inlprt2 ; if so, prepare to exit call conout ; output to console jmp inlprt1 ; go get return to caller ; zero push psw ; save Acc mvi a,'0' ; print a '0' to console call conout ; do it push h ; save lhld free ; get nb of fr another inlprt2 xthl ; orig HL...sp at end of msg ret ; return to end of msg ; conout push h ; single character console push d ; ...output; 1st save all ee blocks inx h ; add one free shld free ; store total free count pop h pop psw ; restore Acc ret ; return to caller ; ;Binary to decimal push b ; ...the registers push psw mvi c,ochar ; tell bdos mov e,a ; bdos wants it in E call bdos ; let bdos do it pop psw ; reinst output routine. Enter with 8 bit binary ;number in . Second entry at BNDEC2 assumes 16 bit nb. in ; bndec1 mvi h,0 mov l,a ; now has number ; bndec2 push b push d push h l ; load HL with CCP sp shld oldsp ; save it for later lxi sp,stack ; initialize our own sp jmp start ; bypass some subroutines ds 48 ; stack space stack e  print db 'BITMAP 2.2 AS OF ' db '7/11/80',0dh,0ah,0dh,0ah,'$' mvi c,curdsk ; get current disk in call bdos ; ...use from bdos sta drive ; save it lda  call conout pop h pop d pop b ret ; err1 call inlprt ; in line print db 0dh,0ah,'Nonstandard disk ' db 'parameter block error' db 0dh,0ah aldrv ; get any alternate drv ora a ; any specified? jz dpblk ; if not, skip next dcr a ; less one sta drive ; save as drive to use ; dpblk,'$' ; finis lhld oldsp ; get CCP sp sphl ; retore it ret ; direct return to CCP ; ;We need a little internal storage ; drive ds 1 ; current drive aldrv d lda drive ; get drive to bitmap mvi c,sdsk ; set call for disk select mov e,a ; bdos wants it in E call bdos ; let bdos do it mvi c,dskpar ; we want s 1 ; alternate specified drv dpb ds 2 ; disk parameter block add tbtr ds 2 ; total bits to read alloc ds 2 ; allocation address blksiz ds 1 ; blocdsk parameter blk call bdos ; get it, and..... shld dpb ; ...save it lxi d,5 ; offset for total blks used dad d ; add it to HL mov e,m k size code free dw 0 ; count of free blocks ; ;The actual start of it all ; start lda fcb ; get any alternate drv sta aldrv ; save it for later call inlprt ; in line  ; lsb into E inx h ; point to msb mov d,m ; get it xchg ; put it in HL... inx h ; alloc size = (dsm/8)+1 shld tbtr ; ...andxi b,-10 lxi d,-1 bndc dad b inx d jc bndc lxi b,10 dad b xchg mov a,h ora l cnz bndec2 mov a,e adi '0'   in to be safe mov e,a ; into E for bdos mvi c,sdsk ; reselect disk call bdos ; let bdos do it mvi c,gtaloc ; get the allocation address call bdos  ; it will be 3-7 (make it 1-5) cpi 5+1 ; check for over 5 jnc err1 ; nonstandard size cpi 1 ; check for less than 1 jc err1 ; nonstandard size ; ...from bdos pop d ; tbtr from stack dcx h ; back allocation up one ; ; ;We now have the total number of bits to read in DE, and ; the address to start reading them at in HL for the ; proper push psw ; save it call inlprt ; in line print db 'Allocated disk block size is $' pop psw ; get block size back sta blksiz ; save it for end  drive. So now let's print the bitmap. ; ; bmap mvi c,48 ; 1's and 0's per line call crlf ; followed by a cr,lf bmap1 inx h ; kick the pointer mov a,m ; get the byte  lxi h,512 ; set 1/2k counter lp dad h ; multiply * 2=1024 dcr a ; less block size code count jnz lp ; loop till = 0 call bndec2 ; print siz mvi b,8 ; it has 8 bits bmap2 rlc ; runn'em through carry cc one ; carry set = print '1' cnc zero ; carry not set = print '0' dcx d e in K ; dpbend call inlprt ; finish message db ' bytes per block',0dh,0ah,'$' lhld tbtr ; total bits to read push h ; save it in the stack lda drive ; aga ; decrement bit count push psw ; save the bit pattern mov a,d ; check to see if... ora e ; ...DE = 0 jz bmapend ; if so, we're finished pop psw  save it lhld dpb ; get dsk parameter blk add inx h ; ...and increment HL to inx h ; ...the 3rd byte mov a,m ; it has the block size sui 2    jmp bmap2 ; finish this byte ; bmapend pop psw ; not neccessary, but keeps the call crlf ; ...stack straight..send cr,lf call crlf lda drive ;get drive used !9"=1=~#$MO@_? $>1O>0O*#"&o ڊ |ā{0O? Nonstandard disk parameter block error $*=!:\2?BITMAP 2.2 AS OF 7/ adi 'A' call conout call inlprt db ': R/W, Space: $' lda blksiz ; get block size code lhld free ; get nb of free blocks lp1 dcr a jz don 11/80 $2:=2:_"^#V#"*##~ңڣ?Allocated disk block size is $2!)=ú? bytes per block $*:_+0^#~emz ʧʬð^^:AO?: R/W, Space: $:*=)́?k ; multiplied by size of block dad h ; times 2 jmp lp1 ; don call bndec2 ; print size of free space call inlprt db 'k',0dh,0ah,'$' jmp finis ; res $ bytes per block $*:_+0^#~emz ʧʬð^^:AO?: R/W, Space: $:*=)́?ktore things and GET OUT ; end  ; print size of free space call inlprt db 'k',0dh,0ah,'$' jmp finis ; res ; restore bit pattern dcr c ; decrement line count jz bmap ; new line if zero dcr b ; decrment bit count jz bmap1 ; new byte if zero   18 *   _0 !~=W!xe ~#Xbxʇ {z~#o}o҃i.2_!fp+q*e2_2_!hp+q*g!jp+q*i!lp+q*k!np+q*m2_!pp]r  5 DO IT 0120 MVI E,A MOVE LF TO REG E 0122 MVI C,5 TELL CPM TO MOVE LF TO PRINTER 0124 CALL 5 DO IT 0127 JMP 103 GET NEXT CHARACTER 012A MOV E,A MOVE INPUT CHAR TO REG E 012B MVI C,5 TELL CPM TO MOVE CHAR TO PRINTER 012D CALL 5 DO IT 0130 JMP 103 GET NEXT CHARACTER 0133 NOP 0134 NOP 0135 NOP 0136 NOP 0137 NOP 0138 NOP 0139 CR ENDS DDT ASSEMBLY -^C C RETURNS TO CPM TYPER IS A PROGRAM TO LET YOUR PRINTER RESPOND AS A TYPEWRITER IT WAS WRITTEN AS AN EXERCISE TO BECOME FAMILIAR WITH DDT UTILITY BY DAVE BLAIR 13 JUNE 1982 A>DDT DDT VERS 2.2 -A100 STARTS ASSEMBLY AT LOCATION 100 0100 LXI SP,138 A>SAVE 1 B:TYPER.COM CREATES COM FILE TYPER.COM ON B: A>B:TYPER TRY IT OUT  NOP 0136 NOP 0137 NOP 0138 NOP 0139 CR ENDS DDT ASSEMBLY -^C C RETURNS TO CPM  SAVE STACK POINTER 0103 MVI C,1 TELL CPM TO GET CHAR FROM KEYBOARD AND ECHO IT 0105 CALL 5 DO IT 0108 CPI 1A IS IT Z 010A JZ 0 RETURN TO WARM BOOT IF Z 010D CPI D IS IT CR 010F JNZ 12A IF NOT, GO AROUND 0112 MVI E,A PUT LF IN E 0114 MVI C,2 TELL CPM TO MOVE LF TO KEYBOAR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,:A !@ +/Hҁ!? 6:eA{*8"gAÀ!eA6:A !@ !eA!fA/:I +:I -HH:I +½!@ 6!A 6!? 6#6#6!eA6!fA6!> 6͉N"K >͉ͦ!A 6+64&@ ~  o)͉*4&@ ~24*4M 24*4M! ^#Ve4͉ "͉ #͉ $͉ 3͉ v%͉ [3͉ S ͉ j&͉ @'͉ (͉ ,͉a ³ V0͉ < E N W ` i r { !4q!46> !4 *4& :4~ !4H TED VERS 1.1 $1 ͉3evCLOSE OLDFILE ERROR $CLOSE NEWFILE ERROR $CLOSE NEWFILE ERROR $CLOSE REVFILE ERROR $MISSING OPERAND $NO SUCH LINE $INVALID COMMAND $INVALID NUMBER $INVALID NUMBER $APPEND: $INSERT: $ $INVALID COMMAND $WR  88 ~=26!66*88 ~=!6;ͻ!6:6O!5 Hq!64!66#6!66*88 ~==2 6:6~:6H7*6&5 DM* 6$ 26:64!66:6!6*6&5 *6& 6 w!64+4#~~:626!64:6~4!66:A!6 *6&A *6& 6 w!64~~:A͹ :iAHҶ :4l:4LHD *\A&@ ~ > >>ö !\A4N!@ ~ X >*4MA͹ ҳ *\A&@ ~ x >*\A&@ ~g~GH*\A&@ ~ HҰ ! B6>>>>!4r+s+q!46*\A&@ :4~ H *\A&@ *4&*4w!44!A26!64*88 ~==:iA!6OZ{2 6q: B4!66U:6k!66*88 ~=!6h*6&5 N!64D>:6~Ҿ:626*88 ~!6ھ*6&5 *6& 6 w!64~~ڷ*88 ~26!64y!66:6=!6*6& 6 N!64  :6<<*88 w,>N\A4 :4=*4w*\A&@ :4! >>!4s+p+q:iA24=24!4:4 :424:424*4&*4*4&iA { !45~t :4!45L *4&*4N! B ~24!4:4#~H~HҶ :4<24þ :4!4w6 >:\A=O!@ N  d  ͉*8*8ͩ"~5*8#"z5"x5O DIRECTORY SPACE$MEMORY OVERFLOWNEW FILE $ 0 $EDIT: $INDEX TABLE FULL $ $!"8:]A2688ͺ+N#F*8 ~26Hү!64*8#"8:6 ¬*8#"88 :6w!66a:6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!7ڨ*7&6 N!74‰:@.:@ H!bA64͉$*8#"88<͉!cA6$*88 :@w!76  LAST LINE DELETED BECOMES THE CURRENT LINE. IF THE LINES DELETED WERE AT THE END, THE NEW LAST LINE BECOMES THE CURRENT LINE. n1 AND n2 ARE SIGNED OR UNSIGNED INTEGER NUMBERS. $INSERT COMMAND FORMAT: I . THIS COMMAND INSERTS THE GIVEN TEPRINT LINES COMMAND FORMAT [n1][,n2] + - : n1 AND n2 ARE THE INTEGER NUMBERS WHICH SPECIFY THE RANGE OF LINES TO BE DISPLAYED. + OR - PRECEDING THE NUMBEXT BEFORE THE CURRENT LINE. THIS COMMAND DIFFERS FROM THE APPEND COMMAND ONLY IN THE PLACEMENT OF THE INPUT TEXT. $LOCATE COMMAND FORMAT: L/PATTERN/ THIS COMMAND LOCATES THE FIRST LINE WHICH HAS THE OCCURANCE OF THE SPECIFIED PATTERN. SEARCH STARTR, SPECIFIES A LINE NUMBER RELATIVE TO THE CURRENT LINE. + OR - ALONE MEANS +1 OR -1 FROM THE CURRENT LINE. IF NUMBER NOT SPECIFIED THE CURRENT LINE IS ASSUMED. COLON (:) DISPLAYS 16 LINES STARTING FROM THE CURRENT LINE. THE LAST LINE DISPLAYED BECOMS FROM THE CURRENT LINE. SLASH (/) OR ANY DISPLAYABLE CHARACTER MAY BE USED AS THE PATTERN DELIMETER. $QUIT COMMAND FORMAT: Q THE FIRST QUIT COMMAND RESPONDS WITH -WRITE??????- AS A REMINDER TO SAVE EDITED TEXT IF DESIRED. THE SECOND REQUEST TO QES THE CURRENT LINE. 3,8 DISPLAYS LINE 3 THROUGHOUT 8 + 9 DISPLAY LINE 9 AFTER THE CURRENT LINE : DISPLAYS 16 LINES START FROM THE CURRENT LINE $APPEND COMMAND FORMAT A . THE APPEND COMMAND READS IUIT TERMINATES THE EDIT SESSION AND RETURNS CONTROL TO CP/M. $SUBSTITUTE COMMAND FORMAT: [n1][,n2]S/PATTERN/REPL/[G] THE SUBSTITUTE COMMAND SEARCHES EACH LINE FOR THE OCCURANCE OF THE SPECIFIED PATTERN. IF FOUND, THE LINE IS DISPLAYED WITH THE RENPUT TEXT AND APPENDS IT AFTER THE CURRENT LINE. THE INPUT TEXT IS ENDED BY TYPING A PERIOD ALONE AT THE BEGINNING OF THE LINE. $DELETE COMMAND FORMAT: [n1][,n2]D THE DELETE COMMAND DELETES THE ADDRESSED LINES FROM THE BUFFER. THE LINE AFTER THE PLACEMENT SPECIFIED. GLOBAL REPLACEMENT INDICATOR (G) MEANS CHANGE ALL OF THE OCCURANCES OF THE PATTERN. ANY DISPLAYABLE CHARACTER MAY BE USED AS A DELIMETER INSTEAD OF SLASH. n1 and n2 ARE SIGNED OR UNSIGNED INTEGER NUMBERS $WRITE COMMAND FORMAT: W!Bp+q*BK!Bp+q*BK2B!Bq*B&K!Bp+q*BKn*_ogDM!>))덑o|g| =jDM!>))ґ =‰^#V|g}o š_{ozgO{ozgi`N#Fogo&og_{_z#W  N = 1 LINE SPACING 5 .BP N YES N = +1 BEGIN PAGE 6 .SP N YES N = 1 SPACE N LINES 7 .IN N NO N = 0 INDENT N SPACES 8 .RM N NO N = 72 RIGHT MARMAT 1 APPEND A 2 DELETE [n1][,n2]D 3 INSERT I 4 COPY n1,n2K 5 LOCATE L/PATTERN/ 6 MOVE n1,n2M 7 QUIT Q 8 SUBSTITUTE GIN 9 .TI N YES N = 1 TEMPORARY INDENT 10 .CE N YES N = 1 CENTER 11 .UL N NO N = 1 UNDERLINE 12 .HE |L|M|R| NO EMPTY HEADER TITLE 13 .PN N NO [n1][,n2]S/PATTERN/REPL/[G] 9 WRITE FILE W 10 PRINT LINES [n1][,n2] + - : DETAILED INFO ON EACH COMMAND CAN BE SEEN BY TYPING A QUESTION MARK -?- FOLLOW N = +1 NEXT PAGE NUMBER ENTER CARRIAGE RETURN FOR NEXT INFORMATION. $ 14 .FO |L|M|R| NO EMPTY FOOTER TITLE 15 .PL N NO N = 66 PAGE LENGTH 16 .AD NO - RIGHT ADJED BY THE COMMAND ABBREVIATION. -?T- SUMMARIZES THE TEXT PROCESSOR COMMANDS. COMMANDS MAY MAY BE SPECIFIED IN UPPER OR LOWER CASE. n1, n2 REPRESENT SIGNED OR UNSIGNED INTEGERS. $TEXT PROCESSOR COMMAND SUMMARY # COMMAND CAUSE DEFAUUST 17 .NO NO - NO RIGHT ADJUST 18 .NE N YES N = 2 NEED LINES 19 .PP YES - NEW PARAGRAPH 20 .FN N NO N = 1 FOOTNOTE 21 .TA N1 N2... YELT NOTE & ARGUMENT BREAK? VALUE 1 .FI YES - FILL MODE 2 .NF YES - NO FILL MODE 3 .BR YES - BREAK 4 .LS N NO S N = 4 4 ... TABULATION 22 .DL CHAR NO CHAR = ; TAB SYMBOL/DELIMETER 23 .TM N NO N = 4 TOP MARGIN INCLUDING HEADER 24 .TS N NO N = 2 TOP SPACE 25 .BM N NO  THE WRITE COMMAND CAUSES THE EDITOR TO WRITE THE EDITED FILE AND THEN EXIT. NO BACKUP FILE IS CREATED. $INTRODUCTION ED IS DESIGNED TO CREATE OR UPDATE A TEXT FILE. THE FOLLOWING LIST OF EDITOR COMMANDS ARE AVAILABLE. # COMMAND FOR   NEW $$$REV $$$D FORMAT: n1,n2K THIS COMMAND COPIES LINE n1 TO LINE n2. THIS LINE BECOMES THE CURRENT LINE. $UNRECOGNIZED REQUEST VALID REQUEST ARE: ?A, ?D, ?I, ?K, ?L, ?M, ?P, ?Q, ?S, ?W, ?T (FOR TEXT PROCESSOR COMMAND LIST), ? $ 0 $ N = 4 BOTTOM MARGIN 26 .BS N NO N = 2 BOTTOM SPACE $MOVE COMMAND FORMAT: n1,n2M THIS COMMAND MOVES LINE n1 TO LINE n2. BOTH ARGUMENT NUMBERS ARE SIGNED OR UNSIGNED INTEGER. n2 BECOMES CURRENT LINE. $COPY COMMAN  \  . . . . . . . . . . . . . . . . . . . .11 QUIT . . . . . . . . . . . . . . . . . . . . . . .12 SUBSTITUTE . . . . . . . . . . . . . . . . . . . .13 WRITE FILE . . . . . . . . . . . . . . . . . . . .15 ERROR MESSAGE'S. . . . . . . . . . . . . . . . . .16 ACKNOWLEDGEMENTS . . . . . . . . . . . . . . . . .18 1  TED USER'S MANUAL CP/M VERSION 1.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . 2 INFORMATION REQUEST. . . TED USER'S MANUAL INTRODUCTION TED is a simple, easy-to-use, and yet powerful text  . . . . . . . . . . . . . 4 APPEND . . . . . . . . . . . . . . . . . . . . . . 5 DELETE LINES . . . . . . . . . . . . . . . . . . . 6 INSERT . . . . . . . . . . . . . . . . . . . . . . 7  editor designed for use with any standard CP/M system with 24K bytes or more of memory. To use TED type: TED or  COPY LINE. . . . . . . . . . . . . . . . . . . . . 8 LOCATE LINE. . . . . . . . . . . . . . . . . . . . 9 MOVE LINE. . . . . . . . . . . . . . . . . . . . .10 PRINT LINE  TED . where specifies a standard CP/M file to be edited or created. An omitted file name is considered to be a filename of all blanks.    TED USER'S MANUAL All the edit commands, including the information request, will be briefly exferenced by absolute or relative line numbers. Additionally, pattern search may be used to locate a line and for global substition within a specified range of lines. The size of the file to be editeplained in the following paragraphs. Arguments depicted by n1 and n2 are signed integer numbers. n1 or n2 meaning 25 line number 25 d is not limited to internal buffer size. TED creates temporary disk files to extend the available buffer space. Version 1.1 limits files to 2048 lines of up to 128 characters per line (slightly -10 line number ten prior to the current line. +5 line number five relative to the current line.  larger than the capacity of a standard 8-inch diskette). Although TED is a general purpose editor, it has a companion program called PRO. PRO is a powerful test proc 3 TED USER'S MANUAL INFORMATION REQUEST Format: essor for formatting textual information. This document was developed using both TED and PRO. PRO commands may be referenced via the self-helping feature of TED. 2 ?[char] Operand: char...........Char is one of TED's command characters. Description: The information request command provides instructions on  TED is "self-helping" and may be used productively without further reference to this documentation! TED is line-oriented, meaning that lines of text within the file may be re   4 TED USER'S MANUAL APPEND Format:  The following is a list of information command options. ? general information ?a append info ?d delete lines info ?i  a . Description: The APPEND command is used to change the edit mode to the input mode. This command consists of an ASCII character 'a'  insert info ?k copy line info ?l locate line info ?m move line info ?p print lines info ?q  followed immediately by a carriage return. TED will give a response: 'APPEND:' and a carriage return. Then TED is ready to accept input text. New lines are appended after the currentquit info ?s substitute substring info ?t text processor commands list info ?w write file info A question mark '?' should appear in the first col line. When a line containing only a period is typed the user is returned to the EDIT mode. TED will give a prompt with 'EDIT:' followed by a carriage return, and edit level indicator '====>'. umn of the line. Blank characters or tab characters separating the question mark and the command character are ignored. Only the first displayable character of a command is checked.  Example: ====>a APPEND: This text is appended to the current line. The input mode will be ended by a line that contains a period the use of TED commands. The information command '?' followed by a carriage return, prints an introduction to TED, and instructions for obtaining more detailed information.   deletes line number three. 3,6d deletes lines number three through six. ,+5d deletes the current line through next five lines. d  TED USER'S MANUAL DELETE LINES Format: [n1][,n2]d Operands: n1............Beginning line  deletes the current line. 6 TED USER'S MANUAL number to be deleted. If not specified, the current line is assumed. If preceded by a plus or minus sign, n1 is added to, or subtracted from, t INSERT Format: i . Description: The INSERT command is used to insert an additional line or lines before thehe current line. n2............Ending line number to be deleted. If not specified, only one line is deleted. Description:  current line. The input text is ended by typing a period alone at the beginning of a line, followed by a carriage return. This command differs from the APPEND command only in the placement of the The delete command is used to delete a line or group of lines in the buffer. The line following the last line deleted becomes the current line. Example: 3d input text. Example: ====>i INSERT: This text is inserted prior to the current line. . EDIT:  only, like the line below . EDIT: ====> 5    ====>3,8k 8 (the copied line is displayed here). ====> 8  COPY LINE Format: n1,n2 k Operands: n1............The line number to be copied. If preceded by a plus or minus sign, n1 is added  TED USER'S MANUAL LOCATE LINE Format: l/pattern/ Operands: /.............A delimiter of the pattern s to, or subtracted from, the current line. n2............The destination to where the line must be copied. If preceded by a plus or minus sign, pecified. Any displayable character may be used instead of a slash. pattern.......The string pattern to be searched for. Description:  n2 is added to, or subtracted from, the current line. Description: The COPY command is used to copy the line specified, to the line destinat The LOCATE command is used to locate the first line, starting with the line following the current line, which has the occurance of the pattern specified. If the last line is reached aion. This new line becomes the current line. If the destination line is greater than the last line number, this line will be appended to the last line in the file. Example:nd no pattern is matched, TED will prompt with a message - 'CANNOT FIND:' followed by the pattern specified. If locate is successful, the line will be displayed, and becomes the current line.  ====> 7 TED USER'S MANUAL    ====>11,20m 20 (the moved line is displayed here). ====> 10  TED USER'S MANUAL MOVE LINE Format: n1,n2 m Operands: n1............The  TED USER'S MANUAL PRINT LINES Format: [n1] [,n2]|+|-|: Operands: n1............The beginning line to be displayedline to be moved. If preceded by a plus or minus sign, n1 is added to, or subtracted from, the current line. n2............The new location of the moved line. . n2............The last line to be displayed. +.............The line after the current line. -.............The line prior to the current line. :.............Displays 16 lines  If preceded by a plus or minus sign, n2 is added to, or subtracted from, the current line. Description: starting from the current line. Description: The print lines command requests TED to type out a group of one or more lines. A carriage return without  The MOVE command is used to move a line from one location to another. The new location of the line becomes the current line. This line is removed from the old location. Example: any character preceding it, prints the current line. Example: ====>1,5 prints line one through line five. ====>,+9 prints 10 lines starting from the current Example: ====>l;ofrmat; 23 Each command has its own ofrmat. ====> 9   n2] s/pattern/repl/[g] Operands: /.............delimiter, any displayable character may be used instead of a slash character. n1............the beginning line  TED USER'S MANUAL QUIT Format: q Description: The quit command is used to exit the edit session withoof substitution. If not specified the current line is assumed. n2............the ending line of substitution. n2 should be greater than n1 patteut altering the source file. All current editting is lost. As a precaution, TED will prompt with the message "WRITE?????" whenever the first entry of the quit command is requested. A rn.......the pattern to be replaced. repl..........the replacement string. The null string is included. g.............global replacement indicator. Descriptio subsequent quit command ends the edit session. Example: ====>q WRITE???? ====>q A> n: The substitute command is used to search for an occurance of the specified pattern, and replace it with the replacement string. If the replacement is made, the line is  12 TED USER'S MANUAL SUBSTITUTE Format: [n1] [, displayed. If no occurance is found, TED gives a message: "CANNOT FIND: 'pattern'." If the global replacement indicator is used, all occurances of the pattern in each line are replac line. ====>25 prints line number 25. 11    TED USER'S MANUAL ERROR MESSAGES DESCRIPTION: TED's error messages are self-explanatory, for example: if  TED USER'S MANUAL Example: ====>16,40s;change;replace;g  you attempt to write to a disk which already has 256 records on it TED will respond with the message 'DISK FULL'. If your directory is full TED will respond with the message 'DIRECTORY S 14 TED USER'S MANUAL WRITE FILE Format: w PACE FULL'. These types of errors are considered fatal, and in the case of fatal errors TED will print the error message and return to CP/M. If this occurs you may find you have two working files Description: The write file command writes the updated disk file and deletes temporary files. No backup file is created. After the file is written, control is returned to the operating  on your disk, NEW.$$$ and REV.$$$. Since these files take up disk space during the edit session you may run out of disk space much sooner then you might have imagined! It is recommended that y system. Example: ====>w A> 15 ou have at least 2.5 times as much space on the disk as the size of the file you are intending to edit. If you have made several changes to your file and you get a 'DISK FULL' error you may ed. Line length is truncated to 128 if the resulting replacement makes the line length overflow. 13   ING OPERAND NO SUCH LINE(ON DELETE COMMANDS) INVALID COMMAND INVALID NUMBER(ANY NUMBER >2048 OR EQUAL TO 0) INVALID LOCATE INVALID SUBSTITUTEt with the original file using the PIP command. The following errors are fatal errors:- FILE EXTENSION ERROR DISK FULL DIRECTORY SPACE FULL  17 TED USER'S MANUAL DISK ERROR CLOSE NEWFILE ERROR CLOSE REVFILE ERROR CLOSE OLDFILE ERROR 16  ACKNOWLEDGEMENTS TED is a modified version of ED an editor designed and implemented by LTCOL Triyono at the Naval Postgraduate School as part of his thesis res TED USER'S MANUAL MEMORY OVERFLOW(CP/M SYSTEM IS TOO SMALL FOR TED) In addition to the fatal errors there are various errors in command format. Theseearch. ED was designed to run on the ISIS-II operating system and was part of a TEXT processing system entered in the Intel Insite library contest which eventually won the grand prize.  are not considered fatal errors and TED will wait for further input after printing an appropriate error message. The non-fatal errors include the following:- MISS Many of the data structures used in ED and TED were originally designed by professor Gary Kildall. LCDR Frank Burkhead served as LTCOL Triyono's thesis advisor and contri be able to recover some of the changes you have made by inspecting the first part of your NEW.$$$ file. It may or may not contain the latest changes made. If it does, you may combine i  ther information on TED may be obtained from:- LT Mark Moranville(code 52mi) Naval Postgraduate School Monterey, Calif 93940 ph 408-646-2253  LCDR Frank Burkhead(code 52bg) Naval Postgraduate School Monterey, Calif 93940 ph 408-646-2449 18  Calif 93940 ph 408-646-2449 18 ;********************************; ; ; INTEL ASSEMBLER ; CROSS REFERENCE PROGRAM ; ; VERSION 1.0 ; ; JEFF KRAVITZ ; ;********************************; ;********************************; ; ; MAIN LOOP ; ;********************************; ORG 100H ;ORIGIN ADDRESS XREF: LXI SP,STACK ;SET STACK POINTER CALL SETUP ;INITIALIZE MAIN: CALL GETBT ;GET A BYTE FROM SOURCE FILE CALL SAVBT ;SAVE BYTE IN PRINT BUFFER MAIN2: CALL CKNUM ;TEST FOR NUbuted his guidance and experience during the development of the original system. Alterations to ED to allow TED to run on CP/M were made by LT Mark Moranville and LCDR Frank Burkhead. Fur  T ROUTINE ; ;********************************; PREFS: LHLD REF ;GET REF BLOCK ADDR INX H INX H ;BUMP TO FIRST REF NUMBER SHLD TEMP ;SAVE REF NUM ADDR MVI A,(REFSZ-2)/2 ;NUMBER OF REF SLOTS STA SYMCT ;SAVE IN SYMCT PREF: LHLD TEMP ;GET RE****************************; ; ; FINAL SYMBOL TABLE PRINT ; ;********************************; DONE: CALL PAGE ;ISSUE PAGE EJECT LHLD SYMBT ;GET SYMBOL TABLE BOTTOM SHLD SYM ;SET SYMBOL POINTER LHLD SYMTP ;GET SYMBOL TABLE TOP MVI M,F SLOT ADDR MOV E,M INX H MOV D,M ;GET REF LXI H,0000 ;ZERO? CALL CPHL JZ PREFX ;YES, DONE XCHG ;GET NUM IN HL CALL DECOT ;CONVERT LXI H,DEC ;POINT TO DEC STRING MVI M,' ' ;BLANK LEADING ZERO MVI B,5 PREF2: MOV E,M CALL PBYT0FFH ;END OFF SYMBOL TABLE DLP1: LHLD SYM ;GET SYMBOL TABLE POINTER CALL PSYM ;PRINT SYMBOL LHLD SYM LXI D,6 ;OFFSET TO REF LINK DAD D MOV E,M INX H MOV D,M ;GET REF BLOCK ADDR XCHG ;INTO HL SHLD REF CALL PREFS ;PRINT REFERENCE ;PRINT BYTE INX H DCR B JNZ PREF2 ;PRINT REFERENCE NUMBER LHLD TEMP ;GET REF SLOT ADDR INX H INX H ;BUMP TO NEXT SLOT SHLD TEMP LDA SYMCT ;GET COUNT DCR A ;DECREMENT STA SYMCT JNZ PREF LHLD REF ;GET REF BLOCK ADDRESS MOV ES LHLD SYM ;GET SYMBOL TABLE POINTER LXI D,SSIZ ;SIZE OF SYM TABLE ENTRY DAD D SHLD SYM MOV A,M ;GET BYTE CPI 0FFH ;END OF TABLE? JZ BOOT JMP DLP1 ;LOOP ;********************************; ; ; SYMBOL PRINT ROUTINE ; ;********,M INX H MOV D,M ;GET LINK TO NEXT BLOCK LXI H,0000 CALL CPHL ;ANY MORE BLOCKS? JZ PREFX ;NO, EXIT XCHG ;YES, SET NEXT BLOCK POINTER IN REF SHLD REF CALL CRLF ;PRINT CR,LF MVI B,07 PREF3: MVI E,' ' CALL PBYT ;PRINT SPACES DCR ************************; PSYM: MVI B,5 ;SYMBOL SIZE PSYM2: MOV E,M ;GET BYTE CALL PBYT ;PRINT BYTE INX H DCR B JNZ PSYM2 MVI E,' ' CALL PBYT ;PRINT 2 SPACES CALL PBYT RET ;********************************; ; ; REFERENCE PRINB JNZ PREF3 ;PRINT 6 SPACES JMP PREFS PREFX: CALL CRLF ;PRINT CR,LF RET ;********************************; ; ; CHARACTER PARSING ROUTINES ; ;********************************; LALPH: LXI H,SBUF ;POINT TO SYMBOL BUFFER MVI C,05 MVI A,MERIC JNC LNUM ;YES, FOUND A NUMBER, PROCESS CALL CKALP ;TEST FOR ALPHABETIC JNC LALPH ;YES, PROCESS LXI H,CTAB1 ;POINT TO CHARACTER TABLE CALL LOOK ;LOOK UP CHAR IN CHAR TABLE JC LIGN ;NOT FOUND, IGNORE PCHL ;EXECUTE ROUTINE ;****  ES JZ LQUOT ;YES, START SCAN AGAIN JMP MAIN2 ;NO, CONTINUE IN MAIN SCAN LSEMI: CALL GETBT ;GET A BYTE CALL SAVBT ;SAVE BYTE CPI 0DH ;WAIT FOR CR JNZ LSEMI ;CONTINUE JMP MAIN2 ;ENTER MAIN LOOP LCR: CALL PLINE ;PRINT LINE LHLD LCNFILE CALL SAVBT ;SAVE BYTE IN PRINT BUFFER CALL CKNUM ;TEST FOR NUMBER JNC LAL3 ;YES, CONTINUE CALL CKALP ;TEST FOR ALPHABETIC JNC LAL3 ;YES, CONTINUE CALL CRES ;TEST FOR RESERVED WORD JC LAL1 ;NO, CONTINUE LAL0: LDA CHAR ;GET CHARACT ;GET LINE NUMBER INX H ;BUMP LINE NUMBER SHLD LCNT ;STORE JMP MAIN ;CONTINUE LIGN: JMP MAIN ;RE-ENTER MAIN LOOP LLF EQU LIGN LSPC EQU LIGN LTAB EQU LIGN LDOL EQU LIGN LDEL EQU LIGN ;********************************; ; ; TER THAT ENDED ID JMP MAIN2 ;CONTINUE SCAN LAL1: CALL FIND ;SEE IF DEFINED JC LAL2 ;NO, CONTINUE CALL ADDRF ;YES, ADD REFERENCE JMP LAL0 ;DONE LAL2: CALL ENSYM ;ENTER SYMBOL DEFINITION CALL ADDRF ;ADD REFERENCE JMP LAL0 ;CONTINUE LAL SUBROUTINES ; ;********************************; ;********************************; ; ; INITIALIZATION ; ;********************************; SETUP: LXI D,TFCB ;POINT TO FCB CALL FOPEN ;OPEN FCB LXI H,PBUF SHLD LPNT ;SET PRINT POI3: CALL GTSYM ;COLLECT IDENTIFIER JMP LALC ;CONTINUE LNUM: CALL GETBT ;GET BYTE CALL SAVBT ;SAVE BYTE IN PRINTER BUFFER CALL CKNUM ;TEST FOR NUMERIC JNC LNUM ;YES, CONTINUE CALL CKALP ;TEST FOR ALPHABETIC JNC LNUM ;YES, CONTINUE JMNTER LXI H,00001 SHLD LCNT LXI H,SYMT ;GET ADDRESS OF SYMBOL TABLE SHLD SYM SHLD SYMBT SHLD SYMTP ;SET SYMBOL TABLE POINTERS LHLD MEMSZ ;GET AVAILABLE MEMORY ADDRESS DCX H SHLD REF SHLD REFBT SHLD REFTP ;SET REFERENCE TABLE POINTEP MAIN2 ;CONTINUE WITH MAIN SCAN LQUOT: CALL GETBT ;GET A BYTE CALL SAVBT ;SAVE BYTE IN PRINTER BUFFER CPI '''' ;SEE IF STRING QUOTE JNZ LQUOT ;NO, KEEP LOOPING CALL GETBT ;GET NEXT BYTE CALL SAVBT ;SAVE BYTE CPI '''' ;TEST FOR DOUBLRS CALL PAGE ;ISSUE PAGE EJECT RET ;********************************; ; ; CHECK FOR RESERVED WORD ; ;********************************; CRES: LXI H,RTAB ;POINT TO RESERVED WORD TABLE SHLD TEMP ;SAVE IN TEMP WORD CRES1: LHLD TEMP ;GET T' ' LALX: MOV M,A INX H DCR C JNZ LALX ;CLEAR SYMBOL BUFFER LXI H,SBUF SHLD SYMPT MVI A,00 STA SYMCT ;RESET SYMBOL POINTER+COUNT LDA CHAR ;GET CHARACTER AGAIN CALL GTSYM ;COLLECT IDENTIFIER LALC: CALL GETBT ;GET A BYTE FROM SOURCE   OF SYMBOL TABLE CALL CPHL ;TEST FOR END OF TABLE JZ FIND4 ;YES, DONE JC FERR ;TABLE OVERFLOW, ERROR XCHG ;CURRENT POINTER INTO HL SHLD SYM ;SET CURRENT POINTER JMP FIND1 ;LOOP FIND4: STC ;SET CARRY FOR NOT FOUND LHLD SYMTP ;GET CURREMENT BYTE COUNT JNZ CRES2 ;KEEP TESTING JMP CRES4 ;FOUND CRES3: LHLD TEMP ;GET TABLE POINTER LXI D,RSIZ ;SIZE OF ENTRY DAD D ;BUMP POINTER SHLD TEMP ;STORE NEW POINTER MOV A,M ;GET TABLE BYTE CPI 0FFH ;END OF TABLE? JNZ CRES1 ;NOENT TOP SHLD SYM ;SET CURRENT POINTER RET FERR: LXI D,EMSG1 ;POINTER TO ERROR MESSAGE MVI C,09 ;WRITE CONSOLE CALL CPM ;ISSUE ERROR MESSAGE JMP BOOT ;EXIT ;********************************; ; ; ADD REFERENCE TO REF TABLE ; ;*******, LOOP STC ;SET CARRY (NOT IN TABLE) RET CRES4: ORA A ;RESET CARRY RET ;********************************; ; ; FIND SYMBOL IN TABLE ; ;********************************; FIND: LHLD SYMBT ;GET BEGIN OF SYM TABLE SHLD SYM ;SET TEMP PO*************************; ADDRF: LHLD SYM ;GET SYMBOL POINTER LXI D,6 ;OFFSET PAST SYMBOL&FLAGS DAD D MOV E,M INX H MOV D,M ;GET REFERENCE POINTER LXI H,0000 CALL CPHL ;TEST FOR ZERO REF PTR JZ BLDRF ;YES, BUILD REFERENCE ENTRY LINKINTER FIND1: LHLD SYM ;GET TEMP POINTER LXI D,SBUF ;POINT TO CURRENT SYMBOL MVI B,5 ;SYMBOL SIZE FIND2: LDAX D ;GET BYTE FROM SBUF CMP M ;COMPARE TO SYM TABLE BYTE RC ;GREATER, NOT IN TABLE JNZ FIND3 ;LESS, GET NEXT TABLE ENTRY INX D : XCHG ;REF PTR IN HL MOV E,M ;GET REF LINK INX H MOV D,M ;INTO DE DCX H ;REPOSITION HL PUSH H ;SAVE REF PTR LXI H,0000 CALL CPHL ;IF LINK IS ZERO POP H JNZ LINK ;NON ZERO, GET NEXT LINK SHLD REF ;SAVE REF POINTER INX H INX ;BUMP POINTER INX H ;BUMP POINTER DCR B ;DECREMENT BYTE COUNT JNZ FIND2 ;LOOP RET ;TRUE ZERO, FOUND FIND3: LHLD SYM ;GET CURRENT POINTER LXI D,SSIZ ;SYMBOL TABLE ENTRY SIZE DAD D ;BUMP POINTER XCHG ;INTO DE LHLD SYMTP ;GET TOP  H ;SKIP TO FIRST REF NUMBER MVI B,(REFSZ-2)/2 ;NUMBER OF REF NUMBERS/ENTRY LINK3: MOV E,M ;GET REF NUMBER INX H MOV D,M DCX H ;REPOSITION PUSH H ;SAVE REF NUM ADDR LXI H,0000 CALL CPHL ;SEE IF REF NUM IS ZERO POP H JZ ENREF ;YES, ABLE POINTER LXI D,SBUF ;POINT TO SYMBOL MVI B,5 ;SYMBOL SIZE CRES2: LDAX D ;GET SYMBOL BYTE CMP M ;COMPARE AGAINST TABLE ENTRY RC ;LESS, NOT IN TABLE JNZ CRES3 ;GREATER, GET NEXT TABLE ENTRY INX D ;BUMP POINTERS INX H DCR B ;DECR  00 ADB2: MOV M,A ;ZERO THE REF BLOCK INX H DCR B JNZ ADB2 LHLD TEMP ;GET NEW REF BOTTOM SHLD REFBT ;SET REFBT RET ;********************************; ; ; ENTER SYMBOL IN SYM TABLE ; ;********************************; ENSYM: LHLD  LHLD LCNT ;GET LINE NUMBER XCHG ;INTO DE POP H ;GET REF SLOT ADDR MOV M,E INX H MOV M,D ;STORE LINE REF RET ;DONE ;********************************; ; ; BUILD REF TABLE BLOCK ; ;********************************; BLDRF: LHLD SYM ;GET SYMBOL POINTER XCHG ;INTO DE LHLD SYMTP ;GET SYMBOL TABLE TOP CALL CPHL ;CHECK FOR END OF TABLE JZ NWSYM ;YES, ADD SYMBOL AT END LXI D,SSIZ ;SYMBOL TABLE ENTRY SIZE DAD D ;CALCULATE NEW END OF TABLE XCHG ;INTO DE LHLD REFSYM ;GET SYMBOL POINTER LXI D,6 ;OFFSET TO REF POINTER DAD D SHLD REF ;SET TEMP REF POINTER TO HERE CALL ADBLK ;ADD BLOCK LHLD REF ;GET REAL REF POINTER INX H INX H ;POSITION TO FIRST REF SLOT JMP ENREF ;ADD REFERENCE ADBLK: LHLD REBT ;REFERENCE TABLE BOTTOM CALL CPHL ;TEST FOR TABLE OVERFLOW JZ FERR ;FULL, ERROR JC FERR ;YES, ERROR LHLD SYMTP ;GET TABLE TOP LXI D,SSIZ-1 ;BUMP TO END OF ENTRY DAD D SHLD TO ;STORE IN TO ADDRESS LXI D,SSIZ MOV A,L SUB E MOV FBT ;GET REF BOTTOM LXI D,REFSZ ;SUBTRACT REF SIZE MOV A,L SUB E MOV L,A MOV A,H SBB D MOV H,A SHLD TEMP ;SAVE NEW REF BOTTOM XCHG ;INTO DE ALSO LHLD SYMTP ;GET SYMBOL TOP CALL CPHL ;CHECK FOR BUMP JZ FERR ;YES, NO ROOM JNL,A MOV A,H SBB D MOV H,A ;SUBTRACT SIZE OF ONE ENTRY SHLD FROM ;STORE AS FROM ADDRESS LHLD SYM ;GET CURRENT POINTER SHLD LIMIT ;STORE AS LIMIT ADDRESS CALL MVUP ;MOVE TABLE UP IN MEMORY NWSYM: LHLD SYM ;GET CURRENT POINTER LXI D,SBUC FERR ;NO ROOM LHLD TEMP ;GET REF BOTTOM XCHG ;INTO DE LHLD REF ;GET REF POINTER MOV M,E ;SET LINK INX H MOV M,D ;TO NEW REF BLOCK LHLD TEMP ;GET NEW REF BLOCK ADDR SHLD REF ;STORE IN REF MVI B,REFSZ ;SIZE OF REF BLOCK MVI A,F ;POINT TO SYMBOL MVI B,5 ;SIZE OF SYMBOL CALL MOVE ;COPY SYMBOL TO TABLE MVI A,0 MOV M,A INX H MOV M,A INX H MOV M,A ;SET POINTERS TO 0000 LHLD SYMTP ;GET SYMBOL TABLE TOP LXI D,SSIZ ;GET SYMBOL ENTRY SIZE DAD D ;BUMP SHLD ENTER REFERENCE INX H INX H ;SKIP TO NEXT REF NUM DCR B ;DECREMENT COUNT JNZ LINK3 ;TRY AGAIN AT NEXT SLOT CALL ADBLK ;ADD NEW REF BLOCK LHLD REF ;GET REF POINTER INX H INX H ;SKIP TO FIRST REF SLOT ENREF: PUSH H ;SAVE REF SLOT ADDR  I 'A' RC ;NO, EXIT CPI 'Z'+1 CMC RET ;********************************; ; ; TEST FOR NUMERIC CHAR ; ;********************************; CKNUM: CPI '0' RC CPI '9'+1 CMC RET ;********************************; ; ; LOOK UP T ;GET LIMIT ADDRESS MVUP2: LDAX D ;GET FROM BYTE STAX B ;STORE AT TO ADDRESS CALL CPHL ;COMPARE FROM TO LIMIT RZ ;EXIT IF DONE DCX B ;DECREMENT TO DCX D ;DECRMENT FROM JMP MVUP2 ;LOOP ;********************************; ; ; GENECHAR IN PARSE TABLE ; ;********************************; LOOK: LXI D,0003 ;TABLE ENTRY SIZE MOV B,A ;ARGUMENT BYTE IN B LOOK2: MOV A,M ;GET TABLE BYTE CPI 0FFH ;END OF TABLE? JZ LOOKN ;YES, NOT FOUND CMP B ;COMPARE JZ LOOKY ;FOUND DARAL PURPOSE MOVE ROUTINE ; ;********************************; MOVE: LDAX D ;GET BYTE MOV M,A ;STORE BYTE INX D INX H ;BUMP POINTERS DCR B ;DECREMENT COUNT JNZ MOVE ;LOOP RET ;********************************; ; ; BINARY TO DECIMD D ;BUMP POINTER JMP LOOK2 ;LOOP LOOKN: STC ;CARRY = NOT FOUND RET LOOKY: INX H ;SKIP TO TABLE BYTE MOV E,M INX H MOV D,M ;TABLE ENTRY IN DE XCHG ;INTO HL RET ;********************************; ; ; SAVE BYTE IN LINE BUFFEAL CONVERSION ; ;********************************; DECOT: LXI D,DEC XCHG LXI B,10000 CALL DIG LXI B,1000 CALL DIG LXI B,100 CALL DIG LXI B,10 CALL DIG LXI B,1 CALL DIG RET DIG: MVI M,'0' DI0: MOV A,E SUB C MOV E,A MOV AR ; ;********************************; SAVBT: STA CHAR ;SAVE CHAR IN CHAR LHLD LPNT ;GET LINE POINTER MOV M,A ;SAVE BYTE INX H ;BUMP POINTER SHLD LPNT ;SAVE POINTER RET ;********************************; ; ; PRINT SOURCE LINE WITH N,D SBB B MOV D,A JM DI2 INR M JMP DI0 DI2: MOV A,E ADD C MOV E,A MOV A,D ADC B MOV D,A INX H RET ;********************************; ; ; TEST FOR ALPHABETIC CHAR. ; ;********************************; CKALP: CPI 'A' ;ASCIUMBER ; ;********************************; PLINE: LHLD LCNT ;GET LINE NUMBER CALL DECOT ;CONVERT TO DECIMAL LXI H,DEC ;POINT TO DEC STRING PL2: MOV E,M ;GET STRING BYTE MOV A,E CPI 0DH ;DONE? JZ PL3 ;YES CALL PBYT ;PRINT BYTE INX HSYMTP ;STORE EW TOP RET ;********************************; ; ; MOVE SYMBOL TABLE UP ; ;********************************; MVUP: LHLD TO ;GET TO POINTER MOV B,H MOV C,L ;INTO BC LHLD FROM ;GET FROM POINTER XCHG ;INTO DE LHLD LIMI!   ORA A ;IF ZERO, OK JNZ BOOT ;EXIT POP H POP D POP B RET ;*********************************; ; ; ISSUE PAGE EJECT ; ;*********************************; PAGE: MVI E,0CH CALL PBYT MVI E,00H MVI B,10 PAGE2: CALL PBYT ;PRINT 10;DONE? JZ PL5 CPI 0AH ;LF? JZ PL4A ;YES, IGNORE CPI 09H ;TAB? JNZ PL42 ;NO, CONTINUE PUSH H ;SAVE HL PL43: MVI E,' ' CALL PBYT ;PRINT SPACE LXI H,COL INR M MOV A,M ANI 07H ;MODULO 8 JNZ PL43 POP H JMP PL4A PL42: LDA COL NULLS DCR B JNZ PAGE2 MVI A,00 STA LINES ;SET LINE COUNT RET ;********************************; ; ; ISSUE CR, LF & TEST PAGE ; ;********************************; CRLF: MVI E,0DH CALL PBYT MVI E,0AH CALL PBYT MVI E,00 CALL INR A STA COL CALL PBYT ;PRINT BYTE PL4A: INX H JMP PL41 PL5: CALL CRLF ;PRINT CR,LF LXI H,PBUF SHLD LPNT ;RESET LINE POINTER RET ;********************************; ; ; COLLECT SYMBOL IN SYM BUF ; ;************************** PBYT CALL PBYT ;PRINT 2 NULLS LDA LINES INR A STA LINES ;INCREMENT LINE COUNT CPI 56 ;TEST LINE COUNT CZ PAGE ;IF 56 THEN NEW PAGE RET ;********************************; ; ; CHARACTER PARSING TABLE ; ;***************************; GTSYM: MOV B,A ;SAVE CHAR LDA SYMCT ;GET SYMBOL COUNT CPI 05 ;MAX? RNC ;YES, DONE INR A STA SYMCT LHLD SYMPT MOV M,B INX H ;BUMP SYMBOL POINTER SHLD SYMPT RET ;********************************; ; ; PRINTER INT***********; CTAB1: DB 0DH DW LCR DB 0AH DW LLF DB '''' DW LQUOT DB ';' DW LSEMI DB ' ' DW LSPC DB 09H DW LTAB DB '$' DW LDOL DB '(' DW LDEL DB ')' DW LDEL DB '+' DW LDEL DB '-' DW LDEL DB '*' DW LDEL DB '/'ERFACES ; ;********************************; ;********************************; ; ; PRINT A SINGLE BYTE ; ;********************************; PBYT: PUSH B PUSH D PUSH H MVI C,05 CALL CPM MVI C,11 ;CHECK CONSOLE STATUS CALL CPM  DW LDEL DB ',' DW LDEL DB ':' DW LDEL DB EOF DW DONE DB 0FFH DW 0000H EOF EQU 1AH ;EOF CODE ;********************************; ; ; RESERVED WORD TABLE ; ;********************************; RTAB: DB 'A ' DB 'ACI ' DB  ;BUMP POINTER JMP PL2 PL3: MVI E,':' CALL PBYT ;PRINT ':' MVI E,' ' CALL PBYT ;PRINT ' ' CALL PBYT ;PRINT SPACE LXI H,PBUF ;POINT TO PRINT BUFFER PL4: MVI A,00 STA COL ;SET COLUMN COUNT PL41: MOV E,M ;GET BYTE MOV A,E CPI 0DH "  ' DB 'TITLE' DB 'XCHG ' DB 'XOR ' DB 'XRA ' DB 'XRI ' DB 'XTHL ' DB 0FFH ;END OF RESERVED WORD TABLE RSIZ EQU 05 ;SIZE OF TABLE ENTRY ;********************************; ; ; MISCELLANEOUS DATA ; ;**************************** DB 'CZ ' DB 'D ' DB 'DAA ' DB 'DAD ' DB 'DB ' DB 'DCR ' DB 'DCX ' DB 'DI ' DB 'DS ' DB 'DW ' DB 'E ' DB 'EI ' DB 'END ' DB 'ENDIF' DB 'ENDM ' DB 'EQU ' DB 'H ' DB 'HLT ' DB 'IF ' DB 'IN ****; EMSG1: DB 'SYMBOL TABLE ERROR',0DH,0AH,'$' SSIZ EQU 8 ;SYMBOL TABLE ENTRY SIZE SYMBT: DS 2 ;SYMBOL TABLE BOTTOM ADDRESS SYMTP: DS 2 ;SYMBOL TABLE TOP ADDRESS REFBT: DS 2 ;REFERENCE TABLE BOTTOM ADDRESS REFTP: DS 2 ;REFERENCE TABLE TOP AD ' DB 'INR ' DB 'INX ' DB 'JC ' DB 'JM ' DB 'JMP ' DB 'JNC ' DB 'JNZ ' DB 'JP ' DB 'JPE ' DB 'JPO ' DB 'JZ ' DB 'L ' DB 'LDA ' DB 'LDAX ' DB 'LHLD ' DB 'LXI ' DB 'M ' DB 'MACRO' DB 'MOD ' DB 'DRESS SYM: DS 2 ;CURRENT SYMBOL TABLE ADDRESS REFSZ EQU 2+(8*2) ;NUMBER OF BYTES IN REF BLOCK REF: DS 2 ;CURRENT REFERENCE TABLE ADDRESS FROM: DS 2 ;MOVE POINTER TO: DS 2 ;TO POINTER LIMIT: DS 2 ;LIMIT POINTER COL: DS 1 CHAR: DS 1 LCNT: DS 2MOV ' DB 'MVI ' DB 'NOP ' DB 'NOT ' DB 'OR ' DB 'ORA ' DB 'ORG ' DB 'ORI ' DB 'OUT ' DB 'PCHL ' DB 'POP ' DB 'PSW ' DB 'PUSH ' DB 'RAL ' DB 'RAR ' DB 'RC ' DB 'RET ' DB 'RLC ' DB 'RM ' DB 'RNC '  ;LINE COUNTER LPNT: DS 2 DEC: DS 5 DB 0DH PBUF: DS 132 SYMCT: DS 1 SYMPT: DS 2 SBUF: DS 5 LINES: DB 0 ;PRINT LINE COUNT ;********************************; ; ; OPERATING SYSTEM EQUATES ; ;********************************; BOOT DB 'RNZ ' DB 'RP ' DB 'RPE ' DB 'RPO ' DB 'RRC ' DB 'RST ' DB 'RZ ' DB 'SBB ' DB 'SBI ' DB 'SET ' DB 'SHL ' DB 'SHLD ' DB 'SHR ' DB 'SP ' DB 'SPHL ' DB 'STA ' DB 'STAX ' DB 'STC ' DB 'SUB ' DB 'SUI EQU 0000H ;REBOOT ENTRY POINT CPM EQU 0005H ;CPM ENTRY POINT MEMSZ EQU 0006H ;END OF MEMORY POINTER TBUF EQU 0080H ;TRANS. BUFFER TFCB EQU 005CH ;TRANS. FCB OPEN EQU 15 ;OPEN FUNCTION CODE READ EQU 20 ;READ FUNCTION CODE ;*****************'ADC ' DB 'ADD ' DB 'ADI ' DB 'ANA ' DB 'AND ' DB 'ANI ' DB 'B ' DB 'C ' DB 'CALL ' DB 'CC ' DB 'CM ' DB 'CMA ' DB 'CMC ' DB 'CMP ' DB 'CNC ' DB 'CNZ ' DB 'CP ' DB 'CPE ' DB 'CPI ' DB 'CPO ' #  OMPARE HL VS DE ; ;********************************; CPHL: MOV A,H CMP D RNZ MOV A,L CMP E RET ;********************************; ; D A T A ; ;********************************; TEMP: DS 2 ;TEMP SAVE WORD INPNE CODE CALL CPM ;ISSUE OPEN CPI 0FFH ;ERROR? JZ FOERR ;YES XRA A ;CLEAR CARRY RET FOERR: STC RET ;********************************; ; G E T B T ; ; ROUTINE TO READ A BYTE ; ; PTR: DW TBUF+128;INPUT POINTER DS 64 STACK EQU $ ;***********************************; ; SYMBOL TABLE AREA ; ; THE SYMBOL TABLE MUST BE ; THE LAST BYTE OF THE PROGRAM ; ;***********************************; ORG ($ AND 0FFF0H)  ; ; OUTPUTS: A=BYTE ; ; CARRY=ERROR ; ;********************************; GETBT: LXI H,TBUF+128 XCHG ;BUFFER END ADDR. IN DE LHLD INPTR ;CURRENT POINTER IN HL CALL CPHL ;TEST FOR END OF BUFFER JZ GETB2 ;Y+ 10H ;FORCE 16 BYTE BOUNDARY SYMT: DB 0FFH END ; THE SYMBOL TABLE MUST BE ; THE LAST BYTE OF THE PROGRAM ; ;***********************************; ORG ($ AND 0FFF0H) ES, READ GETB1: MOV A,M ;GET BYTE INX H ;BUMP POINTER SHLD INPTR ;SAVE POINTER ORA A ;RESET CARRY RET GETB2: MVI C,READ ;READ CODE LXI D,TFCB ;FCB ADDRESS CALL CPM ;ISSUE READ CPI 00 ;ERROR? JNZ IERR ;YES LXI H,TBUF ;RESET BUFFER POINTE1 {͏ͣ͂/{!v͉xA*"*6*Z*^#V"n*"~0^,#\ ,,*##">2x*^#V!ͻA!6 ^,#•*##":x=2x{*^#V!ͻ"W ,nW!{> w# !{"y>2x:͏ͣ͂R SHLD INPTR JMP GETB1 ;CONTINUE IERR: STC RET ;********************************; ; MISCELLANEOUS SUBROUTINES ; ;********************************; ;********************************; ; C P H L ; ; ROUTINE TO C){)ͪ:  $$͏ͣ͂/{/ ͏ͣ'D͏ͣ'D ͏ͣ ] ͯ*#"\́!"!"! """*+"""A!"*{#¸*"~°7ɷ*"*{#*****************; ; F O P E N ; ; ROUTINE TO OPEN A DISK FILE ; ; ; ; INPUT: DE=A(FCB) ; ; OUTPUT: CARRY=ERROR ; ;********************************; FOPEN: MVI C,OPEN ;O$   OUT PCHL POP PSW PUSH RAL RAR RC RET RLC RM RNC RNZ RP RPE RPO RRC RST RZ SBB SBI SET SHL SHLD SHR Sʍ7!*ͻʣ~#"\¹!"Ü7|}SYOL TABLE ERROR $OD MOV MVI NOP NOT OR RA ORG ORI!*{8>w#w#w*"*DM**ͻ -w#8'dddd dd60{_zWs4f{_zW#A[?0:?G~ʛʝÍ7#^#V2*w#"*A!^{ ,#ø:, ,,!>2^{    ,!4~  OUT PCHL POP ʍ7!*ͻʣ~#"\¹!"Ü7|}SYOL TABLE ERROR $OD MOV MVI NOP NOT OR RA ORG ORI:<2,#W!"G:x<2x*yp#"y  , ,J>2 , ,,,:<28A k x'D;] x x$x(x)x+x-x*x/x,x:x"A ACI ADC ADD ADI ANA AND ANI B C CALL CC CM CMA CMC CMP CNC CNZ CP CPE CPI CPO CZ D DAA DAD DB DCR DCX DI DS DW E EI END ENDIFENDM EQU H HLT IF IN INR INX JC JM JMP JNC JNZ JP JPE JPO JZ L LDA LDAX LHLD LXI M MACROMOD MOV MVI NOP NOT OR ORA ORG ORI OUT PCHL POP PSW PUSH RAL RAR RC RET RLC RM RNC RNZ RP RPE RPO RRC RST RZ SBB SBI SET SHL SHLD SHR SP SPHL STA STAX STC SUB SUI TITLEXCHG XOR XRA XRI XTHL SYMBOL TABLE ERROR $OD MOV MVI NOP NOT OR RA ORG ORIͻ"7*" *^#V!ͻu^#V+!ͻ7"##^#V+!ͻk##N͊*##*s#r*"͊*##k*}o|g"*ͻ**s#r*">w#º*"**ͻ*ͻ*"}o|g"*"%  COM in drive A. At the A> prompt, type BMAP7/11 d: where d: is an optional drive identifier. BMAP is essentially the same program, but a newer version; it was received from the Osborne Users Group (OUG) of the Washington D.C. area. TYPER was submitted by Dave Blair of FOG. It permits typing directly to your printer (LST: device). Place TYPER.COM in drive A. At the A> prompt, type TYPER Make sure your printer is turned on, then use your keyboard like a typewriter. See TYPER.DOC. XREF, from -CPMUG.036, permits cross-referencing labels used in assembly language programs. Place XREF.COM in drive A. At the A> prompt, type XREF d:filename.ASM Make sure your printer is turned on. TED, also from -CPMUG.036, is a text editor program. Perhaps it should be placed in the Applications category of the library, rather than the Utilities category. However, it is of questionable use anyway, since Osborne owners already have WordStar and ED. It is being inc DISK.DOC -FOG/UTL.008 First Osborne Group (FOG) Utilities Disk BMAP7/11, from -CPMUG.047, provides a bit map representation of the allocation of information on your disk. To use, place BMAP7/11.luded here for anyone who may find it interesting. Place TED.COM in drive A. At the A> prompt, type TED There are built-in instructions. Also, refer to TED.DOC. Jim Woolley FOG Disk Librarian &   September, 1982 uilt-in instructions. Also, refer to TED.DOC. Jim Woolley FOG Disk Librarian '