.TITLE ERPRG - Program Errors .IDENT /V01.00/ .ENABL LC ;+ ; This module processes program errors by outputing the supplied message. ; ; (taskname) -- [Exiting due to] Program error ; (error message) ; ; Call with: MOV #ERR,-(SP) ; JSR PC,ERPRGX (or ERPRGR) ; ; ERR = error message address. ; ; Exit with: ERPRGR -> Message output and return to caller (PSW/CS). ; ERPRGX -> Message output and task exit (with error status). ;- .PSECT ERR$TX,RO,D PRGERR: .ASCIZ /Program/ .PSECT ERR$CD,RO,I ERPRGX::INC (SP) ;Set to exit ERPRG:: MOV #9999$,-(SP) ;Set return address JSR PC,$SAVAL ;Save all registers CLR R0 ;Set no error number MOV #PRGERR,R1 ;Get the error type message MOV 22(SP),R2 ;Get the message address MOV 20(SP),R3 ;Get the error PC BIC #177776,R3 ;Only want the exiting bit CLR R5 ;Set there is no optional line CALLR ERMSG ;Go processor the error and exit ; ; Come here after message is output and pop the user supplied argument. ; 9999$: MOV (SP),2(SP) ;Set return address TST (SP)+ ;Clean stack SEC ;Set error RETURN ;Return to caller .END