On Mon, 9 Feb 2009 14:24:12 -0800, Don Russell wrote:
>
>That sounds like the subroutine was trying to be bi-modal, and probably used
>BSM to return. If it were called via BAL, the "addressing mode" bit in the
>return register is not reliable for determining address mode when the caller
>is in 24 bit mode. BAL sets the two high order bits of the regsiter to
>B'10', an ILC of 2. However, if the  caller were in 24 bit mode,  a BSM Rx
>would then incorrectly set the amode to 31 because the high-order bit is on.
>
>i.e. BSM may be used to return from calls via BAS, BASR, BASSM and BALR when
>the caller is in either 24 or 31 bit mode, but from BAL only if the caller
>is in 31 bit mode.
>
I did something like that in the Bad Old Days when access methods needed
to be called in 24-bit mode.  IIRC (vaguely):

Entry Code:

         STM
         BALR  0,0
         LTR   0,0
* if entered in 31-bit mode, BSM to enter 24-bit mode.
* if entered in 24-bit mode, clear the top bit of R14
* in the RSA.

Exit code:

         LM
         LTR   R14,R14
         BNMR  R14
         BSMR  R14

... runs in 24 bit mode on either architecture; never issues a
BSM to cause an instruction exception on 370.

-- gil

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

Reply via email to