Re: Registers at entry to subtask (from ATTACH)

2022-02-12 Thread Seymour J Metz
The issuer sees the same values in R2-R12 before and after the ATTACH.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Tony Harminc [t...@harminc.net]
Sent: Saturday, February 12, 2022 5:14 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Registers at entry to subtask (from ATTACH)

On Sat, 12 Feb 2022 at 13:54, Binyamin Dissen 
wrote:

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

Isn't the  "Used as work registers by the system" talking about the
registers the issuer sees after the ATTACH, rather than what the ATTACHed
subtask sees?

Tony H.

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

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


Re: Registers at entry to subtask (from ATTACH)

2022-02-12 Thread Peter Sylvester

On 12/02/2022 23:14, Tony Harminc wrote:

On Sat, 12 Feb 2022 at 13:54, Binyamin Dissen
wrote:


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.


Isn't the  "Used as work registers by the system" talking about the
registers the issuer sees after the ATTACH, rather than what the ATTACHed
subtask sees?


Hi:

A few lines above:

The contents of the GPRs on entry to the subtask ar

otherwise: What is the issuers base register?

You don't do a stm/lm around attach.

/PS



Tony H.

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



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


Re: Registers at entry to subtask (from ATTACH)

2022-02-12 Thread Tony Harminc
On Sat, 12 Feb 2022 at 13:54, Binyamin Dissen 
wrote:

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

Isn't the  "Used as work registers by the system" talking about the
registers the issuer sees after the ATTACH, rather than what the ATTACHed
subtask sees?

Tony H.

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


Re: Registers at entry to subtask (from ATTACH)

2022-02-12 Thread Binyamin Dissen
On Sat, 12 Feb 2022 12:53:41 -0800 Ed Jaffe 
wrote:

:>On 2/12/2022 10:54 AM, Binyamin Dissen wrote:
:>> 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.

:>Perhaps it's expecting to be invoked via LINK(X) rather than ATTACH(X)?

No. Explicitly sets up for ATTACH.

--
Binyamin Dissen 
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

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


Re: Registers at entry to subtask (from ATTACH)

2022-02-12 Thread Ed Jaffe

On 2/12/2022 10:54 AM, Binyamin Dissen wrote:

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.


Perhaps it's expecting to be invoked via LINK(X) rather than ATTACH(X)?


--
Phoenix Software International
Edward E. Jaffe
831 Parkview Drive North
El Segundo, CA 90245
https://www.phoenixsoftware.com/



This e-mail message, including any attachments, appended messages and the
information contained therein, is for the sole use of the intended
recipient(s). If you are not an intended recipient or have otherwise
received this email message in error, any use, dissemination, distribution,
review, storage or copying of this e-mail message and the information
contained therein is strictly prohibited. If you are not an intended
recipient, please contact the sender by reply e-mail and destroy all copies
of this email message and do not otherwise utilize or retain this email
message or any or all of the information contained therein. Although this
email message and any attachments or appended messages are believed to be
free of any virus or other defect that might affect any computer system into
which it is received and opened, it is the responsibility of the recipient
to ensure that it is virus free and no responsibility is accepted by the
sender for any loss or damage arising in any way from its opening or use.

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


Re: Registers at entry to subtask (from ATTACH)

2022-02-12 Thread Mike Schwab
Standard IBM z/OS calling convention.  R13 Save Area, R14 return
address, R15 address being called, R0 ?, R1 address to parameter list,
R2-14 will be restored from R13 save area before BR14 to return to
caller.

https://www.ibm.com/docs/en/zos/2.3.0?topic=guide-linkage-conventions

On Sat, Feb 12, 2022 at 6:54 PM Binyamin Dissen
 wrote:
>
> 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.
>
> --
> Binyamin Dissen 
> http://www.dissensoftware.com
>
> Director, Dissen Software, Bar & Grill - Israel
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN



-- 
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?

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


Re: Registers at entry to subtask (from ATTACH)

2022-02-12 Thread Michael Stein
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


Re: Registers at entry to subtask (from ATTACH)

2022-02-12 Thread Charles Mills
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.

Charles


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Binyamin Dissen
Sent: Saturday, February 12, 2022 10:54 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Registers at entry to subtask (from ATTACH)

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.

--
Binyamin Dissen 
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

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

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


Registers at entry to subtask (from ATTACH)

2022-02-12 Thread 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.

--
Binyamin Dissen 
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

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