Chapter 2. Program Organization26 PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual GFK-2950C2.3.1 Interrupt HandlingAn I/O, Module, or Timed interrupt can be associated with any block except _MAIN, as long as theblock has no parameters other than an OK output. After an interrupt has been associated with ablock, that block executes each time the interrupt trigger occurs. A given block can have multipletimed, I/O, and module interrupt triggers associated with it. It is executed each time any one of itsassociated interrupts triggers. For details on how interrupt blocks are prioritized, refer to InterruptBlock Scheduling.If a parameterized block or external block is triggered by an interrupt, it inherits %P data as its %Llocal data. For example, a %L00005 reference in the parameterized block or C block actuallyreferences %P00005.Note: Timer function blocks do not accumulate time if used in a block that is executed as a result ofan interrupt.Blocks that are triggered by interrupts can make calls to other blocks. The application stack usedduring interrupt-driven execution is different from the stack used during normal block-structuredprogram execution. In particular, the nested call limit is different from the limit described for callsfrom the _MAIN block. If a call results in insufficient stack space to complete the call, the CPU logs anApplication Stack Overflow fault.Note: We strongly recommend that interrupt-driven blocks not be called from the _MAIN block orother non-interrupt driven blocks because the interrupt and non-interrupt driven blockscould be reading and writing the same global memories at indeterminate times relative toeach other. In the following example (Figure 13) INT1, INT2, BLOCK5, and PB1 should not becalled from _MAIN, BLOCK2, BLOCK3, or BLOCK4.INT Block 1_MAINBlockBlock2Block3Block4Block5INT Block 2PB1Figure 13: Conflict Avoidance when using Interrupt-Driven Blocks