Texas Instruments MSP430x4xx Family User Manual page 218

Hide thumbs Also See for MSP430x4xx Family:
Table of Contents

Advertisement

MSP430 Instructions
* SETC
Syntax
Operation
Emulation
Description
Status Bits
Mode Bits
Example
DSUB
4-104
16-Bit MSP430X CPU
Set carry bit
SETC
1 −> C
BIS
#1,SR
The carry bit (C) is set.
N: Not affected
Z: Not affected
C: Set
V: Not affected
OSCOFF, CPUOFF, and GIE are not affected.
Emulation of the decimal subtraction:
Subtract R5 from R6 decimally
Assume that R5 = 03987h and R6 = 04137h
ADD
#06666h,R5
INV
R5
SETC
DADD
R5,R6
; Move content R5 from 0−9 to 6−0Fh
; R5 = 03987h + 06666h = 09FEDh
; Invert this (result back to 0−9)
; R5 = .NOT. R5 = 06012h
; Prepare carry = 1
; Emulate subtraction by addition of:
; (010000h − R5 − 1)
; R6 = R6 + R5 + 1
; R6 = 0150h

Advertisement

Table of Contents
loading

Table of Contents