Or if you don't have a base register, execute relative.

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


________________________________________
From: IBM Mainframe Assembler List <[email protected]> on behalf 
of Charles Mills <[email protected]>
Sent: Thursday, May 20, 2021 1:07 PM
To: [email protected]
Subject: Re: Macro to set a bit string

Interesting..

Shift Ry right 27 bits so you have the bit offset*4. Then EX 0,OI_Table(Ry).


Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]]
On Behalf Of Seymour J Metz
Sent: Thursday, May 20, 2021 9:41 AM
To: [email protected]
Subject: Re: Macro to set a bit string

You can avoid the extra register with a table of 8 OI instructions.


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


________________________________________
From: IBM Mainframe Assembler List <[email protected]> on
behalf of Charles Mills <[email protected]>
Sent: Thursday, May 20, 2021 12:28 PM
To: [email protected]
Subject: Re: Macro to set a bit string

Thinking about this a little, it is non-trivial. There is AFAIK -- someone
will correct me if I am wrong -- no single-byte-or-register-to-storage nor
an or-under-mask instruction analogous to STC or ICM, so you need to use an
executed OI. Then you need three registers. I will use Rx, Ry and Rz in the
example below. Rx and Ry must be an even-odd register pair.

Assume the bit number in base 0 starts out in Rx. Shift Rx right double 3
bits. That gives you the byte offset in Rx and the bit offset in the high 3
bits of Ry. Then shift Ry right 29 bits so the count is in the low bits.
Load X'80' into Rz. Shift it right by the count in Ry (possibly zero). Add
the target array address to Rx with LA. EX Rz an OI 0(Rx),0 instruction.

Logic is the same for setting a bit off. Substitute X'7F' for X'80' and NI
for OI.

Reply via email to