sw
, store word, is given as follows.
sw $t1, offset($t2) # mem[[$t2]+offset]=$t1 # mem[ [rs]+offset]= rt |
ExtOp=“sign”
sign-extends the 16-bit immediate to 32 bits.
ALUSrc=‘1’
selects the extended immediate as the second ALU input.
ALUCtrl=“ADD”
calculates data memory address as [rs]+sign-extended(imm16)
.
MemWrite=‘1’
writes to data memory.
RegDst=‘X’
means “don’t care” because of no destination register.
MemtoReg=‘X’
is “don’t care.”
RegWrite=‘0’
because no register is written by the store instruction.