.TITLE SHTERR - 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: SHTERR.MAC ; Author: Robin Miller ; Date: January 4, 1985 ; ; Description: ; ; Write a directive or FCS error message. ; ; Modification History: ; ;- .ENABL AMA .NLIST BEX ; Offsets into error message block. ERROFF = 2 ; The error code offset. BUFOFF = 4 ; The output buffer offset. FLGOFF = 6 ; The message flags offset. FACOFF = 10 ; The facility name offset. STAOFF = 12 ; The status return offset. ALTOFF = 14 ; The alternate facility offset. ; Equates for RSX-11M error messages. TXTBIT = 1 ; Include text of the message. MIDBIT = 2 ; Include message the id field. SEVBIT = 4 ; Include severity the level. FACBIT = 10 ; Include the facility name. ; Argument block for error messages. ERRBLK: .BYTE 6,0 ; Argument block for PUTMSG. .WORD ERRCOD ; Address of the error code. .WORD -1 ; Address of the message buffer. .WORD MSGFLG ; Address of the flag word. .WORD FACNAM ; Address of the facility name. .WORD STACOD ; Address for the status return. .WORD -1 ; Address of the message facility. ERRCOD: .WORD 0 ; The error message code. MSGFLG: .WORD TXTBIT!MIDBIT!SEVBIT!FACBIT ; Include everything. STACOD: .WORD 0 ; RSXMSG status return code. FACNAM: .ASCIZ %SHT% ; The facility name. .EVEN .SBTTL CHKERR - CHECK FOR ERRORS ;+ ; ; CHKERR - Check for directive or I/O errors to terminal. ; ; Inputs: ; $DSW = status from last directive issued. ; SHSB = the terminal I/O status code. ; ; Outputs: ; C bit clear/set = success/failure. ; On failure, an error message is output. ; ;- .ENABL LSB CHKDIR::MOV R0,-(SP) ; SAVE R0 ON STACK BCC 30$ ; IF CC, SUCCESS MOV $DSW,R0 ; COPY THE ERROR CODE BR 20$ ; USE COMMON CODE ... CHKERR::BCS CHKDIR ; IF CS, DIRECTIVE ERROR MOV R0,-(SP) ; SAVE R0 ON STACK 10$: MOVB SHSB,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 .DSABL LSB .SBTTL WRTERR - Report an error message. ;+ ; ; WRTERR - Report an error message. ; ; This routine sets up the argument block and calls PUTMSG to get the ; RSX-11M error message text. ; ; Inputs: ; R0 = The error code. ; R5 = The file table entry address. ; ; Outputs: ; C bit is set to indicate error occured. ; ; All registers are preserved. ; ;- WRTERR::CALL $SAVAL ; Save all registers. MOV R5,R4 ; Copy the file entry address. MOV #ERRBLK,R5 ; Address of the argument block. MOV R0,@ERROFF(R5) ; Save the error code. CALL PUTMSG ; Write the error message text. SEC ; Show there was an error. RETURN .END