Hitachi H8/3152 Hardware Manual page 68

Single-chip microcomputer h8/3150 series
Table of Contents

Advertisement

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 execution by outputting a signal to an I/O pin.
--- Example of program in UDF interrupt routine ---
UDFentry:
BTST
#7,@TCSR
BEQ
ERROR
MOV.W
@(2,SP), R0
MOV.W
#H'1000, R1
MOV.W
#H'1FFF, R2
CMP.W
R0, R1
BHS
ERROR
CMP.W
R0, R2
BLO
ERROR
RTE
ERROR:
MOV.B
#H'FF, R0L
MOV.B
R0L, @TCSR
--- End ---
H'1000
MOV
*2
ADD
H'1FFF
Application program area
Figure 5.4 Memory Contents for Checking Application Execution
64
; reconfirmation
; if (H'1000<=PC<=H'1FFF) then PASS
; system halt
UDF interrupt
PC marked with *1 points to address marked with *2
SP
CCR
(CCR)
SP+1
SP+2
PCH
SP+3
PCL
Stack area
*1
*1

Advertisement

Table of Contents
loading

Table of Contents