Encoding:

EXTEND

11110

offset 10:5

offset 15:11

LH

10001

rx

ry

offset 4:0

5

6

5

5

3

3

5

Format:

LH ry, offset(rx)

MIPS16e

Load Halfword (Extended)

Purpose:

Load Halfword (Extended)

To load a halfword from memory as a signed value.

Description:

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

The 16-bit offsetis sign-extended and then added to the contents of GPR rx to form the effective address. The contents of the halfword at the memory location specifie by the effective address are sign-extended and loaded into GPR

ry.

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, LOAD)
pAddr = pAddrPSIZE-1..2 || (pAddr1..0 xor (ReverseEndian || 0))
memword = LoadMemory (CCA, HALFWORD, pAddr, vAddr, DATA)
byte = vAddr1..0 xor (BigEndianCPU || 0)
GPR[Xlat(ry)] = sign_extend(memword15+8*byte..8*byte)

Exceptions:

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