Instructions: Data Transfer | |||||||||||||
Halfword operations (short int) | |||||||||||||
short int is usually 16 bits | |||||||||||||
lh $rt, offset($rs) | Load halfword from memory location to register | ||||||||||||
Data is sign-extended in register | |||||||||||||
lhu $rt, offset($rs) | Data is zero-extended in register | ||||||||||||
sh $rt, offset($rs) | Store halfword from register to memory location | ||||||||||||
Loading constant | |||||||||||||
lui $rt, immed | |||||||||||||
Semantics: | |||||||||||||
R[t] = IR15-0 016 | |||||||||||||
load the lower halfword of immed into upper halfword of $rt | |||||||||||||
lower bits of $rt are set to 0 | |||||||||||||
$rs is ignored |