>Yes, as long as the code is RMODE31 you can use BASSM to
>switch modes; I don't recommend Set Addressing Mode.

I quite strongly disagree.

You often are required to use the linkage instruction that the target 
routine expects you to use.
If you are to use a macro, then the macro will use that linkage 
instruction.
If the documentation is "CALL" then you should use that (and it will 
generate BASR or BALR, but not BASSM).
Of course you can BASSM to "yourself" so that you can get to the real 
target via subsequent BASR/BALR.

Simply put, a service routine needs to know whether it is BASR-entered or 
BASSM-entered in order to know how to determine the caller's AMODE.
Many routines will begin with "BSM 14,0" to "capture the current AMODE" 
perhaps in order that they can issue BAKR and have the corresponding PR 
work. If the routine expects to be entered by BASSM it will not do this. 
If it expects to be entered by BASR it can be necessary. If the wrong 
choice is taken, control will not return properly. And the responsibility 
is on the caller to do what the target documents (or use what the target 
provides as the calling mechanism).

>It depends on the SVC. The Diagnosis book describes the 
>register requirements.

It is never a system requirement to provide R13 for an SVC.
I think, in general, that only the LINK SVC (and the LINKX extended SVC), 
and SYNCH might return control with regs 2-13 not preserved. For those the 
R13 requirement is an attribute of the target routine. If the target 
routine chooses not to have such a requirement -- perhaps it uses BAKR/PR 
-- then it imposes no such requirement on the invoker.

Peter
rel...@us.ibm.com 
     1-845-435-8390            8+295-8390

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to