Google
 

Trailing-Edge - PDP-10 Archives - bb-j710b-bm_tops20_v41_tools - tools/sed/sedvew.mac
There is 1 other file named sedvew.mac in the archive. Click here to see a list.
TITLE	SEDVEW - DEFINITIONS FOR THE ADDS VIEWPOINT TERMINAL
SUBTTL	A CHRISTOPHER HALL FECIT

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1981 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

;LOAD THE EDITOR BY: .LOAD SEDSYM,SEDVEW,SED
;		     .SS SED

	SEARCH	SEDSYM
IFE TOPS10,<SEARCH MONSYM>

	EXTERN	CPOPJ,PUTTYP,PUTSTG,PUTSQ1,PUTNUM,TRMNAM,TYPBUF,HOMPOS
	EXTERN	CHOME,CDOWN,CRIGHT
	INTERN	TERMNL

FTFAST==0	;SET THIS IF TERMINAL SENDS OUT XON-XOFF'S

TERMNL:	OVEWTB	;ADDRESS OF THE TERMINAL TABLE TO USE

;TERMINAL OUTPUT TABLE - SEQUENCES TO MAKE THE TERMINAL DO SPECIAL THINGS
;FILL IN WITH THE CODES FOR YOUR TERMINAL

OVEWTB:	BYTE (7) "Z"-100	;CURSOR UP
	BYTE (7) "J"-100	; DOWN
	BYTE (7) "F"-100	; RIGHT
	BYTE (7) "U"-100	; LEFT
	BYTE (7) 33,"Y"," "," "	; HOME
	BYTE (7) 33,"k"		;CLEAR TO END OF PAGE
	BYTE (7) 33,"K"		;CLEAR TO END OF LINE
	BYTE (7) 12		;ROLL UP AND CLEAR LINE
	BYTE (7) 0		;ROLL DOWN AND CLEAR LINE
	BYTE (7) "N"-100	;PROTECT ON (0 IF NONE)
	BYTE (7) "O"-100	;PROTECT OFF (0 IF NONE)
	BYTE (7) 0		;INSERT LINE (0 IF NONE)
	BYTE (7) 0		;INSERT SPACE (0 IF NONE)
	BYTE (7) 0		;DELETE LINE (0 IF NONE)
	BYTE (7) 0		;DELETE SPACE (0 IF NONE)
	BYTE (7) 1		;MOVE TO BOTTOM
	BYTE (7) 1,14		;HOME AND CLEAR ENTIRE PAGE
	POSCUR			;ROUTINE TO POSITION TO CHARACTER
	POSLIN			;ROUTINE TO POSITION TO START OF LINE
	^D24			;LINES PER PAGE
	^D80			;CHARACTERS PER LINE
IFE FTFAST,<
	SLW!WRP			;TERMINAL-DEPENDENT FLAGS
>
IFN FTFAST,<
	SLW!WRP!NPG		;TERMINAL-DEPENDENT FLAGS (KEEP TTY PAGE)
>
	VENVEW			;ROUTINE TO CALL ON ENTRY
	CPOPJ			;ROUTINE TO CALL ON EXIT
	0,,0			;NUMBER OF NULLS TO OUTPUT,,NULL CHARACTER
	IVEWTB			;ADDRESS OF INPUT CHARACTER TABLE
	0			;MARK TO DISPLAY ON ENTER (OMIT IF MRK NOT SET)

;TERMINAL INPUT TABLE - TELLS WHAT CONTROL CHARACTERS OR SEQUENCES
;INVOKE WHICH COMMANDS

IFE FTFAST,<
	EXP	$RESET				;RUBOUT
