lhbrx

Load Halfword Byte-Reverse Indexed

lhbrx RT, RA, RB

Loads a halfword from memory, byte-reverses it, and stores it in a register.

Details

The lhbrx instruction loads a halfword from memory, byte-reverses it, and stores it in the target register RT. The effective address (EA) is calculated as the sum of the contents of registers RA and RB.

Pseudocode Operation

if RA = 0 then
    b ← 0
else
    b ← (RA)
EA ← b + (RB)
load_data ← MEM(EA, 2)
RT ← 480 || load_data8:15 || load_data0:7

Programming Note

These instructions have the effect of loading and storing data in the opposite byte ordering from that which would be used by other Load and Store instructions.

Example

lhbrx r3, r4, r5

Encoding

Binary Layout
31
0
RT
6
RA
11
RB
16
790
/
 
Format X-form
Opcode 0x7C00062C
Extension Base

Operands

  • RT
    Target
  • RA
    Base
  • RB
    Index