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

stw or st (Store) Instruction

Purpose

Stores a word of data from a general-purpose register into a specified location in memory.

Syntax

PowerPC
stw RS,D(RA)
POWER
st RS,D(RA)

Description

The stw and st instructions store a word from general-purpose register (GPR) RS into a 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.

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

Parameters

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

Examples

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

.csect data[rw]
buffer: .long 0,0
# Assume GPR 6 contains 0x9000 3000.
# Assume GPR 5 contains the address of buffer.
.csect text[pr]
stw 6,4(5)
# 0x9000 3000 is now stored at the address buffer+4.

Related Information

Fixed-Point Processor.

Fixed-Point Load and Store Instructions.


[ Previous | Next | Contents | Home | Search ]