Texas Instruments TMS320C28x Reference Manual page 360

Dsp cpu and instruction set
Table of Contents

Advertisement

MOVH loc16, P
SYNTAX OPTIONS
MOVH loc16,P
Operands
loc16
P
Description
Flags and
N
Modes
Z
PM
Repeat
Example
; Calculate Y32 = M16*X16 >> 6
MOV
MPY
SPM
MOV
MOVH
Addressing mode (see Chapter 5)
Product register
The contents of the P register are shifted by the amount specified in the
product shift mode (PM), and the upper half of the shifted value is stored into
the 16-bit location pointed to by the "loc16" addressing mode. The P register
is not modified by the operation:
[loc16] = (P << PM) >> 16;
If (loc16 = @AX) and bit 15 of the AX register is 1, then the N bit is set;
otherwise, N is cleared.
If (loc16 = @AX) and the value of AX after the load is zero, then the Z bit is
set; otherwise Z is cleared.
The value in the PM bits sets the shift mode for the output operation from the
product register. If the product shift value is positive (logical left shift
operation), then the low bits are zero filled. If the product shift value is
negative (arithmetic right shift operation), the upper bits are sign extended.
This instruction is repeatable. If the operation follows a RPT instruction, then
it will be executed N+1 times. The state of the Z, and N flags will reflect the
final result.
T,@M16
; T = M
P,T,@X16
; P = T * X
−6
; Set product shift to >> 6
@Y32+0,P
; Y32 = P >> 6
@Y32+1,P
Save High Word of the P Register
OPCODE
0101 0111 LLLL LLLL
MOVH loc16, P
OBJMODE
RPT
CYC
X
Y
N+1
6-203

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C28x and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF