Re: Assembler theology question

2023-06-02 Thread David Cole

No. I left the comma out intentionally.




At 6/1/2023 02:06 PM, you wrote:

? ITYM
  L R10,PSATOLD-PSA(,0)



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

From: IBM Mainframe Assembler List 
[ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of David Cole 
[dbc...@colesoft.com]

Sent: Thursday, June 1, 2023 1:49 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Assembler theology question
WRT:
  L R10,PSATOLD-PSA(,R9)Get current TCB
  L R9,TCBJSCB-TCB(,R1) Get JSCB
In the specific case of the PSA, there is no need to load a base register.
Also, I probably wouldn't bother with a USING. My favorite
instruction for this is:
  L R10,PSATOLD-PSA(0)
Note, providing the "0" for the index register prevents that rather
annoying ASMA306W message.
Dave Cole





At 6/1/2023 12:57 PM, Seymour J Metz wrote:

>R9? I might believe R0.
>In general, I prefer the code with USING over the code with explicit
>offset and base, although I might use the second if I'm only going
>to reference a single field in the control block. If I need to
>access multiple instances of the same control block, I would prefer
>to use a labeled USING or, in some cases, a labeled dependent USING.
>  USING PSA,R0
>  L R10,PSATOLD Get current TCB
>  DROP  R0
>THIS USING TCB,R10
>  L R9,THIS.TCBJSCB Get JSCB
>  l R11,THIS.TCBOTCB
>THAT USING TCB,R11
>--
>Shmuel (Seymour J.) Metz
>http://mason.gmu.edu/~smetz3
>

>>From: IBM Mainframe Assembler List
>>[ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Phil Smith III
>>[li...@akphs.com]
>>Sent: Thursday, June 1, 2023 12:24 PM
>>To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
>>Subject: Assembler theology question
>>We've all seen (and written!) code like this:
>>  USING PSA,R9
>>  L R10,PSATOLD Get current TCB
>>  DROP  R9
>>  USING TCB,R10
>>  L R9,TCBJSCB  Get JSCB
>>  DROP  R10
>>I've also seen (and probably written) the equivalent:
>>  L R10,PSATOLD-PSA(,R9)Get current TCB
>>  L R9,TCBJSCB-TCB(,R1) Get JSCB
>>I like the latter because it's tighter to read, reduces the USING
>>map, keeps you out of trouble if you decide to use R9 or R10 for
>>something global, etc. But I can also see a theological argument
>>that you really *are* using (USING?) the control block.
>>Thoughts? (Yes, I *said* it was theology, so I'm prepared for
>>religious arguments!)


Re: Assembler theology question

2023-06-02 Thread Seymour J Metz
I realize that it takes up room on a page/screen, but there is an option to 
display active USINGs, and that makes it easier to catch certain types of 
errors.

Defensive programming is your friend, in any language.

I'm not convinced that it's any easier to shoot yourself in the foot with HLASM 
than with, e.g., FORTRAN IV. Each language has its own pitfalls.


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


From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf 
of Steve Smith [sasd...@gmail.com]
Sent: Friday, June 2, 2023 11:07 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Assembler theology question

On Thu, Jun 1, 2023 at 10:25 PM Phil Smith III  wrote:

> See, I knew this would get into theology!
>
>
>
> I guess I wasn't clear enough: I only meant this for when you're doing a
> single instruction, something that will never expand-this
> kind of "flyby" of a control block on the way to another. Clearly if
> you're doing a bunch, it makes more sense to do the USING.
>
>
>
> What I meant about "keeping out of trouble" is that if you make a change
> later and decide to use one of the registers as a base
> semi-globally, then having this single-line USING makes for a larger
> change. Of course you'll argue (and I'll agree) that this might
> be good, as it might keep you from stepping on that base, so I guess that
> doesn't really apply.
>

This shouldn't be an issue.  You should always DROP when the code that was
written for is done with it.  Leaving hanging USINGs that may or may not be
valid anymore certainly is looking for trouble.

So, now we're talking about 3 statements vs. 1, and I think that tilts the
answer towards the 1-instruction form.  But I agree with most of the
comments about how it depends on various other considerations.  imho, I
tend to use the one-line version for common things, but I like USINGs for
more exotic control blocks.

>
>
>
> Jeremy's comment about typos is certainly an interesting point, though
> it'll likely come clear pretty fast once run! I'm not sure
> that three lines of code vs. one represents a net savings in potential
> typos, either, TBH.
>

Yeah, you could typo the USING just as easily as the instruction
reference.

>
>
>
> I sure do love assembler.
>

I'm going to presume you mean that  both literally and ironically (I agree
dually).  While you can write gibberish in any language, only assembler
opens up the myriad possibilities of screwing up register usage.

