Trailing-Edge
-
PDP-10 Archives
-
steco_19840320_1er_E35
-
10,5676/teco/source/techp.mac
There are 3 other files named techp.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(HP,<TECO HP terinal support>) ; Generate the TITLE and other stuff
$CODE ; Put into code PSECT
SUBTTL Table of Contents
;+
;.pag.lit
; Table of Contents for TECHP - HP terminal support
;
;
; Section Page
; 1. Introduction . . . . . . . . . . . . . . . . . . . . . 1
; 2. Table of Contents. . . . . . . . . . . . . . . . . . . 2
; 3. Revision History . . . . . . . . . . . . . . . . . . . 3
; 4. Tables
; 4.1. HP-2600 . . . . . . . . . . . . . . . . . . . 5
; 5. Support routines
; 5.1. HP-2640
; 5.1.1. XY positioning . . . . . . . . . . . 6
; 5.1.2. Control U. . . . . . . . . . . . . . 7
; 5.1.3. Delete a line feed . . . . . . . . . 8
; 5.1.4. Delete a vertical tab. . . . . . . . 9
; 5.1.5. Delete a form feed . . . . . . . . . 10
; 6. Low segment. . . . . . . . . . . . . . . . . . . . . . 11
; 7. End of TECHP . . . . . . . . . . . . . . . . . . . . . 12
;.end lit.pag
;-
SUBTTL Revision History
COMMENT |
1000 Start of this version
1123 By: Robert McQueen On: 30-August-1981
Incorporate the support give to use from University of Delaware (Richard
Braun) for HP2621 terminals.
Modules: TECHP
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 -- HP-2600
CRTINI VHP26
CRTENT BCK,<TB(.CHCNH)>
CRTENT SPC,<TB(.CHESC,"C")>
CRTENT DBS,<TB(" ",.CHCNH)>
CRTENT DLF,<PUSHJ P,HP2DLF> ; Routine to delete a line feed
CRTENT DVT,<PUSHJ P,HP2DVT> ; Routine to delete a vertical tab
CRTENT DFF,<PUSHJ P,HP2DFF> ; Routine to delete a form feed
CRTENT CRB,<TB(.CHCNH," ",.CHCNH,.CHCNH)>
CRTENT CTU,<PUSHJ P,HP2CTU> ; Routine to handle control U
CRTEND
SUBTTL Tables -- HP2621
; Hewlett-Packard HP2621 terminal
CRTINI VHP21
CRTENT INT,<PUSHJ P,H21INT> ; Initialize the terminal handling
CRTENT WID,^D79 ; 80 wide by
CRTENT LIN,^D24 ; 24 lines long (HP2621)
CRTENT BCK,<TB(.CHCNH)> ; Back cursor (non-destructive)
CRTENT CIN,<PUSHJ P,H21CIN> ; Cost initialization
CRTENT CRP,<PUSHJ P,H21CRP> ; Cost of replace character
CRTENT CIC,<PUSHJ P,H21CIC> ; Cost of insert character
CRTENT CDC,<PUSHJ P,H21CDC> ; Cost of delete character
CRTENT CIL,<MOVX T1,<<INSVL.($OPICH,CS$OPR)>!<INSVL.(2,CS$CST)>>> ; Cost of insert line
CRTENT CDL,<MOVX T1,<<INSVL.($OPDCH,CS$OPR)>!<INSVL.(2,CS$CST)>>> ; Cost of insert line
CRTENT CPP,<PUSHJ P,H21CPP> ; Cost of point to point move
CRTENT SPC,<TB(.CHESC,"C")> ; Forward cursor (non-destructive)
CRTENT DBS,<TB(" ",.CHCNH)> ; String to delete a character
CRTENT DLF,<PUSHJ P,H21DLF> ; Routine to delete a line feed
CRTENT DVT,<PUSHJ P,H21DVT> ; Routine to delete a veritcal tab
CRTENT DFF,<PUSHJ P,H21DFF> ; Routine to delete a form feed
CRTENT CRB,<TB(.CHCNH)> ; String to cancel effect of rubout
CRTENT CTU,<PUSHJ P,H21CTU> ; String to delete entire line
CRTENT FIN,<PUSHJ P,H21FIN> ; String to put cursor home
CRTENT ERS,<TB(.CHESC,"H",.CHESC,"J")> ; String to home and erase screen
CRTENT DEL,<PUSHJ P,H21DEL> ; String to delete to end of line
CRTENT DSP,.CHSPC ; Destructive forward space
CRTENT INL,<PUSHJ P,H21INL> ; Routine to insert lines
CRTENT DLL,<PUSHJ P,H21DLL> ; Routine to delete lines
CRTENT DCH,<PUSHJ P,H21DCH> ; Routine to delete a character
CRTENT ICH,<PUSHJ P,H21ICH> ; Routine to insert a character
CRTENT TCH,<PUSHJ P,H21TCH> ; Routine to type a character
CRTENT XYP,<PUSHJ P,H21XY> ; XY positioning instruction
CRTENT CDE,<MOVEI T1,3> ; Cost of 3
CRTEND
SUBTTL Support routines -- HP2621 -- Initialization routine
;+
;.HL1 H21INT
;This routine will initialize the terminal handling routines for the
;specific terminal. It will also initialize the HP2621 terminal
;.literal
;
; Usage:
; MOVEI CRT,CRT.block.address
; XCT $CRINT(CRT)
; (Return)
;
;.end literal
;-
H21INT: SETZM INSFLG ; Flag not in insert mode
MOVX T1,<BYTE(7).CHESC,"R"> ; Get string to take out of insert mode
PJRST SC$STR ; And output it
SUBTTL Support routines -- HP2621 -- Reset terminal
;+
;.HL1 H21FIN
;This routine will reset the terminal to set up for exiting from
;TECO.
;.literal
;
; Usage:
; MOVEI CRT,CRT.block.address
; XCT $CRFIN(CRT)
; (Return)
;
;.end literal
;-
H21FIN: SKIPN INSFLG ; In insert mode?
POPJ P, ; No, just return
SETZM INSFLG ; Flag not in insert mode
MOVX T1,<BYTE(7).CHESC,"R"> ; Get string to take out of insert mode
PJRST SC$STR ; And output it
SUBTTL Support routines -- HP2621 -- Delete a line feed
;+
;.HL1 H21DLF
;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
;-
H21DLF: MOVX T1,<BYTE (7).CHESC,"A"> ; Get the string
PJRST SC$STR ; And output it
SUBTTL Support routines -- HP2621 -- Delete a vertical tab
;+
;.HL1 H21DVT
;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
;-
H21DVT: $SAVE <P1> ; Save P1
MOVX P1,4 ; Get the number of times to repeat
H21CMN: MOVX T1,<BYTE (7).CHESC,"A"> ; Get the string
PUSHJ P,SC$STR ; Output the string
SOJG P1,H21CMN ; Loop until done
POPJ P, ; Return to the caller
SUBTTL Support routines -- HP2621 -- Delete a form feed
;+
;.HL1 H21DFF
;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
;-
H21DFF: $SAVE <P1> ; Save P1
MOVX P1,10 ; Get the number of times to repeat
PJRST H21CMN ; Go to the common routine
SUBTTL Support routines -- HP2621 -- Control-U
;+
;.HL1 H21CTU
;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
;-
H21CTU:
; MOVX T1,<BYTE(7).CHCRT,.CHESC,"K"> ; Get the characters
MOVX T1,<BYTE (7) .CHESC,"M",.CHESC,"L"> ;try a real hack
PUSHJ P,SC$STR ; Output them
MOVX CH,.CHCRT ; And the free carriage return
PJRST T$OCHR ; Output it
SUBTTL Support routines -- HP2621 -- Insert character
;+
;.HL H21ICH
;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
;-
H21ICH: SKIPE INSFLG ; In insert mode ?
PJRST SC$CHR ; Yes, then just type it
PUSH P,T1 ; Save T1
MOVX T1,<BYTE (7).CHESC,"Q"> ; Enter insert mode string
PUSHJ P,SC$STR ; Type the string
POP P,T1 ; Restore T1
SETOM INSFLG ; Flag we are now in insert mode
PJRST SC$CHR ; Type the character
SUBTTL Support routines -- HP2621 -- Type a character
;+
;.HL1 H21TCH
;This routine will type a character on the terminal. It will first check
;to see if the terminal is in insert character mode and take it out if it
;is in insert character mode.
;.literal
;
; Usage:
; MOVX CH,Character
; MOVEI CRT,CRT.block.address
; XCT $CRTCH(CRT)
; (Return)
;
;.end literal
;-
H21TCH: SKIPN INSFLG ; In insert character mode ?
PJRST SC$CHR ; No - Type the character
PUSH P,T1 ; Save T1
MOVX T1,<BYTE (7).CHESC,"R"> ; Get the string
PUSHJ P,SC$STR ; Type the string
POP P,T1 ; And return
SETZM INSFLG ; Not in insert mode now
PJRST SC$CHR ; Type the character
SUBTTL Support routines -- HP2621 -- Delete N lines
;+
;.HL1 H21DLL
;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
;-
H21DLL: $SAVE <P1> ; Save P1
MOVE P1,T1 ; Copy the repeat count
H21DL0: MOVX T1,<BYTE (7).CHESC,"M"> ; Get the text to send
PUSHJ P,SC$STR ; Output the string
SOJG P1,H21DL0 ; Loop for all the lines
POPJ P, ; Return
SUBTTL Support routines -- HP2621 -- Insert N lines
;+
;.HL1 H21INL
;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
;-
H21INL: $SAVE <P1> ; Save P1
MOVE P1,T1 ; Copy the count
H21IN0: MOVX T1,<BYTE (7).CHESC,"L"> ; Get the text to send
PUSHJ P,SC$STR ; Output the string
SOJG P1,H21IN0 ; Loop for all the lines
POPJ P, ; Return to the caller
SUBTTL Support routines -- HP2621 -- Delete a character
;+
;.HL1 H21DCH
;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
;-
H21DCH: $SAVE <P1> ; Save P1
MOVE P1,T1 ; Copy the value
H21CI0: MOVX T1,<BYTE (7).CHESC,"P"> ; Get the string to delete a char
PUSHJ P,SC$STR ; Type it
SOJG P1,H21CI0 ; Loop back
POPJ P, ; Return to the caller
SUBTTL Support routines -- HP2621 -- Cost initialization routine
;+
;.hl 1 H21CIN
; This routine will return the initial cost word for the character
;by character comparison of a line.
;.b.lit
;
; Usage:
; MOVE CRT,CRTTYP
; PUSHJ P,@$CRCIN(CRT) or XCT $CRCIN(CRT)
; (return, first array element in T1)
;
;.end literal
;-
CS$INS==1 ; Term dependent info - terminal in insert mode
H21CIN: MOVX T1,<INSVL.(0,CS$DEP)>!<INSVL.($OPACH,CS$OPR)>
SKIPE INSFLG ; In insert mode?
MOVX T1,<INSVL.(CS$INS,CS$DEP)>!<INSVL.($OPACH,CS$OPR)>
POPJ P, ; Return the cost word
SUBTTL Support routines -- HP2621 -- Replacement cost calculation
;+
;.hl 1 H21CRP
; This routine will return the cost of replacing a character in the
;line.
;.b.lit
;
; Usage:
; MOVE T1,CST entry
; MOVE X,[-n,,Column]
; MOVE Y,[-n,,Row]
; MOVE CRT,CRTTYP
; XCT $CRCRP(CRT)
; (return, T1=CST entry
;
;.end literal
;-
H21CRP: MOVE T2,T1 ; Copy the old word
MOVX T1,<<INSVL.($OPRCH,CS$OPR)>!<INSVL.(1,CS$CST)>> ; Get the operation
TXNN T2,<INSVL.(CS$INS,CS$DEP)> ; Check if in insert mode
POPJ P, ; No, return now
STORI. 3,T2,CSTCST,+T1 ; Store the cost if we are coming from insert mode
POPJ P, ; And return
SUBTTL Support routines -- HP2621 -- Insert cost calculation
;+
;.hl 1 H21CIC
; This routine will return the cost of inserting a character in the
;line.
;.b.lit
;
; Usage:
; MOVE T1,CST entry
; MOVE X,[-n,,Column]
; MOVE Y,[-n,,Row]
; MOVE CRT,CRTTYP
; XCT $CRCIC(CRT)
; (return, T1=CST entry
;
;.end literal
;-
H21CIC: MOVE T2,T1 ; Get a copy of the old entry
MOVX T1,<<INSVL.(CS$INS,CS$DEP)>!<INSVL.($OPICH,CS$OPR)>!<INSVL.(1,CS$CST)>>
TXNE T2,<INSVL.(CS$INS,CS$DEP)> ; Already in insert mode?
POPJ P, ; Yes, return
STORI. 3,T2,CSTCST,+T1 ; Store the cost if we must put into insert mode
POPJ P, ; And return
SUBTTL Support routines -- HP2621 -- Delete cost calculation
;+
;.hl 1 H21CDC
; This routine will return the cost of deleting a character in the
;line.
;.b.lit
;
; Usage:
; MOVE T1,CST entry
; MOVE X,[-n,,Column]
; MOVE Y,[-n,,Row]
; MOVE CRT,CRTTYP
; XCT $CRCDC(CRT)
; (return, T1=CST entry
;
;.end literal
;-
H21CDC: ANDX T1,CS$DEP ; Keep only the dependant portion
TXO T1,<<INSVL.($OPDCH,CS$OPR)>!<INSVL.(2,CS$CST)>> ; Store the operation
POPJ P, ; And return
SUBTTL Support routines -- HP2621 -- Delete to End of line
;+
;.hl1 H21DEL
;This routine will delete to the end of the line.
;.literal
;
; Usage:
; MOVEI T1,# of characters to delete
; XCT $CRDEL(CRT)
;
;.end literal
;-
H21DEL: MOVX T1,<BYTE (7) .CHESC,"K">
PJRST SC$STR ; Print out the string
SUBTTL Support routines -- HP2621 -- XY positioning
;+
;.hl1 H21XY
;This routine will do the positioning for the Hewlett Packard HP2621 terminal.
;.literal
;
; Usage:
; MOVE X,X.postion
; MOVE Y,Y.postion
; MOVE CRT,CRT.block.index
; XCT $CRXYP(CRT)
; (Return)
;
;.end literal
;-
H21XY: $SAVE <X,Y> ; Save X and Y
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 H21XYA ; No - Handle normally
JUMPN T1+$OFSX,H21XYX ; Just moving in the X direction
JUMPN T1+$OFSY,H21XYY ; Just moving in the Y direction
POPJ P, ; If we get here, we don't have to move at all
; Here to do a full address
H21XYA: SKIPN X ; Going home?
JUMPE Y,H21XYH ; . . .
MOVEI T1,[$STRING(<&a^D/Y/r^D/X/C>)] ; Get the string address
PJRST SC$STR ; And go position the cursor
; Here if we are just going to home the cursor
H21XYH: MOVX T1,<BYTE (7).CHESC,"H"> ; Get the string
PJRST SC$STR ; Type the string
; Here to move only in the X direction
H21XYX: MOVM T3,T1 ; Get the number of spaces to move
CAXN T3,1 ; Only one space?
JRST H21X.1 ; Yes, go handle it
JRST H21XYA ; Go address the cursor
; Here to move in the X direction one position
H21X.1: SKIPG T1 ; Backwards
SKIPA T1,[BYTE(7).CHESC,"C"] ; Go forward one
MOVX T1,<BYTE(7).CHCNH> ; Go backwards one
PJRST SC$STR ; Go output the string
; Here to move only in the Y direction
H21XYY: MOVM T1,T1+$OFSY ; Get the number to move
CAXN T1,1 ; Only one line?
JRST H21Y.1 ; Yes, go handle it
JRST H21XYA ; Go address the cursor
; Here to move one position in the Y direction
H21Y.1: SKIPL T2 ; Up or down?
SKIPA T1,[BYTE(7).CHESC,"A"] ; Up, use escape seqeunce
MOVX T1,<BYTE(7).CHLFD> ; Down, use a line feed
PJRST SC$STR ; All done
SUBTTL Support routines -- HP2621 -- Move cost calculation
;+
;.hl 1 H21CPP
; 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
;-
H21CPP: MOVE T3,T2 ; Get a copy of where we want to go
XOR T3,T1 ; See if they are the same
JUMPE T3,.RET0 ; Return a zero if not moving
TXNN T3,LH.ALF ; Same X position line ?
JRST H21.X ; Yes - Check more
TXNN T3,RH.ALF ; Same Y position ?
JRST H21.Y ; Yes - Check more
JUMPE T2,.RET2 ; If going home, return 2
JRST H2.ADD ; Go calculate full cursor address
H21.X: MOVEI T2,(T2) ; Get the Y position
SUBI T2,(T1) ; Find the difference
MOVM T1,T2 ; Get the magnitude
SOJG T1,H2.ADD ; If greater than one, calculate cursor addr
JUMPL T2,.RET2 ; If going up, use 2
JRST .RET1 ; If going down, use 1
H21.Y: HLRZ T2,T2 ; Get the X position
JUMPE T2,.RET1 ; Going to left column? Use <CR>
HLRZ T1,T1 ; Get the old X position
SUBI T1,(T2) ; Take the difference
MOVM T3,T1 ; Get the magnitude
SOJG T3,H2.ADD ; If greater than one, calculate full address
JUMPL T1,.RET1 ; If going left, use 1
JRST .RET2 ; If going right, use 2
; Here to count characters needed for cursor positioning
H2.ADD: MOVE T2,T1 ; Get the destination column
MOVEI T1,5 ; Get the basic cost
CAIL T3,^D9 ; Before line 10?
AOJ T1, ; No, takes another digit
CAIL T2,^D9 ; Before column 10
AOJ T1, ; No, another digit
POPJ P, ; All done
SUBTTL Support routines -- HP-2640 -- XY positioning
;+
;.HL HP2XY
;This routine will do the positioning for the HP-2640 terminal.
;.literal
;
; Usage:
; MOVE X,X.postion
; MOVE Y,Y.postion
; MOVE CRT,CRT.block.index
; PUSHJ P,@$CRXYP(CRT)
; (Return)
;
;.end literal
;-
HP2XY: 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
SUBTTL Support routines -- HP-2640 -- Control U
;+
;.HL1 HP2CTU
;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
;-
HP2CTU: MOVX T1,<BYTE (7),.CHCRT,.CHESC,"K">
PUSHJ P,SC$STR ; Output the string to the terminal
MOVX T1,.CHCRT ; Get the ending character
PJRST T$OCHR ; Output the character
SUBTTL Support routines -- HP-2640 -- Delete a line feed
;+
;.HL1 HP2DLF
;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
;-
HP2DLF: MOVX T1,<BYTE (7).CHESC,"A"> ; Get the string
PJRST SC$STR ; Output the string
SUBTTL Support routines -- HP-2640 -- Delete a vertical tab
;+
;.HL1 HP2DVT
;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
;-
HP2DVT: $SAVE <P1> ; Save P1
MOVX P1,4 ; Get the number of times to loop
HP2CMN: MOVX T1,<BYTE (7).CHESC,"A"> ; Get the string
PUSHJ P,SC$STR ; Output the string
SOJG P1,HP2CMN ; Loop
POPJ P, ; Return to the caller
SUBTTL Support routines -- HP-2640 -- Delete a form feed
;+
;.HL1 HP2DFF
;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
;-
HP2DFF: $SAVE <P1> ; Save P1
MOVX P1,10 ; Get the number of times to loop
PJRST HP2CMN ; Go to the common routine
SUBTTL Low segment
$IMPURE ; Put in correct place
HPBEG:!
INSFLG: BLOCK 1 ; Flag whether we are in insert mode (0 if not)
LOWVER(HP,<.-HPBEG>); Define the version number
SUBTTL End of TECHP
END ; End of TECHP