ldu (Load Doubleword with Update) instruction

Purpose

Loads a doubleword of data into the specified general purpose register (GPR) , and updates the address base.

Note: This instruction should only be used on 64-bit PowerPC® processors that run a 64-bit application.

Syntax

Bits Value
0 - 5 58
6 - 10 RT
11 - 15 RA
16 - 29 DS
30 - 31 0b01
PowerPC 64 
ldu RT, Disp(RA)

Description

The ldu instruction loads a doubleword in storage from a specified location in memory that is addressed by the effective address (EA) into the target GPR RT.

DS is a 14-bit, signed two's complement number, which is sign-extended to 64 bits, and then multiplied by 4 to provide a displacement (Disp). If GPR RA is not 0, the EA is the sum of the contents of GPR RA and Disp.

If RA equals 0 or RA equals RT, the instruction form is invalid.

Parameters

Item Description
RT Specifies the target GPR where the result of the operation is stored.
Disp Specifies a 16-bit signed number that is a multiple of 4. The assembler divides this number by 4 when generating the instruction.
RA Specifies the source GPR for the EA calculation.

Examples

The following code loads the first of four doublewords from memory into GPR 4, and increments to GPR 5 to point to the next doubleword in memory:


.csect   foodata[RW]
storage: .llong 5,6,7,12  # Successive doublewords.

.csect   text[PR]
                          # Assume GPR 5 contains address of csect foodata[RW].
ldu       4,storage(5)    # GPR 4 now contains the first doubleword of
                          # foodata; GRP 5 points to the second doubleword.

Implementation

This instruction is defined only for 64-bit implementations. Using it on a 32-bit implementation invokes the system illegal instruction error handler.