Trailing-Edge
-
PDP-10 Archives
-
steco_19840320_1er_E35
-
10,5676/teco/newsrc/tecact.mac
There are 3 other files named tecact.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(ACT,<TECO ACT terminal support>) ; Generate the TITLE and other stuff
$CODE ; Put into code PSECT
SUBTTL Table of Contents
;+
;.pag.lit
; Table of Contents for TECACT - ACT terminal support
;
;
; Section Page
; 1. Introduction . . . . . . . . . . . . . . . . . . . . . 1
; 2. Table of Contents. . . . . . . . . . . . . . . . . . . 2
; 3. Revision History . . . . . . . . . . . . . . . . . . . 3
; 4. Tables
; 4.1. ACT-IV. . . . . . . . . . . . . . . . . . . . 5
; 4.2. ACT-V . . . . . . . . . . . . . . . . . . . . 5
; 5. Support routines
; 5.1. ACT-4
; 5.1.1. Control U. . . . . . . . . . . . . . 6
; 5.2. ACT-5
; 5.2.1. Control U. . . . . . . . . . . . . . 7
; 5.3. ACT4
; 5.3.1. Delete a line feed . . . . . . . . . 8
; 5.3.2. Delete a vertical tab. . . . . . . . 9
; 5.3.3. Delete a form feed . . . . . . . . . 10
; 6. Low segment. . . . . . . . . . . . . . . . . . . . . . 11
; 7. End of TECACT. . . . . . . . . . . . . . . . . . . . . 12
;.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 -- ACT-IV
SUBTTL Tables -- ACT-V
VACT5TBL::
CRTINI VACT4
CRTENT LIN,^D24 ; Number of lines
CRTENT WID,^D79 ; Width of screen
CRTENT ERS,<BYTE(7).CHFFD> ; Clear screen and home cursor
CRTENT DEL,<PUSHJ P,AC4DEL> ; Delete to end of line
CRTENT CPP,<PUSHJ P,AC4CPP> ; Cost to position
CRTENT XYP,<PUSHJ P,AC4XY> ; Position cursor
CRTENT BCK,<TB(.CHCNH)>
CRTENT SPC,<TB(" ")>
CRTENT DBS,<TB(" ",.CHCNH)>
CRTENT DLF,<PUSHJ P,AC4DLF>
CRTENT DVT,<PUSHJ P,AC4DVT>
CRTENT DFF,<PUSHJ P,AC4DFF>
CRTENT CRB,<TB(.CHCNH)>
CRTENT CTU,<PUSHJ P,AC4CTU>
CRTEND
; Define flags for the ACT-5
VACT5FLG==:VACT4FLG
SUBTTL Support routines -- ACT-4 -- Control U
;+
;.HL1 AC4CTU
;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
;-
AC4CTU: MOVX T1,<BYTE (7).CHCRT,.CHCCF> ; Get the string
PUSHJ P,SC$STR ; Output the string
MOVX CH,.CHCRT ; Get the ending character
PJRST T$OCHR ; Output it
SUBTTL Support routines -- ACT-5 -- Control U
;+
;.HL1 AC5CTU
;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
;-
AC5CTU==AC4CTU ; Same as the other one
SUBTTL Support routines -- ACT4 -- Delete a line feed
;+
;.HL1 AC4DLF
;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
;-
AC4DLF: MOVX T1,<BYTE(7).CHCNZ> ; Get the character
PJRST SC$STR ; Output the string
SUBTTL Support routines -- ACT4 -- Delete a vertical tab
;+
;.HL1 AC4DVT
;This routine will send the character string to delete a vertical tab.
;.literal
;
; Usage:
; MOVE CRT,CRT.block.address
; PUSHJ P,@$CRDVT(CRT)
; (Return)
;
;.end literal
;-
AC4DVT: MOVX T1,4 ; Get the repeat count
AC4D.0: MOVX CH,.CHCNZ ; Get the character
PUSHJ P,SC$IMG ; Delete the line feed
SOJG P1,.-1 ; Loop for all of them
POPJ P, ; And return
SUBTTL Support routines -- ACT4 -- Delete a form feed
;+
;.HL1 AC4DFF
;This routine will send the character string to delete a form feed.
;.literal
;
; Usage:
; MOVE CRT,CRT.block.address
; PUSHJ P,$CRDFF(CRT)
; (Return)
;
;.end literal
;-
AC4DFF: MOVX T1,^D8 ; Get the number of line feeds
PJRST AC4D.0 ; And go join common routine
SUBTTL Support routines -- ACT-4 and 5 -- Move cost calculation
;+
;.hl 1 AC4CPP
; 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 X,[-n,,Column]
; MOVE Y,[-n,,Row]
; MOVE CRT,CRTTYP
; XCT $CRCPP(CRT)
; (return, T1= cost in characters)
;
;.end literal
;-
AC4CPP: MOVE T3,T2 ; Get a copy of where we are moving to
XOR T3,T1 ; Xor together
JUMPE T3,.RET0 ; Return a zero if not moving
TXNN T3,LH.ALF ; Same X position line ?
JRST AC4CPY ; Yes - Check more
TXNN T3,RH.ALF ; Same Y position ?
JRST AC4CPX ; Yes - Check more
JUMPE T1,.RET2 ; If moving home return cost of two
AC4CPA: MOVX T1,3 ; Have to type four characters
POPJ P, ; Return
; Here if possible same column movement
AC4CPY: MOVEI T2,(T2) ; Get just the Y position
SUBI T2,(T1) ; Determine if just one line movement
MOVM T1,T2 ; . . .
SOJG T1,AC4CPA ; More than one - use four
JRST .RET1 ; Else return one
; Here if possible same line movement
AC4CPX: 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,AC4CPA ; If more than one - return four
JRST .RET1 ; Else return one
SUBTTL Support routines -- ACT 4 and 5 -- XY positioning
;+
;.HL AC4XY
; This routine will do the cursor positioning.
;.literal
;
; Usage:
; MOVE X,X.postion
; MOVE Y,Y.postion
; MOVE CRT,CRT.block.index
; PUSHJ P,@$CRXYP(CRT)
; (Return)
;
;.end literal
;-
AC4XY: $SAVE <X,Y> ; Save the args
$SAVE <CH> ; Save CH
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 AC4XYA ; No - Handle normally
SKIPN T1+$OFSY ; No change in the Y offset ?
JUMPE X,AC4XYC ; Yes - Only need a CR
MOVM T3,T1+$OFSX ; Get the X offset
SOJE T3,AC4XYX ; Just X by one
MOVM T3,T1+$OFSY ; Get the Y offset
SOJE T3,AC4XYY ; Just the Y by one
AC4XYA: SKIPN X ; Is this non-zero ?
JUMPE Y,AC4XYH ; Just home it
MOVEI T1,[$STRING(<^8/Y/^8/X/>)]
PJRST SC$STR ; Output the string
; Here to just home the cursor
AC4XYH: MOVX CH,.CHCRB ; Get the character
PJRST SC$IMG ; And output it
; Here to just output a CR
AC4XYC: MOVX CH,.CHCRT ; Just output a CR
PJRST SC$IMG ; . . .
; Here to move in the X direction by one
AC4XYX: SKIPGE T1+$OFSX ; Is this negative ?
SKIPA CH,[EXP .CHCNX] ; No - To the right
MOVX CH,.CHCNH ; Yes, use a backspace
PJRST SC$STR ; Output the string
; Here to move in the Y direction by one
AC4XYY: SKIPL T1+$OFSY ; Is this negative ?
SKIPA CH,[EXP .CHCNZ] ; No - Move up
MOVX CH,.CHLFD ; Yes, move down with a line feed
PJRST SC$STR ; Output the string
SUBTTL Support routines -- ACT 4 and 5 -- Delete to End of line
;+
;.hl1 AC4DEL
;This routine will delete to the end of the line.
;.literal
;
; Usage:
; MOVEI T1,# of characters to delete
; XCT $CRDEL(CRT)
;
;.end literal
;-
AC4DEL: $SAVE <CH> ; Save CH
MOVX CH,.CHCCF ; Get the character
PJRST SC$IMG ; Print out the string
SUBTTL Low segment
$IMPURE ; Put in correct place
ACTBEG:!
LOWVER(ACT,<.-ACTBEG>) ; Define the version number
SUBTTL End of TECACT
END ; End of TECACT