lbarx

Load Byte And Reserve Indexed

lbarx RT,RA,RB,EH
lbarx RT,RA,RB

Loads a byte from memory and reserves the location for exclusive access.

Details

Loads a single byte from memory at the address computed from RA+RB into RT, zero-extending to 64 bits, and reserves the location for exclusive access for a subsequent stbcx. instruction. The optional EH field provides a hint for the subsequent store. No condition register fields are affected by this load.

Pseudocode Operation

EA ← (RA|0) + RB
RT ← (56)0 || MEM[EA, 1]
RESERVED ← EA

Programming Note

lbarx serves as both a basic and an extended mnemonic. The Assembler will recognize a lbarx mnemonic with four operands as the basic form, and a lbarx mnemonic with three operands as the extended form. In the extended form the EH operand is omitted and assumed to be 0.

Example

lbarx r3, r4, r5, 0

Encoding

Binary Layout
31
0
RT
6
RA
11
RB
16
52
21
0
 
Format X-form
Opcode 0x7C000068
Extension Base
Registers Altered RESERVE, RESERVE_LENGTH, RESERVE_ADDR

Operands

  • RT
    Target
  • RA
    Base
  • RB
    Index
  • EH
    Hint for subsequent store operation