[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Assembler Language Reference

stwu or stu (Store Word with Update) Instruction

Purpose

Stores a word of data from a general-purpose register into a specified location in memory and possibly places the address in another general-purpose register.

Syntax

PowerPC
stwu RS,D(RA)
POWER
stu RS,D(RA)

Description

The stwu and stu instructions store the contents of general-purpose register (GPR) RS into the word of storage addressed by the effective address (EA).

If GPR RA is not 0, the EA is the sum of the contents of GPR RA and D, a 16-bit signed two's complement integer sign-extended to 32 bits. If GPR RA is 0, then the EA is D.

If GPR RA is not 0 and the storage access does not cause an Alignment Interrupt or a Data Storage Interrupt, then EA is placed into GPR RA.

The stwu and stu instructions have one syntax form and do not affect the Fixed-Point Exception Register or Condition Register Field 0.

Parameters

RS Specifies general-purpose register of stored data.
D Specifies16-bit signed two's complement integer sign-extended to 32 bits for EA calculation.
RA Specifies source general-purpose register for EA calculation and possible address update.

Examples

The following code stores the contents of GPR 6 into a location in memory:

.csect data[rw]
buffer: .long 0
# Assume GPR 4 contains the address of csect data[rw].
# Assume GPR 6 contains 0x9000 3000.
.csect text[pr]
stwu 6,buffer(4)
# buffer now contains 0x9000 3000.
# GPR 4 contains the address of buffer.

Related Information

Fixed-Point Processor.

Fixed-Point Load and Store with Update Instructions.


[ Previous | Next | Contents | Home | Search ]