instruction are correct. If they are not correct, EEPROM will be incorrectly written to due to
invalid register settings.
In this case, system operation can be stopped by writing 1 to the HLT flag, or the external systems
can be notified of the abnormal operation by outputting a signal to an I/O pin.
--- Example of program in EWE interrupt routine ---
EWEentry:
BTST
#6, @TCSR
BEQ
ERROR
MOV.W
@(2,SP), R0
MOV.W
#H'7B5C, R1
MOV.W
#H'598F, R2
MOV.W
@R0, R3
CMP.W
R1, R3
BNE
ERROR
MOV.W
@(2,R0), R3
CMP.W
R2, R3
BNE
ERROR
MOV.W
@(-18,R0), R2
CMP.W
R2,R5
BNE
ERROR
RTE
ERROR:
MOV.B
#H'FF, R0L
MOV.B
R0L, @TCSR
--- End ---
66
; reconfirmation
; EEPMOV instruction line check
; R5 set value check
; system halt