MOVH loc16,ACC << 1..8
6-202
MOVH loc16,ACC << 1..8 Save High Word of Shifted Accumulator
SYNTAX OPTIONS OPCODE OBJMODE RPT CYC
MOVH loc16, ACC << 1 1011 0011 LLLL LLLL 1 Y N+1
MOVH loc16, ACC << 2..8
0101 0110 0010 1111
0000 0SHF LLLL LLLL
1 Y N+1
1011 0SHF LLLL LLLL 0 − 1
Operands loc16 Addressing mode (see Chapter 5)
ACC Accumulator register
#1..8 Shift value
Description Load the content of the location pointed to by the “loc16” addressing mode
with the high word of the ACC register after left−shifting by the specified
value. The ACC register is not modified:
[loc16] = ACC >> (16 − shift value);
Flags and
Modes
N
If (loc16 = @AX), then after the load AX is checked for a negative condition.
The N flag is set if bit 15 of the AX is 1; else N is cleared.
Z
If (loc16 = @AX) then after the load AX is checked for a zero condition. The Z
flag is set if AX is zero; else Z is cleared.
Repeat If the operation is repeatable, then the instruction will be executed N+1
times. The state of the Z and N flags will reflect the final result. If the operation
is not repeatable, the instruction will execute only once.
Example
; Multiply two Q15 numbers (VarA and VarB) and store result in
; VarC as a Q15 number:
MOV T,@VarA ; T = VarA (Q15)
MPY ACC,T,@VarB ; ACC = VarA * VarB (Q30)
MOVH @VarC,ACC << 1 ; VarC = ACC >> (16−1) (Q15)
; VarC as a Q31 number:
MOV T,@VarA ; T = VarA (T = Q14)
MPY ACC,T,@VarB ; ACC = VarA * VarB (ACC = Q28)
MOV @VarC+0,ACC << 3 ; VarC low = ACC << 3
MOVH @VarC+1,ACC << 3 ; VarC high = ACC >> (16−1) (VarC = Q31)