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
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.
Pseudocode 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.
Example
lhbrx r3, r4, r5
Encoding
Binary Layout
31
0
RT
6
RA
11
RB
16
790
/
Operands
-
RT
Target -
RA
Base -
RB
Index