IVEWTB:	EXP		$RECAL, $CURHM		;   0, A
	EXP	-SIZ.CB,,SUBCB			;B (NEEDS A SUBTABLE)
	EXP	$ABORT, $INSLN, $SRCBK, $CURRT	;C, D, E, F
	EXP	$PUT,   $DELCH, $TAB,   $CURDN	;G, H, I, J
	EXP	$TAB,   $BKTAB, $RETRN, $SWTCH	;K, L, M, N
	EXP	$ENTCC, $GOTO,  $RLBKP, $SRCFW	;O, P, Q, R
	EXP	$DELSP, $RLFWL, $CURLF, $PICK	;S, T, U, V
	EXP	$RLBKL, $EXEC,  $RLFWP, $CURUP	;W, X, Y, Z
	EXP	-SIZ.IS,,ISUBTB			;ESCAPE
	EXP	$MARK,  $CURRT, $PUSH,  $CURHM	;\, ], ^, _
>
IFN FTFAST,<
;THIS TABLE SETS UP THE KEYBOARD ARRANGEMENT FOR WHEN YOU NEED TO KEEP
;TTY PAGE IN EFFECT BECAUSE THE TERMINAL SENDS OUT ITS OWN CONTROL S AND Q'S
;THOSE TWO CHARACTERS CANNOT BE COMMANDS SINCE SED DOES NOT KNOW WHETHER THE
;USER HAS TYPED THEM OR THEY WERE SENT BY THE TERMINAL.

;SO Q GOES TO A, A AND S GO TO K AND L, K TO ESCAPE-L, AND L TO ESCAPE-T

;NOTE: this table has not been altered for the Viewpoint.

	EXP	$RESET				;RUBOUT
IVEWTB:	EXP		$RECAL, $RLBKP, $SETFI	;   0, A, B
	EXP	$ABORT, $INSLN, $SRCBK, $DELLN	;C, D, E, F
	EXP	$PUT,   $DELCH, $TAB,   $ERSLN	;G, H, I, J
	EXP	$INSSP, $DELSP, $RETRN, $SWTCH	;K, L, M, N
	EXP	$ENTCC, $GOTO,  0,	$SRCFW	;O, P, Q, R
	EXP	0,	$RLFWL, $BKTAB, $PICK	;S, T, U, V
	EXP	$RLBKL, $EXEC,  $RLFWP, $EXIT	;W, X, Y, Z
		-SIZ.IS,,ISUBTB			;ESCAPE
	EXP	$CURDN, $CURRT, $CURUP, $CURHM	;\, ], ^, _
>
;SUBTABLE FOR CONTROL-B (NORMAL AND SHIFTED F1, F2, F3)

