410
CHAPTER 16 INTERRUPT FUNCTIONS
16.8.3 Basic operation of macro service (except CPU monitor modes 0 and 1)
The macro service function is to transfer data between the special function register area and memory space by hardware,
using an interrupt request.
When a macro service request is generated, the CPU temporarily stops program execution, and automatically transfers
1/2-byte data between a special function register (SFR) and memory. When data transfer has been completed, an interrupt
request flag is reset (0), and the CPU starts program execution again. Data is transferred the number of times set to the
macro service counter (MSC) and then a vectored interrupt request is generated.
Figure 16-17. Example of Macro Service Processing Sequence
Unlike other interrupt processing, processing using the macro service function is automatically performed without starting
an interrupt processing program. Therefore, operations such as branching to an interrupt service routine, saving/restoring
registers, and returning from the interrupt service routine are not performed. This means that the service time of the CPU
can be improved and that the number of program steps can be decreased.
When macro service processing is executed, the status before execution of the macro service processing, such as the
contents of the general-purpose registers and instruction queue of the CPU, are retained.
The interrupt request that specifies the macro service processing is not affected by the status of the IE flag in the program
status word (PSWL). The macro service processing can be executed even in the interrupt disabled status or while an
interrupt processing program is executed. It is disabled only when the corresponding bit in the interrupt mask registers (MK0,
MK1) is set (1).
If two or more macro service requests are issued at the same time, the sequence in which the macro service requests
are processed is determined by the default priority. Until all the macro service requests are processed, instructions are
not executed.
The
m
PD784046 supports macro service processing for all the internal interrupt requests.
Basically, the macro service processing executes the following two operations:
Data transfer from memory to special function register (SFR)
Data transfer from special function register (SFR) to memory
Generation of Interrupt Request
That Executes Mocro Service Processing
Executes macro service
processing
MSC
←
MSC – 1
; Transfers data, controls real-time output port
; Decrements (_1) macro service counter (MSC)
YES
NO
MSC = 0
Macro Service Enable Flag
←
0
Interrupt Request Flag
←
0
Generation of Vectored Interrupt Request
Execution of Next Instruction