lhbrx

Load Halfword Byte-Reverse Indexed

lhbrx RT, RA, RB

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

Encoding

Binary Layout
31
0:5
RT
6:10
RA
11:15
RB
16:20
790
21:30
/
31
 
Format X-form
Opcode 0x7C00062C
Extension Base

Operands

  • RT
    Target
  • RA
    Base
  • RB
    Index

Example

lhbrx r3, r4, r5

Related

More in Base

Reference

Description

Loads a halfword from memory at address (RA|0) + RB, byte-reverses it, and stores the result in RT. No status flags are affected. This is part of the Base category and is commonly used for endianness conversion when reading network or file data.

Operation

EA ← (RA|0) + RB
RT ← byte_reverse_16([EA])

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.