Load From Memory With a 15-Bit Constant Offset
LDB(U)/LDH(U)/LDW
3-71
TMS320C62x/C67x Fixed-Point Instruction Set
Syntax
LDB (.unit) *+B14/B15[
ucst15], dst
or
LDH (.unit) *+B14/B15[
ucst15], dst
or
LDW (.unit) *+B14/B15[
ucst15], dst
or
LDBU (.unit) *+B14/B15[
ucst15], dst
or
LDHU (.unit) *+B14/B15[
ucst15], dst
.unit = .D2
Opcode
31
29 28 27
23 22
creg
z
dst
4
3
2
1
0
1
1
s
p
3
5
15
6
ld/st
ucst15
7
8
y
3
Description
Each of these instructions performs a load from memory to a general-purpose
register (
dst). Table 3–15 summarizes the data types supported by loads. The
memory address is formed from a base address register (
baseR) B14 (y = 0)
or B15 (y = 1) and an offset, which is a 15-bit unsigned constant (
ucst15). The
assembler selects this format only when the constant is larger than five bits in
magnitude. This instruction operates only on the .D2 unit.
The offset,
ucst15, is scaled by a left shift of 0, 1, or 2 for LDB(U), LDH(U), and
LDW, respectively. After scaling,
ucst15 is added to baseR. Subtraction is not
supported. The result of the calculation is the address sent to memory. The ad-
dressing arithmetic is always performed in linear mode.
For LDH(U) and LDB(U), the values are loaded into the 16 and 8 LSBs of
dst,
respectively. For LDH and LDB, the upper 16 and 24 bits of
dst values are sign-
extended, respectively. For LDHU and LDBU loads, the upper 16 and 24 bits
of
dst are zero-filled, respectively. For LDW, the entire 32 bits fills dst. dst can
be in either register file. The
s bit determines which file dst will be loaded into:
s = 0 indicates dst is loaded in the A register file, and s = 1 indicates dst is
loaded into the B register file.
Square brackets, [ ], indicate that the
ucst15 offset is left-shifted by 2, 1, or 0
for word, halfword, and byte loads, respectively. Parentheses, ( ), can be used
to set a nonscaled, constant offset. For example, LDW (.unit) *+B14/B15(60)
dst represents an offset of 60 bytes, whereas LDW (.unit) *+B14/B15[60] dst
represents an offset of 60 words, or 240 bytes. You must type either brackets
or parentheses around the specified offset if you use the optional offset param-
eter.