> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Greg Price
> Sent: Wednesday, June 18, 2008 9:03 AM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: LRVH instruction - misnamed or BAD?
> 
> LRVH - Load Reversed (Halfword)
> 
> So it should load a reversed halfward, right?
> 
> Well, sure, it swaps the byte order (compared to their order 
> in storage)
> and puts them in register bits 48->63, **BUT** it leaves bits 0->47
> UNCHANGED.
> 
> Now, that last part is not what LH does, is it?
> 
> In my book, that's an INSERT, not a LOAD.  I think it should have
> zeroed bits just like LH does.  I think the LOAD (as I envisage it)
> function is more useful than the INSERT function (as it is 
> implemented).
> 
> Am I right or am I right?  (They are the only possibilities, 
> aren't they?)
> 
> Cheers,
> Greg

I agree. I guess to really make this do what I would generally want, I'd
need to do something like:

        LRVH    R0,INTEL_HALFWORD
        SLL     R0,16
        SRA     R0,16

That would propagate the sign bit correctly. That's for only using the
32 bit register. For using 64 bit, I'd replace the 16 with 48.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it.  

----------------------------------------------------------------------
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