.TITLE GETKEY - Read a single keypress from DECUS C .IDENT /X0.0/ ;+ ; A couple of simple functions to be used from DECUS C to ; do terminal I/O. ; ; Written by Johnny Billquist ; ; This is free software. ; ; The functions are: ; att(n) - Initialize these functions, and define n as the LUN ; on which all I/O should be done. ; getkey() - Returns as an integer the key pressed. ; echo() - Turn on terminal echoing at read ; noecho() - Turn off terminal echoing at read ;- .MCALL QIOW$S .PSECT DATA,D,RW FNC: .WORD IO.RLB!IO.RAL LUN: .WORD 0 IOSB: .BLKW 2 BUF: .BLKW .PSECT CODE ATT:: MOV 2(SP),LUN QIOW$S #IO.ATT,LUN,#1 RETURN GETKEY:: QIOW$S FNC,LUN,#1,,#IOSB,,<#BUF,#1> MOVB BUF,R0 RETURN ECHO:: BIC #TF.RNE,FNC RETURN NOECHO:: BIS #TF.RNE,FNC RETURN .END