SUBCB:	$ENTER,,"1"	;CONTROL-B 1 == ENTER
	$DELLN,,"2"	;CONTROL-B 2 == DELETE-LINES
	$BLINE,,"3"	;CONTROL-B 1 == BEGIN-LINE
	$RECAL,,"!"	;CONTROL-B ! == RECALL
	$ERSLN,,""""	;CONTROL-B " == ERASE-LINE
	$ELINE,,"#"	;CONTROL-B 1 == END-LINE
SIZ.CB==.-SUBCB

;SUBTABLE. PUT THE MOST FREQUENTLY-USED SEQUENCES FIRST
;ENTER IS PROBABLY THE MOST COMMON OF ALL

ISUBTB:	$SETFI,,"F" 	;ESCAPE F == SET-FILE
	$SAVE ,,"S" 	;ESCAPE S == SAVE-FILE
	$EXIT ,,"E" 	;ESCAPE E == EXIT
	$WINDW,,"W" 	;ESCAPE W == WINDOW
	$REWRT,,"X" 	;ESCAPE X == REWRITE
	$CASE ,,"C" 	;ESCAPE C == CASE
	$HELP ,,"H" 	;ESCAPE H == HELP
	$INSSP,,"I" 	;ESCAPE I == INSERT-SPACES
	$INMOD,,"M" 	;ESCAPE M == INSERT-MODE
	$SLDLF,,"L" 	;ESCAPE L == SLIDE-LEFT
	$SLDRT,,"R" 	;ESCAPE R == SLIDE-RIGHT
	$RLFWP,,"P" 	;ESCAPE P == ROLL-FORWARD-PAGES
	$RLTAB,,"T" 	;ESCAPE T == REAL-TAB
	$ENTER,,33 	;ESCAPE ESCAPE == ENTER

	$SETFI,,"f" 	;ESCAPE f == SET-FILE
	$SAVE ,,"s" 	;ESCAPE s == SAVE-FILE
	$EXIT ,,"e" 	;ESCAPE e == EXIT
	$WINDW,,"w" 	;ESCAPE w == WINDOW
	$REWRT,,"x" 	;ESCAPE x == REWRITE
	$CASE ,,"c" 	;ESCAPE c == CASE
	$HELP ,,"h" 	;ESCAPE h == HELP
	$INSSP,,"i" 	;ESCAPE i == INSERT-SPACES
	$INMOD,,"m" 	;ESCAPE m == INSERT-MODE
	$SLDLF,,"l" 	;ESCAPE l == SLIDE-LEFT
	$SLDRT,,"r" 	;ESCAPE r == SLIDE-RIGHT
	$RLFWP,,"p" 	;ESCAPE p == ROLL-FORWARD-PAGES
	$RLTAB,,"t" 	;ESCAPE t == REAL-TAB
IFN FTFAST,<
			;IF TTY PAGE IS IN EFFECT,
			;DEFINE SEQUENCES FOR
			;<SLIDE-LEFT> AND <SLIDE-RIGHT> HERE
>
SIZ.IS=.-ISUBTB

;PUT THE CURSOR POSITIONING ROUTINES HERE (SEE SED.POS FOR SAMPLES)
;ALSO PUT ENTRY AND EXIT ROUTINES HERE

COMMENT \
;NOTE:	THE FOLLOWING CODE, UNDER TOPS-10 7.01, WILL READ THE TERMINAL TYPE,
;	IN SIXBIT, INTO T1. THE TYPE IS COMPARED WITH A LIST OF KNOWN TYPES
;	AND THE ADDRESS OF THE RIGHT TERMINAL OUTPUT TABLE IS SET UP:

IFN TOPS10,<
	...
	MOVE	T1,[2,,TRMBLK]	;READ SIXBIT TERMINAL TYPE INTO T1
	TRMOP.	T1,
	  JFCL
	MOVEI	T2,TTBLEN	;FIND THIS TYPE IN THE TERMINAL TABLE
	CAME	T1,TNMTBL(T2)
	SOJGE	T2,.-1
	JUMPL	T2,TRMERR	;NOT FOUND - ERROR (note: no error routine)
	HRR	TM,TADTBL(T2)	;FOUND - GET ADDRESS OF OUTPUT TABLE
	...

TNMTBL:	SIXBIT	/VT52/
	SIXBIT	/VT100/
	SIXBIT	/ADM3A/
TTBLEN=.-TNMTBL-1

TADTBL:	OVT52
	OVT100
	OADB3A

TRMBLK:	1041
	-1
>
IFE TOPS10,<
;THE TERMINAL TYPE CAN BE READ UNDER TOPS20 LIKE THIS:

TENTRY:	MOVEI	T1,.PRIIN	;READ TERMINAL TYPE
	GTTYP
>
;(END OF EXAMPLE CODE)
\
;VIEWPOINT SUBROUTINE TO EXECUTE ON ENTRY

VENVEW:	MOVE	T1,[BYTE (7) 33,"0","P",0]
	PUSHJ	P,PUTSQ1
	JRST	PUTTYP		;OUTPUT IT AND RETURN

;VIEWPOINT SUBROUTINE TO MOVE TO ROW, COLUMN [RW, CM]

POSCUR:	MOVE	T1,[BYTE (7) 33,"Y",0]
	PUSHJ	P,PUTSQ1
	MOVEI	T1," "(RW)
	IDPB	T1,TY
	MOVEI	T1," "(CM)
	IDPB	T1,TY
	POPJ	P,

;VIEWPOINT SUBROUTINE TO MOVE TO THE START OF ROW (T4)

POSLIN:	MOVE	T1,[BYTE (7) 33,"Y",0]
	PUSHJ	P,PUTSQ1
	MOVEI	T1," "(T4)
	IDPB	T1,TY
	MOVEI	T1," "
	IDPB	T1,TY
	POPJ	P,

	END