McKown, John wrote:
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of Ludmila Koganer
Sent: Wednesday, August 22, 2007 1:37 PM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Calling a AMODE 31 program from AMODE 64


Can someone please provide me a sample of how to call a AMODE 31 program (ASM) from a AMODE 64 program (ASM) and pass parameters and get return values.

I am able to BASR to AMODE 31 and execute it but unable to use R1 for
passing parm address. I get a protection exception.

Thanks,
Ludmila


Make sure that the data you are sending to the AMODE 31 program resides
in AMODE 31 storage. I had this sort of problem when we first when from
AMODE 24 to AMODE 31.
Also, remember that BASR does not affect the addressing mode. So if you
are in AMODE 64 before the BASR, you are still in AMODE 64 in the other
module. To branch and change AMODE, you need to use the BASSM. And your
AMODE 31 code needs to use BSM to return, not BR! Otherwise, you'll need
to use a sequence  like SAM31, BASR, SAM64 to switch AMODEs in your
AMODE 64 code.

--
John McKown

I second what John says. If you have more details / symptoms
to give us more detailed clues, we can help you better. But
I would first make sure you are using BASSM / BSM instead of
BASSR / BE to call your subroutine and return.


--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

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

  z/OS Application development made easier
    * Our classes include
       + How things work
       + Programming examples with realistic applications
       + Starter / skeleton code
       + Complete working programs
       + Useful utilities and subroutines
       + Tips and techniques

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