Google
 

Trailing-Edge - PDP-10 Archives - BB-M836A-BM - tools/sed/sed2.mac
There are 2 other files named sed2.mac in the archive. Click here to see a list.
TITLE	SED2 - EDITOR TERMINAL DEFINITIONS FOR THE VT52 AND ADM2
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 SED2,SED

	SEARCH	SEDSYM
IFE TOPS10,<SEARCH MONSYM>

	EXTERN	CPOPJ,PUTTYP,PUTSQ1,TRMNAM
	INTERN	TERMNL

TERMNL:	OVT52	;ADDRESS OF THE TERMINAL TABLE TO USE
	OADM2

;TERMINAL TABLES FOR THE VT52

OVT52:	BYTE (7) 33,"A"		;CURSOR UP
	BYTE (7) 33,"B"		; DOWN
	BYTE (7) 33,"C"		; RIGHT
	BYTE (7) 10		; LEFT
	BYTE (7) 33,"H"		; HOME
	BYTE (7) 33,"J"		;CLEAR TO END OF PAGE
	BYTE (7) 33,"K"		;CLEAR TO END OF LINE
	BYTE (7) 12		;ROLL UP AND CLEAR LINE
	BYTE (7) 33,"I"		;ROLL DOWN AND CLEAR LINE
	CPOPJ			;PROTECT ON (NONE)
	CPOPJ			;PROTECT OFF
	0			;INSERT LINE (NONE)
	0			;INSERT SPACE (NONE)
	0			;DELETE LINE (NONE)
	0			;DELETE SPACE (NONE)
	BYTE (7) 33,"Y","7"," " ;MOVE TO BOTTOM
	BYTE (7) 33,"H",33,"J"	;HOME AND CLEAR PAGE
	VT5PSC			;ROUTINE TO POSITION TO CHARACTER
	VT5PSL			;ROUTINE TO POSITION TO START OF LINE
	^D24			;LINES PER PAGE
	^D80			;CHARACTERS PER LINE
;	MRK!TBS			;FLAGS (NO PROTECT, HARD TABS)
	MRK!TBS!SLW		;FLAGS (NO PROTECT, HARD TABS)
	WHATER			;ROUTINE TO CALL ON ENTRY
	TEXIT			;ROUTINE TO CALL ON EXIT
	0			;NO NULLS NEEDED
	IVT52			;ADDRESS OF INPUT CHARACTER TABLE
	"~"			;MARK TO DISPLAY ON ENTER

		 0			;COMMAND FOR RUBOUT (RESET)
IVT52:	EXP	40, 1, 2, 3, 4, 5, 6, 7 ;NOTHING SPECIAL
	EXP	42,11,50,13,14,15,16,17
	EXP	20,21,22,23,24,25,26,27
	EXP	30,31,32
	-12,,I.VT52	;ESCAPE NEEDS A SUBTABLE
	EXP		 34,35,36,37

I.VT52:	36,,"A"		;ESCAPE A == UP
	34,,"B"		;ESCAPE B == DOWN
	35,,"C"		;ESCAPE C == RIGHT
	10,,"D"		;ESCAPE D == LEFT
	33,,"P"		;ESCAPE P == ENTER
	37,,"R"		;ESCAPE R == HOME
	40,,"Q"		;ESCAPE Q == RECALL
	IAVT52,,"?"	;ESCAPE ? NEEDS A SUB-SUBTABLE
	47,,"W"		;ESCAPE W == WINDOW (NO KEY)
	47,,"w"		;ESCAPE W == WINDOW (NO KEY)

IAVT52:	41,,"M"         ;ESCAPE ? M = ENT = INSERT-MODE
	42,,"n"		;ESCAPE ? n =  .  = DELETE-CHARACTER
	43,,"p"		;ESCAPE ? p =  0  = REAL TAB
	44,,"w"		;ESCAPE ? w =  7  = MARK
	45,,"x"		;ESCAPE ? x =  8  = LINE
	46,,"y"		;ESCAPE ? y =  9  = CASE
	0

;POSITIONING ALGORITHMS - VT52 AND ADM2

ADMPSC:	SKIPA	T1,[BYTE (7) 33,"="]
VT5PSC:	MOVE	T1,[BYTE (7) 33,"Y"]
	PUSHJ	P,PUTSQ1	;START IT OFF
	MOVEI	T1,40(RW)	;GET ROW POSITION
	IDPB	T1,TY
	MOVEI	T1,40(CM)	;GET COLUMN POSITION
	IDPB	T1,TY
	POPJ	P,		;DONE

ADMPSL:	SKIPA	T1,[BYTE (7) 33,"="]
VT5PSL:	MOVE	T1,[BYTE (7) 33,"Y"]
	PUSHJ	P,PUTSQ1	;START IT OFF
	MOVEI	T1,40(T4)	;GET ROW POSITION
	IDPB	T1,TY
	MOVEI	T1,40		;MOVE TO COLUMN ZERO
	IDPB	T1,TY
	POPJ	P,

;**********************************************************************
;TERMINAL TABLES FOR THE ADM2

