Google
 

Trailing-Edge - PDP-10 Archives - BB-M836B-BM - tools/sed/seddme.mac
There is 1 other file named seddme.mac in the archive. Click here to see a list.
TITLE	SEDDME - DEFINITIONS FOR THE DATAMEDIA ELITE
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,SEDDME,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:	OTABLE	;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

OTABLE:	BYTE (7) 37		;CURSOR UP
	BYTE (7) 12		; DOWN
	BYTE (7) 34		; RIGHT
	BYTE (7) 10		; LEFT
	BYTE (7) 31		; HOME
	BYTE (7) 13		;CLEAR TO END OF PAGE
	BYTE (7) 35		;CLEAR TO END OF LINE
	BYTE (7) 12		;ROLL UP AND CLEAR LINE
	BYTE (7) 0		;ROLL DOWN AND CLEAR LINE
	BYTE (7) 0		;PROTECT ON (0 IF NONE)
	BYTE (7) 0		;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) 36," ","7"	;MOVE TO BOTTOM
	BYTE (7) 14		;HOME AND CLEAR ENTIRE PAGE
	DATCUR			;ROUTINE TO POSITION TO CHARACTER
	DATLIN			;ROUTINE TO POSITION TO START OF LINE
	^D24			;LINES PER PAGE
	^D80			;CHARACTERS PER LINE
IFE FTFAST,<
	SLW!WRP!MRK		;TERMINAL-DEPENDENT FLAGS
>
IFN FTFAST,<
	SLW!WRP!MRK!NPG		;TERMINAL-DEPENDENT FLAGS (KEEP TTY PAGE)
>
	CPOPJ			;ROUTINE TO CALL ON ENTRY
	CPOPJ			;ROUTINE TO CALL ON EXIT
	0,,0			;NUMBER OF NULLS TO OUTPUT,,NULL CHARACTER
	IDATAM			;ADDRESS OF INPUT CHARACTER TABLE
	"*"			;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
IDATAM:	EXP		$RECAL, $RLBKP, $SETFI	;   0, A, B
	EXP	$ABORT, $INSLN, $SRCBK, $DELLN	;C, D, E, F
	EXP	$PUT,   $CURLF, $TAB,   $CURDN	;G, H, I, J
	EXP	$SLDLF, $SLDRT, $RETRN, $SWTCH	;K, L, M, N
	EXP	$ENTCC, $GOTO,  $RLBKP, $SRCFW	;O, P, Q, R
	EXP	$DELSP, $RLFWL, $BKTAB, $PICK	;S, T, U, V
	EXP	$RLBKL, $EXEC,  $CURHM, $EXIT	;W, X, Y, Z
	EXP	-SIZ.IS,,ISUBTB			;ESCAPE
	EXP	$CURRT, $ENTER, $CURHM, $DELCH	;\, ], ^, _
>
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 Datamedia.

	EXP	$RESET				;RUBOUT
IDATAM:	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. 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
	$RECAL,,"?" 	;ESCAPE ? == RECALL
	$ENTER,,33 	;ESCAPE ESCAPE == ENTER
	$PUSH ,,"^" 	;ESCAPE ^ == PUSH
	$MARK ,,"\" 	;ESCAPE \ == MARK

	$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)
\
;DATAMEDIA SUBROUTINE TO MOVE TO ROW, COLUMN [RW, CM]

DATCUR:	MOVEI	T1,36
	IDPB	T1,TY
	MOVEI	T1," "(CM)
	IDPB	T1,TY
	MOVEI	T1," "(RW)
	IDPB	T1,TY
	POPJ	P,

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

DATLIN:	MOVEI	T1,36
	IDPB	T1,TY
	MOVEI	T1," "
	IDPB	T1,TY
	MOVEI	T1," "(T4)
	IDPB	T1,TY
	POPJ	P,

	END