Texas Instruments MSP430x4xx Family User Manual page 198

Hide thumbs Also See for MSP430x4xx Family:
Table of Contents

Advertisement

MSP430 Instructions
* INV[.W]
* INV.B
Syntax
Operation
Emulation
Emulation
Description
Status Bits
Mode Bits
Example
Example
4-84
16-Bit MSP430X CPU
Invert destination
Invert destination
INV
dst
INV.B
dst
.NOT.dst −> dst
XOR
#0FFFFh,dst
XOR.B
#0FFh,dst
The destination operand is inverted. The original contents are lost.
N: Set if result is negative, reset if positive
Z: Set if dst contained 0FFFFh, reset otherwise
Set if dst contained 0FFh, reset otherwise
C: Set if result is not zero, reset otherwise ( = .NOT. Zero)
Set if result is not zero, reset otherwise ( = .NOT. Zero)
V: Set if initial destination operand was negative, otherwise reset
OSCOFF, CPUOFF, and GIE are not affected.
Content of R5 is negated (twos complement).
MOV
#00AEh,R5 ;
INV
R5
INC
R5
Content of memory byte LEO is negated.
MOV.B
#0AEh,LEO ;
INV.B
LEO
INC.B
LEO
; Invert R5,
; R5 is now negated,
; Invert LEO,
; MEM(LEO) is negated,MEM(LEO) = 052h
R5 = 000AEh
R5 = 0FF51h
R5 = 0FF52h
MEM(LEO) = 0AEh
MEM(LEO) = 051h

Advertisement

Table of Contents
loading

Table of Contents