Open as PDF
LDH(U) Load Halfword From Memory With a 15-Bit Unsigned Constant Offset
3-134 Instruction Set SPRU733
Load Halfword From Memory With a 15-Bit Unsigned Constant Offset
Syntax LDH (.unit) *+B14/B15[ucst15], dst
LDHU (.unit) *+B14/B15[ucst15], dst
.unit = .D2
Compatibility C62x, C64x, C67x, and C67x+ CPU
31 29 28 27 23 22 18 17 13 12 9 8 7 6 4 3 2 1 0
creg z dst ucst15 y op 1 1 s p
3 1 5 15 1 3 1 1
Description Loads a halfword from memory to a general-purpose register (dst). Table 3−20
summarizes the data types supported by loads. The memory address is
formed from a base address register B14 (y = 0) or B15 (y = 1) and an offset,
which is a 15-bit unsigned constant (ucst15). The assembler selects this for-
mat only when the constant is larger than five bits in magnitude. This instruc-
tion operates only on the .D2 unit.
The offset, ucst15, is scaled by a left shift of 1 bit. After scaling, ucst15 is added
to baseR. Subtraction is not supported. The result of the calculation is the
address sent to memory. The addressing arithmetic is always performed in
For LDH(U), the values are loaded into the 16 LSBs of dst. For LDH, the upper
16 bits of dst are sign-extended; for LDHU, the upper 16 bits of dst are zero-
filled. The s bit determines which file dst will be loaded into: s = 0 indicates dst
will be loaded in the A register file and s = 1 indicates dst will be loaded in the
B register file.
Square brackets, [ ], indicate that the ucst15 offset is left-shifted by 1.
Parentheses, ( ), can be used to set a nonscaled, constant offset. You must
type either brackets or parentheses around the specified offset, if you use the
optional offset parameter.
Halfword addresses must be aligned on halfword (LSB is 0) boundaries.