4 macro service function, 1 macro service outline, Chapter 12 interrupt functions – NEC PD78214 User Manual
Page 348

319
Chapter 12 Interrupt Functions
12
12.4 MACRO SERVICE FUNCTION
12.4.1 Macro Service Outline
Macro service is one of the interrupt handling methods. When a vectored interrupt is processed, the contents of
the program counter (PC) and the program status word (PSW) are saved in the stack and the PC is loaded with the
vector address retrieved from the vector table. With the macro service function, a different type of processing
(mainly data transfer) is performed. This type of processing can respond to an interrupt request quickly. Moreover,
it transfers data much faster than the program does, shortening the required processing time significantly.
With the macro service function, a vectored interrupt can be generated after processing has been performed a
specified number of times, so that the vectored interrupt program can be simplified.
Fig. 12-14 Differences between a Vectored Interrupt and Macro Service
Notes 1. This timing chart applies when the register bank switching function is used and the registers are loaded with the initial values in
advance.
2. The PC and PSW contents are saved in the stack and the PC is loaded with the vector address.
Macro service
Vectored interrupt
Note 1
Vectored interrupt
Macro service
processing
Main routine
Note 2
SEL
RBn
Interrupt
processing
Main routine
Restores
PC, PSW
Note 2
Saves
general
registers
Initializes
general
registers
Interrupt
processing
Restores
general
registers
Restores
PC, PSW
Main routine
Interrupt request occurs
Main
routine
Main
routine
Main
routine