Trailing-Edge
-
PDP-10 Archives
-
steco_19840320_1er_E35
-
10,5676/teco/source/tecbee.mac
There are 3 other files named tecbee.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(BEE,<TECO Beehive terminal support>) ; Generate the TITLE and other stuff
$CODE ; Put into code PSECT
SUBTTL Table of Contents
;+
;.pag.lit
; Table of Contents for TECBEE - Beehive terminal support
;
;
; Section Page
; 1. Introduction . . . . . . . . . . . . . . . . . . . . . 1
; 2. Table of Contents. . . . . . . . . . . . . . . . . . . 2
; 3. Revision History . . . . . . . . . . . . . . . . . . . 3
; 4. Tables
; 4.1. Mini-BEE. . . . . . . . . . . . . . . . . . . 5
; 5. Support routines
; 5.1. Beehive
; 5.1.1. Control U. . . . . . . . . . . . . . 6
; 5.1.2. Delete a line feed . . . . . . . . . 7
; 5.1.3. Delete a vertical tab. . . . . . . . 8
; 5.1.4. Delete a form feed . . . . . . . . . 9
; 6. Low segment. . . . . . . . . . . . . . . . . . . . . . 10
; 7. End of TECBEE. . . . . . . . . . . . . . . . . . . . . 11
;.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 -- Mini-BEE
CRTINI VBEE
CRTENT INT,<PUSHJ P,MB4INT> ; Initialization routine
CRTENT WID,^D79 ; Width (minus one)
CRTENT LIN,^D24 ; Length of the screen
CRTENT CPP,<PUSHJ P,MB4CPP> ; Positioning cost
CRTENT BCK,<TB(.CHCNH)>
CRTENT SPC,<TB(.CHESC,"C")>
CRTENT DBS,<TB(" ",.CHCNH)>
CRTENT DLF,<PUSHJ P,MB4DLF> ; Delete a line feed
CRTENT DVT,<PUSHJ P,MB4DVT> ; Delete a vertical tab
CRTENT DFF,<PUSHJ P,MB4DFF> ; Delete a form feed
CRTENT CRB,<TB(.CHCNH)>
CRTENT CTU,<PUSHJ P,MB4CTU> ; Control U routine
CRTENT XYP,<PUSHJ P,MB4XY> ; Cursor positioning routine
CRTEND
SUBTTL Support routines -- Minibee 4 -- Initialization
;+
;.hl1 MB4INT
; This routine will initialize the terminal. It will just send the code
;to ensure that format mode is off.
;-
MB4INT: MOVX T1,<BYTE(7).CHESC,"X"> ; Get the string
PJRST SC$STR ; And output the string
SUBTTL Support routines -- Minibee 4 -- Control U
;+
;.HL1 MB4CTU
;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
;-
MB4CTU: MOVX T1,<BYTE (7),.CHCRT,.CHESC,"K">
PUSHJ P,SC$STR ; Output the string
MOVX CH,.CHCRT ; Get the return character
PJRST T$OCHR ; Output the character
SUBTTL Support routines -- Minibee 4 -- Delete a line feed
;+
;.HL1 MB4DLF
;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
;-
MB4DLF: MOVX T1,<BYTE (7).CHESC,"A"> ; Get the string to send
PJRST SC$STR ; Set it
SUBTTL Support routines -- Minibee 4 -- Delete a vertical tab
;+
;.HL1 MB4DVT
;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
;-
MB4DVT: $SAVE <P1> ; Save P1
MOVX P1,4 ; Get the number of times to loop
BEECMN: MOVX P1,<BYTE (7).CHESC,"A"> ; Get the string
PUSHJ P,SC$STR ; Output the string
SOJG P1,BEECMN ; Loop until done
POPJ P, ; Return to the caller
SUBTTL Support routines -- Minibee 4 -- Delete a form feed
;+
;.HL1 MB4DFF
;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
;-
MB4DFF: $SAVE <P1> ; Save P1
MOVX P1,10 ; Get the number of times to loop
PJRST BEECMN ; Go to the common routine
SUBTTL Support routines -- Minibee 4 -- XY positioning
;+
;.HL MB4XY
;This routine will do the positioning for the Minibee 4.
;.literal
;
; Usage:
; MOVE X,X.postion
; MOVE Y,Y.postion
; MOVE CRT,CRT.block.index
; PUSHJ P,@$CRXYP(CRT)
; (Return)
;
;.end literal
;-
MB4XY: $SAVE <X,Y> ; Save the args
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 MB4XYA ; No - Handle normally
SKIPN T1+$OFSY ; No change in the Y offset ?
JUMPE X,MB4XYC ; Yes - Only need a CR
MOVM T3,T1+$OFSX ; Get the X offset
SOJE T3,MB4XYX ; Just X by one
MOVM T3,T1+$OFSY ; Get the Y offset
SOJE T3,MB4XYY ; Just the Y by one
MB4XYA: SKIPN X ; Is this non-zero ?
JUMPE Y,MB4XYH ; Just home it
MOVX T1,<BYTE (7).CHESC,"F"> ; Get the initial string
PUSHJ P,SC$STR ; Type it
$SAVE <CH> ; Save T1
MOVE T1,Y ; get the line number
IDIVX T1,^D10 ; Split into the two digits
MOVE CH,T2 ; Get the low order half
STOR T1,CH,^O340 ; Stuff in the high order half
PUSHJ P,SC$IM0 ; Output the character exactly
MOVE T1,X ; Get the line
IDIVX T1,^D10 ; Split the number up
MOVE CH,T2 ; Get the low order half
STOR T1,CH,^O340 ; Store the high order
PJRST SC$IM0 ; Output the char and return
; Here to just home the cursor
MB4XYH: MOVX T1,<BYTE (7).CHESC,"H"> ; Get the home string
PJRST SC$STR ; Send it
; Here to just output a CR
MB4XYC: $SAVE <CH> ; Save current character
MOVX CH,.CHCRT ; Just output a CR
PJRST SC$IMG ; . . .
; Here to move in the X direction by one
MB4XYX: SKIPGE T1+$OFSX ; Is this negative ?
SKIPA T1,[BYTE (7).CHESC,"C"] ; No - To the right
MOVX T1,<BYTE(7).CHCNH> ; Yes, use a backspace
PJRST SC$STR ; Output the string
; Here to move in the Y direction by one
MB4XYY: SKIPL T1+$OFSY ; Is this negative ?
SKIPA T1,[BYTE (7).CHESC,"A"] ; No - Move up
MOVX T1,<BYTE(7).CHLFD> ; Yes, move down with a line feed
PJRST SC$STR ; Output the string
SUBTTL Support routines -- Minibee 4 -- Move cost calculation
;+
;.hl 1 MB4CPP
; 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
;-
MB4CPP: 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 MB4CPY ; Yes - Check more
TXNN T3,RH.ALF ; Same Y position ?
JRST MB4CPX ; Yes - Check more
JUMPE T2,.RET2 ; If moving home return cost of two
MB4CPA: MOVX T1,4 ; Have to type four characters
POPJ P, ; Return
; Here if possible same column movement
MB4CPY: MOVEI T2,(T2) ; Get just the Y position
SUBI T2,(T1) ; Determine if just one line movement
MOVM T1,T2 ; . . .
SOJG T1,MB4CPA ; 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
MB4CPX: 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,MB4CPA ; If more than one - return four
JUMPL T1,.RET1 ; If backing up then only one
JRST .RET2 ; Else return two
SUBTTL Low segment
$IMPURE ; Put in correct place
BEEBEG:!
LOWVER(BEE,<.-BEEBEG>); Define the version number
SUBTTL End of TECBEE
END ; End of TECBEE