Trailing-Edge
-
PDP-10 Archives
-
bb-m836d-bm
-
tools/sed/sed1dt.mac
There are 10 other files named sed1dt.mac in the archive. Click here to see a list.
TITLE SED1DT - SED DATA
SUBTTL A CHRISTOPHER HALL FECIT
SEARCH SEDSYM
SALL
IFN TOPS10,<
SEARCH UUOSYM
TWOSEG
RELOC 400000
>
IFE TOPS10,<
SEARCH MONSYM
>
;HISEG DATA
CMVTBL::CDOWN ;CURSOR MOVE TABLE -
CRIGHT ; USED BY AJDONE TO MOVE CURSOR
CURUP
POSCUR
PTRTBL::440700 ;TABLE OF ASCII POINTER LH'S
350700
260700
170700
100700
010700
;COMMAND DISPATCH TABLE
CMDTBL::XRESET,,RESNPM ; RESET (LOOKS LIKE A NULL)
OPENSP,,OPSNPM ; A OPEN SPACES
SETFIL,,SETNPM ; B SET UP A FILE FOR EDITING
ABOPAR,,ABORT ; C ABORT
OPENLN,,OPENLN ; D OPEN LINES
SRCBAK,,SRBNPM ; E SEARCH BACKWARD
CLOSLN,,CLOSLN ; F CLOSE LINES
PUT,,PUT ; G PUT
LFTARG,,LEFT ; H CURSOR LEFT
TABARG,,TAB ; I TAB
LNFPAR,,LNFEED ; J LINEFEED
IFN NEWTAB,<
SLIDEL,,SLLNPM ; K SLIDE LEFT
SLIDER,,SLRNPM ; L SLIDE RIGHT
RETARG,,RETURN ; M CARRIAGE RETURN
SWITCH,,SWHNPM ; N SET SWITCHES
>
IFE NEWTAB,<
PICK,,PIKNPM ; K PICK
SLIDEL,,SLLNPM ; L SLIDE LEFT
RETARG,,RETURN ; M CARRIAGE RETURN
BTBARG,,BAKTAB ; N BACK-TAB
>
ENTCCH,,ENTCCH ; O ENTER CONTROL CHARACTER
PERCEN,,PERNPM ; P PERCENT GOTO
ROLBKP,,RBKNPM ; Q ROLL BACK PAGES
SRCFWD,,SRFNPM ; R SEARCH FORWARD
CLOSSP,,CLOSSP ; S CLOSE SPACES
ROLFWL,,RFLNPM ; T ROLL FORWARD LINES
IFN NEWTAB,<
BTBARG,,BAKTAB ; U BACK-TAB
PICK,,PIKNPM ; V PICK
>
IFE NEWTAB,<
SLIDER,,SLRNPM ; U SLIDE RIGHT
SWITCH,,SWHNPM ; V SET SWITCHES
>
ROLBKL,,ROLBKL ; W ROLL BACK LINES
EXECUT,,EXCNPM ; X DO COMMAND SEQUENCE
ROLFWP,,RFPNPM ; Y ROLL FORWARD PAGES
EXIPAR,,EEXIT ; Z NORMAL EXIT
ENTERA,,ENTERA ; [ ENTER PARAMS
DWNARG,,DOWN ; \ CURSOR DOWN
RGTARG,,RIGHT ; ] CURSOR RIGHT
UPARG,,UP ; ^ CURSOR UP
HOMARG,,HOME ; _ HOME
RECARG,,RECALL ;40 RECALL
0,,INSMOD ;41 INSERT MODE
LFTAG0,,DELCHR ;42 DELETE CHAR
REALTB,,REALTB ;43 TYPE A REAL TAB (SAME AS E-C-C I)
MRKARG,,MARK ;44 MARK POSITION FOR PICK AND CLOSE
LINARG,,LINE ;45 MOVE TO BEGINNING OR END OF LINE
CHGCAS,,CHGCAS ;46 CHANGE CASE OF LETTER AT CURSOR
IFN FTTST,<
DELFIR,,WINSET ;47 SET OR CLEAR WINDOWING
>
IFE FTTST,<
WINCLR,,WINSET ;47 SET OR CLEAR WINDOWING
>
LNFPAR,,ERASLN ;50 ERASE TO END OF LINE
TABCLR,,TABSET ;51 SET/CLEAR TAB STOPS
UPTARG,,UPTAB ;52 UP-TAB (UP 6 LINES)
DNTARG,,DNTAB ;53 DOWN-TAB (DOWN 6 LINES)
RWRARG,,DISALL ;54 REWRITE SCREEN
0,,SAVEIT ;55 SAVE FILE
RECOVR,,HELPER ;56 GIVE HELP (SAME AS ENTER ENTER)
BLIARG,,BLINE ;57 MOVE TO START OF LINE
ELIARG,,ELINE ;60 MOVE TO END OF LINE
BTBARG,,ERASWD ;61 ERASE PREVIOUS WORD
IFN TOPS10,<
0,,0 ;62 PUSH (ILLEGAL ON TOPS-10)
>
IFE TOPS10,<
PSHARG,,PUSHER ;62 PUSH TO EXEC
>
SUBSTI,,SUBNPM ;63 SUBSTITUTE
ILLCMD,,ICMNPM ;64 ILLEGAL COMMAND (GIVES AN ERROR)
JUSTIF,,JUSTIF ;65 JUSTIFY TEXT
MARKER,,MARNPM ;66 MARKER
CMDLEN=:.-CMDTBL
DEFINE TEXT1,<
;COMMAND NAMES (FOR EXECUTE, MAINLY)
CMDNAM::ASCII /^RS/ ; @ RESET
ASCII /^IS/ ; A INSERT SPACES
ASCII /^FL/ ; B SET UP A FILE FOR EDITING
ASCII /^AB/ ; C ABORT
ASCII /^IL/ ; D INSERT LINES
ASCII /^SB/ ; E SEARCH BACKWARD
ASCII /^DL/ ; F DELETE LINES
ASCII /^PT/ ; G PUT
ASCII /^CL/ ; H CURSOR LEFT
ASCII /^TB/ ; I TAB
ASCII /^LF/ ; J LINEFEED
IFN NEWTAB,<
ASCII /^SL/ ; K SLIDE LEFT
ASCII /^SR/ ; L SLIDE RIGHT
ASCII /^RT/ ; M CARRIAGE RETURN
ASCII /^SW/ ; N SET SWITCHES
>
IFE NEWTAB,<
ASCII /^PK/ ; K PICK
ASCII /^SL/ ; L SLIDE LEFT
ASCII /^RT/ ; M CARRIAGE RETURN
ASCII /^BT/ ; N BACK-TAB
>
ASCII /^EC/ ; O ENTER CONTROL CHARACTER
ASCII /^GO/ ; P PERCENT GOTO
ASCII /^RBP/ ; Q ROLL BACK PAGES
ASCII /^SF/ ; R SEARCH FORWARD
ASCII /^DS/ ; S DELETE SPACES
ASCII /^RFL/ ; T ROLL FORWARD LINES
IFN NEWTAB,<
ASCII /^BT/ ; U BACK-TAB
ASCII /^PK/ ; V PICK
>
IFE NEWTAB,<
ASCII /^SR/ ; U SLIDE RIGHT
ASCII /^SW/ ; V SET SWITCHES
>
ASCII /^RBL/ ; W ROLL BACK LINES
ASCII /^EX/ ; X DO COMMAND SEQUENCE
ASCII /^RFP/ ; Y ROLL FORWARD PAGES
ASCII /^XT/ ; Z NORMAL EXIT
ASCII /$/ ; [ ENTER PARAMS
ASCII /^CD/ ; \ CURSOR DOWN
ASCII /^CR/ ; ] CURSOR RIGHT
ASCII /^CU/ ; ^ CURSOR UP
ASCII /^CH/ ; _ HOME
ASCII /^RC/ ; RECALL
ASCII /^IN/ ; INSERT MODE
ASCII /^DC/ ; DELETE CHAR
ASCII /^TA/ ; REAL TAB
ASCII /^MK/ ; MARK POSITION FOR PICK OR CLOSE
ASCII /^LN/ ; MOVE TO BEGINNING OR END OF LINE
ASCII /^CS/ ; CHANGE CASE OF LETTER AT CURSOR
ASCII /^WI/ ; SET OR CLEAR WINDOWING
ASCII /^EL/ ; ERASE LINE
ASCII /^TS/ ; TAB SET/CLEAR
ASCII /^UT/ ; UP-TAB
ASCII /^DT/ ; DOWN-TAB
ASCII /^RW/ ; REWRITE SCREEN
ASCII /^SV/ ; SAVE FILE
ASCII /^HL/ ; GIVE HELP
ASCII /^LB/ ; MOVE TO START OF LINE
ASCII /^LE/ ; MOVE TO END OF LINE
ASCII /^EW/ ; ERASE PREVIOUS WORD
IFN TOPS10,<
ASCII / / ; PUSH (NOT ON TOPS-10)
>
IFE TOPS10,<
ASCII /^PU/ ; PUSH TO EXEC
>
ASCII /^SU/ ; SUBSTITUTE
ASCII /^IC/ ; ILLEGAL COMMAND
ASCII /^JU/ ; JUSTIFY TEXT
ASCII /^MR/ ; MARKER
;TABLE OF EXECUTE CONSTRUCTS WHICH ARE NOT COMMANDS, AND THEIR CODES
;CONDITIONAL FLAGS: COND; DO, FR, FC, IF, DW, NOT
;OTHER CODES CAN'T GO BEYOND 37
;OTHER CODES IN USE: 100, 101: END OF CONDITIONALS; 77: <RESET>
; "$", ")", "^": REAL CHARACTERS AS GIVEN
CMDCON::BYTE (7) "^","F","R" (15) 120 ;^FR - IF ROW
BYTE (7) "^","F","C" (15) 110 ;^FC - IF COLUMN
BYTE (7) "^","F","." (15) 130 ;^F. - IF COUNTER
BYTE (7) "^","I","F" (15) 104 ;^IF - IF CHARACTER
BYTE (7) "^","D","W" (15) 102 ;^DW - DO WHILE
BYTE (7) "^","X","B" (15) 005 ;^XB - EXIT BLOCK
BYTE (7) "^","C","B" (15) 006 ;^CB - CONTINUE BLOCK
BYTE (7) "^","X","X" (15) 007 ;^XX - EXIT BUFFER
BYTE (7) "^","C",".","(" (8) 010 ;^C. - ITERATE COUNTER
BYTE (7) "^","C","=" (15) 011 ;^C= - CLEAR COUNTER
BYTE (7) "^","C","+" (15) 012 ;^C+ - BUMP COUNTER
BYTE (7) "^","C","-" (15) 013 ;^C- - DEBUMP COUNTER
BYTE (7) "^","C","T" (15) 014 ;^CT - USE COUNTER
BYTE (7) "^","S","T","(" (8) 015 ;^ST - START (INITIALIZATION)
BYTE (7) "^","O","U","(" (8) 016 ;^OU - IMAGE OUTPUT
BYTE (7) "^","S","C" (15) 017 ;^SC - SET COUNTER
BYTE (7) "^","N","D" (15) 020 ;^ND - NO DISPLAY
BYTE (7) "^","D","F","(" (8) 021 ;^DF - DO ON SEARCH FAILURE
CMDCLN=:.-CMDCON
XCTREL::BYTE (7) 0,0,0,"G",0 ;RELATIONS: G-2, L-3, E-4, N-5
XCTCLS::BYTE (7) 0,0,0,"L",0 ;CLASSES: L-1, E, N, A, S, U-6
BYTE (7) 0,0,0,"E",0
BYTE (7) 0,0,0,"N",0
BYTE (7) 0,0,0,"A",0
BYTE (7) 0,0,0,"S",0
BYTE (7) 0,0,0,"U",0
STARS:: BYTE (7) 15,12,15,12,40
BYTE (7) 40,40,40,40,40
BYTE (7) 40,40,40,40,40
BYTE (7) 40,"*","*","*","*"
ASCII /******************************/
BYTE (7) "*","*",15,12,15
BYTE (7) 12,40,40,40,40
BYTE (7) 40,40,40,40,40
BYTE (7) 40,40,40,0
>
XLIST
TEXT1
LIT
LIST ;DUMP THE LITERALS (IN THE HISEG, FOR TOPS-10)
IFN TOPS10,<
RELOC 0 ;*** LOWSEG STARTS HERE ***
>
DEFINE TEXT2,<
FENCE:: ASCII / *** This FENCE marks the last page of the file /
ASCII /but is NOT a part of it */
BYTE (7)"*","*"," "," ",0
>
XLIST
TEXT2
LIST
;SOFTWARE INTERRUPT TABLES
IFN TOPS10,<
INTERR::4,,GAKERR ;SAVE AND EXIT ON FATAL ERRORS
100
BLOCK 2
TTYBLK::2
SIXBIT /TTY/
0
BRKADR::2037
0
0
CHRIN:: 20
0
TSTIN:: 1
0
PAGADR::2021 ;SET UP TTY NO PAGE
0
0
XOFADR::1022 ;SEE IF XOFF IS IN EFFECT
0
0
CRRADR::1010 ;READ SETTING OF TTY CRLF
0
CRWADR::2010 ;SET UP TTY NO CRLF
0
1
>
STACK:: BLOCK STKSIZ
;NOMINAL PARAMETERS TO COMMANDS (FROM HERE TO SAVPML ARE SAVED DURING EXECUTE)
PARAMS::
ADDSPC::BLOCK 1 ;SPACES TO ADD OR DELETE (OPENSP, CLOSSP)
ADDSLN::BLOCK 1 ;NUMBER OF LINES TO DO A RECTANGULAR OPEN/CLOSE ON
ADDLNS::BLOCK 1 ;LINES TO ADD OR DELETE (OPENLN, CLOSLN)
ADDLSP::BLOCK 1 ;SPACES TO ADD OR DELETE ALONG WITH LINES
ROLLIN::BLOCK 1 ;LINES TO ROLL (ROLFWL, ROLBKL)
ROLPGS::BLOCK 1 ;PAGES TO ROLL (ROLFWP, ROLBKP)
GOPERC::BLOCK 1 ;PERCENT TO GO TO (PERCEN)
SRCKEY::BLOCK 10 ;SEARCH KEY (SRCFWD, SRCBAK)
PICKLN::BLOCK 1 ;NUMBER OF LINES TO PICK (PICK)
PICKSP::BLOCK 1 ;NUMBER OF SPACES TO PICK (PICK, WITH CURSOR MOVE)
SLIDES::BLOCK 1 ;LENGTH OF ONE SLIDE (SLIDEL, SLIDER)
CASSPS::BLOCK 1 ;SPACES TO CHANGE THE CASE OF (CHGCAS)
CASLNS::BLOCK 1 ;DITTO, LINES (CHGCAS)
JUSLNS::BLOCK 1 ;LINES TO JUSTIFY (JUSTIF)
;SWITCH FLAG WORDS (THE ???FLG ARE ALSO SAVED)
SLDFLG::BLOCK 1 ;0 == DISABLE ^L AND ^U
UPPFLG::BLOCK 1 ;0 == CONVERT ALPHABETICS TO UPPER CASE
BAKFLG::BLOCK 1 ;0 == NO BACKUP FILE WILL BE WRITTEN
PAGFLG::BLOCK 1 ;0 == SWITCH OUTPUTS PAGES-LINES; ELSE LINES
INSTBS::BLOCK 1 ;0 == MAKSPC INSERTS TABS IF IT CAN, ELSE ALL SPACES
INVFLG::BLOCK 1 ;0 == CHGCAS INVERTS CASE, ELSE USE UPCFLG
UPCFLG::BLOCK 1 ;0 == CHGCAS CONVERTS TO UPPER CASE; ELSE LOWER
STRFLG::BLOCK 1 ;0 == ERROR ON SOS LINE NUMBERS; ELSE STRIP THEM
XSHFLG::BLOCK 1 ;0 == SUPPRESS EXECUTE DISPLAY; ELSE SHOW IT
FLLFLG::BLOCK 1 ;-1 == JUSTIFY FILL; 0 == NO-FILL
RLCFLG::BLOCK 1 ;-1 == ROLL SCREEN IF CU ON TOP LINE, CD ON BOTTOM
SAVPML=:.-PARAMS
;THESE ARE NOT SAVED:
DSPFLG::BLOCK 1 ;0 == DISPLAY THE FILE WHEN SETTING TO IT
TRLFLG::BLOCK 1 ;-1 == STRIP TRAILING SPACES/TABS FROM FILE ON EXIT
CLAFLG::BLOCK 1 ;-1 == PREVIOUS COMMAND WAS ^DL - APPEND TO CLSBUF
AGNFLG::BLOCK 1 ;-1 == SETFIL TO SAME FILE AGAIN
CRRFLG::BLOCK 1 ;-1 == SETFIL SHOULD REPLACE CURRENT, NOT OLD, FILE
CREFLG::BLOCK 1 ;-1 == SETFIL: ALWAYS CREATE FILE IF IT'S NOT FOUND
GREFLG::BLOCK 1 ;-1 == GLOBAL /READ SWITCH (SET FOR ALL FILES)
APPFLG::BLOCK 1 ;POINTER == APPEND TO THE PICK BUFFER ON A PICK
SAVPRM::BLOCK SAVPML ;PARMS & FLAGS SAVED DURING EXECUTE (SEE BELOW)
SAVFGS::BLOCK 1 ;SAVED LH OF TM ,, RH OF F
ADDLNX::BLOCK 1 ;FRAGGABLE ADDLNS AND ADDLSP (FOR CLOSLN, MARK)
ADDLSX::BLOCK 1
SLIDNM::BLOCK 1 ;NOMINAL LENGTH OF A SLIDE (10 OR SETTING OF /SLIDE:
TRMNAM::BLOCK 1 ;NAME OF TERMINAL GIVEN BY USER
SROKEY::BLOCK 10 ;PREVIOUS SEARCH KEY (SRCFWD, SRCBAK, RECALL)
ROLLS:: BLOCK 1 ;HOLDS ROLLIN OR LPP*ROLPGS, FOR ROLBK & ROLFW
SRCPTR::BLOCK 1 ;SAVED BUFFER POINTER FOR SEARCHES
GOPRCT::BLOCK 1 ;PERCENT GOTO SET UP BY SWITCH
ADDSPS::BLOCK 1 ;FRAGGABLE SPACES TO INS/DEL (OPENSP, CLOSSP)
CASLIN::BLOCK 1 ;FRAGGABLE LINES TO CHANGE THE CASE OF (CHGCAS)
XCTNUM::BLOCK 1 ;CURRENT # OF TIMES TO ITERATE EXECUTE BUFFER (EXECUT)
XCTITR::BLOCK 1 ;NOMINAL # OF TIMES TO ITERATE EXECUTE BUFFER (EXECUT)
XCTPTW::BLOCK 1 ;USED ACTIVE EXECUTE BUFFER POINTER (WRITING)
XCTACW::BLOCK 1 ;STARTING ACTIVE EXECUTE BUFFER POINTER (WRITING)
XCTPTR::BLOCK 1 ;USED ACTIVE EXECUTE BUFFER POINTER (READING)
XCTACR::BLOCK 1 ;STARTING ACTIVE EXECUTE BUFFER POINTER (READING)
XCTISV::BLOCK 1 ;SAVED # OF ITERATIONS (EXECUT, STACKED)
XCTNSV::BLOCK 1 ;SAVED NOMINAL ITERATIONS (EXECUT, STACKED)
XCTPSV::BLOCK 1 ;SAVED EXECUTE BUFFER READ POINTER
XCTASV::BLOCK 1 ;SAVED STARTING EXECUTE BUFFER READ POINTER
XCTRPT::BLOCK 1 ;NUMBER OF TIMES TO REPEAT THIS EXECUTE COMMAND
XCTRPR::BLOCK 1 ;POINTER TO COMMAND TO REPEAT
XCTINI::BLOCK 1 ;XCTACR SAVED DURING INITIALIZATION
XCTLVL::BLOCK 1 ;LEVEL OF NESTING OF EXECUTE BLOCKS
XCTCTR::BLOCK 1 ;EXECUTE COUNTER
XCTSNM::BLOCK 1 ;VALUE TO SAVE IN EXECUTE COUNTER ON ^SC CONSTRUCT
WINDIS::BLOCK 1 ;FLAG -1 == BOTTOM WINDOW HAS A FILE
SUBCNT::BLOCK 1 ;NUMBER OF TIMES TO SUBSTITUTE
SUBNUM::BLOCK 1 ;NUMBER OF TIMES TO SUBSTITUTE, DECREMENTABLE
SRCKLN::BLOCK 1 ;LENGTH OF SEARCH KEY
SUBSLN::BLOCK 1 ;LENGTH OF SUBSTITUTE STRING
SUBSTG::BLOCK 10 ;SUBSTITUTE STRING
JSHCNT::BLOCK 1 ;LENGTH OF JUSHED
JUSHED::BLOCK 4 ;STG TO STRIP OFF EACH LINE BEFORE, ADD AFTER, JUSTIFY
MRKEND::BLOCK 1 ;HIGHEST MARKER IN USE
MRKLAT::BLOCK 1 ;DISPLAY POINTER OF LATEST-SET MARKER
MRKNTB::BLOCK MRKSIZ ;FIRST 5 CHARACTERS OF MARKER NAME
MRKNT1::BLOCK MRKSIZ ;LAST 5 CHARACTERS OF MARKER NAME
BLOCK 1 ;NULL MARKER POINTER
MRKPTB::BLOCK MRKSIZ ;DISPLAY POINTER FOR THIS MARKER
MRKSTK::BLOCK MRKSTL ;MARKER STACK
MRKSTP::BLOCK 1 ;POINTER INTO MARKER STACK
PRERW:: BLOCK 1 ;PRE-SET ROW AND COLUMN
PRESL:: BLOCK 1 ;PRE-SET SLIDE
PREDP:: BLOCK 1 ;PRE-SET DISPLAY POINTER
PREONE::BLOCK 1 ;PRE-SET ONE-SHOT POINTER
DELIM:: BLOCK 1 ;FLAG: THERE ARE EXTRA WW-TABS DELIMITER CHARACTERS
CHBITS::BLOCK 15 ;PER-CHARACTER FLAGS, 9 PER WORD, 4 BITS/FLAG
CHRTAB::POINT 4,CHBITS(T1),3 ;POINTERS TO EACH FLAG IN A CHBITS WORD
POINT 4,CHBITS(T1),7
POINT 4,CHBITS(T1),11
POINT 4,CHBITS(T1),15
POINT 4,CHBITS(T1),19
POINT 4,CHBITS(T1),23
POINT 4,CHBITS(T1),27
POINT 4,CHBITS(T1),31
POINT 4,CHBITS(T1),35
NEWMSG::ASCII /; This file is / ;NOTE: THIS IS 3 WORDS LONG
IFE TOPS10,<
FILSPC::BLOCK 14 ;FILE SPECS (SETFIL)
BAKSPC::BLOCK 14 ;BACKUP FILE SPECS
FILBSZ::BLOCK 1 ;SIZE OF FILE, IN BLOCKS
>
IFN TOPS10,<
FILSPC::BLOCK 13 ;FILE SPECS (SETFIL)
BYTE (7) 15,12
IFN FTSFD,<
FILPTH::-2 ;PATH OF CURRENT FILE
0
BLOCK 1
BLOCK SFDLVL+1
>
FILBLK::BLOCK 3
FILFIL::LUKLEN ;EXTENDED LOOKUP BLOCK FOR CURRENT FILE
BLOCK LUKLEN ;(PPN, NAME, EXT, PROT, SIZE, ... DEVICE
>
FILSIZ::BLOCK 1 ;SIZE OF FILE, IN BYTES
INJFN:: BLOCK 1 ;JFN FOR THE FILE ON INPUT
OLDSPC::BLOCK 14 ;OLD FILE SPECS, FROM LAST SETFIL
IFN TOPS10,<
IFN FTSFD,<
OLDPTH::-2 ;PATH OF DITTO
BLOCK SFDLVL+3
>
OLDBLK::BLOCK 3 ;OPEN BLOCK FOR ALTERNATE FILE
OLDFIL::LUKLEN ;EXTENDED LOOKUP BLOCK FOR DITTO
BLOCK LUKLEN
>
SAVERW::BLOCK 1 ;OLD ROW AND COLUMN ACS
SAVEDP::BLOCK 1 ;OLD DISPLAY POINTER
SAVESL::BLOCK 1 ;OLD SLIDE OFFSET
SAVEFG::BLOCK 1 ;OLD FLAG WORD
IFN TOPS10,<
SVASPC::BLOCK 13 ;SAVED ALTERNATE FILE SPECS
BYTE (7) 15,12
IFN FTSFD,<
SVAPTH::-2
BLOCK SFDLVL+3
>
BLOCK 3
LUKLEN
BLOCK LUKLEN
>
IFE TOPS10,<
SVASPC::BLOCK SPCSIZ+3 ;SAVED ALTERNATE FILE INFO, IN CASE OF /RCUR
>
BLOCK 4 ;SAVED POINTERS
NEWSPC::BLOCK 10 ;NEW FILESPEC - UNPARSED FROM /OUT: SWITCH
OUTFLG::BLOCK 1 ;-1==MUST PARSE NEWSPC INTO FILSPC; 1==PARSE IN PROGRESS
CHGSPC::BLOCK 1 ;-1==FILSPECS HAVE CHANGED (BY /O: SWITCH)
IFN TOPS10,<
GOBLK:: SIXBIT /SYS/ ;RUN BLOCK FOR EXIT AND GO
SIXBIT /COMPIL/
EXP 0,0,0,0
IFN FTSFD,<
DEFPTH::-1 ;RUNNER'S STARTING PATH
BLOCK SFDLVL+3
>
FILPPN::BLOCK 1 ;USER'S FILE'S PPN
USRPPN::BLOCK 1 ;PPN OF RUNNER OF EDITOR
GENBLK::16 ;GENERAL OPEN BLOCK
SIXBIT /DSK/
0
FILCCL::IOWD 0,BUFFER ;CHANNEL COMMAND FOR INPUTTING EDITABLE FILE
0
PIKFIL::SIXBIT /000PIK/ ;FILE BLOCK FOR PICK FILE
SIXBIT /TMP/
EXP 0,0
PIKCCL::IOWD PCBSIZ,PIKBUF ;CHANNEL COMMAND FOR PICK BUFFER
0
PKACCL::IOWD 200,PIKBUF ;DITTO FOR APPENDING TO THE PICK BUFFER
0
CLSFIL::SIXBIT /000CLS/ ;FILE BLOCK FOR CLOSE FILE
SIXBIT /TMP/
EXP 0,0
CLSCCL::IOWD PCBSIZ,CLSBUF ;CHANNEL COMMAND FOR CLOSE BUFFER
0
CLACCL::IOWD 200,CLSBUF ;DITTO FOR APPENDING TO THE CLOSE BUFFER
0
SEDFIL::SIXBIT /000SED/ ;FILE BLOCK FOR STATISTICS FILE
SIXBIT /TMP/
EXP 0,0
SEDCCL::IOWD 1,PIKBUF+PCBSIZ-400
0 ;CHANNEL COMMAND FOR STATISTICS FILE
IFN FTTMPC,<
TMPBLK::XWD 'SED',0 ;TMPCOR BLOCK
IOWD 30,PIKBUF+PCBSIZ-400
>
DELFIL::BLOCK 4 ;FILE BLOCK FOR DELETING
BAKFIL::BLOCK 4 ;FILE BLOCK FOR RENAMING BACKUP FILE
PRTFIL::BLOCK 4 ;FILE BLOCK FOR LOWERING FILE PROTECTION
NEWCCL::IOWD 13,NEWMSG ;CHANNEL COMMAND FOR NEW FILE
0
PUTCCL::BLOCK 2 ;CHANNEL COMMAND FOR PICK OR CLOSE BUFFER
SWHFIL::SIXBIT /SWITCH/ ;FILE BLOCK FOR SWITCH.INI
SIXBIT /INI/
EXP 0,0
INIFIL::SIXBIT /SED/ ;FILE BLOCK FOR SED.INI
SIXBIT /INI/
EXP 0,0
EXTTBL::SIXBIT / MAC/ ;EXTENSIONS TO BE TRIED IN SETFIL
SIXBIT /TXTRNO/
SIXBIT /FORCBL/
SIXBIT /DAT /
SIXBIT / /
SIXBIT / / ;(RH OF LAST WORD MUST BE ZERO)
REDACC::5,,0 ;CHKACC BLOCKS FOR READING
BLOCK 2
WRTACC::2,,0 ; AND WRITING
BLOCK 2
HLPFIL::SIXBIT /SEDONL/ ;FILE BLOCK FOR ON-LINE HELP FILE
SIXBIT /HLP/
EXP 0,0
HLPCCL::IOWD 200,PIKBUF+PCBSIZ-200 ;CHANNEL COMMAND FOR HELP FILE
0
> ;END IFN TOPS10
EEEPTR::BLOCK 1 ;POINTER INTO EXTENSION TABLE
INIFLG::BLOCK 1 ;-1==SED.INIT FOUND, 0==SWITCH.INI FOUND
IFE TOPS10,<
ITTFLG::BLOCK 1 ;FLAG: -1 == MONITOR CHAR. TRAPPING IS OFF
NEWJFN::BLOCK 1 ;JFN OF NEW FILE BEING SET-FILED TO
GOBLK:: 1 ;ARGUMENT TO PASS TO EXEC TO DO EXIT AND GO
4B2+17B12+2 ;(MAY GET OVERWRITTEN WITH A PROGRAM NAME)
0
BLOCK 10
EXTPTR::BLOCK 1 ;POINTER TO WHERE TO FILE EXT SHOULD BE
EXTTBL::0 ;EXTENSIONS TO BE TRIED IN SETFIL
ASCII /MAC/ ;(FIRST WORD: EXT OF PREVIOUS FILE)
ASCII /TXT/
ASCII /RNO/
ASCII /FOR/
ASCII /CBL/
ASCII /DAT/
BLOCK 5
SAVEXP::BLOCK 2 ;EXTPTR AND EXTTBL OF OLD FILE
PIKFIL::ASCIZ /000PIK.TMP/
CLSFIL::ASCIZ /000CLS.TMP/
SEDFIL::ASCIZ /000SED.TMP/
BLOCK 4
SWHFIL::ASCIZ /SWITCH.INI/
INIFIL::ASCIZ /SED.INIT/
INIJFN::GJ%OLD ;LONG GTJFN BLOCK FOR SED.INIT
.NULIO,,.NULIO ;NO I/O FOR NAME
-1,,INIDEV ;POINTER TO DEVICE NAME (PS:)
-1,,USRNAM ;POINTER TO USER NAME
BLOCK 5
INIDEV::ASCIZ /PS/
USRNAM::BLOCK 10 ;USER'S NAME
HLPFIL::ASCIZ /HLP:SEDONL.HLP/
OUTJFN::BLOCK 1 ;JFN FOR THE FILE ON OUTPUT
EXCHDL::BLOCK 1 ;HANDLE OF EXEC FORK RUNNING UNDER SED
>
SAVSED::BLOCK 1 ;SAVED 1ST WORD OF STAT FILE NAME
;GENERAL DATA
TABLEN::10 ;LENGTH OF AN ENTIRE TAB
TABSIZ::BLOCK 1 ;LENGTH OF TAB THAT CURSOR POINTS TO
TABSPC::BLOCK 1 ;NUMBER OF SPACES TO LEFT OF CURSOR, IF IT'S IN A TAB
TABPTR::BLOCK 1 ;POINTER TO TAB, IN FILE BUFFER
TABTBL::BLOCK 4 ;TABLE OF SETTABLE TABS
COMAND::BLOCK 1 ;COMMAND SEQUENCE FROM TERMINAL
SAVEAC::BLOCK 13 ;PLACE TO SAVE ACS ON EXIT, IN CASE OF REE
SAVFLG::BLOCK 1 ;SAVED TERMINAL FLAGS
LPP.0:: BLOCK 1 ;SAVED LINES PER PAGE
LPP.1:: BLOCK 1 ;LINES PER PAGE - 1
LPP.2:: BLOCK 1 ;NUMBER OF BOTTOM LINE (NEXT TO BOTTOM IF NEL SET)
CPL.0:: BLOCK 1 ;SAVED CHARACTERS PER LINE
CPL.1:: BLOCK 1 ;CHARACTERS PER LINE - 1
LMARGN::BLOCK 1 ;LEFT MARGIN FOR TYPE-IN INDENT
RMARGN::BLOCK 1 ;RIGHT MARGIN FOR TYPE-IN WRAPAROUND
PARIND::BLOCK 1 ;PARAGRAPH INDENT (FOR JUSTIFY COMMAND)
LINROL::BLOCK 1 ;LINES PER ROLL
HOMPOS::BLOCK 1 ;ROW OF SCREEN WHERE HOME IS (NON-0 ONLY FOR WINDOWING)
SAVRUP::BLOCK 1 ;ROLL-UP SEQUENCE (SAVED WHILE THERE'S WINDOWING)
SAVRLD::BLOCK 1 ;DITTO ROLL-DOWN SEQUENCE
SAVILN::BLOCK 1 ;DITTO INSERT-LINE SEQUENCE
SAVDLN::BLOCK 1 ;DITTO DELETE-LINE SEQUENCE
SAVCPG::BLOCK 1 ;DITTO CLEAR-TO-EOP SEQUENCE
SAVLPP::BLOCK 1 ;DITTO NUMBER OF LINES PER PAGE
CHRCUR::BLOCK 1 ;CHARACTER AT THE CURSOR POSITION, BLIPPED
SAVPOS::BLOCK 2 ;CURSOR POSITION SAVED ON ENTER
SVPMRK::BLOCK 2 ;CURSOR POSITION SAVED WHEN MARK COMMAND IS TYPED
TYPCHR::BLOCK 1 ;CHARACTER TYPED USER DURING A DISPLAY
WRTNUM::BLOCK 1 ;NUMBER OF CHARACTERS TO NULL OUT (WRTNUL)
NUMCHR::BLOCK 1 ;NUMBER OF CHARACTERS TO DEAL WITH (MAKSPC, &C)
NUMWDS::BLOCK 1 ;NUMBER OF WORDS TO DEAL WITH (MAKSPC, &C)
NUMNUL::BLOCK 1 ;NUMBER OF EXTRA NULLS PUT IN
CHARAC::BLOCK 1 ;CHARACTER TO DEAL WITH (IN MAKSPC, &C)
MAKPTR::BLOCK 1 ;POINTER TO LAST REAL CHAR ADDED BY MAKSPC &C.
ADJWRD::BLOCK 1 ;WORD FOR MAKSPC &C TO ADJUST
SPCCNT::BLOCK 1 ;COUNT OF CHARACTERS MOVED BY SPCBUF
SQZCNT::BLOCK 1 ;COUNT OF COMMANDS REMAINING UNTIL NEXT SQUEZW
DISPPT::BLOCK 1 ;POINTER TO LAST LINE; SET BY DISPLL
MAKLNS::BLOCK 1 ;NUMBER OF <CRLF>S IN PICK OF CLOSE BUFFER
RSCANF::BLOCK 1 ;FLAG - SET IF USER GAVE A FILE IN THE RUN COMMAND
SAVCPT::BLOCK 1 ;CHRPTR SAVED WHEN ENTER IS TYPED
MRKPTR::BLOCK 1 ;MARK POINTER, FOR PICK AND CLOSE-LINES
MRLPTR::BLOCK 1 ;SAVED LINPTR FOR DITTO
MRCPTR::BLOCK 1 ;SAVED CHRPTR FOR DITTO
ISVNUM::BLOCK 1 ;NUMBER OF COMMANDS BETWEEN INCREMENTAL SAVES
SAVNUM::BLOCK 1 ;NUMBER OF TYPEIN CHARACTERS BETWEEN INC'L SAVES
ISVCNT::BLOCK 1 ;COMMAND INCREMENTAL SAVE COUNTER
SAVCNT::BLOCK 1 ;TYPEIN INCREMENTAL SAVE COUNTER
INDFLG::BLOCK 1 ;FLAG TO SEE IF INDIRECT FILE NEEDS TO BE READ AGAIN
MFLPTR::BLOCK 1 ;POINTER TO START OF NEXT FILE IN nnnSED.TMP
MFLPT0::BLOCK 1 ;DITTO, ALTERNATE FILE
MFLPT1::BLOCK 1 ;DITTO, CURRENT FILE
;MFLBLK:: BLOCK 1 ;BLOCK OF nnnSED.TMP WHICH POINTER IS IN
STTFLG::BLOCK 1 ;NON-ZERO == INITIALIZING (HOLDS WID,,LEN FOR LATER)
TAGFLG::BLOCK 2 ;NON-0 == SAVE SPEC/DATE/USER TAG AT TOP OF FILE
TAGFG1::BLOCK 1 ; FLG/ STARTING COMMENT CHARS; FG1/ ENDING DITTO
IFE TOPS10,<
SAVCOC::BLOCK 2 ;SAVED CCOC WORDS (TOPS20)
SAVCAP::BLOCK 1 ;SAVED RPCAP WORD (TOPS20)
FMDSAV::BLOCK 1 ;SAVED FMOD BITS (TOPS20)
IFN FTECHO,<
SMDSAV::BLOCK 1 ;SAVED SED'S FMOD BITS (TOPS20)
SAVWKU::BLOCK 5 ;SAVED STARTING WAKE-UP SET (TOPS20)
FLDWTH::BLOCK 1 ;FIELD WIDTH: MIN(CPL,RMARGN+1) (TOPS20)
TTYJFN::BLOCK 1 ;TERMINAL'S JFN, FOR OUTPUT (TOPS20)
EKOFLG::BLOCK 1 ;0 == ECHO ALL; -1 == ECHO NONPRINTING
BRKFLG::BLOCK 1 ;0 == BREAK ON ALL; -1 == BREAK ON NONPRINTING
>>
;VARIOUS BUFFERS
PUTPTR::BLOCK 1 ;POINTER, FOR MAKSPC, TO CLOSE OR PICK BUFFER
PTMPTR::BLOCK 1 ;COPY OF ABOVE SET UP BY MAKSPC
MAKCNT::BLOCK 1 ;COUNT OF CHARACTERS TO INSERT, FOR MAKSPC
PUTJFN::BLOCK 1 ;JFN OF PICK OR CLOSE BUFFER, FROM PUT TO MAKSPC
DELCNT::BLOCK 1 ;COUNT OF CHARACTERS IN THE DELETE BUFFER
DELBUF::BLOCK 40 ;BUFFER FOR STUFF DELETED BY ^DS, ^DW, ^DC, ^EL
PIKCNT::BLOCK 1 ;COUNT OF CHARACTERS IN THE PICK BUFFER
PIKJFN::BLOCK 1 ;JFN FOR PICK FILE ON DISK (GENERATED ON OVERFLOW)
PIKBUF::BLOCK PCBSIZ ;PICK BUFFER (PICK, PUT)
BLOCK 1 ;ZERO AT THE END OF PICK BUFFER
CLSCNT::BLOCK 1 ;COUNT OF CHARACTERS IN THE CLOSE BUFFER
CLSJFN::BLOCK 1 ;JFN FOR CLOSE FILE ON DISK (GENERATED ON OVERFLOW)
CLSBUF::BLOCK PCBSIZ ;CLOSE BUFFER (CLOSELN, PUT)
BLOCK 1 ;ZERO AT THE END OF CLOSE BUFFER
IFN TOPS10,<
TYPPTR::010700,,TYPBUF-1 ;TYPE BUFFER POINTER FOR 7-BIT CHARACTERS
>
IFE TOPS10,<
IFN FTECHO,<
TYPPTR::011000,,TYPBUF-1 ;TYPE BUFFER POINTER FOR 8-BIT CHARACTERS
>
IFE FTECHO,<
TYPPTR::010700,,TYPBUF-1 ;TYPE BUFFER POINTER FOR 7-BIT CHARACTERS
>>
TYPBUF::BLOCK TYPSIZ ;BUFFER FOR OUTPUTTING TO TERMINAL
BLOCK 10 ;OVERFLOW FOR TYPE BUFFER
XCTKEY::BLOCK XBFNUM ;SEQUENCES GIVEN BY TERMINAL KEYS WHICH INVOKE BUFFERS
XCTNAM::BLOCK XBFNUM-1 ;EXECUTE BUFFER NAMES
1 ;NO-NAME BUFFER (MARKED IN USE)
XCTADR::BLOCK XBFNUM ;POINTERS TO EXECUTE BUFFERS
XCFPTR::BLOCK 1 ;POINTER TO START OF UNUSED FREE SPACE
XCTOVF::BLOCK 1 ;POINTER TO END OF EXECUTE FREE SPACE
XCTFRE::BLOCK XCFSIZ ;FREE SPACE FOR EXECUTE BUFFERS
IFN FTJOUR,<
JRNPTR::BLOCK 1 ;POINTER INTO JOURNAL BUFFER
JRNBIT::BLOCK 1 ;JOURNALING: -1 == DO FIRST FILE WRITE
;RECOVERING: -1 == START JOURNALING WHEN DONE
JRNFLG::BLOCK 1 ;FLAG: RECOVER JOURNAL, THEN -1 == END OF FILE
JRNENP::BLOCK 1 ;POINTER TO END OF JOURNAL BUFFER
IFN TOPS10,<
JOURNL::BLOCK 201 ;TOPS-10 BUFFER == 1 DISK BLOCK (PLUS WORD OF SLACK)
JRNDSK::BLOCK 1 ;NUMBER-1 OF LATEST DISK BLOCK OF JOURNAL
JRNCCL::IOWD 200,JOURNL
0 ;CHANNEL COMMAND FOR JOURNAL FILE I/O
JRNLKB::SIXBIT /SEDJRN/
SIXBIT /TMP/
EXP 0,0
JRNFIL::11,,0 ;(CHANNEL 11)
.IODMP ;DUMP MODE
SIXBIT /DSK/ ;DEVICE
0 ;BUFFER HEADER ADDRESS (NONE)
0 ;NUMBER OF BUFFERS (NONE)
JRNLKB ;ADDRESS OF LOOKUP BLOCK
>
IFE TOPS10,<
JOURNL::BLOCK JRNSIZ+1
JRNFIL::ASCIZ /SEDJRN.TMP/
JRNJFN::BLOCK 1 ;JFN FOR THE JOURNAL FILE
>>
LINPTR::BLOCK 1 ;POINTER TO START OF LINE
CHRPTR::BLOCK 1 ;POINTER TO CHARACTER AT CURSOR
DISPTR::BLOCK 1 ;POINTER TO FIRST CHARACTER DISPLAYED
BOTPTR::BLOCK 1 ;POINTER TO START OF LAST LINE OF SCREEN
PARPTR::BLOCK 1 ;POINTER INTO PARAMETER BUFFER
PARG1:: BLOCK 1 ;STORAGE AREAS FOR CONVERTED PARAMETERS
PARG2:: BLOCK 1
PARBUF::BLOCK PARBLN+1 ;PARAMETER BUFFER
;*** NOTE: FOR TOPS-20, PARBUF MUST BE THE LAST ITEM BEFORE BUFFER ***
IFN TOPS10,<
6424 ;PRECEDE BUFFER WITH A NONZERO, NON-ODD WORD
BUFFER::
>
IFE TOPS10,<
BUFBLK==:31 ;START BUFFER IN NEXT BLOCK
BUFFER==:BUFBLK_11
LOC BUFFER-1
6424 ;PRECEDE BUFFER WITH A NONZERO, NON-ODD WORD
>
DEFINE TEXT3,<
ASCIZ /**************************************************************************
Hi! This is SED, the full screen editor. It is easier and more
natural to use than line or character editors, and is generally faster
too. To use it, just type. You can move the cursor (which is that
blinking mark in the upper left corner) to other parts of the screen.
To change existing text, just type over it.
There are also commands to the editor. They move the viewing
window around, insert or delete lines or spaces, move text from one
place to another, search, and other useful things.
For a summary of the editor commands see the file HLP:SED.HLP.
For a tutorial manual see the file DOC:SED.MAN.
For complete editor documentation see the file DOC:SED.DOC.
You can also get on-line help. Type "3" on the keypad and then any
command to get a description of that command.
To exit from SED type CTRL-Z.
/
0
>
XLIST
TEXT3
LIST ;OUTPUT TEXT3 (SAVING LISTING PAPER)
BUFFEN==:.
IFN FTDDT,<
.TEXT ?/SYMSEG:HIGH?
>
END