>>That's why you usually omit R15 from the registers that are to be 
>>reloaded. There are two solutions (at least) to this problem: split
the 
>>LM into a load for R14 and a LM which starts at R0 and 20(r13),
leaving 
>>R15 untouched, so you can put the return code into R15 before the 
>>reload,
>>or: modify the contents of the savearea (16(r13) for R15) before
>>doing the reload.

>That solution would not work in the example given because R9 was 
>being used as the base register, not R15.

I would have to disagree and suggest that this is the only solution that
will work (in traditional programs) if the intent is to load a variable
return code into Reg 15.  Your choices are quite simple.  Place the
value into the save area so it is restored into R15 after the LM
instruction completes, or don't restore R15 with the LM instruction and
place the RC value in beforehand.

Actually you could also simply re-establish addressability, (although
it's not as elegant) by simply issuing a DROP R9 and then a USING
CSECTNAME,R15 after the LM instruction.  At that point you would have
program addressability and could restore from the designated work area.
It doesn't matter that R15 will be modified since the only remaining
instruction doesn't require addressability.

Another solution would be to simply replace the LH instruction with a
LARL instruction and make the SURC field a fullword.  That wouldn't
require addressability either.

Regards

Adam

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to