FDVTIO.MAC;3/AU:78:3,FDVTIO.LST/-SP=FDVTIO.MAC;2 -5,,/;JEK/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; 22-Jan-87 J. E. Kulaga ;; ;; Add support for time-out feature with default character insertion ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -126,127,/;JEK/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; tst $TMO$ ; timeout requested? bgt 12$ ; yes - process default char input blt 13$ ; yes - process after input ; no - issue normal QIO QIOW$S #IO.RTT!TF.RNE,#T$LUN,#T$IEFN,,R5,, br 14$ ; no timeout - join normal code seq ; The following code sequence implements a timeout feature for a ; single character input. Subroutine FSTMO is used to set the ; timeout period and subroutine FSDEFC is used to input the ; default character to be inserted into the buffer when the time- ; out period expires. .MCALL DIR$, QIO$S, MRKT$, WTLO$S, CMKT$S .GLOBL $DSW $TMO$:: .WORD 0 ; no timeout if $TMO$ = 0 $DCHR$:: .WORD 0 ; default character M$IEFN = 29. ; mark tme event flag MKT: MRKT$ M$IEFN,,2 ; mark time directive call 12$: MOV $TMO$,MKT+M.KTMG ; set time into directive DPB QIO$S #IO.RTT!TF.RNE,#T$LUN,#T$IEFN,,R5,, DIR$ #MKT ; issue mark time NEG $TMO$ ; negate $TMO$ as processing flag WTLO$S 1,#30000 ; wait for mark time or QIO CMKT$S #M$IEFN ; if QIO, cancel mark time CLEF$S #M$IEFN ; check state of mark time flag CMP $DSW,#IS.SET ; to check for timeout BNE 14$ ; branch if QIO returned QIOW$S #IO.KIL,#T$LUN,,,,, ; if timeout, cancel QIO MOVB $DCHR$,@X$TBFR(R4) ; insert default char into buffer MOV #IS.SUC,$DSW ; make QIO appear successful BR 14$ ; and join normal code sequence 13$: CLR $TMO$ ; clear $TMO$ as processing flag MOVB #CR,@X$TBFR(R4) ; insert into buffer MOV #IS.SUC,$DSW ; make QIO appear successful 14$: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /