.TITLE USEERR - WRITE AN ERROR MESSAGE .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: USEERR.MAC ; Author: Robin Miller ; Date: June 27, 1982 ; ; Description: ; ; Write a directive or FCS error message. ; ; ; Modification History: ; ;- .ENABL AMA .NLIST BEX .MCALL QIOW$S ; Offsets into error message block. ERROFF = 2 ; ERROR CODE OFFSET BUFOFF = 4 ; OUTPUT BUFFER OFFSET FLGOFF = 6 ; MESSAGE FLAGS OFFSET FACOFF = 10 ; FACILITY NAME OFFSET STAOFF = 12 ; STATUS RETURN OFFSET ALTOFF = 14 ; ALTERNATE FACILITY OFFSET ; Equates for RSX-11M error messages. TXTBIT = 1 ; INCLUDE TEXT OF MESSAGE MIDBIT = 2 ; INCLUDE MESSAGE ID SEVBIT = 4 ; INCLUDE SEVERITY LEVEL FACBIT = 10 ; INCLUDE FACILITY NAME ; Argument block for error messages. ERRBLK: .BYTE 6,0 ; ARG BLOCK FOR GETMSG .WORD ERRCOD ; ADDRESS OF ERROR CODE .WORD -1 ; ADDRESS OF MESSAGE BUFFER .WORD MSGFLG ; ADDRESS OF FLAG WORD .WORD FACNAM ; ADDRESS OF FACILITY NAME .WORD STACOD ; ADDRESS FOR STATUS RETURN .WORD -1 ; ADDRESS OF MESSAGE FACILITY ERRCOD: .WORD 0 ; ERROR MESSAGE CODE FACNAM: .ASCIZ %USERS% ; FACILITY NAME .EVEN MSGFLG: .WORD TXTBIT!MIDBIT!SEVBIT!FACBIT ; INCLUDE EVERYTHING STACOD: .WORD 0 ; STATUS CODE RETURN .SBTTL CHKERR - CHECK FOR ERRORS ;+ ; ; CHKERR - Check for directive or I/O errors to terminal. ; ; Inputs: ; $DSW = status from last directive issued. ; TIOSB = the terminal I/O status code. ; ; Outputs: ; C bit clear/set = success/failure. ; On failure, an error message is output. ; ;- CHKERR::MOV R0,-(SP) ; SAVE R0 ON STACK BCC 10$ ; IF CC, DIRECTIVE SUCCESS MOV $DSW,R0 ; ELSE, COPY THE ERROR CODE BR 20$ ; USE COMMON CODE ... 10$: MOVB TIOSB,R0 ; I/O ERROR ENCOUNTERED ? BPL 30$ ; IF PL, NO (C CLEAR FROM $DSW) BIC #^C377,R0 ; CLEAR TO SHOW I/O ERROR ; Output the error message. 20$: CALL WRTERR ; WRITE THE ERROR MESSAGE 30$: MOV (SP)+,R0 ; RESTORE R0 RETURN ;+ ; ; WRTERR - Report a directive or FCS error message. ; ; This routine sets up the argument block for a call to PUTMSG to ; report the RSX-11M error message text. ; ; Inputs: ; R0 = the error code. ; ; Outputs: ; C bit is set to indicate error occured. ; ; All registers are preserved. ; ;- WRTERR::CALL $SAVAL ; SAVE R0 - R5 MOV R0,ERRCOD ; SAVE THE ERROR CODE MOV #ERRBLK,R5 ; ADDRESS OF ARG BLOCK CALL PUTMSG ; WRITE THE ERROR MESSAGE SEC ; SHOW FAILURE RETURN .SBTTL OUTMSG - OUTPUT A MESSAGE TO THE TERMINAL ;+ ; ; OUTMSG - Output a message to the terminal. ; ; Inputs: ; R1 = the message address. ; R2 = the message byte count. ; ; Outputs: ; C bit clear/set = success/failure. ; ; All registers are preserved. ; ;- OUTMSG::JSR R2,$SAVVR ; SAVE REGISTERS R0 - R2 QIOW$S #IO.WLB!TF.CCO,#TILUN,#TIEFN,,#TIOSB,, CALL CHKERR ; CHECK FOR ERRORS RETURN .END