.TITLE CATUTL - CATCHALL UTILITY ROUTINES .IDENT /1.0/ .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: CATUTL.MAC ; Author: Robin Miller ; Date: September 22, 1982 ; ; Description: ; ; Catchall utility routines. ; ; Modification History: ; ;- .NLIST BEX .MCALL QIOW$S .SBTTL CUPPER - CONVERT CHARACTER TO UPPER CASE ;+ ; ; CUPPER - Convert character to upper case. ; ; Inputs: ; (R0) = Character to convert. ; ;- CUPPER::CMPB (R0),#'a ; POSSIBLE LOWERCASE ? BLO 10$ ; IF LO, NO CMPB (R0),#'z ; REALLY LOWERCASE ? BHI 10$ ; IF HI, NO BICB #40,(R0) ; CONVERT TO UPPERCASE 10$: RETURN .SBTTL MOVE -- MOVE AN ASCIZ STRING ;+ ; ; MOVE - Move an ASCIZ string to Spawn buffer (SPNBUF). ; MOVEC - Alternate entry (R1 contains output address). ; ; INPUTS: ; R0 = Address of ASCIZ string to move. ; R1 = Address of output buffer. ; ; OUTPUTS: ; R1 = Updated (ready for next character). ;- MOVE:: MOV #SPNBUF,R1 ; SET UP OUTPUT BUFFER MOVEC:: MOVB (R0)+,(R1)+ ; START COPY BNE MOVEC ; IF NE, MORE TO GO DEC R1 ; POINT TO NULL RETURN .SBTTL SKIP - Skip Any Leading Spaces ;+ ; ; SKIP - Skip any leading spaces. ; ; This routine skips leading spaces in the command line. ; ;- SKIP:: JSR R2,$SAVVR ; Save R0 - R2 MOV SCMD,R0 ; Copy the command address TSTB STATUS ; Do we have a command ? BPL 20$ ; If PL, no 10$: TSTB (R0) ; End of the command line ? BEQ 20$ ; If EQ, yes CMPB (R0)+,#SPACE ; Is this a space byte ? BEQ 10$ ; If EQ, yes (check next) DEC R0 ; Nope, point to last byte 20$: MOV R0,SCMD ; Save updated address RETURN .SBTTL WRITE -- WRITE A MESSAGE TO THE TERMINAL ;+ ; ; WRITE - Write a message to the terminal. ; ; This routine is used to write a message to the terminal. ; ; Inputs: ; R0 = address of message to write. ; R1 = the message byte count. ; ; Outputs: ; C bit clear/set = success/failure. ; On Failure, R0 = the error status. ; ; All other registers are preserved. ; ;- VFC:: .WORD SPACE ; VERTICAL FORMAT CHARACTER WRITE:: QIOW$S #IO.WAL,#TILUN,#TIEFN,,#IOSB,, BCC 10$ ; IF CC, OK MOV $DSW,R0 ; ELSE SET EXIT STATUS BR 20$ ; AND CONTINUE ... 10$: TSTB IOSB ; WAS THE WRITE SUCCESSFUL ? BPL 20$ ; IF PL, YES MOVB IOSB,R0 ; ELSE, COPY THE ERROR CODE SEC ; AND SHOW FAILURE 20$: MOV #SPACE,VFC ; RESET TO SINGLE SPACING RETURN ; ALL DONE .END