3 jumps – Texas Instruments MSP430x4xx User Manual

Page 54

Advertising
background image

Instruction Set

3-20

RISC 16-Bit CPU

3.4.3

Jumps

Figure 3−11 shows the conditional-jump instruction format.

Figure 3−11. Jump Instruction Format

C

10-Bit PC Offset

15

0

Op-code

8

7

14

13

12

11

10

9

6

5

4

3

2

1

Table 3−13 lists and describes the jump instructions.

Table 3−13.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

Conditional jumps support program branching relative to the PC and do not
affect the status bits. The possible jump range is from − 511 to +512 words
relative to the PC value at the jump instruction. The 10-bit program-counter
offset is treated as a signed 10-bit value that is doubled and added to the
program counter:

PC

new

= PC

old

+ 2 + PC

offset

Ч

2

Advertising