Download Print this page

Advertisement

Section 4 Exception Handling

4.7

Usage Note

When accessing word data or longword data, this LSI assumes that the lowest address bit is 0. The
stack should always be accessed in words or longwords, and the value of the stack pointer (SP:
ER7) should always be kept even.
Use the following instructions to save registers:
PUSH.W
Rn
PUSH.L
ERn
Use the following instructions to restore registers:
POP.W
Rn
POP.L
ERn
Setting SP to an odd value may lead to a malfunction. Figure 4.3 shows an example of what
happens when the SP value is odd.
SP
SP set to H'FFFEFF
[Legend]
CCR:
Condition code register
PC:
Program counter
R1L:
General register R1L
SP:
Stack pointer
Note: This diagram illustrates an example in which the interrupt control mode is 0.
Rev. 1.00 Mar. 12, 2008 Page 76 of 1178
REJ09B0403-0100
(or
MOV.W Rn, @-SP
(or
MOV.L ERn, @-SP
(or
MOV.W @SP+, Rn
(or
MOV.L @SP+, ERn
SP
TRAPA instruction executed
Data saved above SP
Figure 4.3 Operation When SP Value is Odd
)
)
)
)
SP
CCR
PC
MOV.B R1L, @-ER7 executed
Contents of CCR lost
Address
R1L
H'FFFEFA
H'FFFEFB
H'FFFEFC
PC
H'FFFEFD
H'FFFEFF

Advertisement

loading

This manual is also suitable for:

R4f2472R4f2462H8s/2462H8s/2400 seriesH8s/2472