<snip>
USING RBBASIC,R5 POINT TO REQUEST BLOCK
L R7,RBLINK LOAD CALLER RB IN REG 7
DROP R5 DROP SVC RB MAPPING
USING RBBASIC,R7 AND NOW MAP CALLER RB
L R1,RBOPSW GET CALLER PSW AND PUT IN REG 1
N R1,=X'00F00000' ONLY PSW KEY
SRL R1,16 SHIFT TO 000000K0
* ST R1,KEY STORE CALLER KEY
DC H'0' FORCE ABEND
</snip>
If your SVC is a type 2/3/4 SVC, the code works.
I can't speak to how you are debugging or what you are seeing in a dump because
you have not shared any of that information.
You could even try this without needing your own SVC by having your code in a
LINK target, at least to verify that you are seeing the PSW of the SVC issuer
(SVC 6 in the simplest LINK case). You wouldn't have R5 set on input but can
easily pick that up via (IHAPSA) PSATOLD -> (IKJTCB) TCBRBP.
It is in general poor form to use RBLINK rather than RBLINKB unless AMODE 24,
but in your case you would know that the caller's RB is not waiting so the high
byte will have a 0 wait count so can get away with using the 4-byte name.
These days, the L/N/SRL has many better alternatives, such as
LLC (of the 2nd byte of RBOPSW) / NILL (to clear the low 4 bits if for some
reason you need to do so).
Peter Relson
z/OS Core Technology Design
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN