You are right and is the best solution
&NAME LA R14,0(,&BIT) BIT #
SRDL R14,3 /8
AIF ('&VAR'(1,1) EQ '(').V2R
LA R14,&VAR.(R14) ARRAY POSITION
AGO .V2
.V2R AR R14,&VAR ARRAY POSITION
.V2 SRL R15,29 ADJUST REMAINDER
AIF ('&ACT' EQ 'OFF').F2
.N2 LA R1,X'80' INITIAL MASK
SRL R1,0(R15) ADJUST MASK
AIF ('&ACT' EQ 'TEST').T2
OI 0(R14),*-* TURN ON
EX R1,*-4 TURN ON
MEXIT
.T2 TM 0(R14),*-* TEST
EX R1,*-4 TEST
MEXIT
.F2 LAY R1,X'7F7F' INITIAL MASK
SRL R1,0(R15) ADJUST MASK
B N&SYSNDX BR AROUND
NI 0(R14),*-* TURN OFF
N&SYSNDX EX R1,*-4 TURN OFF
-----Mensagem original-----
De: IBM Mainframe Assembler List <[email protected]> Em nome
de Charles Mills
Enviada em: quinta-feira, 20 de maio de 2021 18:08
Para: [email protected]
Assunto: Re: RES: Macro to set a bit string
Why would you use a loop on SRL 1 rather than an SRL 0(15)?
Charles
-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]]
On Behalf Of Mike Hochee
Sent: Thursday, May 20, 2021 1:48 PM
To: [email protected]
Subject: Re: RES: Macro to set a bit string
Interesting. Thank you Philippe! I can see how the loop might be faster
despite the storage reference.
-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]]
On Behalf Of Philippe Leite
Sent: Thursday, May 20, 2021 4:43 PM
To: [email protected]
Subject: Re: RES: Macro to set a bit string
Caution! This message was sent from outside your organization.
Hi João,
I'm glad you liked the macro.
In my implementation I use shift in a loop before execute.
This is much faster than memory access through IC instruction.
Even in the worst case when it shifts seven times it's faster than IC.
That's why I didn't use it. You can test in a loop to be certain.
Best regards,
Philippe Leite
z/OS System Programmer