" *********************************************************** " * * " * Copyright, (C) Honeywell Information Systems Inc., 1982 * " * * " *********************************************************** " EDIT - BOS BCD File Editor. " Modified 9/17/75 by Noel I. Morris " Last modified 2/11/81 by Sherman D. Sprague for prompting " ****************************************************** " * * " * * " * Copyright (c) 1972 by Massachusetts Institute of * " * Technology and Honeywell Information Systems, Inc. * " * * " * * " ****************************************************** include bosequ " stx2 x2 eax0 0,2 tsx2 init_io tsx2 ttyinit arg ttyrequest lcq 1,dl make a line mark stq pagectl .. ldx0 mem|0,0 get loc of args lda mem|1,0 first arg sta name tra edit ttyrequest: x2: eax2 * lca =1,dl tra mem|1,2 return to bos " " The basic edit loop. A line is read from the tty and the first " character is used to determine the command. The following " commands are defined: " " P [1] print [N] lines starting at the current line. " N [1] next [N] lines...skip N lines. " - [1] backup [N] lines...skip backward N lines. " I Insert text before current line. Input stops when a " null line is read. " D [1] delete [N] lines starting at the current line. " T go to beginning (top) of file. " B go to end (bottom) of file and receive input. " W -name- write the runcom file out with the given name and " exit from the editor. If no name is given the " file that was read in is overwritten. " Q Quit from the editor without saving the work. " = Print out current line number. " " The brackets are not part of the syntax. The are used only to " show what the default parameters used are. " " The editor works by keeping a "current line" pointer. This " pointer is changed by the various requests depending on the " request. The P request prints the line pointed to by CLP " (current line pointer). It leaves CLP pointing at the last " line printed. " The N request moves CLP down the specified number of lines. " The B request moves CLP backward the specified number of lines. " The I request inserts text in front of the line pointed to " by CLP but leaves CLP pointing at the line after the last line " input. " The D request deletes the specified number of lines starting at " the line pointed to by CLP. It leaves CLP pointing at the first " line after those deleted. " The T request leaves the CLP pointing to the first line. " The B request causes input to be accepted and placed after " the last line. " The = request prints out the number of the line pointed to by CLP. " " edit: lda name search for the name in the directory cmpa =-1 check if a name was given tze enotf1 no, initialize name to all blanks tsx2 search search for it tra enotf not there, tell him and wait for requests era =o4000,dl turn off runcom bit tsx2 rdsec read in the runcom file nop bf|0 tra x2 " initialize the editor by finding the length of the runcom file " and setting up certain pointers and lengths. eax0 0 count words in the file stz nlines count the lines in the file eskip4: lda bf|0,0 get word from buffer cmpa =-1 end of file? tze estart if so, finished with count aos nlines count the line adx0 bf|0,0 add length of line to offset eax0 1,0 skip over the marker tra eskip4 search on estart: eax0 1,0 count final fence stx0 nwords save the number of words in the file stz cur_word start editing at beginning of the file lda 1,dl start editing at line 1 sta cur_line save as current line tra edit_loop start editing ... enotf1: lda =h " set name to all blanks sta name tsx2 erpt acc "input..." tra startin enotf: tsx2 erpt acc "^g not found. input..." arg name startin: stz cur_word stz nlines initialize counters, etc. lda 1,dl sta cur_line lda 1,du sta nwords lca 1,dl sta bf|0 tra insert edit_loop: tsx2 readtty get the request line tra edit_loop ignore blank lines tsx2 scan get any numbers converted. lda darg+1 get count (would be first arg) tpl *+2 if non-zero, then number was given lda 1,dl use 1 if no count given sta count lda arg get the request name cmpa =h - tze backup cmpa =h b tze bottom cmpa =h d tze delete cmpa =h i tze insert cmpa =h n tze next cmpa =h p tze eprint cmpa =h q tze quit cmpa =h t tze etop cmpa =h w tze write cmpa =h = tze lineno tsx2 erpt not a known request acc "-NO-" tra edit_loop " " " " " " " " " " " " lineno " " " " " " " " " " " lineno: tsx2 erpt acc "^d" arg cur_line tra edit_loop " " " " " " " " " " backup " " " " " " " " " " backup: lxl1 count get the number of lines to back up back1: eax1 -1,1 decrement lines done tmi edit_loop all done tsx2 skip_backward backup 1 line tra bof_message backed up to beginning of file tra back1 bof_message: tsx2 erpt acc "*BOF*" tra edit_loop " " " " " " " " " " next " " " " " " " " " " next: lxl1 count get number of lines to skip next1: eax1 -1,1 decrement number of lines skipped tmi edit_loop all done tsx2 skip_forward skip over a line tra eof_message end of file encountered tra next1 eof_message: tsx2 erpt acc "*EOF*" tra edit_loop " " " " " " " " " " " delete " " " " " " " " " " delete: lxl1 count get number of lines to delete lda cur_word get current word (points to start of current line) ldq bf|0,au see if at end of file cmpq =-1 tze eof_message yes ... sta save_cur_word save current word index lda cur_line sta save_cur_line delete1: eax1 -1,1 decrement number of lines deleted tmi delete2 when finished, do actual deletion tsx2 skip_forward skip a line tra feof_message look for EOF tra delete1 continue skipping lines delete2: lda save_cur_word get previous current word ldq cur_word get new current word lls 2 compute 9-bit offsets eax6 0,au previous offset in X6 eax7 0,qu new offset in X7 lda nwords get number of words in file sba cur_word minus new current word als 2 compute number of characters to move mlr (pr,rl,x7),(pr,rl,x6) move lines down over deleted lines desc9a bf|0,au desc9a bf|0,au lda save_cur_word update new number of wrds in file sbla cur_word asa nwords lda save_cur_word update new cur_word (line number doesn't change) sta cur_word lda save_cur_line now, put current line back sta cur_line to what it was before tra edit_loop go back to main edit loop feof_message: tsx2 erpt acc "*EOF*" tra delete2 " " " " " " " " " " " insert " " " " " " " " " " insert: lda =h input load input prompt sta com|curtcmd store the new prompt tsx2 readtty get the new input line tra eset_pmt go set return promt tsx2 runcom_line_len get length of line and set line mark stq len save length ldq nwords number of words in file sbq cur_word minus current word qls 2 compute number of chars to end of file lda cur_word current word als 2 compute current offset in file eax7 0,au current offset in X7 adx7 len compute new offset for remainder of file mrl (pr,au,rl),(pr,x7,rl) move lines down to make room for new line desc9a bf|0,qu desc9a bf|0,qu ldx6 len length of new line in X6 mlr (rl),(pr,rl,au) copy in new line desc9a pagectl,x6 desc9a bf|0,x6 eaa 0,6 length of new line in AU arl 2 in words asa nwords increment number of words in file asa cur_word step over newly inserted line aos cur_line update current position values aos nlines increment count of lines in file tra insert get another input line eset_pmt: lda =h edit sta com|curtcmd put back correct promt tra edit_loop stop input on blank line " " " " " " " " " " " bottom " " " " " " " " " " bottom: tsx2 skip_forward move to end of file tra insert when there, insert text tra bottom keep skipping " " " " " " " " " " top " " " " " " " " " " etop: tsx2 skip_backward backup to beginning of file tra edit_loop tra etop " " " " " " " " " " " " print " " " " " " " " " " " eprint: lxl1 count get number fo lines to print eprint4: eax1 -1,1 count down until all lines are printed tmi edit_loop eprint3: ldq cur_word lda bf|0,qu see if at end of file cmpa =-1 tze eof_message arl 18 length of line in AL stca type1,07 place in call to type lls 2 compute offset and length in characters mlr (pr,rl,qu),(rl) copy the line desc9a bf|1,al desc9a line,al tsx2 type type1: zero line,0 eax1 -1,1 decrement count of lines to print tmi edit_loop if none left, back to main loop tsx2 skip_forward step to next line tra eof_message tra eprint3 print more lines " " " " " " " " " " " " write " " " " " " " " " " " write: lda arg+1 see if name was given cmpa =-1 if -1, no name was given tze *+2 sta name lda name check for no name given cmpa =h " tze noname none given, complain ldq nwords get size of buffer qrl 18 in QL tsx2 store_runcom_file store completed file tra x2 tra x2 all finished noname: tsx2 erpt acc "what name..." tra edit_loop " " " " " " " " " " " quit " " " " " " " " " " " quit: tra x2 " " " " " " " " " " " " " " " " " subroutines " " " " " " " " " " " " " " " " skip_forward: ldx0 cur_word get index to current line lda bf|0,0 see if at end of file cmpa =-1 tze 0,2 yes, take eof return adx0 bf|0,0 step to next line eax0 1,0 skip over the marker stx0 cur_word update index to start of current line aos cur_line also update current line number lda bf|0,0 are we at the end of the file? cmpa =-1 tze 0,2 yes, take EOF return tra 1,2 no, take normal return skip_backward: ldx0 cur_word get index to current line eax6 -1 count words in X6 eskip2: eax6 1,6 count a word eax0 -1,0 step back one word tmi top until BOF lxl7 bf|0,0 look for line mark cmpx7 =o777777,du .. tnz eskip2 if not mark, keep looking cmpx6 bf|0,0 does it have correct word count ? tnz eskip2 if not, keep looking stx0 cur_word save new starting index lca 1,dl update line number asa cur_line tra 1,2 take normal exit top: stz cur_word reset index to start of file lda 1,dl and also line number sta cur_line tra 0,2 take BOF return " name: oct 0 macro file name nwords: bss ,1 number of words in file cur_word: bss ,1 current word being examined nlines: bss ,1 number of lines in file cur_line: bss ,1 current line being examined count: bss ,1 edit request count save_cur_word: bss ,1 save_cur_line: bss ,1 len: bss ,1 include runcom_util include bos_tv include bos_common end " " " ----------------------------------------------------------- " " " " Historical Background " " This edition of the Multics software materials and documentation is provided and donated " to Massachusetts Institute of Technology by Group Bull including Bull HN Information Systems Inc. " as a contribution to computer science knowledge. " This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, " Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell Bull Inc., Groupe Bull " and Bull HN Information Systems Inc. to the development of this operating system. " Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), " renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership " of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for " managing computer hardware properly and for executing programs. Many subsequent operating systems " incorporated Multics principles. " Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., " as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . " " ----------------------------------------------------------- " " Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without " fee is hereby granted,provided that the below copyright notice and historical background appear in all copies " and that both the copyright notice and historical background and this permission notice appear in supporting " documentation, and that the names of MIT, HIS, Bull or Bull HN not be used in advertising or publicity pertaining " to distribution of the programs without specific prior written permission. " Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. " Copyright 2006 by Bull HN Information Systems Inc. " Copyright 2006 by Bull SAS " All Rights Reserved " "