Encoding:

EXTEND

11110

offset 10:5

offset 15:11

SH

11001

rx

ry

offset 4:0

5

6

5

5

3

3

5

Format:

SH ry, offset(rx)

MIPS16e

Store Halfword (Extended)

Purpose:

Store Halfword (Extended)

To store a halfword to memory.

Description:

memory[GPR[rx] + offset] = GPR[ry]

The 16-bit offsetis sign-extended and then added to the contents of GPR rx to form the effective address. The leastsignificant half ord of GPR ry is stored at the effective address.

Restrictions:

The effective address must be naturally-aligned.Ifthe least-significanbit ofthe address is non-zero, an Address

Error exception occurs.

Operation:

vAddr = sign_extend(offset) + GPR[Xlat(rx)]
if vAddr0 != 0 then
   SignalException(AddressError)
endif
(pAddr, CCA) = AddressTranslation (vAddr, DATA, STORE)
pAddr = pAddrPSIZE-1..2 || (pAddr11..0 xor (ReverseEndian || 0))
bytesel = vAddr11..0 xor (BigEndianCPU || 0)
dataword = GPR[Xlat(ry)]31-8*bytesel..0|| 08*bytesel
StoreMemory (CCA, HALFWORD, dataword, pAddr, vAddr, DATA)

Exceptions:

TLB Refill, TLB I valid, TLB Modified, Bus Erro , Address Error