USING BTAB,R4
         LHI   R5,TBLENT           Item count

LOOPTBL  DS    0H
         CLC   FUNC,BFUN           This one?
         JE    FOUND_IT            Yes - handle
         LA.   R4,BLEN(R4).      <========= increment pointer
         JCT   R5,LOOPTBL          No  - try next
         J     ENDOFDAYS           Not found

On Saturday, October 3, 2015, Brent Longborough <[email protected]>
wrote:

> >
> > Date:    Fri, 2 Oct 2015 13:57:34 -0400
> > From:    Scott Ford <[email protected] <javascript:;>>
> > Subject: Branch table
> >
> > All:
> >
> > I am building a branch table like this:
> >
>
> BTAB     DSECT
> BADD     DS    A                   Routine address
> BFUN     DS    CL10                Function code
>          DS    0A                  Align to next item
> BLEN     EQU   *-BADD              One item length
> PROG     CSECT ,                   (or LOCTR)
> * ---------------------------------------------------
> FUNC     DS    CL(L'BFUN)          Input
>
> FUNCTBL  DS    0A                  Table
>          DC    A(INIT_DSP),CL(L'BFUN)'INIT'
>          DC    A(KILL_DSP),CL(L'BFUN)'KILL'
>          DS    0A                  Align end
> TBLENT   EQU   (*-FUNCTBL)/BLEN
> * ---------------------------------------------------
>          LA    R4,FUNCTBL          Start of table
>          USING BTAB,R4
>          LHI   R5,TBLENT           Item count
>
> LOOPTBL  DS    0H
>          CLC   FUNC,BFUN           This one?
>          JE    FOUND_IT            Yes - handle
>          JCT   R5,LOOPTBL          No  - try next
>          J     ENDOFDAYS           Not found
>
> FOUND_IT DS    0H
>          L     R15,BADD            Routine address
>          DROP  R4
>          BASR  R14,R15             Execute routine
> *        etc...
> * ---------------------------------------------------
>

Reply via email to