Texas Instruments MSP430x4xx Family User Manual page 179

Hide thumbs Also See for MSP430x4xx Family:
Table of Contents

Advertisement

AND[.W]
AND.B
Syntax
Operation
Description
Status Bits
Mode Bits
Example
Example
Logical AND of source word with destination word
Logical AND of source byte with destination byte
AND
src,dst or AND.W src,dst
AND.B
src,dst
src .and. dst → dst
The source operand and the destination operand are logically ANDed. The
result is placed into the destination. The source operand is not affected.
N:
Set if result is negative (MSB = 1), reset if positive (MSB = 0)
Z:
Set if result is zero, reset otherwise
C:
Set if the result is not zero, reset otherwise. C = (.not. Z)
V:
Reset
OSCOFF, CPUOFF, and GIE are not affected.
The bits set in R5 (16-bit data) are used as a mask (AA55h) for the word TOM
located in the lower 64 K. If the result is zero, a branch is taken to label TONI.
R5.19:16 = 0
MOV
#AA55h,R5
AND
R5,&TOM
JZ
TONI
...
or shorter:
AND
#AA55h,&TOM
JZ
TONI
A table byte pointed to by R5 (20-bit address) is logically ANDed with R6. R5 is
incremented by 1 after the fetching of the byte. R6.19:8 = 0
AND.B @R5+,R6
MSP430 Instructions
; Load 16-bit mask to R5
; TOM .and. R5 -> TOM
; Jump if result 0
; Result > 0
; TOM .and. AA55h -> TOM
; Jump if result 0
; AND table byte with R6. R5 + 1
16-Bit MSP430X CPU
4-65

Advertisement

Table of Contents
loading

Table of Contents