brd
Byte-Reverse Doubleword
brd RT,RA
Reverses the bytes in a doubleword.
Details
The brd instruction reverses the byte order of the contents of register RA and places the result into register RT.
Pseudocode Operation
RT <- REVERSE_BYTES(RA)
Programming Note
The brd instruction is useful for reversing the byte order of a doubleword in a register, which can be necessary for data format conversion between big-endian and little-endian systems. Ensure that the source register (RA) contains a valid doubleword value to avoid undefined behavior. This operation does not require any special privileges or alignment considerations.
Example
brd r3, r4
Encoding
Binary Layout
18
0
LI
6
AA
30
LK
31
Operands
-
RT
Target General Purpose Register -
RA
Source General Purpose Register