74h UT$LEAV leave a control region
Input B register - Code number to be returned by UT$ENTR.
Output B register - Code number to be returned by UT$ENTR.
C-flag - Clear if B register is zero, else set.
Description SEE UT$ENTR for full description of control regions.

Causes an exit from the control region established by the most recent UT$ENTR call.

Execution resumes as if UT$ENTR had returned the value in the B register, so that UT$LEAV never returns to the calling routine. Routines to any depth may be terminated early by calling UT$LEAV, provided that all are dynamic descendants of at least one UT$ENTR call.

Example To restart a routine after each error message.
LOOP:
        LDX     #ERROR_PRONE_ROUTINE
        LDD     PARAMETER
        OS      UT$ENTR
        BCC     EXIT_LOOP
        JSR     DISPLAY_MESSAGE   ; display the message corresponding
                                  ;     to the value in B
        BRA     LOOP
EXIT_LOOP:
Then in any of ERROR_PRONE_ROUTINE's dynamic descendants UT$LEAV may be called with the appropriate error code in B.
DYNAMIC_DESCENDANT:
        .
        .
        BCC     NO_ERROR
        LDAB    #ERROR_CODE_1
        OS      UT$LEAV    ; cause UT$ENTR to return B, setting C-flag
NO_ERROR:
See UT$ENTR for more examples.
Errors - none -