OADM2:	BYTE (7) 13		;CURSOR UP
	BYTE (7) 12		; DOWN
	BYTE (7) 14		; RIGHT
	BYTE (7) 10		; LEFT
	BYTE (7) 36		; HOME
	BYTE (7) 33,"Y"		;CLEAR TO END OF PAGE
	BYTE (7) 33,"T"		;CLEAR TO END OF LINE
	BYTE (7) 12		;ROLL UP AND CLEAR LINE
	BYTE (7) 33,"E"		;ROLL DOWN AND CLEAR LINE
	BYTE (7) 33,")"		;PROTECT ON
	BYTE (7) 33,"("		;PROTECT OFF
	BYTE (7) 33,"E"		;INSERT A BLANK LINE
	BYTE (7) 33,"Q"		;INSERT A SPACE
	BYTE (7) 33,"R"		;DELETE LINE
	BYTE (7) 33,"W"		;DELETE SPACE
	BYTE (7) 36,13		;MOVE TO BOTTOM
	BYTE (7) 36,33,"Y"	;HOME AND CLEAR PAGE
	ADMPSC			;ROUTINE TO POSITION TO CHARACTER
	ADMPSL			;ROUTINE TO POSITION TO START OF LINE
	^D24			;LINES PER PAGE
	^D80			;CHARACTERS PER LINE
	WRP!LSD			;FLAGS (WRAPAROUND, LF=DOWN, NO ROLL DOWN)
;	WRP!LSD!NEL!SLW		;FLAGS (WRAPAROUND, LF=DOWN, NO ROLL DOWN)
	CPOPJ			;ROUTINE TO CALL ON ENTRY
	CPOPJ			;ROUTINE TO CALL ON EXIT
	0			;NO NULLS NEEDED
	IADM2			;ADDRESS OF TERMINAL INPUT TABLE

		 0			;COMMAND FOR RUBOUT (RESET)
IADM2:		40
	-14,,IAADM2	;^A NEEDS A SUBTABLE
	EXP	       2, 3, 4, 5, 6, 7
	EXP	10,11,12,36,35,15,16,17 ;^K AND ^L ALTERED
	EXP	20,21,22,23,24,25,26,27
	EXP	30,31,32,33,34,35,37,43 ;36==HOME; 37==REAL-TAB

IAADM2:	IADF16,,"O"	;^A O CR == 16 == ENTER
	IADF01,,"@"	;^A @ CR ==  1 == INSERT-SPACES
	IADF02,,"A"	;^A A CR ==  2 == DELETE-SPACES
	IADF03,,"B"	;^A B CR ==  3 == SLIDE-LEFT
	IADF04,,"C"	;^A C CR ==  4 == SLIDE-RIGHT
	IADF13,,"L"	;^A L CR == 13 == ERASE-CHARACTER
	IADF14,,"M"	;^A M CR == 14 == INSERT MODE
	IADF15,,"N"	;^A N CR == 15 == RECALL
	IADF08,,"G"	;^A G CR ==  8 == REAL TAB
	IADF12,,"K"	;^A K CR == 12 == MARK
	IADF11,,"J"	;^A J CR == 11 == ERASE-LINE
	IADF10,,"I"	;^A I CR == 10 == WINDOW

IADF01:	"A"-100,,0
IADF02:	"S"-100,,0
IADF03:	"K"-100,,0
IADF04:	"L"-100,,0
IADF08:	43,,0
IADF12:	44,,0
IADF13:	42,,0
IADF14:	41,,0
IADF15:	40,,0
IADF16:	33,,0
IADF11:	50,,0
IADF10:	47,,0

;HERE ON ENTRY TO DECIDE WHICH TERMINAL TABLE TO USE
;ASSUME IT'S A VT52 UNLESS IT'S ONE OF A KNOWN SET OF TTY NUMBERS
;(NOW, ONLY TTY 70, 65, AND 63)

WHATER:	SKIPE	T1,TRMNAM	;DID USER GIVE THE TERMINAL NAME?
	JRST	WHATR1		;YES - DO WHAT HE SAYS
	SETO	T1,		;READ TERMINAL NUMBER
	TRMNO.	T1,
	  JFCL
	ANDI	T1,7777		;KEEP ONLY THE RELEVANT DIGITS
	CAIE	T1,7		;IS TERMINAL AN ADM2?
	CAIN	T1,70
	HRR	TM,TERMNL+1	;YES - SET IT UP
	CAIE	T1,65		;IS TERMINAL AN ADM2?
	CAIN	T1,63
	HRR	TM,TERMNL+1	;YES - SET IT UP
	CAIE	T1,45		;IS TERMINAL AN ADM2?
	CAIN	T1,40
	HRR	TM,TERMNL+1	;YES - SET IT UP

;IDEA: MAYBE PRE-SET TABS IF AN ADM2

WHATR2:	HRRZ	T1,TM		;SET FOR A VT52?
	CAIE	T1,OVT52
	POPJ	P,		;NO - RETURN NOW
	MOVE	T1,[BYTE (7) 33,"="] ;YES - SET UP ALTERNATE KEYPAD MODE
	PUSHJ	P,PUTSQ1
	JRST	PUTTYP

WHATR1:	ROT	T1,6		;GET JUST FIRST CHARACTER
	ANDI	T1,77
	SETZ	T2,		;ASSUME NO TERMINAL
	CAIN	T1,'V'		;WANT A VT52?
	MOVE	T2,TERMNL       ;YES - SET UP ADDRESS
	CAIN	T1,'A'		;WANT AN ADM2?
	MOVE	T2,TERMNL+1	;YES - SET UP ADDRESS
	JUMPE	T2,WHATER+2	;IF NO MATCH, GO MAKE THE DECISION
	HRR	TM,T2		;ELSE GET THE RIGHT TABLE
	JRST	WHATR2		;AND FINISH UP

;EXIT ROUTINE - ONLY CALLED IF TERMINAL IS A VT52

TEXIT:	MOVE	T1,[BYTE (7) 33,">"] ;RESTORE UP ALTERNATE KEYPAD MODE
	PUSHJ	P,PUTSQ1
	JRST	PUTTYP

	END