bit masking

2012-05-28 Thread glen herrmannsfeldt
> I am working with some IPv6 addresses that are 128 bits long.
> The input to the program is an ip name or address and the
> number of high bits that I need to use for a compare against
> another ip address.

> So, I want to create run time routine to build the a
> 16 byte 'and' bit field based on the input number of bits.
> (I will then 'and' both addresses and then use a simple CLC.)

There is no double 64 bit (that is, 128 bit) shift instruction
as far as I know.

Most obvious is to store the bits in some number of bytes,
halfwords, words, or doublewords. Then, based on the shift
amount, fill some with all ones, and use a shift instruction
(or smaller table) for the boundary case. I would probably
choose words. Using shift and mask, split the shift amount
into 32's and a remainder (or use Divide).

For bytes in memory, EX an MVC, or a loop of MVI, to fill the
high bytes. Use a table of bytes to IC and STC the boundary byte.

-- glen


Generating a bit mask

2012-05-28 Thread Tony Thigpen

I am working with some IPv6 addresses that are 128 bits long. The input
to the program is an ip name or address and the number of high bits that
I need to use for a compare against another ip address.

So, I want to create run time routine to build the a 16 byte 'and' bit
field based on the input number of bits. (I will then 'and' both
addresses and then use a simple CLC.)

Although a table built at compile time might be a reasonable solution, I
thought this would be a good time to learn a new trick if someone has
one they can share.

--

Tony Thigpen


MVC with 2nd operand length

2012-05-28 Thread Sharuff Morsa3
This is an interesting discussion with lots of useful information and code
snippets.  The Request For Enhancement has been submitted to the HLASM
team at IBM.  Please use this URL
http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=22828
 to add your cements to the request. The RFE also allows you to add
attachments.
Sharuff

Sharuff Morsa
IBM Hursley
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU