Xilinx UG129 Answering Machine User Manual


 
PicoBlaze 8-bit Embedded Microcontroller www.xilinx.com 101
UG129 (v1.1.2) June 24, 2008
JUMP [Condition,] Address — Jump to Specified Address, Possibly with Conditions
R
JUMP [Condition,] Address — Jump to Specified Address,
Possibly with Conditions
The JUMP instruction modifies the normal program execution sequence by jumping to a
specified program address. Each JUMP instruction must specify the 10-bit address as a
three-digit hexadecimal value or a label that the assembler resolves to a three-digit
hexadecimal value.
The JUMP instruction has both conditional and unconditional variants. A conditional JUMP
is only performed if a test performed against either the ZERO flag or CARRY flag is true. If
unconditional or if the condition is true, the JUMP instruction loads the specified jump
address into the Program Counter (PC).
The JUMP instruction does not affect the CALL/RETURN stack.
The JUMP instruction does not affect the ZERO or CARRY flags.
Example
JUMP NEW_LOCATION; Unconditionally jump to NEW_LOCATION
JUMP C, NEW_LOCATION; If CARRY flag set, jump to NEW_LOCATION
JUMP NC, NEW_LOCATION; If CARRY flag not set, jump to NEW_LOCATION
JUMP Z, NEW_LOCATION; If ZERO flag set, jump to NEW_LOCATION
JUMP NZ, NEW_LOCATION; If ZERO flag not set, jump to NEW_LOCATION
Condition
Depending on the specified condition, the program jumps to the instruction at the
specified address. If the specified condition is not met, the program continues on to the
next instruction.
Pseudocode
if (Condition = TRUE) then
PC Å Address
else
PC Å PC + 1
endif
Registers/Flags Altered
Registers: PC
Flags: Not affected
Table C-2: JUMP Instruction Conditions
Condition Description
<none> Always true. Jump unconditionally.
C CARRY = 1. Jump if CARRY flag is set.
NC CARRY = 0. Jump if CARRY flag is cleared.
Z ZERO = 1. Jump if ZERO flag is set.
NZ ZERO = 0. Jump if ZERO flag is cleared.