R
Appendix : PicoBlaze Instruction Set and Event Reference
INTERRUPT Event, When Enabled
The interrupt event is not an instruction but the response of the PicoBlaze microcontroller to an external interrupt input. If the INTERRUPT_ENABLE flag is set, then a recognized logic level on the INTERRUPT input generates an Interrupt Event. The action essentially generates a subroutine CALL to the
The instruction at the
Pseudocode
;only respond to INTERRUPT input if INTERRUPT_ENABLE flag is set if ( (INTERRUPT_ENABLE = 1)and (INTERRUPT input = High) ) then
;clear the INTERRUPT_ENABLE flag
INTERRUPT_ENABLE Å 0
;push the current program counter (PC) to the stack
;TOS = Top of Stack
TOS Å PC
;preserve the current CARRY and ZERO flags
PRESERVED_CARRY Å CARRY PRESERVED_ZERO Å ZERO
;load program counter (PC) with interrupt vector ($3FF) PC Å $3FF
endif
Registers/Flags Altered
Registers: PC, CALL/RETURN stack
Flags: CARRY, ZERO, INTERRUPT_ENABLE
Notes
The PicoBlaze microcontroller asserts the INTERRUPT_ACK output on the second CLK cycle of the
The programmer must ensure that a RETURNI instruction is only performed in response to a previous interrupt. Otherwise, the PC stack may not contain a valid return address.
Do not use the RETURNI instruction to return from a subroutine CALL. Instead, use the RETURN instruction.
Because an interrupt event may happen at any time, the values of the CARRY and ZERO flags cannot be predetermined. Consequently, the corresponding Interrupt Service Routine (ISR) must not depend on specific values for the CARRY and ZERO flags.
100 | www.xilinx.com | PicoBlaze |
|
| UG129 (v1.1.2) June 24, 2008 |