
406
CHAPTER 16 INTERRUPT FUNCTIONS
16.8 Macro Service Function
16.8.1 Outline of macro service function
Macro service is one method of processing 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-16. 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 25 kinds of interrupt shown in Table 16-6 (22 of which can be used simultaneously).
There are seven kinds of operation mode, 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
Processing
Main Routine
SEL
RBn
Interrupt
Processing
Restore
PC, PSW
Save
General
Registers
Initialize
General
Registers
Interrupt
Processing
Restore
General
Registers
Main Routine
Restore
PC & PSW
Main Routine