How to "Prevent No Base Register Found" in z/OS Assembly?

Posted on 2011-10-11
Last Modified: 2012-05-12
In IBM z/OS assembly code, I'm trying to understand how to give the assembler the base register. Do you know how to do that?
Question by:JCW2
    LVL 4

    Accepted Solution

    When I wrote assembler we wrote USING R13 etc. See IBM manual
    LVL 8

    Assisted Solution

    You need to set up the base register when you enter your function and tell the assembler about it with the USING directive.

    An example is shown in   (This is the reference I provided in your earlier question).  Classic entry code for a function is this:

             USING *,12          Tell assembler what register we are using for pgm. base
             STM   14,12,12(13)  Save registers 14,15,and 0 thru 12 in callers Save area
             LR    12,15         Set up base register with programs entry point address      
             LA    15,SAVE       Now Point at our own save area
             ST    15,8(13)      Set forward chain
             ST    13,4(15)      Set back chain              
             LR    13,15         Now switch to new save area

    There are multiple ways to write function entry code.  Some or all of this may be performed by macros in your code.  Take a look at what the SUBENTRY macro generates.  

    LVL 4

    Expert Comment

    No need to copy the example, that I gave him, he's able to click on a link?
    LVL 8

    Expert Comment

    Apparently, the questioner has some trouble clicking on links and following the material there.  This is a repeat of his previous questions.

    Author Comment

    Sorry about my absence.

    Author Closing Comment

    Thank you for your help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
    How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
    The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now