
267
CHAPTER 16 INTERRUPT FUNCTION
User’s Manual U15017EJ2V0UD
16.8 Macro Service Function
16.8.1 Outline of macro service function
Macro service is one method of servicing interrupts. With a normal interrupt, the program counter (PC) and program
status word (PSW) are saved, and the start address of the interrupt service program is loaded into the PC, but with
macro service, different processing (mainly data transfers) is performed instead of this processing. This enables
interrupt requests to be responded to quickly, and moreover, since transfer processing is faster than processing by
a program, the processing time can also be reduced.
Also, since a vectored interrupt is generated after processing has been performed the specified number of times,
another advantage is that vectored interrupt programs can be simplified.
Figure 16-17. Differences Between Vectored Interrupt and Macro Service Processing
Notes 1.
When register bank switching is used, and an initial value has been set in the register beforehand
2.
Register bank switching by context switching, saving of PC and PSW
3.
Register bank, PC and PSW restoration by context switching
4.
PC and PSW saved to the stack, vector address loaded into PC
16.8.2 Types of macro service
Macro service can be used with the 19 kinds of interrupts shown in Table 16-6. There are three kinds of operation,
which can be used to suit the application.
Macro service
Context switching
Note 1
Vectored interrupt
Note 1
Vectored interrupt
Interrupt request generation
Main routine
Main routine
Main routine
Main routine
Macro service
processing
Main routine
Note 2
Note 4
Note 4
Note 3
Interrupt
servicing
Main routine
SEL
RBn
Interrupt
servicing
Restore
PC, PSW
Save
general
registers
Initialize
general
registers
Interrupt
servicing
Restore
general
registers
Main routine
Restore
PC & PSW
Main routine