On Tue, 14 Sep 2010 13:38:15 -0500, Mike Schwab wrote:

>On Tue, Sep 14, 2010 at 12:15 PM, Tony Harminc wrote:
><deleted>
>> Well, we had this discussion at great length a few years ago... The
>> pre-existing 24- or 31-bit program that's been running for many years
>> now gets called by a 64-bit program, issues a GETMAIN which now zeros
>> the high half of 64-bit R1, does some stuff, and returns to its
>> caller, restoring the only R1 it knows about, which is 32 bits.
>>
>> The 64-bit caller has had its R1 clobbered by calling the pre-existing
>> program, even though the pre-existing program used no 64-bit
>> instructions or services and restored R1 as it always has done, and as
>> its documentation states.

The programmer who wrote the 64-bit program should not expect that 
the bits 0-31 of registers 0, 1 and 15 are preserved.

>
>This is just like a 31 bit program calling a 24 bit program.  You have
>to save your own registers and set up the with 24 bit addresses before
>calling the 24 bit program.

No, you don't have to save your own registers if you are a 31-bit 
program calling a 24-bit program.  You do, of course, have to ensure 
that the called program will get control in AMODE(24) and must expect 
that it will return in AMODE(24), but that is a very different discussion.

An AMODE(64) program does not have to save its registers either. 
Read the Assembler Services Guide chapter on Linkage Conventions.

>
>System interrupts do have to restore all 64 bits of the register, but not
calls.

----------------------------------------------------------------------
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