.TITLE RUBOUT - RUBOUT AND CTRL U PROCESSING FOR TECOIO .IDENT "X0207" ; ; COPYRIGHT (C) 1976 BY DIGITAL EQUIPMENT CORPORATION, ; MAYNARD, MASSACHUSETTS ; ; THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY ON A ; SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH THE IN- ; CLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE, OR ; ANY OTHER COPIES THEREOF, MAY NOT BE PROVIDED OR OTHERWISE ; MADE AVAILABLE TO ANY OTHER PERSON EXCEPT FOR USE ON SUCH ; SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE TERMS. TITLE ; TO AND OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN ; IN DIGITAL. ; ; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITH- ; OUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ; DIGITAL EQUIPMENT CORPORATION. ; ; DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY FOR ; THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT WHICH IS ; NOT SUPPLIED BY DIGITAL. ; ; ANDREW C. GOLDSTEIN 3-FEB-78 14:00 ; MARK H. BRAMHALL 27-MAR-79 21:12 .SBTTL SET UP FOR SCOPE CHARACTER/LINE DELETION .PSECT CRTRUB,RO,I,GBL,REL,OVR CRTRUB::.WORD CRTSET ;ADDRESS OF THE SET UP ROUTINE .IIF NE CRTRUB+2-., .ERROR CUPSEQ: .BLKW 4 ;SPACE FOR 4 TERMINAL TYPES .IIF NE CRTRUB+12-., .ERROR ERLSEQ: .BLKW 4 ;SPACE FOR 4 TERMINAL TYPES CRTSET: CLR R4 ;SAY NO "WATCH" READ/WRITE REGION RETURN ;NO SCOPE SUPPORT, JUST EXIT .PSECT PURE,RO,D NORSEQ: .BYTE 3,010,040,010 ; NORMAL SEQUENCE - ; ; CHARACTER COMPARE TABLE ; CHRTAB: .BYTE SPACE,AM,CR,BS,LF,VT,FF .EVEN .SBTTL RUBOUT ROUTINE ;+ ; ; *** - DELCHR DELETE CHARACTER FROM TERMINAL LINE ; ; THIS ROUTINE PROCESSES A RUBOUT TYPED BY THE USER. IN NORMAL MODE, THE ; LAST CHARACTER IN THE LINE IS SIMPLY ECHOED. IN CRT MODE, THE CHARACTER IS ; MADE TO DISAPPEAR. MOST CHARACTERS ARE DELETED BY THE BACKSPACE-SPACE- ; BACKSPACE SEQUENCE. TABS ARE DONE BY ERASING AND RETYPING THE LINE. VERTICAL ; MOTION CHARACTERS ARE HANDLED WITH CURSOR UP COMMANDS. ; ; INPUTS: ; ; R0 = CHARACTER TO DELETE ; ; OUTPUTS: ; ; R0 - R4 CLOBBERED ; ;- .PSECT CODE,RO,I .ENABL LSB 60$: JMP TYPE ; TYPE A CHARACTER; EXIT DELCHR:: BIT #ET.CRT,ETYPE(R5) ; CHECK IF CRT MODE BEQ 60$ ; BRANCH IF NOT MOV #NORSEQ,R3 ; GET NORMAL RUBOUT STRING MOV #1,R1 ; AND COUNT TO DO ONCE MOV #CHRTAB,R2 ; POINT TO CHARACTER TABLE CMPB R0,(R2)+ ; IF THE CHAR IS A NORMAL GRAPHIC BHIS 20$ ; THAT'S IT CMPB R0,(R2)+ ; IF ALT MODE BEQ 20$ ; ALSO SINGLE CHARACTER ASL R1 ; ASSUME DOUBLE CHARACTER SEQUENCE CMPB R0,(R2)+ ; SEE IF CURSOR MOTION CHARACTER BHI 20$ ; HI MEANS NOT CMPB R0,(R2)+ ; BLO 20$ ; AND LO MEANS NOT ASR R1 ; HANDLE VERTICAL MOTION - ASSUME 1 CMPB R0,(R2)+ ; CHECK FOR LINE FEED BEQ 10$ ; YES - UP ONE LINE MOV #4,R1 ; ASSUME 4 LINES FOR VERTICAL TAB CMPB R0,(R2)+ ; BEQ 10$ ; BRANCH IF YES ASL R1 ; ASSUME 8 LINES FOR FORM FEED CMPB R0,(R2)+ ; IF NONE OF THE ABOVE BNE 40$ ; REPRINT THE LINE ; ; TO HERE TO DO CURSOR UP SEQUENCES ; 10$: MOV #CUPSEQ,R3 ; GET CURSOR UP DESCRIPTOR CALL PRISEQ ; OUTPUT ONE CURSOR UP(S) BR 50$ ; GO FIX UP CURSOR ; ; TO HERE TO BACKSPACE AND ERASE A CHARACTER OR TWO ; 20$: CMP TABCNT,TTLNSZ ; SEE IF WE ARE AT THE EDGE OF THE SCREEN BHIS 40$ ; BRANCH IF YES - REPRINT LINE SUB R1,TABCNT ; CORRECT POSITION BLO 30$ ; WE'RE RUBBING OVER A LINE WRAP... CALL XXXSEQ ; OUTPUT NORMAL RUBOUT SEQUENCE(S) BR 50$ ; GO FIX UP CURSOR 30$: CALL ERASE ; WE ARE RUBBING OUT OVER A LINE WRAP CALL PRICU1 ; SO MOVE UP ONE LINE ; ; TO HERE TO REPRINT A LINE ; 40$: CALL ERASE ; ERASE THE LINE JMP PRTLIN ; REPRINT THE LINE; EXIT ; ; SUBROUTINE TO JUST ERASE THE CURRENT LINE ; ERASE: CLR TABCNT ; SHOW LINE EMPTY MOV #ERLSEQ,R3 ; GET CONTROL STRING DESCRIPTOR CALL PRISQ1 ; AND OUTPUT THE SEQUENCE ONCE ; ; TO HERE AFTER RUBOUT SEQUENCE. IF WE HAVE POSITIONED TO COLUMN 0, WE HAVE ; TO DO A KLUGE TO PREVENT GRATUITOUS LINE FEEDS FROM THE VMS TREMINAL ; DRIVER. THIS CONSISTS OF DOING A CURSOR UP FOLLOWED BY A CR/LF. ; 50$: TST TABCNT ; CHECK CURSOR POSITION BNE 70$ ; BRANCH IF NOT COLUMN 0 CALL PRICU1 ; ELSE MOVE UP ONE LINE CALL CRLF ; FOLLOWED BY CR/LF 70$: JMP TYPENC ; FLUSH THE TYPE OUT BUFFER; EXIT .DSABL LSB ; ; SUBROUTINES TO OUTPUT SEQUENCES ; PRICU1: MOV #CUPSEQ,R3 ; SET BASE FOR CURSOR UP PRISQ1: MOV #1,R1 ; SET # TIMES TO ONCE PRISEQ: ADD CRTYPE(R5),R3 ; FORM THE CORRECT POINTER MOV (R3),R3 ; GET POINTER TO: CNT, DATA XXXSEQ: MOV TABCNT,-(SP) ; SAVE CURRENT POSITION MOV R3,-(SP) ; SAVE POINTER TO: CNT, DATA MOVB (R3)+,R4 ; GET BYTE COUNT 10$: MOVB (R3)+,R0 ; PICK UP EACH CHARACTER CALL TYPEC ; AND OUTPUT IT (R4<>0!) SOB R4,10$ ; LOOP FOR ALL... MOV (SP)+,R3 ; RESTORE POINTER TO: CNT, DATA MOV (SP)+,TABCNT ; RESTORE THE POSITION SOB R1,XXXSEQ ; AND LOOP FOR # TIMES... RETURN ; THEN RETURN .SBTTL CONTROL U ROUTINE ;+ ; ; *** - DELLIN PROCESS CONTROL U CHARACTER ; ; THIS ROUTINE HANDLES THE CONTROL U CHARACTER. NORMAL MODE MEANS JUST ECHOING ; CRLF. CRT MODE ERASES THE CURRENT LINE. ; ; INPUTS: ; ; NONE ; ; OUTPUTS: ; ; R0 - R4 CLOBBERED ; ;- DELLIN:: BIT #ET.CRT,ETYPE(R5) ; CHECK FOR CRT MODE BNE ERASE ; YES - USE COMMON CODE ABOVE JMP CRLF ; OUTPUT CRLF WITH TECO ROUTINE .END