sas


Re: Assembler theology question

2023-06-02 Thread Steve Smith
On Thu, Jun 1, 2023 at 10:25 PM Phil Smith III  wrote:

> See, I knew this would get into theology!
>
>
>
> I guess I wasn't clear enough: I only meant this for when you're doing a
> single instruction, something that will never expand-this
> kind of "flyby" of a control block on the way to another. Clearly if
> you're doing a bunch, it makes more sense to do the USING.
>
>
>
> What I meant about "keeping out of trouble" is that if you make a change
> later and decide to use one of the registers as a base
> semi-globally, then having this single-line USING makes for a larger
> change. Of course you'll argue (and I'll agree) that this might
> be good, as it might keep you from stepping on that base, so I guess that
> doesn't really apply.
>

This shouldn't be an issue.  You should always DROP when the code that was
written for is done with it.  Leaving hanging USINGs that may or may not be
valid anymore certainly is looking for trouble.

So, now we're talking about 3 statements vs. 1, and I think that tilts the
answer towards the 1-instruction form.  But I agree with most of the
comments about how it depends on various other considerations.  imho, I
tend to use the one-line version for common things, but I like USINGs for
more exotic control blocks.

>
>
>
> Jeremy's comment about typos is certainly an interesting point, though
> it'll likely come clear pretty fast once run! I'm not sure
> that three lines of code vs. one represents a net savings in potential
> typos, either, TBH.
>

Yeah, you could typo the USING just as easily as the instruction
reference.

>
>
>
> I sure do love assembler.
>

I'm going to presume you mean that  both literally and ironically (I agree
dually).  While you can write gibberish in any language, only assembler
opens up the myriad possibilities of screwing up register usage.

sas


Re: Assembler theology question

2023-06-02 Thread Peter Relson
Dave Cole wrote


Also, I probably wouldn't bother with a USING. My favorite

instruction for this is:

  L R10,PSATOLD-PSA(0)



Note, providing the "0" for the index register prevents that rather

annoying ASMA306W message.


ASMA306W is for overlapping usings. So I don't think it would apply to this "L" 
which is unaffected by USINGs.

And if you're referring to ASMA309W, I'd say that it's not right --  You need 0 
as a base register to prevent ASMA306W.
And of course you can not use FLAG(PAGE0) if you don't like that message.
Here are the examples that come to mind (I removed the ASMA435I messages), 
using FLAG(PAGE0,NOUSING0):
 5880 021C   021C  4  L R8,PSATOLD-PSA
** ASMA309W Operand PSATOLD-PSA resolved to a displacement with no base register
0004 5880 021C   021C  5  L 
R8,PSATOLD-PSA(0)
** ASMA309W Operand PSATOLD-PSA(0) resolved to a displacement with no base 
register
0008 5880 021C   021C  6  L 
R8,PSATOLD-PSA(,0)
000C 5880 021C   021C  7  L 
R8,PSATOLD-PSA(0,0)

Peter Relson
z/OS Core Technology Design


Re: Assembler theology question

2023-06-01 Thread Phil Smith III
See, I knew this would get into theology!

 

I guess I wasn't clear enough: I only meant this for when you're doing a single 
instruction, something that will never expand-this
kind of "flyby" of a control block on the way to another. Clearly if you're 
doing a bunch, it makes more sense to do the USING.

 

