ldbrx
Load Doubleword Byte-Reverse Indexed
Loads a doubleword from memory, byte-reversing it before storing in the target register.
Details
The ldbrx instruction loads a doubleword from memory and reverses its bytes before placing it into the target register RT. The effective address (EA) is calculated as the sum of the contents of registers RA and RB.
Pseudocode Operation
Programming Note
The ldbrx instruction is commonly used for loading and reversing the byte order of a doubleword from memory into a register. Ensure that the base address in RA (or 0 if using an absolute address) and the offset in RB are correctly set to avoid accessing invalid memory locations. This instruction operates at user privilege level, but care must be taken to handle potential exceptions such as alignment errors or access violations. Performance may vary depending on memory alignment; optimal performance is achieved when the effective address is 8-byte aligned.
Example
Encoding
Operands
-
RT
Target -
RA
Base -
RB
Index