************************************************** 1) DR3:[351,73]AUXIO.MAC;22 1 .TITLE AUXIO - AUX I/O Routines 2 .IDENT /1.1/ *************** 2) DR3:[351,73]AUXIOREM.MAC;11 1 .TITLE AUXIO - AUX I/O Routines 2 .IDENT /1.1/ ************************************************** 1) DR3:[351,73]AUXIO.MAC;22 41 ;- *************** 2) DR3:[351,73]AUXIOREM.MAC;11 41 ; modified oct 86 to work with remote terminals on IAS, F. Borger 42 ;- ************************************************** 1) DR3:[351,73]AUXIO.MAC;22 45 .MCALL DIR$, QIOW$S, GET$, mrkt$s, clef$s, cmkt$s 47 .psect rwdata,rw,d,lcl,rel,con 49 ; Local definitions: 51 ESCDLY = 15. ; Escape clock ticks delay. 52 ; 53 ; The Read-with-termination table function (IO.RTT) allows control 54 ; characters and space to terminate the read. 55 ; 56 TTABLE: .WORD -1 ; Terminate on all (00-15) 57 .WORD -1 ; control characters (16-31) 58 .WORD 1 ; (32-47) 59 .WORD 0 ; (48-63) 60 .WORD 0 ; (64-79) 61 .WORD 0 ; (80-95) 62 .WORD 0 ; (96-111) 63 .WORD 100000 ; and the delete key. (112-127) 64 .BLKW 8. ; Remaining table zero. 66 BUFSAV::.WORD 0 ; The starting buffer address. *************** 2) DR3:[351,73]AUXIOREM.MAC;11 46 .MCALL DIR$, QIOW$S, GET$, mrkt$s, clef$s, cmkt$s,qio$s,wtse$s 48 .psect rwdata,rw,d,lcl,rel,con 50 ; Local definitions: 52 ESCDLY = 30. ; Escape clock ticks delay. 54 BUFSAV::.WORD 0 ; The starting buffer address. ************************************************** 1) DR3:[351,73]AUXIO.MAC;22 69 .psect code,ro,i,lcl,rel,con *************** 2) DR3:[351,73]AUXIOREM.MAC;11 58 .SBTTL GETCMD - Get a command from the user. 59 .psect code,ro,i,lcl,rel,con ************************************************** 1) DR3:[351,73]AUXIO.MAC;22 73 .SBTTL GETCMD - Get a command from the user. 74 ;+ *************** 2) DR3:[351,73]AUXIOREM.MAC;11 62 ;+ ************************************************** 1) DR3:[351,73]AUXIO.MAC;22 104 10$: TST CMDEND ; Is there an existing command ? 105 BEQ 40$ ; If EQ, no. 106 MOV CMDEND,R1 ; Copy end of command line. 107 SUB R1,BUFCNT ; Adjust remaining buffer size. 108 CMP CMDPTR,R1 ; Pointing at end of command ? 109 BEQ 30$ ; If EQ, yes (do normal read). 110 20$: CALL DOREAD ; Do single character reads. 111 ; BCS 120$ ; If CS, we've had an error. 112 ; BR 50$ ; Else, use common code ... 113 bcc 50$ ; if ok, use common code 114 jmp 120$ ; else do error thing 115 30$: ADD CMDPTR,R0 ; Point to end of command line. 117 40$: mov r5,-(sp) ;save reg 118 mov .crtsk,r5 ;get my ti PUD 119 mov a.ti(r5),r5 120 cmp u.dn(r5),#"HT ;running on network ? 121 beq 411$ ;if so, must not do read with timeout 122 cmp r0,bufsav ; is this a full line read ? 123 beq 41$ ; if so, do read with timeout 124 411$: QIOW$S #IO.RTT,#TOLUN,#TOEFN,,#TIOSB,, 125 br 42$ ; else do normal read 126 41$: QIOW$S #IO.RTT!tf.tmo,#TOLUN,#TOEFN,,#TIOSB,, 127 42$: CALL CHKERR ; Check/report any errors. 128 BCC 43$ ; br if went 129 mov (sp)+,r5 ; else restore r5 130 jmp 120$ ; If CS, treat this as fatal. 131 43$: mov (sp)+,r5 ; restore used reg 132 cmpb tiosb,#2 ; did we time out on read ? 133 bne 45$ ; no, treat normally 134 call getmes ; yes, go for messages 135 mov #1,clrflg ; show that 3 top lines are cleared 136 br 40$ ; go again, (losing anything typed) 137 45$: MOV BUFSAV,R0 ; Set the starting buffer address. 138 ADD TIOSB+2,CMDEND ; Accumulate the line length. 139 SUB TIOSB+2,BUFCNT ; Calculate remaining byte count. 140 MOV CMDEND,R1 ; Copy the current byte count. 141 MOV R1,CMDPTR ; Set the command line pointer. 142 ; 143 ; On VMS, the terminator is stored in the buffer. On RSX, it isn't. 144 ; 145 MOV R0,R5 ; Copy the input buffer address. 146 ADD R1,R5 ; Point to end of input buffer. 147 MOVB TIOSB+1,(R5) ; Store terminator in buffer. 149 ; Check for the various control keys. 151 50$: TST BUFCNT ; Terminated by buffer full ? *************** 2) DR3:[351,73]AUXIOREM.MAC;11 92 10$: 93 ; for remote use, can't do fancy stuff, do single char all the time 94 MOV CMDEND,R1 ; Copy end of command line. 95 SUB R1,BUFCNT ; Adjust remaining buffer size. 96 20$: CALL DOREAD ; Do single character reads. 97 bcc 50$ ; if ok, use common code 98 jmp 120$ ; else do error thing 99 ; 100 ;; Check for the various control keys. 101 ; 102 50$: TST BUFCNT ; Terminated by buffer full ? ************************************************** 1) DR3:[351,73]AUXIO.MAC;22 181 TST CMDEND ; Is there a command line ? 182 BEQ 40$ ; If EQ, no (normal read). 183 CMP CMDPTR,R1 ; In middle of a command line ? 184 ; BNE 20$ ; If NE, yes. 185 beq 91$ ; br if not 186 jmp 20$ 187 91$: ADD R1,R0 ; Set next input buffer address. 188 ; BR 40$ ; And go read some more input. 189 jmp 40$ ; And go read some more input. 191 ; Terminate the command line with a NULL. *************** 2) DR3:[351,73]AUXIOREM.MAC;11 132 91$: ADD R1,R0 ; Set next input buffer address. 133 jmp 20$ ; And go read some more input. 135 ; Terminate the command line with a NULL. ************************************************** 1) DR3:[351,73]AUXIO.MAC;22 237 MOVB TMPBUF,R3 ; Copy the character input. 238 CMP R3,#SPACE ; Is this a control key ? *************** 2) DR3:[351,73]AUXIOREM.MAC;11 181 movb tiosb+1,r3 ; get terminator 182 bic #200,r3 183 cmpb r3,#15 ; terminated with cr ? 184 beq 11$ 185 cmpb r3,#33 ; or escape 186 bne 12$ 187 11$: movb r3,tmpbuf ; put terminator in buffer 188 12$: MOVB TMPBUF,R3 ; Copy the character input. 189 CMP R3,#SPACE ; Is this a control key ? ************************************************** 1) DR3:[351,73]AUXIO.MAC;22 297 ; Sit in a delay loop waiting for escape sequence. 299 MOV #ESCDLY,R2 ; Retry up to this limit. 300 10$: MOV #1,R0 ; Wait for 1 301 MOV #TICKS,R1 ; clock tick. 302 CALL DELAY ; Do the delay. 303 CALL GTYPAH ; Get the typeahead count --> R1. 304 BCS 20$ ; If CS, nothing in typeahead. (01) 305 CMP R1,#2 ; Do we have remaining bytes ? 306 BHIS 30$ ; If HIS, yes. (01) 307 20$: SOB R2,10$ ; Loop until limit reached. 308 SEC ; Show no escape sequence read. 309 BR 100$ ; Use common return ... 311 30$: MOV #2,R1 ; Only read one escape sequence. 312 CLRB (R5)+ ; Clear the escape character. 313 QIOW$S #IO.RNE,#TOLUN,#TOEFN,,#TIOSB,, ; Read escape seq. 314 CALL CHKERR ; Check/report any errors. 315 BCS 100$ ; If CS, we've had an error. 316 MOV #IS.ESQ,TIOSB ; Show escape sequence read. 317 BIS #B.ESQ,STATUS ; Show an escape sequence found. *************** 2) DR3:[351,73]AUXIOREM.MAC;11 248 30$: MOV #2,R1 ; Only read one escape sequence. 249 CLRB (R5)+ ; Clear the escape character. 250 clr tiosb ; for semaphor 251 QIO$S #IO.RNE,#TOLUN,#TOEFN,,#TIOSB,, ; Read escape seq. 252 mrkt$s #toefn,#2,#2 ; give 2 seconds for escape seq 253 wtse$s #toefn 254 clef$s #toefn 255 CALL CHKERR ; Check/report any errors. 256 BCS 100$ ; If CS, we've had an error. 257 tst tiosb ; did read finish ? 258 bne 35$ ; if it did, this is esc sequence 259 sec ; show no escape read 260 return 261 35$: MOV #IS.ESQ,TIOSB ; Show escape sequence read. 262 BIS #B.ESQ,STATUS ; Show an escape sequence found. ************************************************** 1) DR3:[351,73]AUXIO.MAC;22 340 ; If character entered is an escape, check for escape sequence. *************** 2) DR3:[351,73]AUXIOREM.MAC;11 284 movb tiosb+1,r3 ; get terminator 285 bic #200,r3 286 cmpb r3,#15 ; terminated with cr ? 287 beq 11$ 288 cmpb r3,#33 ; or escape 289 bne 12$ 290 11$: movb r3,tmpbuf ; put terminator in buffer 291 12$: 292 ; If character entered is an escape, check for escape sequence. 10 differences found AUXIO.DIF=AUXIO.MAC,AUXIOREM.MAC