DEBUG FUNCTION
17.4 Out-of-address-area detection mode
17.4.2 Operations in out-of-address-area detection mode
ꢀ Setting the detect enable bit to “1” initiate to compare the contents of PG and PC with the contents of
the address compare registers 0 and 1.
ꢀ When an address less than the contents of the address compare registers 0 or larger than the one of
the address compare register 1 is detected, an address matching detection interrupt request occurs, and
then, this request will be accepted.
ꢀ Perform the necessary processing with an address matching detection interrupt routine.
ꢀ The contents of PG, PC, and PS at acceptance of the address matching detection interrupt request are
saved onto the stack area. Therefore, be sure to rewrite the above contents of PG and PC to a certain
return address, and return there by using the RTI instruction.
When an address matching detection interrupt request has been accepted, the interrupt disable flag (I) is
set to “1”; the processor interrupt priority level (IPL) does not change.
By setting the start address of the programming area into the address compare register 0 and the last
address of the programming area into the address compare register 1, a program runaway (in other words,
fetching op codes from the area out of the programming area) can be detected. If any program runaway
is detected and reset of the microcomputer is required, be sure to write “1” into the software reset bit (bit
6 at address 5E16) within an address matching detection interrupt routine.
Figure 17.4.2 shows an example of program runaway detection using the out-of-address-area detection
mode.
00000016
Access to the area
Address matching detection
out of the progra-
interrupt routine
mming area
TOP_PRG
The microcomputer
is reset.
Software reset bit ← 1 (Note)
(bit 6 at address 5E16
Programming area
)
Access to the
area out of the
programming
area
END_PRG
FFFFFF16
RTI
TOP_PRG :
Start address of programming are→a This address is to be set into the address compare register 0,
in advance.
END_PRG : Last address of programming area → This address is to be set into the address compare register 1,
in advance.
Note: A program runaway may affect the contents of the data bank register (DT), the direct page registers (DPRi) etc.
Therefore, the contents of these registers must be rewritten in order to write “1” to the software reset bit with an
addressing mode using DT, DPRi, etc.
Fig. 17.4.2 Example of program runaway detection using out-of-address-area detection mode
7906 Group User’s Manual Rev.2.0
17-11