What I meant about "keeping out of trouble" is that if you make a change later 
and decide to use one of the registers as a base
semi-globally, then having this single-line USING makes for a larger change. Of 
course you'll argue (and I'll agree) that this might
be good, as it might keep you from stepping on that base, so I guess that 
doesn't really apply.

 

Jeremy's comment about typos is certainly an interesting point, though it'll 
likely come clear pretty fast once run! I'm not sure
that three lines of code vs. one represents a net savings in potential typos, 
either, TBH.

 

I sure do love assembler.


Re: Assembler theology question

2023-06-01 Thread Jeremy Nicoll
In Thu, 1 Jun 2023, at 17:24, Phil Smith III wrote:
> We've all seen (and written!) code like this:
>  USING PSA,R9  
>  L R10,PSATOLD Get current TCB
>  DROP  R9
> 
>  USING TCB,R10 
>  L R9,TCBJSCB  Get JSCB
>  DROP  R10
> 
> I've also seen (and probably written) the equivalent:
>  L R10,PSATOLD-PSA(,R9)Get current TCB
>  L R9,TCBJSCB-TCB(,R1) Get JSCB
> 
> I like the latter because it's tighter to read, reduces the USING
> map, keeps you out of trouble if you decide to use R9 or R10
> for something global, etc.

How does using R9 or R10 globally cause a problem, unless you
forget to place the "DROP" in the right place?

I think I preferred to use USING/DROP.

Also while I recognise that one has to be ultracareful when writing
in assembler, keying lots of statements like

  L R9,TCBJSCB-TCB(,R1)

all require one not to mistype the "-TCB(,R1)" part - which - and
is this not an irony? - you did.  Should have been (,R10).  Using
USING and DROP gives you nine or ten fewer opportunities to
type an unnecessary or wrong character.


-- 
Jeremy Nicoll - my opinions are my own.


Re: Assembler theology question

2023-06-01 Thread Seymour J Metz
How does that eliminate the ASMA306W?


From: IBM Mainframe Assembler List  on behalf 
of David Cole 
Sent: Thursday, June 1, 2023 2:58 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Assembler theology question

No. I left the comma out intentionally




At 6/1/2023 02:06 PM, Seymour J Metz wrote:
>? ITYM
>   L R10,PSATOLD-PSA(,0)
>
>
>
>
>--
>Shmuel (Seymour J.) Metz
>http://mason.gmu.edu/~smetz3
>
>
>From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU]
>on behalf of David Cole [dbc...@colesoft.com]
>Sent: Thursday, June 1, 2023 1:49 PM
>To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
>Subject: Re: Assembler theology question
>
>WRT:
>   L R10,PSATOLD-PSA(,R9)Get current TCB
>   L R9,TCBJSCB-TCB(,R1) Get JSCB
>
>In the specific case of the PSA, there is no need to load a base register.
>Also, I probably wouldn't bother with a USING. My favorite
>instruction for this is:
>   L R10,PSATOLD-PSA(0)
>
>Note, providing the "0" for the index register prevents that rather
>annoying ASMA306W message.
>
>Dave Cole
>
>
>
>
>
>
>At 6/1/2023 12:57 PM, Seymour J Metz wrote:
> >R9? I might believe R0.
> >In general, I prefer the code with USING over the code with explicit
> >offset and base, although I might use the second if I'm only going
> >to reference a single field in the control block. If I need to
> >access multiple instances of the same control block, I would prefer
> >to use a labeled USING or, in some cases, a labeled dependent USING.
> >  USING PSA,R0
> >  L R10,PSATOLD Get current TCB
> >  DROP  R0
> >THIS USING TCB,R10
> >  L R9,THIS.TCBJSCB Get JSCB
> >  l R11,THIS.TCBOTCB
> >THAT USING TCB,R11
> >--
> >Shmuel (Seymour J.) Metz
> >http://mason.gmu.edu/~smetz3
> >
> >>From: IBM Mainframe Assembler List
> >>[ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Phil Smith III
> >>[li...@akphs.com]
> >>Sent: Thursday, June 1, 2023 12:24 PM
> >>To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> >>Subject: Assembler theology question
> >>We've all seen (and written!) code like this:
> >>  USING PSA,R9
> >>  L R10,PSATOLD Get current TCB
> >>  DROP  R9
> >>  USING TCB,R10
> >>  L R9,TCBJSCB  Get JSCB
> >>  DROP  R10
> >>I've also seen (and probably written) the equivalent:
> >>  L R10,PSATOLD-PSA(,R9)Get current TCB
> >>  L R9,TCBJSCB-TCB(,R1) Get JSCB
> >>I like the latter because it's tighter to read, reduces the USING
> >>map, keeps you out of trouble if you decide to use R9 or R10 for
> >>something global, etc. But I can also see a theological argument
> >>that you really *are* using (USING?) the control block.
> >>Thoughts? (Yes, I *said* it was theology, so I'm prepared for
> >>religious arguments!)


Re: Assembler theology question

2023-06-01 Thread David Cole

No. I left the comma out intentionally




At 6/1/2023 02:06 PM, Seymour J Metz wrote:

? ITYM
  L R10,PSATOLD-PSA(,0)




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


From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] 
on behalf of David Cole [dbc...@colesoft.com]

