Why does the watchdog interrupt occurs?

Question:

When the watchdog interrupt occurred, I calculated the memory checksum and restarted from the cstart address if there was an error.
However, after restarting, interrupts could no longer be acknowledged.
I checked both the PSW and mask registers, but interrupts were in the enabled state.

Answer:

Are you perhaps using a nonmaskable interrupt as the watchdog interrupt?
In this case, the system simply restarts from the cstart address, and the next operation executed is nonmaskable interrupt servicing.
Consequently, interrupts cannot be acknowledged.

To avoid this, you must execute the RETI instruction and exit from nonmaskable interrupt servicing.
Specifically, load the PSW and branch destination address (cstart in this case) onto the stack and branch to the branch destination address using the RETI instruction.

In the following example, the vector is read from address 0 and the program branches there.