> -----Original Message-----
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-
> [email protected]] On Behalf Of Scott Ford
> Sent: Friday, October 02, 2015 10:58 AM
> To: [email protected]
> Subject: Branch table
>
> All:
>
> I am building a branch table like this:
>
> FUNC DS CL10
>
> FUNCTBL DS 0H
> DC 'INIT 'A(INIT_DSP)
I assume you meant
DC C'INITbbbbbb',A(INIT_DISP)
It would eliminate typing issues if you changed the first constant to CL10'xxxx'
In either case, half the time your address constant will be separated from you
character constant by two extra bytes for alignment. You need to specify the
address constant as AL4(xxx) to avoid this.
> ......etc
> TBLENT DS F'5'
If you don't make this a DC, the first L below will load garbage into R5.
>
> ------------------------------------------------------------------------------
>
> LA R4,FUNCTBL
> L R5,TBLENT
> LOOPTBL DS 0H
> CLC FUNC,0(R4)
> BE FOUND_IT
>
> FOUND_IT DS 0H
> LA R4,10(R4)
> L R14,R4
I assume you meant
L R14,0(R4)
because as written you are loading from location 4 in low memory.
Even after it is fixed, the address in R4 is not aligned for a full word load.
This may no longer cause a specification exception but it still goes against
the grain.
Of course you meant to load the address from the table into R15 since the BALR
below now goes to never-never land.
> BALR R14,R15
>
>
> Is my logic correct ? or did i miss something ?
No. Yes.