Texas Instruments MSP430x1xx User Manual page 85

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

Advertisement

JN
Jump if negative
Syntax
JN
if N = 1: PC + 2 × offset −> PC
Operation
if N = 0: execute following instruction
Description
The negative bit (N) of the status register is tested. If it is set, the 10-bit signed
offset contained in the instruction LSBs is added to the program counter. If N
is reset, the next instruction following the jump is executed.
Status Bits
Status bits are not affected.
Example
The result of a computation in R5 is to be subtracted from COUNT. If the result
is negative, COUNT is to be cleared and the program continues execution in
another path.
SUB
JN
......
......
......
......
L$1
CLR
......
......
......
label
R5,COUNT
; COUNT − R5 −> COUNT
L$1
; If negative continue with COUNT=0 at PC=L$1
; Continue with COUNT≥0
COUNT
Instruction Set
RISC 16−Bit CPU
3-49

Advertisement

Table of Contents
loading

Table of Contents