On Sat, Feb 12, 2022 at 11:17:52AM -0800, Charles Mills wrote:
> I would guess that if it works but is not documented then who knows. There
> is no guarantee that it does not stop working at some point in the future.

I'd guess so too, but might break a lot of things if it was changed..

>From MVS (pre 31 bit) source from IEAVEAT0 - ATTACH - SVC 42 - IGC0004B 

*/* P STORE REGISTERS INTO RBGRSAVE                                  */ 00843000
*                                                                  0352 00844000
*   RBGRSAVE=R4CURTCB->TCBRBP->RBGRSAVE;/* REGISTERS FOR ATTACHED  0352 00845000
*                                      PROGRAM               @YM00058*/ 00846000
         L     @08,TCBRBP(,R4CURTCB)                               0352 00847000
         MVC   RBGRSAVE(64,R3WORKAD),RBGRSAVE(@08)                 0352 00848000

So the new subtask gets a complete copy of the callers registers
preset in the new SVRB register save area hung off the new TCB.

The SVRB (running on the subtask) may (usually) change R13 in the SVRB
register save are to point to a savearea.  The subtask (SVRB) then does
a branch entry to LINK.

When this SVRB (LINK) exits these are the registers the resulting entry
point from the attach will get.

I'd suspect this was true in MVT too...

I glanced at both an MVT and MVS Supervisor Services and Macros 
manual and don't see any specification of the registers being passed.

Perhaps it was never documented as happening, but was coded that way
for simplicity (what registers should a new task get?, Oh a copy)
and tradition/compatiblity restricted any change.

On the other hand, the description of LINK say that the linkage
relationship is the same as that created by the BAL instruction.

BAL doesn't change any but specified registers.  Also way back before MVT
(and subtasks), there are indications that ATTACH on some systems acted
like link (MFT w/o subtasks?) in the old MVT manuals).
 
> Binyamin Dissen:

> The manual (MVS Programming: Assembler Services Reference, Volume 1
> (ABE-HSP)) states:
  
> 2-12 Used as work registers by the system.
  
> but I am looking at some old functional code which seems to expect
> (several?) registers values at ATTACH time be passed as is to the subtask.
> 
> Can someone enlighten me as to whether this is luck or an undocumented API.
> I prefer to follow the old adage - if it ain't broke, don't fix it.

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