% ***************************************************************** % * * % * This module is a part of the SAO VAX/VMS STOIC SYSTEM * % * * % * It was created by * % * Roger Hauck * % * Smithsonian Institution * % * Astrophysical Observatory * % * Cambridge, Massachusetts 02138 * % * (617)495-7151 (FTS 830-7151) * % * * % * This module may be reproduced * % * provided that this header is retained. * % * * % ***************************************************************** % Buffer output to screen 0 'O.FLAG VARIABLE DECIMAL % The following constant sets the buffer length for output to the terminal. % It must be set to a value at least 16 less than the SYSGEN parameter MAXBUF. % At SAO, O.BUFSIZE is 1024 and MAXBUF is 1100. 1024 'O.BUFSIZE CONSTANT HEX 0 'O.BUFCUR VARIABLE .D@ 'O.BUFSTRT CONSTANT O.BUFSIZE .D+! .D@ 'O.BUFEND CONSTANT 'FLUSH : O.BUFSTRT O.BUFCUR @ OVER - NEZ_IF % anything there? UNDROP TYPE % output buffer O.BUFSTRT O.BUFCUR ! ELSE % reset buffer DROP THEN % no action ; 'BUFFER_ON : -1 O.FLAG ! O.BUFSTRT O.BUFCUR ! ; 'BUFFER_OFF : FLUSH O.FLAG 0<- ; 'TYO : O.FLAG @ IF % is buffering turned on? O.BUFCUR @ O.BUFEND OVER - LEZ_IF % yes, out of room? DROP FLUSH O.BUFSTRT THEN % yes, flush DUP 1+ O.BUFCUR ! B! ELSE % put byte in buffer TYO THEN % buffering turned off, do normal tyo ; 'CR : D TYO A TYO ; 'SPACE : 20 TYO ; 'SPACES : GTZ_IF UNDROP ( SPACE ) THEN ; 'TYPE : O.FLAG @ IF % is buffering on? GTZ_IF % anything there? UNDROP ( % yes, loop through string DUP B@ TYO 1+ ) THEN % type next byte DROP ELSE TYPE THEN % buffering off, do normal TYPE ; 'MSG : COUNT TYPE ; 'TYI : O.BUFCUR @ O.BUFSTRT - GEZ O.FLAG @ AND IF % is there a buffer? O.BUFSTRT O.BUFCUR @ OVER - TYPE_TYI % yes O.BUFCUR O.BUFSTRT <- % reset buffer ELSE TYI THEN ; 'GETLINE : O.BUFCUR @ O.BUFSTRT - GEZ O.FLAG @ AND IF % is there a buffer? O.BUFSTRT +ROT O.BUFCUR @ O.BUFSTRT - +ROT TYPE_GETLINE % yes O.BUFCUR O.BUFSTRT <- % reset buffer ELSE O.BUFSTRT +ROT 0 +ROT % stuff the prompt address and count TYPE_GETLINE % output null string if no buffer THEN ;