CALL [Condition,] Address — Call Subroutine at Specified Address, Possibly with Conditions

R

Condition

Depending on the specified Condition, the program calls the subroutine beginning at the specified Address. If the specified Condition is not met, the program continues to the next instruction.

Table C-1:CALL Instruction Conditions

Condition

Description

 

 

<none>

Always true. Call subroutine unconditionally.

 

 

C

CARRY = 1. Call subroutine if CARRY flag is set.

 

 

NC

CARRY = 0. Call subroutine if CARRY flag is cleared.

 

 

Z

ZERO = 1. Call subroutine if ZERO flag is set.

 

 

NZ

ZERO = 0. Call subroutine if ZERO flag is cleared.

 

 

Pseudocode

if (Condition = TRUE) then

;push current PC onto top of the CALL/RETURN stack

;TOS = Top of Stack

TOS Å PC

;load PC with specified Address PC Å Address

else

PC Å PC + 1 endif

Registers/Flags Altered

Registers: PC, CALL/RETURN stack

Flags: Not affected

Notes

The maximum number of nested subroutine calls is 31 levels, due to the depth of the

CALL/RETURN stack.

PicoBlaze 8-bit Embedded Microcontroller

www.xilinx.com

95

UG129 (v1.1.2) June 24, 2008

Page 95
Image 95
Xilinx UG129 manual Table C-1CALL Instruction Conditions Description