lw $12, 0x10($13)
The original contents of $12 are irrelevant; they are replaced with the 32 bits from memory (memory remains unchanged).
The store word instruction, sw
,
copies data from a register to memory.
The register is not changed.
The memory address is specified using a base/register pair.
sw t,off(b) # Word at memory address (b+off) <-- $t # b is a register. off is 16-bit two's complement.
As with the lw
instruction,
the memory address must be word aligned (a multiple of four).
Conditions are as follows and memory is as at right. Write the instruction that puts the word $0xFFFFFFFF into register memory location 0x0004000C.
0xFFFFFFFF
0x00040014
Hint: it is OK to specify the 16-bit offset as a signed decimal integer.sw $_____ , _____($ )