.TITLE HV5 ; SOURCE FILE HV5.MAC ; ; HVPLOT V ; ; These subroutines determine if the program are running under tsx+ ; and set jsw and use emt 375 to allow immediate access of terminal id. ; ; Compiled by E. Grigolato ; Boyne Smelters Ltd ; Gladstone,Qld,4680 ; on the 3-MAR-88 ; ; Taken from code by Chester.G.Wilson for Boyne Smelters Ltd. ; ;Terminal bits TTNOW and TTNORM ; DATA AREA AREAW: .BLKW 10. ;COMMUNICATION AREA FOR EMTS .Sbttl Terminal Routines ;Bits in JSW jsw=44 tcbit$=100 ;If set, inhibit terminal wait ttspc$=10000 ;If set, terminal special mode (no echo, single characters) sysgen=372 ;SYSGEN monitor offset word tsx$=100000 ;If set therein, indicates running under TSX+ (>= V6) .mcall .gval,.print ;Return TRUE (non-zero) if running under TSX TSX:: clr -(sp) .gval #areaw,#sysgen bic #<^C>,r0 beq 10$ inc (sp) 10$: clr r1 ;In case LOGICAL * 4 mov (sp)+,r0 return ;Set up for immediate return from TTINR TTNOW:: bis #tcbit$!ttspc$,@#jsw call tsx beq 10$ mov #oknow,r0 emt 375 MOV #SINGLE,R0 EMT 375 10$: return ;Remove immediate return. Note can't switch off EMT but as long as ; JSW set up properly, this is not a problem. TTNORM:: bic #tcbit$!ttspc$,@#jsw call tsx beq 20$ MOV #OFF,R0 EMT 375 20$: return oknow: .byte 0,152 ;EMT block for TSX to allow single character .word 'U,0 ; input with TTINR SINGLE: .BYTE 0,152 .WORD 'S .WORD 0 OFF: .BYTE 0,152 .WORD 'T .WORD 0 ;Print a string: CALL PRINT('String') PRINT:: mov 2(r5),r0 .print return .END