beautypg.com

NEC PD17062 User Manual

Page 110

background image

110

µ

PD17062

11.2.6 Interrupt Enable Flip-Flop (INTE)

The interrupt enable flip-flop sets the interrupt permissions of all four types of interrupts.

If each interrupt request processing block outputs a 1 while this flip-flop is set to 1, a 1 is output from this

flip-flop and an interrupt is accepted.

Even if a 1 is output from each interrupt request processing block while this flip-flop is reset to 0, an interrupt

is not accepted.

To set or reset this flip-flop, use exclusive instructions EI (set) and DI (reset).

If the EI instruction is executed, this flip-flop is set when the instruction executed after the EI instruction

is completed. If the DI instruction is executed, the flip-flop is reset during the DI instruction execution cycle.

If an interrupt is accepted while the interrupt enable flip-flop is set (EI state), this flip-flop is reset (DI state).

Even if the DI instruction is executed in the DI state or the EI instruction is executed in the EI state, the

instruction is invalid.

This flag is reset (DI state) at power-on reset, clock stop, or CE reset.

11.2.7 Stack Pointer, Address Stack Register, and Program Counter

The return address of control returned from the interrupt processing routine is saved in the address stack

register.

The stack pointer specifies one of six address stack registers (ASR0 to ASR5) to be used.

In other words, when an interrupt is accepted, the stack pointer value is reduced by 1, and the program

counter value is saved in the address stack register indicated by the stack pointer. Next, if exclusive return

instruction RETI is executed after the interrupt processing routine, the contents of the address stack register

indicated by the stack pointer are returned to the program counter. At this time, the stack pointer value is

increased by 1.

See also Chapter 4.

11.2.8 Interrupt Stack

The interrupt stack saves the contents of the bank register and index enable flag in the system register when

an interrupt is accepted.

When the interrupt is accepted and the contents of the bank register and index enable flag are saved, the

bank register and index enable flag in the system register are reset to 0.

The interrupt stack can save the contents of the bank registers and index enable flags of up to two levels.

Therefore, the interrupt stack can issue multiple interrupts of up to two levels; for example, an interrupt can

be accepted during execution of a routine that is processing another interrupt.

The contents of the interrupt stack are restored in the bank register and index enable flag in the system

register by executing the RETI instruction. The RETI instruction is exclusively used to return control from the

interrupt processing routine.

See also Chapter 4.