stb
Store Byte
stb RS, D(RA)
Stores the low 8 bits of a register to memory.
Encoding
Binary Layout
10
DS
RS
RA
SIMM[15:0]
Operands
-
RS
Source Register -
D
Displacement -
RA
Base Register -
EA
Effective Address
Example
stb r3, 0(r4)
// Store byte from r3 to address r4.
Related
More in Base
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
Store the low 8 bits of RS to the byte in memory at the effective address formed by adding the displacement D (sign-extended) to RA, or to the displacement alone if RA is 0. This is a Base category instruction with no status field updates.
Operation
EA ← EXTS(D, 16) + (RA | 0)
MEM(EA, 1) ← RS[56:63]
Programming Note
The stb instruction is commonly used to store a single byte from a register into memory. Ensure that the destination address is properly aligned for optimal performance and avoid accessing invalid or protected memory regions to prevent exceptions.