摘要 |
PURPOSE:To stop a CPU immediately if the stack area of the CPU is used abnormally, by providing a stack circuit monitoring circuit which monitors the in-use state of the stack area by the CPU. CONSTITUTION:An I/O port 7 for inputting and outputting data to and from an ROM5, RAM6, and external equipment 8 and a stack area monitoring circuit 9 are connected to an address bus 2, data bus 3, and control bus 4 connected to the CPU1. The circuit 9 is provided with a save instruction detecting circuit 10 which detects the saving of data from the CPU to the stack area, a load instruction detecting circuit 11 which detects the loading of data from the stack area to the CPU, a set instruction detecting circuit 12 which detects the initialization of a stack pointer, and a reversible counter 13. When the stack area becomes abnormally large, or when the frequency of the saving from the CPU to the stack area exceeds the frequency of the loading, the counter 13 outputs a signal to stop the operation of the CPU immediately, generating an alarm 20. |