Trailing-Edge
-
PDP-10 Archives
-
steco_19840320_1er_E35
-
10,5676/teco/newsrc/tecray.mac
There are 3 other files named tecray.mac in the archive. Click here to see a list.
SUBTTL Introduction
; Copyright (c) 1980 Stevens Institute of Technology, Hoboken, New Jersey
; 07030.
; This software may be used and copied provided that this copyright notice
;is included, and provided that copies of all modifications are sent to:
;
; TECO Project
; Computer Center
; Stevens Institute of Technology
; Castle Point Station
; Hoboken, New Jersey 07030
;
;
; The information in this software is subject to change without notice
; and should not be construed as a commitment by Stevens Institute of
; Technology.
; Search needed universals
SEARCH TECUNV ; TECO universal file
; Generate the prologue
TECVER==200 ; Major version number
TECMIN==1 ; Minor version number
TECEDT==1126 ; Edit level
TECWHO==0 ; Last editor
PROLOGUE(RAY,<TECO TELERAY terminal support>) ; Generate the TITLE and other stuff
$CODE ; Put into code PSECT
SUBTTL Table of Contents
;+
;.pag.lit
; Table of Contents for TECRAY - TELERAY terminal support
;
;
; Section Page
; 1. Introduction . . . . . . . . . . . . . . . . . . . . . 1
; 2. Table of Contents. . . . . . . . . . . . . . . . . . . 2
; 3. Revision History . . . . . . . . . . . . . . . . . . . 3
; 4. Tables
; 4.1. Teleray-10/1061 . . . . . . . . . . . . . . . 5
; 5. Support routines
; 5.1. Teleray-10/1061
; 5.1.1. Initialization routine . . . . . . . 6
; 5.1.2. XY positioning . . . . . . . . . . . 7
; 5.1.3. Control U. . . . . . . . . . . . . . 8
; 5.1.4. Delete a line feed . . . . . . . . . 9
; 5.1.5. Insert character . . . . . . . . . . 10
; 5.1.6. Delete N lines . . . . . . . . . . . 11
; 5.1.7. Insert N lines . . . . . . . . . . . 12
; 5.1.8. Delete a character . . . . . . . . . 13
; 5.1.9. Cost initialization routine. . . . . 14
; 5.1.10. Move cost calculation. . . . . . . . 15
; 5.1.11. Delete to end of line. . . . . . . . 16
; 6. Low segment. . . . . . . . . . . . . . . . . . . . . . 17
; 7. End of TECRAY. . . . . . . . . . . . . . . . . . . . . 18
;.end lit.pag
;-
SUBTTL Revision History
COMMENT |
1000 Start of this version
Start of Version 200A(1126)
|
; Macro to define a word of five characters
DEFINE TB(A<.CHNUL>,B<.CHNUL>,C<.CHNUL>,D<.CHNUL>,E<.CHNUL>)
< BYTE (7)A,B,C,D,E>
SUBTTL Tables -- Teleray-10/1061
CRTINI VTR10
CRTENT INT,<PUSHJ P,T10INT> ; Initialize the Teleray handling
CRTENT WID,^D79 ; Number characters wide
CRTENT LIN,^D24 ; Number of lines long
CRTENT BCK,<TB(.CHCNH)>
CRTENT SPC,<TB(.CHESC,"C")> ; Move one space
CRTENT DBS,<TB(" ",.CHCNH)> ; Destructive backspace
CRTENT DLF,<PUSHJ P,T10DLF> ; Routine to delete a line feed
CRTENT CRB,<TB(.CHCNH)> ; Cancel a rubout
CRTENT ERS,<TB(.CHESC,"j")> ; Erase the screen
CRTENT DEL,<PUSHJ P,T10DEL> ; Delete to end of line
CRTENT DSP,<TB(" ")> ; Destructive space
CRTENT DCH,<PUSHJ P,T10DCH> ; Routine to delete a character
CRTENT ICH,<PUSHJ P,T10ICH> ; Routine to insert a character
CRTENT DLL,<PUSHJ P,T10DLL> ; Routine to delete n lines
CRTENT INL,<PUSHJ P,T10INL> ; Routine to insert n lines
CRTENT CTU,<PUSHJ P,T10CTU> ; Handle Control U
CRTENT XYP,<PUSHJ P,T10XY> ; Do XY positioning
CRTENT CIN,<MOVX T1,<INSVL.(0,CS$DEP)>!<INSVL.($OPACH,CS$OPR)>> ; Initial cost
CRTENT CIC,<MOVX T1,<INSVL.(CS$INS,CS$CST)>!<INSVL.($OPICH,CS$OPR)>> ; Cost to insert a character
CRTENT CDC,<MOVX T1,<INSVL.(CS$DEL,CS$CST)>!<INSVL.($OPDCH,CS$OPR)>> ; Cost to delete a character
CRTENT CRP,<MOVX T1,<INSVL.(CS$REP,CS$CST)>!<INSVL.($OPRCH,CS$OPR)>> ; Cost to replace a character
CRTENT CIL,<MOVX T1,<INSVL.(CS$ILL,CS$CST)>!<INSVL.($OPICH,CS$OPR)>> ; Cost to insert a line
CRTENT CDL,<MOVX T1,<INSVL.(CS$DLL,CS$CST)>!<INSVL.($OPDCH,CS$OPR)>> ; Cost to delete a line
CRTENT CPP,<PUSHJ P,T10CPP> ; Cost to move from point A to B
CRTENT CDE,<MOVEI T1,2> ; Cost to delete to end of line
CRTEND
SUBTTL Support routines -- Teleray-10/1061 -- Initialization routine
;+
;.HL1 T10INT
;This routine will initialize the terminal handling routines for the
;specific terminal. It will also initialize the Teleray-10/1061 terminal
;.literal
;
; Usage:
; MOVEI CRT,CRT.block.address
; XCT $CRINT(CRT)
; (Return)
;
;.end literal
;-
T10INT: PUSHJ P,SETCRT ; Make sure CRT is set up
MOVX T2,.TONFC ; Get the CRLF flag setting
MOVE T3,TRMUDX ; Get the terminals UDX
MOVX T1,<XWD 2,T2> ; Get the pointer
TRMOP. T1, ; And see how the terminal is set
SETO T1, ; Assume monitor is doing CRLF's
TXZ CRT,CR$WAP ; . . .
TXNN T1,1 ; Is CRLF on?
TXO CRT,CR$WAP ; Yes, flag terminal is doing the wraparound
MOVEM CRT,CRTTYP ; Store the type back
MOVX T1,<BYTE (7).CHESC,"h"> ; Set a protocal enable
PJRST SC$STR ; String to the terminal
SUBTTL Support routines -- Teleray-10/1061 -- XY positioning
;+
;.HL T10XY
;This routine will do the positioning for the Teleray-10/1061 terminal.
;.literal
;
; Usage:
; MOVE X,X.postion
; MOVE Y,Y.postion
; MOVE CRT,CRT.block.index
; PUSHJ P,@$CRXYP(CRT)
; (Return)
;
;.end literal
;-
T10XY: DMOVE T1,CURPOS ; Get the current position
DMOVEM X,CURPOS ; Save the current position
SUB T1+$OFSX,X ; Determine if it is an up/down/right/left by one
SUB T1+$OFSY,Y ; movement
SKIPE T1+$OFSX ; Is the X zero ?
SKIPN T1+$OFSY ; Or the Y ?
SKIPA ; Yes - Handle differently
JRST T10XYA ; No - Handle normally
SKIPN T1+$OFSY ; No change in the Y offset ?
JUMPE X,T10XYC ; Yes - Only need a CR
MOVM T3,T1+$OFSX ; Get the X offset
SOJE T3,T10XYX ; Just X by one
MOVM T3,T1+$OFSY ; Get the Y offset
SOJE T3,T10XYY ; Just the Y by one
T10XYA: SKIPN X ; Is this non-zero ?
JUMPE Y,T10XYH ; Just home it
ADDX X," " ; Convert to a position
ADDX Y," " ; Convert to a position
MOVEI T1,[$STRING(<_[Y^8/Y/^8/X/>)]
PJRST SC$STR ; Output the string
; Here to just home the cursor
T10XYH: MOVX T1,<BYTE (7).CHESC,"H"> ; Get the home string
PJRST SC$STR ; Send it
; Here to just output a CR
T10XYC: $SAVE <CH> ; Save the current character
MOVX CH,.CHCRT ; Just output a CR
PJRST SC$IMG ; . . .
; Here to move in the X direction by one
T10XYX: SKIPG T1+$OFSX ; Is this negative ?
SKIPA T1,[BYTE (7).CHESC,"C"] ; No - To the right
MOVX T1,<BYTE (7).CHCNH> ; Yes, To the left
PJRST SC$STR ; Output the string
; Here to move in the Y direction by one
T10XYY: SKIPL T1+$OFSY ; Is this negative ?
SKIPA T1,[BYTE (7).CHESC,"A"] ; No - Move up
MOVX T1,<BYTE (7).CHLFD> ; Yes - Move down
PJRST SC$STR ; Output the string
SUBTTL Support routines -- Teleray-10/1061 -- Control U
;+
;.HL1 T10CTU
;This routine will process the control U in the command parser. It
;may be called without CRT being set up.
;.literal
;
; Usage:
; MOVE CRT,CRT.block.address
; PUSHJ P,@$CRCTU(CRT)
; (Return)
;
;.end literal
;-
T10CTU: MOVX T1,<BYTE (7).CHCRT,.CHESC,"K">
PUSHJ P,SC$STR ; Output the string to the terminal
MOVX CH,.CHCRT ; Get the ending character
PJRST T$OCHR ; Output the character
SUBTTL Support routines -- Teleray-10/1061 -- Delete a line feed
;+
;.HL1 T10DLF
;This routine will send the character string to delete a line feed.
;.literal
;
; Usage:
; MOVE CRT,CRT.block.address
; PUSHJ P,@$CRDLF(CRT)
; (Return)
;.end literal
;-
T10DLF: MOVX T1,<BYTE (7).CHESC,"A"> ; Get the string
PJRST SC$STR ; Output the string
SUBTTL Support routines -- Teleray-10/1061 -- Insert character
;+
;.HL1 T10ICH
;This routine will cause a character to be inserted. It is called
;with the character. It is assumed that the positioning has been done
;before this routine is called.
;.literal
;
; Usage:
; MOVX CH,Character
; MOVEI CRT,CRT.block.address
; XCT $CRICH(CRT)
;
;.end literal
;-
T10ICH: PUSH P,CH ; Save the character
MOVX T1,<BYTE (7).CHESC,"P"> ; Get the string to send
PUSHJ P,SC$STR ; Send it
POP P,CH ; Restore the string
PJRST SC$CHR ; Output the character
SUBTTL Support routines -- Teleray-10/1061 -- Delete N lines
;+
;.HL1 T10DLL
;This routine will cause N lines to be deleted from the screen. It is
;called with a repeat count.
;.literal
;
; Usage:
; MOVEI T1,Repeat.count
; MOVEI CRT,CRT.block.address
; XCT $CRDLL(CRT)
; (Return)
;
;.end literal
;-
T10DLL: $SAVE <P1> ; Save a register
MOVE P1,T1 ; Copy the repeat count
T10DL0: MOVX T1,<BYTE (7).CHESC,"M"> ; Get the string to send
PUSHJ P,SC$STR ; Output the string
SOJG P1,T10DL0 ; Loop for all lines
POPJ P, ; Return to the caller
SUBTTL Support routines -- Teleray-10/1061 -- Insert N lines
;+
;.HL1 T10INL
;This routine will cause N lines to be inserted on the screen. It is
;called with a repeat count.
;.literal
;
; Usage:
; MOVEI T1,Repeat.count
; MOVEI CRT,CRT.block.address
; XCT $CRINL(CRT)
; (Return)
;
;.end literal
;-
T10INL: $SAVE <P1> ; Save a register
MOVE P1,T1 ; Copy the repeat count into the register
T10IN0: MOVX T1,<BYTE (7).CHESC,"L"> ; Get the string for insert line
PUSHJ P,SC$STR ; Output the string
SOJG P1,T10IN0 ; Loop
POPJ P, ; Return
SUBTTL Support routines -- Teleray-10/1061 -- Delete a character
;+
;.HL1 T10DCH
;This routine will cause n characters to be deleted from the screen.
;It is assumed that all cursor positioning has been done before this
;routine is called.
;.literal
;
; Usage:
; MOVX T1,Number.of.character.to.delete
; MOVEI CRT,CRT.block.address
; XCT $CRDCH(CRT)
; (Return)
;
;.end literal
;-
T10DCH: $SAVE <P1> ; Save a register
MOVE P1,T1 ; Copy the counter
T10DC0: MOVX T1,<BYTE (7).CHESC,"Q"> ; Get the string
PUSHJ P,SC$STR ; Send the string
SOJG P1,T10DC0 ; Loop for the number of characters
POPJ P, ; Return to the caller
SUBTTL Support routines -- Teleray-10/1061 -- Cost initialization routine
;+
;.hl 1 T10CIN
; This routine will return the initial cost word for the character
;by character comparison of a line.
;.b.lit
;
; Usage:
; MOVE CRT,CRTTYP
; XCT $CRCIN(CRT)
; (return, first array element in T1)
;
;.end literal
;-
; Cost parameters
CS$INS==3 ; Insert a character
CS$DEL==2 ; Delete a character
CS$REP==1 ; Replace cost
CS$DLL==2 ; Delete a line
CS$ILL==2 ; Insert a line
SUBTTL Support routines -- Teleray-10/1061 -- Move cost calculation
;+
;.hl 1 T10CPP
; This routine will return the cost of moving the cursor from
;one point to another.
;.b.lit
;
; Usage:
; MOVE T1,[XWD X pos,Y pos] ; Source position
; MOVE T2,[XWD X pos,Y pos]
; MOVE CRT,CRTTYP
; XCT $CRCPP(CRT)
; (return, T1= cost in characters)
;
;.end literal
;-
T10CPP: MOVE T3,T2 ; Get a copy of where we are moving to
XOR T3,T1 ; Xor together
JUMPE T3,.RET0 ; Zero if no movement
TXNN T3,LH.ALF ; Same X position line ?
JRST T10CPY ; Yes - Check more
TXNN T3,RH.ALF ; Same Y position ?
JRST T10CPX ; Yes - Check more
JUMPE T2,.RET2 ; If moving home return cost of two
T10CPA: MOVX T1,4 ; Have to type four characters
POPJ P, ; Return
; Here if possible same column movement
T10CPY: MOVEI T2,(T2) ; Get just the Y position
SUBI T2,(T1) ; Determine if just one line movement
MOVM T1,T2 ; . . .
SOJG T1,T10CPA ; More than one - use four
JUMPL T2,.RET2 ; If less than zero return two
JRST .RET1 ; Else return one
; Here if possible same line movement
T10CPX: HLRZ T2,T2 ; Get just the X position
JUMPE T2,.RET1 ; If moving to the beginning of the line
; then return one
HLRZ T1,T1 ; See if moving only one position
SUBI T1,T2 ; . . .
MOVM T2,T1 ; Get the magntude
SOJG T2,T10CPA ; If more than one - return four
JUMPL T1,.RET1 ; If backing up then only one
JRST .RET2 ; Else return two
SUBTTL Support routines -- Teleray-10/1061 -- Delete to end of line
;+
;.hl1 T10DEL
;.literal
;
; Usage:
; MOVEI T1,#of characters to delete
; XCT $CRDEL(CRT)
;
;.end literal
;-
T10DEL: MOVX T1,<BYTE (7) .CHESC,"K">
PJRST SC$STR ; Type out the string
SUBTTL Low segment
$IMPURE ; Put in correct place
RAYBEG:!
LOWVER(RAY,<.-RAYBEG>); Define the version number
SUBTTL End of TECRAY
END ; End of TECRAY