world leader in high performance signal processing
Trace: » jump

JUMP

General Form

JUMP (destination_indirect)
JUMP (PC + offset)
JUMP offset
JUMP.S offset
JUMP.L offset

Syntax

JUMP ( Preg ) ;       /* indirect to an absolute (not PC-relative) address, 16-bit */
JUMP ( PC + Preg ) ;  /* PC-relative, indexed, 16-bit */
JUMP pcrel25m2 ;      /* PC-relative, immediate, 16 or 32 bit */
JUMP.S pcrel13m2 ;    /* PC-relative, immediate, short, 16-bit */
JUMP.L pcrel25m2 ;    /* PC-relative, immediate, long, 16-bit */
JUMP user_label ;     /* user-defined absolute address label, resolved by the assembler/linker to the appropriate PC-relative instruction 16 or 32 bit */

Syntax Terminology

Preg
P5–0, SP, FP
pcrelm2
undetermined 25-bit or smaller signed, even relative offset, with a range of –16,777,216 through 16,777,214 bytes (0xFF00 0000 to 0x00FF FFFE)
pcrel13m2
13-bit signed, even relative offset, with a range of –4096 through 4094 bytes (0xF000 to 0x0FFE)
pcrel25m2
25-bit signed, even relative offset, with a range of –16,777,216 through 16,777,214 bytes (0xFF00 0000 to 0x00FF FFFE)
user_label
valid assembler address label, resolved by the assembler/linker to a valid PC-relative offset

Functional Description

The Jump instruction forces a new value into the Program Counter (PC) to change program flow.

In the Indirect and Indexed versions of the instruction, the value in Preg must be an even number (bit0=0) to maintain 16-bit address alignment. Otherwise, an odd offset in Preg causes the processor to invoke an alignment exception.

Flags Affected

None

Required Mode

User & Supervisor

Parallel Issue

The Jump instruction cannot be issued in parallel with other instructions.

Example

jump get_new_sample ;  /* assembler resolved target, abstract offsets */
jump (p5) ;            /* P5 contains the absolute address of the target  */
jump (pc + p2) ;       /* P2 relative absolute address of the target and then a presentation of the absolute values for target */
jump 0x224 ;           /* offset is positive in 13 bits, so target address is PC + 0x224, a forward jump */
jump.s 0x224 ;         /* same as above with jump “short” syntax */
jump.l 0xFFFACE86 ;    /* offset is negative in 25 bits, so target address is PC + 0x1FA CE86, a backwards jump */

Also See

Special Applications

None