What are the settings against program malfunction to be valid?

Question:

(CPU) As a countermeasure against program malfunction, is the following measure valid ? Setting FFh to unused areas of the ROM/RAM and, setting a jump instruction at the end of each unused area for jumping to the start address of the program at reset. [2005/03/01]

Answer:

Yes, this should work for a malfunction if the program counter specifies the unused area of the ROM/RAM. At this time, Op-code is FFh and Operand is FFh. As a result, "CLB 7, $FF" is executed in the stated order. When the program is malfunctioning, if the number of FFh set in the address specified by the program counter for the end of the unused ROM/RAM area is an even number, the jump instruction will be executed. However, if the number of FFh is odd, the first byte of the jump instruction (JMP $hhll = 4Ch, llh, hhh), "4Ch" will be recognized as the code of the 2nd byte of the CLB instruction, and the jump instruction will not be executed. (#104750)