SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
Load Halfword from Memory with a 16-Bit Unsigned Constant Offset
LDH *+baseR[ucst16], dst
or
LDHU *+baseR[ucst16], dst
Functional unit = D
32 bit
31 | 16 | 15 | 13 | 12 | 10 | 9 | 0 |
ucst16 | dst | baseR | opcode |
16 | 3 | 3 | 10 |
Syntax | Opcode | Load Type |
---|---|---|
LDH *+baseR[ucst16], dst | 01 1000 1000 | Load halfword (sign-extended) |
LDHU *+baseR[ucst16], dst | 00 1000 1000 | Load halfword unsigned (zero-extended) |
Loads a halfword (signed or unsigned) from memory (effective address) to dst. The memory address is formed from a base address register (baseR) and an offset (number of halfwords) that is a 16-bit unsigned constant (ucst16). If an offset is not given, the assembler assigns an offset of zero. Brackets, [ ],must surround the specified offset, if using the optional offset parameter.
The square brackets, [ ], indicate that the ucst16 is scaled by a left-shift of 1 bit. After scaling, ucst16 is added to baseR. The result of the calculation is the effective address to be accessed in memory and the content loaded into dst.
The content is loaded into the 16 LSBs of dst. For the LDH instruction, the upper 16 bits of dst are sign-extended; for the LDHU instruction, the upper 16 bits of dst are zero-extended.
Halfword addresses must be aligned on halfword (LSB is 0) boundaries.
None
dst = *(baseR[ucst16])