stfdx
Store Floating-Point Double Indexed - 7C 00 00 5C
stfdx

Instruction Syntax

Mnemonic Format Flags
stfdx frS,rA,rB None

Instruction Encoding

0
1
1
1
1
1
S
S
S
S
S
A
A
A
A
A
B
B
B
B
B
0
0
0
0
0
0
0
0
0
0
0

Field Bits Description
Primary Opcode 0-5 011111 (0x1F)
frS 6-10 Source floating-point register
rA 11-15 Base register
rB 16-20 Index register
Reserved 21-29 000000000
Reserved 30-31 00

Operation

EA ← (rA) + (rB)
(EA) ← (frS)

The effective address is calculated by adding the base register to the index register. The double-precision floating-point value in the source register is stored at the effective address.

Note: The stfdx instruction stores a 64-bit double-precision floating-point value to memory using indexed addressing. The address must be aligned to an 8-byte boundary.

Affected Registers

Memory

Examples

Basic Store Floating-Point Double Indexed

# Store double-precision value using indexed addressing
stfdx fr1, r3, r4    # Store fr1 at address r3 + r4

Array of Doubles with Dynamic Index

# Store double in array using dynamic index
li r3, array         # Load array base address
li r4, 16            # Index = 16 (2 * 8 bytes)
stfdx fr1, r3, r4    # Store double at array[2]

Dynamic Addressing

# Store double using dynamic index calculation
li r3, base_addr     # Load base address
add r4, r5, r6       # Calculate index dynamically
stfdx fr1, r3, r4    # Store double at base_addr + index

Related Instructions

stfd, stfdu, stfdux, lfdx

Back to Index