? 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!)