lwbrx
Load Word Byte-Reverse Indexed
Loads a word and swaps bytes.
Details
The lwbrx instruction loads a word from memory and reverses its byte order before storing it in the target register. The effective address is calculated by adding the contents of registers RA and RB.
Pseudocode Operation
Programming Note
The lwbrx instruction is commonly used to load a word from memory and reverse its byte order, which can be useful for handling data in big-endian or little-endian formats. Ensure that the base address (RA) and index (RB) registers are correctly set to avoid incorrect memory access. This instruction operates at user privilege level and will raise an exception if it accesses invalid memory addresses.
Example
Encoding
Operands
-
RT
Target -
RA
Base -
RB
Index