Sent: Thursday, June 1, 2023 1:49 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Assembler theology question

WRT:
  L R10,PSATOLD-PSA(,R9)Get current TCB
  L R9,TCBJSCB-TCB(,R1) Get JSCB

In the specific case of the PSA, there is no need to load a base register.
Also, I probably wouldn't bother with a USING. My favorite
instruction for this is:
  L R10,PSATOLD-PSA(0)

Note, providing the "0" for the index register prevents that rather
annoying ASMA306W message.

Dave Cole






At 6/1/2023 12:57 PM, Seymour J Metz wrote:
>R9? I might believe R0.
>In general, I prefer the code with USING over the code with explicit
>offset and base, although I might use the second if I'm only going
>to reference a single field in the control block. If I need to
>access multiple instances of the same control block, I would prefer
>to use a labeled USING or, in some cases, a labeled dependent USING.
>  USING PSA,R0
>  L R10,PSATOLD Get current TCB
>  DROP  R0
>THIS USING TCB,R10
>  L R9,THIS.TCBJSCB Get JSCB
>  l R11,THIS.TCBOTCB
>THAT USING TCB,R11
>--
>Shmuel (Seymour J.) Metz
>http://mason.gmu.edu/~smetz3
>
>>From: IBM Mainframe Assembler List
>>[ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Phil Smith III
>>[li...@akphs.com]
>>Sent: Thursday, June 1, 2023 12:24 PM
>>To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
>>Subject: Assembler theology question
>>We've all seen (and written!) code like this:
>>  USING PSA,R9
>>  L R10,PSATOLD Get current TCB
>>  DROP  R9
>>  USING TCB,R10
>>  L R9,TCBJSCB  Get JSCB
>>  DROP  R10
>>I've also seen (and probably written) the equivalent:
>>  L R10,PSATOLD-PSA(,R9)Get current TCB
>>  L R9,TCBJSCB-TCB(,R1) Get JSCB
>>I like the latter because it's tighter to read, reduces the USING
>>map, keeps you out of trouble if you decide to use R9 or R10 for
>>something global, etc. But I can also see a theological argument
>>that you really *are* using (USING?) the control block.
>>Thoughts? (Yes, I *said* it was theology, so I'm prepared for
>>religious arguments!)


Re: Assembler theology question

2023-06-01 Thread Schmitt, Michael
I would use the first method, because it is more understandable for users* that 
don't have deep knowledge of both HLASM syntax and what the base field name is 
in the DSECTs.


* like myself


-Original Message-
From: IBM Mainframe Assembler List  On Behalf 
Of Phil Smith III
Sent: Thursday, June 1, 2023 11:24 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Assembler theology question

We've all seen (and written!) code like this:
 USING PSA,R9
 L R10,PSATOLD Get current TCB
 DROP  R9

 USING TCB,R10
 L R9,TCBJSCB  Get JSCB
 DROP  R10

I've also seen (and probably written) the equivalent:
 L R10,PSATOLD-PSA(,R9)Get current TCB
 L R9,TCBJSCB-TCB(,R1) Get JSCB

I like the latter because it's tighter to read, reduces the USING map, keeps 
you out of trouble if you decide to use R9 or R10 for something global, etc. 
But I can also see a theological argument that you really *are* using (USING?) 
the control block.

Thoughts? (Yes, I *said* it was theology, so I'm prepared for religious 
arguments!)


Re: Assembler theology question

2023-06-01 Thread Ed Jaffe

On 6/1/2023 9:24 AM, Phil Smith III wrote:

Thoughts? (Yes, I *said* it was theology, so I'm prepared for religious 
arguments!)


The latter seems great when the field names are super short like 
PSATOLD-PSA or TCBJSCB-TCB as in your example.


Modern control block field names are often much, much longer and the 
explicit specification of both long symbols on the same line can make 
the code both ugly and unwieldy. For example:


 MVC MyMsgTokenArea,MqaMosToken-MqaMsgOutSummary(R4) Copy token

We use long, descriptive (CamelCase) symbol names in our products, so I 
use the first approach probably 96% of the time.


That said, I will use the second approach for very simple stuff like 
loading PSATOLD.


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


Re: Assembler theology question

2023-06-01 Thread Seymour J Metz
? ITYM
  L R10,PSATOLD-PSA(,0)




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


From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf 
of David Cole [dbc...@colesoft.com]
Sent: Thursday, June 1, 2023 1:49 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Assembler theology question

WRT:
  L R10,PSATOLD-PSA(,R9)Get current TCB
  L R9,TCBJSCB-TCB(,R1) Get JSCB

In the specific case of the PSA, there is no need to load a base register.
Also, I probably wouldn't bother with a USING. My favorite
instruction for this is:
  L R10,PSATOLD-PSA(0)

Note, providing the "0" for the index register prevents that rather
annoying ASMA306W message.

Dave Cole






At 6/1/2023 12:57 PM, Seymour J Metz wrote:
>R9? I might believe R0.
>In general, I prefer the code with USING over the code with explicit
>offset and base, although I might use the second if I'm only going
>to reference a single field in the control block. If I need to
>access multiple instances of the same control block, I would prefer
>to use a labeled USING or, in some cases, a labeled dependent USING.
>  USING PSA,R0
>  L R10,PSATOLD Get current TCB
>  DROP  R0
>THIS USING TCB,R10
>  L R9,THIS.TCBJSCB Get JSCB
>  l R11,THIS.TCBOTCB
>THAT USING TCB,R11
>--
>Shmuel (Seymour J.) Metz
>http://mason.gmu.edu/~smetz3
>
>>From: IBM Mainframe Assembler List
>>[ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Phil Smith III
>>[li...@akphs.com]
>>Sent: Thursday, June 1, 2023 12:24 PM
>>To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
>>Subject: Assembler theology question
>>We've all seen (and written!) code like this:
>>  USING PSA,R9
>>  L R10,PSATOLD Get current TCB
>>  DROP  R9
>>  USING TCB,R10
>>  L R9,TCBJSCB  Get JSCB
>>  DROP  R10
>>I've also seen (and probably written) the equivalent:
>>  L R10,PSATOLD-PSA(,R9)Get current TCB
>>  L R9,TCBJSCB-TCB(,R1) Get JSCB
>>I like the latter because it's tighter to read, reduces the USING
>>map, keeps you out of trouble if you decide to use R9 or R10 for
>>something global, etc. But I can also see a theological argument
>>that you really *are* using (USING?) the control block.
>>Thoughts? (Yes, I *said* it was theology, so I'm prepared for
>>religious arguments!)


Re: Assembler theology question

2023-06-01 Thread David Cole

WRT:
 L R10,PSATOLD-PSA(,R9)Get current TCB
 L R9,TCBJSCB-TCB(,R1) Get JSCB

In the specific case of the PSA, there is no need to load a base register.
Also, I probably wouldn't bother with a USING. My favorite 
instruction for this is:

 L R10,PSATOLD-PSA(0)

Note, providing the "0" for the index register prevents that rather 
annoying ASMA306W message.


Dave Cole






At 6/1/2023 12:57 PM, Seymour J Metz wrote:

R9? I might believe R0.
In general, I prefer the code with USING over the code with explicit 
offset and base, although I might use the second if I'm only going 
to reference a single field in the control block. If I need to 
access multiple instances of the same control block, I would prefer 
to use a labeled USING or, in some cases, a labeled dependent USING.

 USING PSA,R0
 L R10,PSATOLD Get current TCB
 DROP  R0
THIS USING TCB,R10
 L R9,THIS.TCBJSCB Get JSCB
 l R11,THIS.TCBOTCB
THAT USING TCB,R11
--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

From: IBM Mainframe Assembler List 
[ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Phil Smith III 
[li...@akphs.com]

Sent: Thursday, June 1, 2023 12:24 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Assembler theology question
We've all seen (and written!) code like this:
 USING PSA,R9
 L R10,PSATOLD Get current TCB
 DROP  R9
 USING TCB,R10
 L R9,TCBJSCB  Get JSCB
 DROP  R10
I've also seen (and probably written) the equivalent:
 L R10,PSATOLD-PSA(,R9)Get current TCB
 L R9,TCBJSCB-TCB(,R1) Get JSCB
I like the latter because it's tighter to read, reduces the USING 
map, keeps you out of trouble if you decide to use R9 or R10 for 
something global, etc. But I can also see a theological argument 
that you really *are* using (USING?) the control block.
Thoughts? (Yes, I *said* it was theology, so I'm prepared for 
religious arguments!)


Re: Assembler theology question

2023-06-01 Thread Rick Troth

On 6/1/23 12:24, Phil Smith III wrote:

We've all seen (and written!) code like this:
  USING PSA,R9
  L R10,PSATOLD Get current TCB
  DROP  R9
  
  USING TCB,R10

  L R9,TCBJSCB  Get JSCB
  DROP  R10
  
I've also seen (and probably written) the equivalent:

  L R10,PSATOLD-PSA(,R9)Get current TCB
  L R9,TCBJSCB-TCB(,R1) Get JSCB
  
I like the latter because it's tighter to read, reduces the USING map, keeps you out of trouble if you decide to use R9 or R10 for something global, etc. But I can also see a theological argument that you really *are* using (USING?) the control block.


Thoughts? (Yes, I *said* it was theology, so I'm prepared for religious 
arguments!)



I like the latter.

Now if I can just remember it!


-- R; <><


Re: Assembler theology question

2023-06-01 Thread David Cole

WRT:
 L R10,PSATOLD-PSA(,R9)Get current TCB
 L R9,TCBJSCB-TCB(,R1) Get JSCB

In the specific case of the PSA, there is no need to load a base register.
Also, I probably wouldn't bother with a USING. My favorite 
instruction for this is:

 L R10,PSATOLD-PSA(0)

Note, providing the "0" for the index register prevents that rather 
annoying ASMA306W message.


Dave Cole






At 6/1/2023 12:57 PM, Seymour J Metz wrote:

R9? I might believe R0.
In general, I prefer the code with USING over the code with explicit 
offset and base, although I might use the second if I'm only going 
to reference a single field in the control block. If I need to 
access multiple instances of the same control block, I would prefer 
to use a labeled USING or, in some cases, a labeled dependent USING.

 USING PSA,R0
 L R10,PSATOLD Get current TCB
 DROP  R0
THIS USING TCB,R10
 L R9,THIS.TCBJSCB Get JSCB
 l R11,THIS.TCBOTCB
THAT USING TCB,R11


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

From: IBM Mainframe Assembler List 
[ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Phil Smith III 
[li...@akphs.com]

Sent: Thursday, June 1, 2023 12:24 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Assembler theology question
We've all seen (and written!) code like this:
 USING PSA,R9
 L R10,PSATOLD Get current TCB
 DROP  R9
 USING TCB,R10
 L R9,TCBJSCB  Get JSCB
 DROP  R10
I've also seen (and probably written) the equivalent:
 L R10,PSATOLD-PSA(,R9)Get current TCB
 L R9,TCBJSCB-TCB(,R1) Get JSCB
I like the latter because it's tighter to read, reduces the USING 
map, keeps you out of trouble if you decide to use R9 or R10 for 
something global, etc. But I can also see a theological argument 
that you really *are* using (USING?) the control block.
Thoughts? (Yes, I *said* it was theology, so I'm prepared for 
religious arguments!)


Re: Assembler theology question

2023-06-01 Thread Seymour J Metz
R9? I might believe R0.

In general, I prefer the code with USING over the code with explicit offset and 
base, although I might use the second if I'm only going to reference a single 
field in the control block. If I need to access multiple instances of the same 
control block, I would prefer to use a labeled USING or, in some cases, a 
labeled dependent USING.

 USING PSA,R0
 L R10,PSATOLD Get current TCB
 DROP  R0
THIS USING TCB,R10
 L R9,THIS.TCBJSCB Get JSCB
 l R11,THIS.TCBOTCB
THAT USING TCB,R11



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


From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf 
of Phil Smith III [li...@akphs.com]
Sent: Thursday, June 1, 2023 12:24 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Assembler theology question

We've all seen (and written!) code like this:
 USING PSA,R9
 L R10,PSATOLD Get current TCB
 DROP  R9

 USING TCB,R10
 L R9,TCBJSCB  Get JSCB
 DROP  R10

I've also seen (and probably written) the equivalent:
 L R10,PSATOLD-PSA(,R9)Get current TCB
 L R9,TCBJSCB-TCB(,R1) Get JSCB

I like the latter because it's tighter to read, reduces the USING map, keeps 
you out of trouble if you decide to use R9 or R10 for something global, etc. 
But I can also see a theological argument that you really *are* using (USING?) 
the control block.

Thoughts? (Yes, I *said* it was theology, so I'm prepared for religious 
arguments!)


SV: Assembler theology question

2023-06-01 Thread Willy Jensen
I too do both, depending on the situation.

-Oprindelig meddelelse-
Fra: IBM Mainframe Assembler List  På vegne af 
John McKown
Sendt: 1. juni 2023 18:31
Til: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Emne: Re: Assembler theology question

I do both. I have the USING when I either want multiple fields from the same 
DSECT or I want to reference the same field(s) multiple times rather than 
storing them myself somewhere. This latter is mainly when I am writing "pure" 
code, such as in LPA and am short on dynamic storage.

On Thu, Jun 1, 2023, 11:24 Phil Smith III  wrote:

> We've all seen (and written!) code like this:
>  USING PSA,R9
>  L R10,PSATOLD Get current TCB
>  DROP  R9
>
>  USING TCB,R10
>  L R9,TCBJSCB  Get JSCB
>  DROP  R10
>
> I've also seen (and probably written) the equivalent:
>  L R10,PSATOLD-PSA(,R9)Get current TCB
>  L R9,TCBJSCB-TCB(,R1) Get JSCB
>
> I like the latter because it's tighter to read, reduces the USING map, 
> keeps you out of trouble if you decide to use R9 or R10 for something 
> global, etc. But I can also see a theological argument that you really
> *are* using (USING?) the control block.
>
> Thoughts? (Yes, I *said* it was theology, so I'm prepared for 
> religious
> arguments!)
>


Re: Assembler theology question

2023-06-01 Thread Mark Hammack
In this specific case (and others like it), I'd probably use the latter
case as well (although I have done both).  However, even for just a line or
two, I much prefer using the former syntax (I also tend to use R14, R15 to
traverse control blocks until I get to the end).

Then again, I'm not sure how either syntax would "keep you out of
trouble...".  Could PUSH/POP help in that case?



*Mark*


On Thu, Jun 1, 2023 at 11:24 AM Phil Smith III  wrote:

> We've all seen (and written!) code like this:
>  USING PSA,R9
>  L R10,PSATOLD Get current TCB
>  DROP  R9
>
>  USING TCB,R10
>  L R9,TCBJSCB  Get JSCB
>  DROP  R10
>
> I've also seen (and probably written) the equivalent:
>  L R10,PSATOLD-PSA(,R9)Get current TCB
>  L R9,TCBJSCB-TCB(,R1) Get JSCB
>
> I like the latter because it's tighter to read, reduces the USING map,
> keeps you out of trouble if you decide to use R9 or R10 for something
> global, etc. But I can also see a theological argument that you really
> *are* using (USING?) the control block.
>
> Thoughts? (Yes, I *said* it was theology, so I'm prepared for religious
> arguments!)
>


Re: Assembler theology question

2023-06-01 Thread Mike Shaw
The second method is better; it's shorter (no USINGs). Simpler is better.

Mike Shaw
MVS/QuickRef Support Group
Chicago-Soft, Ltd.


On Thu, Jun 1, 2023 at 12:24 PM Phil Smith III  wrote:

> We've all seen (and written!) code like this:
>  USING PSA,R9
>  L R10,PSATOLD Get current TCB
>  DROP  R9
>
>  USING TCB,R10
>  L R9,TCBJSCB  Get JSCB
>  DROP  R10
>
> I've also seen (and probably written) the equivalent:
>  L R10,PSATOLD-PSA(,R9)Get current TCB
>  L R9,TCBJSCB-TCB(,R1) Get JSCB
>
> I like the latter because it's tighter to read, reduces the USING map,
> keeps you out of trouble if you decide to use R9 or R10 for something
> global, etc. But I can also see a theological argument that you really
> *are* using (USING?) the control block.
>
> Thoughts? (Yes, I *said* it was theology, so I'm prepared for religious
> arguments!)
>


Re: Assembler theology question

2023-06-01 Thread John McKown
I do both. I have the USING when I either want multiple fields from the
same DSECT or I want to reference the same field(s) multiple times rather
than storing them myself somewhere. This latter is mainly when I am writing
"pure" code, such as in LPA and am short on dynamic storage.

On Thu, Jun 1, 2023, 11:24 Phil Smith III  wrote:

> We've all seen (and written!) code like this:
>  USING PSA,R9
>  L R10,PSATOLD Get current TCB
>  DROP  R9
>
>  USING TCB,R10
>  L R9,TCBJSCB  Get JSCB
>  DROP  R10
>
> I've also seen (and probably written) the equivalent:
>  L R10,PSATOLD-PSA(,R9)Get current TCB
>  L R9,TCBJSCB-TCB(,R1) Get JSCB
>
> I like the latter because it's tighter to read, reduces the USING map,
> keeps you out of trouble if you decide to use R9 or R10 for something
> global, etc. But I can also see a theological argument that you really
> *are* using (USING?) the control block.
>
> Thoughts? (Yes, I *said* it was theology, so I'm prepared for religious
> arguments!)
>


Assembler theology question

2023-06-01 Thread Phil Smith III
We've all seen (and written!) code like this:
 USING PSA,R9  
 L R10,PSATOLD Get current TCB
 DROP  R9
 
 USING TCB,R10 
 L R9,TCBJSCB  Get JSCB
 DROP  R10
 
I've also seen (and probably written) the equivalent:
 L R10,PSATOLD-PSA(,R9)Get current TCB
 L R9,TCBJSCB-TCB(,R1) Get JSCB
 
I like the latter because it's tighter to read, reduces the USING map, keeps 
you out of trouble if you decide to use R9 or R10 for something global, etc. 
But I can also see a theological argument that you really *are* using (USING?) 
the control block.

Thoughts? (Yes, I *said* it was theology, so I'm prepared for religious 
arguments!)