MSP430 Instructions
4-65
16-Bit MSP430X CPU
AND[.W]
Logical AND of source word with destination word
AND.B
Logical AND of source byte with destination byte
Syntax
AND
src,dst or AND.W src,dst
AND.B
src,dst
Operation
src .and. dst
→
dst
Description
The source operand and the destination operand are logically ANDed. The
result is placed into the destination. The source operand is not affected.
Status Bits
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
Mode Bits
OSCOFF, CPUOFF, and GIE are not affected.
Example
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
; Load 16-bit mask to R5
AND
R5,&TOM
; TOM .and. R5 -> TOM
JZ
TONI
; Jump if result 0
...
; Result > 0
or shorter:
AND
#AA55h,&TOM
; TOM .and. AA55h -> TOM
JZ
TONI
; Jump if result 0
Example
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
; AND table byte with R6. R5 + 1
Содержание MSP430x4xx Family
Страница 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Страница 2: ......
Страница 6: ...vi ...
Страница 114: ...3 76 RISC 16 Bit CPU ...
Страница 304: ...5 20 FLL Clock Module ...
Страница 340: ...7 8 Supply Voltage Supervisor ...
Страница 348: ...8 8 16 Bit Hardware Multiplier ...
Страница 372: ...9 24 32 Bit Hardware Multiplier ...
Страница 400: ...10 28 DMA Controller ...
Страница 428: ...13 10 Basic Timer1 ...
Страница 466: ...15 24 Timer_A ...
Страница 522: ...17 30 USART Peripheral Interface UART Mode ...
Страница 544: ...18 22 USART Peripheral Interface SPI Mode ...
Страница 672: ...23 12 Comparator_A ...
Страница 692: ...24 20 LCD Controller ...
Страница 746: ...26 28 ADC12 ...