        .title  getjibadr
        .library "sys$library:lib"
        .link   "sys$system:sys.stb"/selective_search
        $SFDEF
        $IPLDEF
        $PCBDEF
        $SSDEF
        .psect  $LOCAL quad,pic,con,lcl,noshr,noexe,wrt
epid:   .blkl   1
jibadr: .blkl   1
        .psect  $CODE quad,pic,con,lcl,shr,exe,nowrt
        .entry  getjibadr,^m<>
        pushab  highipl_end
        pushab  highipl_start
        pushl   #0
        pushl   #0
        pushab  8(sp)
        calls   #3,G^SYS$LKWSET
        blbc    r0,100$
        movl    @4(ap),epid
        pushl   #0
        pushab  getjibadr_action
        calls   #2,G^SYS$CMKRNL
        blbc    r0,100$
        movl    jibadr,@8(ap)
100$:   ret
        .entry  getjibadr_action,^m<r2,r3,r4,r5>
        movab   G^EXE$SIGTORET,SF$A_HANDLER(fp) ; set exception handler
        pushl   #0
        pushal  epid
        pushl   #2
        movl    sp,ap
highipl_start:
        jsb     G^EXE$NAMPID
        blbs    r0,100$
        SETIPL  #0
        ret
100$:   movl    PCB$L_JIB(r4),r2
        UNLOCK  SCHED,newipl=#0
highipl_end:
        movl    r2,jibadr
        movl    #SS$_NORMAL,r0
        ret
        .end
