Texas Instruments MSP430x1xx User Manual

Page 84

Advertising
background image

Instruction Set Overview

5-20

5.3.3

Conditional Jumps

Conditional jumps support program branching relative to the program counter.
The possible jump range is from – 511 to +512 words relative to the program
counter state of the jump instruction. The 10-bit program-counter offset value
is treated as a signed 10-bit value that is doubled and added to the program
counter. None of the jump instructions affect the status bits.

The instruction code fetch and the program counter increment technique end
with the formula:

PC

new

= PC

old

+ 2 + PC

offset

×

2

Figure 5–9 shows the conditional-jump instruction format.

Figure 5–9. Conditional-Jump Instruction Format

C

10-Bit PC Offset

15

0

Opcode

8

7

14

13

12

11

10

9

6

5

4

3

2

1

Table 5–17 describes these conditional-jump instructions.

Table 5–17.Conditional-Jump Instructions

Mnemonic

S-Reg, D-Reg

Operation

JEQ/JZ

Label

Jump to label if zero bit is set

JNE/JNZ

Label

Jump to label if zero bit is reset

JC

Label

Jump to label if carry bit is set

JNC

Label

Jump to label if carry bit is reset

JN

Label

Jump to label if negative bit is set

JGE

Label

Jump to label if (N .XOR. V) = 0

JL

Label

Jump to label if (N .XOR. V) = 1

JMP

Label

Jump to label unconditionally

Advertising