Google
 

Trailing-Edge - PDP-10 Archives - BB-M836B-BM - tools/sed/sedh15.mac
There are 2 other files named sedh15.mac in the archive. Click here to see a list.
TITLE   SEDH15 - EDITOR TERMINAL DEFINITIONS FOR THE HAZELTINE 1500
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: .COMP SED,SEDH15
;                    .LOAD/RE SEDH15,SED
;                    .SS SED

;EVERYTHING IS USUAL, EXCEPT:
;  ENTER        - ESCAPE ESCAPE
;  CURSOR-UP    - ESCAPE U (OR u)
;  CURSOR-DOWN  - ESCAPE D (OR d)
;  CURSOR-RIGHT - CONTROL-P
;  CURSOR-LEFT  - CONTROL-H
;  CURSOR-HOME  - ESCAPE H (OR h)
;  PERCENT-GOTO - ESCAPE P

        SEARCH  SEDSYM
IFE TOPS10,<SEARCH MONSYM>

        EXTERN  CPOPJ,PUTTYP,PUTSTG,PUTSQ1,PUTNUM,TRMNAM
        INTERN  TERMNL

FTFAST==0	;SET THIS IS 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) "~",14		;CURSOR UP
	BYTE (7) "~",13		; DOWN
	BYTE (7) 20		; RIGHT
	BYTE (7) 10		; LEFT
	BYTE (7) "~",22		; HOME
	BYTE (7) "~",30		;CLEAR TO END OF PAGE
	BYTE (7) "~",17		;CLEAR TO END OF LINE
	BYTE (7) 12		;ROLL UP AND CLEAR LINE
	BYTE (7) "~",32		;ROLL DOWN AND CLEAR LINE
	BYTE (7) "~",37		;PROTECT ON (CPOPJ IF NONE)
	BYTE (7) "~",31		;PROTECT OFF (CPOPJ IF NONE)
	BYTE (7) "~",32		;INSERT LINE (0 IF NONE)
	BYTE (7) 0		;INSERT SPACE (0 IF NONE)
	BYTE (7) "~",23		;DELETE LINE (0 IF NONE)
	BYTE (7) 0		;DELETE SPACE (0 IF NONE)
	BYTE (7) "~",21,140,27	;MOVE TO BOTTOM
	BYTE (7) "~",34		;HOME AND CLEAR 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,<
	WRP			;TERMINAL-DEPENDENT FLAGS (WRAPAROUND)
>
IFN FTFAST,<
	NPG!WRP			;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
	ITABLE			;ADDRESS OF INPUT CHARACTER TABLE

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

IFE FTFAST,<
                0                       ;COMMAND FOR RUBOUT (0==RESET)
ITABLE:	EXP	40, 1, 2, 3, 4, 5, 6, 7 ;NOTHING SPECIAL
	EXP	10,11,12,13,14,15,16,17
	EXP	35,21,22,23,24,25,26,27
	EXP	30,31,32
	-SIZ.IS,,ISUBTB			;ESCAPE NEEDS A SUBTABLE
	EXP		 34,35,36,37
>
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 B AND N, B TO ESCAPE-F, AND N TO ESCAPE-S.

                 0                      ;COMMAND FOR RUBOUT (RESET)
ITABLE:	EXP	40,21, 1, 3, 4, 5, 6, 7 ;NOTHING SPECIAL
	EXP	10,11,12,13,14,15,23,17
	EXP	35, 0,22, 0,24,25,26,27
	EXP	30,31,32
	-SIZ.IS,,ISUBTB
	EXP		 34,35,36,37
>
;SUBTABLE. PUT THE MOST FREQUENTLY-USED SEQUENCES FIRST
;ENTER IS PROBABLY THE MOST COMMON OF ALL

ISUBTB:	33,,33		;ESC ESC  == ENTER
	37,,"H"		;ESCAPE H == HOME
	37,,"h"		;ESCAPE h == HOME
	36,,"U"		;ESCAPE U == UP
	36,,"u"		;ESCAPE u == UP
	34,,"D"	 	;ESCAPE D == DOWN
	34,,"d"	 	;ESCAPE d == DOWN
	35,,"P" 	;ESCAPE P == PERCENT-GOTO
IFN FTFAST,<
	02,,"F"		;ESCAPE F == SET-FILE
	16,,"S"		;ESCAPE S == SWITCH
>
SIZ.IS=.-ISUBTB

;CURSOR POSITIONING ROUTINES
;MOVE TO ROW (RW), COLUMN (CM)

POSCUR:	MOVE	T1,[BYTE (7) 176,21]
	PUSHJ	P,PUTSQ1	;START IT OFF
	SKIPN	T1,CM		;GET COLUMN POSITION - ZERO?
	ADDI	T1,^D96		;YES - SEND ALTERNATE CODE
	IDPB	T1,TY
	SKIPN	T1,RW		;GET ROW POSITION - ZERO?
	ADDI	T1,^D96		;YES - USE ALTERNATE CODE
	IDPB	T1,TY
	POPJ	P,		;DONE

;MOVE TO START OF LINE (T4)

POSLIN:	MOVE	T1,[BYTE (7) 176,21]
	PUSHJ	P,PUTSQ1	;START IT OFF
	MOVEI	T1,^D96		;SET TO COLUMN ZERO
	IDPB	T1,TY
	SKIPN	T1,T4		;GET ROW POSITION - ZERO?
	ADDI	T1,^D96		;YES - USE ALTERNATE CODE
	IDPB	T1,TY
	POPJ	P,		;DONE

        END