Texas Instruments MSP430x1xx User Manual page 74

Texas instruments modules and peripherals user's guide
Table of Contents

Advertisement

Instruction Set
* DECD[.W]
Double-decrement destination
* DECD.B
Double-decrement destination
Syntax
DECD
DECD.B
Operation
dst − 2 −> dst
Emulation
SUB
Emulation
SUB.B
Description
The destination operand is decremented by two. The original contents are lost.
Status Bits
N: Set if result is negative, reset if positive
Z: Set if dst contained 2, reset otherwise
C: Reset if dst contained 0 or 1, set otherwise
V: Set if an arithmetic overflow occurs, otherwise reset.
Mode Bits
OSCOFF, CPUOFF, and GIE are not affected.
Example
R10 is decremented by 2.
; Move a block of 255 words from memory location starting with EDE to memory location
; starting with TONI
; Tables should not overlap: start of destination address TONI must not be within the
; range EDE to EDE+0FEh
;
L$1
Example
Memory at location LEO is decremented by two.
Decrement status byte STATUS by two.
RISC 16−Bit CPU
3-38
dst
or
DECD.W
dst
#2,dst
#2,dst
Set if initial value of destination was 08001 or 08000h, otherwise reset.
Set if initial value of destination was 081 or 080h, otherwise reset.
DECD
R10
MOV
#EDE,R6
MOV
#510,R10
MOV
@R6+,TONI−EDE−2(R6)
DECD
R10
JNZ
L$1
DECD.B
LEO
DECD.B
STATUS
dst
; Decrement R10 by two
; Decrement MEM(LEO)

Advertisement

Table of Contents
loading

Table of Contents