.title STD_HANDLER - standard condition handler .sbttl FIGURE_3 - STD_HANDLER module listing $chfdef ;condition structures $ssdef ;system status codes ;++ ; ; **** USED BY PERMISSION OF THE VAX PROFESSIONAL TECHNICAL JOURNAL **** ; **** USED BY PERMISSION OF THE VAX PROFESSIONAL TECHNICAL JOURNAL **** ; **** USED BY PERMISSION OF THE VAX PROFESSIONAL TECHNICAL JOURNAL **** ; ;Disclaimer: ; This code was published in the VAX Professional technical journal of ; October 1991, Volume 13, 1991, number 5 in an article entitled ; 'Using LIB$SIGNAL To Call SYS$PUTMSG'. The code presented here is ; distributed by permission of the VAX Professional technical journal and ; may not be published or used for profit in *ANY* form without the express ; written consent of both the VAX Professional and the author. ; ; I would also like to expressly thank the editorial staff of the VAX ; Professional technical journal for both their consideration in publishing ; the original article, and for their permission to include it in this ; DECUS release. ; ; For license information, please refer to the licensing information in ; SIGVEC.MAR or the 000READ.ME file. ; ; CREATION DATE: 90.09.04 ; ; AUTHOR: David G. North, CCP ; ; FACILITY: STD_HANDLER ; ; FUNCTIONAL DESCRIPTION: ; This condition handler will use SYS$PUTMSG to dump the signal array ; to SYS$OUTPUT and SYS$ERROR, and will then issue a SS$_CONTINUE for ; success codes, or convert the signal to a return code to the caller ; of the frame establishing this handler (LIB$SIG_TO_RET). ; ; CALLING FORMAT: ; None ; ; USAGE CONVENTION: ; movaw g^STD_HANDLER,(FP) ;set up condition handler ; ;-- .psect std_handler$$code,exe,shr,nowrt,rd .entry STD_HANDLER, ^m ;standard condition handler movl CHF$L_SIGARGLST(AP),r4 ;get address of signal array cmpl CHF$L_SIG_NAME(r4),#SS$_UNWIND ;was this an unwind signal? beql cont ;SS$_CONTINUE an $UNWIND cmpl CHF$L_SIG_NAME(r4),#SS$_DEBUG ;was this a debug signal? beql resig ;resignal SS$_DEBUG pushab cont ;assume a continuable signal blbs CHF$L_SIG_NAME(r4),10$ ;signal is continuable movab unwind,(SP) ;set target to unwind to caller ; ; Following code calls SYS$PUTMSG. It is possible for code here to 'look up' ; the argument list to the procedure that established this handler, and extract ; a 'standard' parameter describing the target for the SYS$PUTMSG call. An ; example of such a 'target' might be a network channel for SYS$PUTMSG ; to output its message text to. ; 10$: $PUTMSG_S - msgvec = @CHF$L_SIGARGLST(AP) rsb ;return to post-processing return: ret ;exit STD_HANDLER cont: movzwl #SS$_CONTINUE,r0 ;continue from exception brb return ;exit handler resig: movzwl #SS$_RESIGNAL,r0 ;resignal exception brb return ;exit handler unwind: movl CHF$L_MCHARGLST(AP),r5 ;get mechanism list address movl CHF$L_SIG_NAME(r4),CHF$L_MCH_SAVR0(r5) ;copy signal name $UNWIND_S ;unwind to caller brb return ;exit handler .end