> -----Original Message-----
> From: IBM Mainframe Discussion List On Behalf Of Lindy Mayfield
> 
> I want to pull the bits off of a register a nibble at a time. 
>  Is SLDL on an even/odd register the best way to go?
> 
> If so, I'm having a bit of trouble moving the bits to the top 
> end.  For example, I want this:
> 
> 0000009A -> 9A000000
> 
> I thought I could do it this way:
> 
> LA     R3,X'9A'
> SLA    R3,24
> 
> But for some reason that produces 1A000000 in R3 and I'm not sure why.
> Would someone explain what is happening here?

>From the PoP manual:

"For SHIFT LEFT SINGLE (SLA), the 31-bit numeric part of the signed
first operand is shifted left the number of bits specified by the
second-operand address, and the result is placed at the first-operand
location. Bits 0-31 of general register R1 remain unchanged."  (Note
that all registers are 64-bit nowadays.) 

And:  "For SLA, the first operand is treated as a 32-bit signed binary
integer in bit positions 32-63 of general register R1. The sign of the
first operand remains unchanged. All 31 numeric bits of the operand
participate in the left shift."

Since the sign bit is zero after the LA instruction, it remains zero
after the SLA for 24 bits, thus effectively "dropping" it in the instant
case.

You'll have better luck using SLL instead of SLA.

    -jc-

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to