HD643303x Hitachi, HD643303x Datasheet - Page 88

no-image

HD643303x

Manufacturer Part Number
HD643303x
Description
Hitachi Microcomputer
Manufacturer
Hitachi
Datasheet
4.6 Notes on Stack Usage
When accessing word data or longword data, the H8/3032 Series regards the lowest address bit as
0. The stack should always be accessed by word access or longword access, and the value of the
stack pointer (SP, ER7) should always be kept even. Use the following instructions to save
registers:
Use the following instructions to restore registers:
Setting SP to an odd value may lead to a malfunction. Figure 4-6 shows an example of what
happens when the SP value is odd.
SP
Legend
CCR:
PC:
R1L:
SP:
Note: The diagram illustrates modes 1 and 3.
PUSH.W Rn (or MOV.W Rn, @–SP)
PUSH.L ERn (or MOV.L ERn, @–SP)
POP.W Rn
POP.L ERn
Condition code register
Program counter
General register R1L
Stack pointer
SP set to H'FFFEFF
(or MOV.W @SP+, Rn)
(or MOV.L @SP+, ERn)
TRAPA instruction executed
Figure 4-6 Operation when SP Value is Odd
SP
Data saved above SP
73
CCR
PC
MOV. B RIL, @-ER7
SP
CCR contents lost
RIL
PC
H'FFFEFA
H'FFFEFB
H'FFFEFC
H'FFFEFD
H'FFFEFF

Related parts for HD643303x