Tony Thigpen wrote:
I always like to use a second register with a value of +1

QMGREX01 CSECT ,
         STM   R14,R12,12(R13)
         LR    R11,R15
         LA    R14,1
         USING QMGREX01,R11,R12
         LA    R12,4095(R14,R11)
         LR    R8,R1
         USING WORKAREA,R13

It is even move meaningful if using more base registers.

QMGREX01 CSECT ,
         STM   R14,R12,12(R13)
         LR    R10,R15
         LA    R14,1
         USING QMGREX01,R10,R11,R12
         LA    R11,4095(R14,R10)
         LA    R12,4095(R14,R11)
         LR    R8,R1
         USING WORKAREA,R13

I always use R14 because I always pick it up using LM before branching
back to the caller so it's always fair game at this point in the
program. Any other register would have to be reloaded because the
program might be expecting them to contain something important.

Tony Thigpen

In our beginning Assembler class we present the student with
three models for setting up multiple base registers:


THEPROG CSECT
        STM   14,12,12(13)
        LR    12,15
        USING THEPROG,12,11,10
        LM    10,11,ADCON
        B     AROUND
ADCON   DC    A(THEPROG+8192,THEPROG+4096)
AROUND  DS    0H

----------------

THEPROG CSECT
        STM    14,12,12(13)
        LR     12,15
        USING  THEPROG,12,11,10
        LA     11,4095(12)
        LA     11,1(11)
        LA     10,4095(11)
        LA     10,1(10)

--------------

THEPROG CSECT
        STM    14,12,12(13)
        LR     12,15
        USING  THEPROG,12,11,10
        BAS    2,*+8
        DC     F'4096'
        L      2,0(2)
        LA     11,0(2,12)
        LA     10,0(2,11)

-------------

Each of these works fine, and has its unique set
of teaching points. Next I ask them how to modify
each of these approaches to add an additional
base register: some interesting points about
maintenance come up.


But in the class on programming for z/Architecture
we recommend using LARL for initializing the first
base register; then you may use LAY for subsequent
base registers, although at this point we emphasize
using long-displacement instructions to minimize
the need for multiple base registers.



--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

* To get a good Return on your Investment, first make an investment!
  + Training your people is an excellent investment

Reply via email to