.TITLE VTMUTL - VTM UTILITY ROUTINES .IDENT /02.3/ .ENABL LC ;+ ; ; Free software BY ; Project Software & Development, Inc. ; ; This software is furnished for free and may be used and copied as ; desired. This software or any other copies thereof may be provided or ; otherwise made available to any other person. No title to and ; ownership of the software is hereby transferred or allowed. ; ; The information in this software is subject to change without notice ; and should not be construed as a commitment by PROJECT SOFTWARE ; AND DEVELOPMENT, INC. ; ; PROJECT SOFTWARE assumes no responsibility for the use or reliability ; of this software on any equipment whatsoever. ; ; Project Software & Development, Inc. ; 14 Story St. ; Cambridge, Ma. 02138 ; 617-661-1444 ; ; ; Title: VTMUTL.MAC ; Author: Robin Miller ; Date: June 10, 1982 ; ; Description: ; ; Utility routines for VT100 Message Formatter (VTM) program. ; ; ; Modification History: ; ;- .ENABL AMA .NLIST BEX .MCALL ASTX$S, CMKT$S, MRKT$S, QIOW$S, SETF$S, WTSE$S ; Local equates: MRKEFN = 10. ; MARKTIME EVENT FLAG TICKS = 1 ; TIME UNITS FOR MARKTIME SECNDS = 2 ; MINUTE = 3 ; HOURS = 4 ; .SBTTL CTRLC - CONTROL/C AST ROUTINE ;+ ; ; CTRLC - Control/C AST routine. ; ; This routine is entered when the users types CTRL/C to abort. ; ;- CTRLC:: TST MRKFLG ; MARK TIME OUTSTANDING ? BEQ 10$ ; IF EQ, NO (SKIP CANCEL) CMKT$S #MRKEFN ; CANCEL THE MARK TIME SETF$S #MRKEFN ; ENSURE EVENT FLAG IS SET 10$: BIS #B.CTRC,STATUS ; SHOW CONTROL/C WAS TYPED ; QIOW$S #IO.KIL,LUN,EFN,,,, ; KILL OUTSTANDING I/O TST (SP)+ ; REMOVE CTRL/C FROM STACK ASTX$S ; EXIT THE AST .SBTTL CVTOPT - CONVERT VTM OPTIONS TO UPPERCASE ;+ ; ; CVTOPT - Convert VTM options to uppercase. ; ; VTM options start with a left parentheses "{" and end with a right ; parentheses "}". In order for TPARS to parse the options, the ; options must be converted to uppercase. ; ; Inputs: ; R4 = the input buffer address (terminated by NULL). ; ; Outputs: ; All registers are preserved. ; ;- CVTOPT::CALL $SAVAL ; SAVE ALL REGISTERS 10$: TSTB (R4) ; END OF INPUT STRING ? BEQ 30$ ; IF EQ, YES CMPB (R4)+,#'{ ; BEGINNING OF AN OPTION ? BEQ 20$ ; IF EQ, YES BR 10$ ; AND LOOP ... 20$: TSTB (R4) ; END OF INPUT STRING ? BEQ 30$ ; IF EQ, YES CMPB (R4),#'} ; END OF OPTIONS ? BEQ 10$ ; IF EQ, YES CALL CUPPER ; ELSE, CONVERT TO UPPERASE INC R4 ; POINT TO THE NEXT BYTE BR 20$ ; AND LOOP ... 30$: RETURN .SBTTL CUPPER - CONVERT CHARACTER TO UPPER CASE ;+ ; ; CUPPER - Convert character to upper case. ; ; Inputs: ; (R4) = Character to convert. ; ;- CUPPER::CMPB (R4),#'a ; POSSIBLE LOWERCASE ? BLO 10$ ; IF LO, NO CMPB (R4),#'z ; REALLY LOWERCASE ? BHI 10$ ; IF HI, NO BICB #40,(R4) ; CONVERT TO UPPERCASE 10$: RETURN .SBTTL DELAY - WAIT SPECIFIED NUMBER OF SECONDS ;+ ; ; DELAY - Wait for a specified number of seconds. ; ; Inputs: ; R0 = the number of seconds to wait. ; ; Outputs: ; Carry clear/set = success/failure. ; ; All registers are preserved. ; ;- DELAY:: MRKT$S #MRKEFN,R0,#SECNDS ; MARK TIME FOR 2 SECONDS BCS 10$ ; IF CS, DIRECTIVE ERROR MOV #-1,MRKFLG ; SHOW MARKTIME IS ACTIVE WTSE$S #MRKEFN ; ELSE WAIT FOR MARKTIME CLR MRKFLG ; MARKTIME NO LONGER ACTIVE BR 20$ ; AND CONTINUE ... 10$: MOV $DSW,R0 ; COPY THE ERROR CODE CALL WRTERR ; WRITE THE ERROR MESSAGE 20$: RETURN .END