Notes On Stack Usage - Renesas H8/3067 Series User Manual

Renesas 16-bit single-chip microcomputer
Hide thumbs Also See for H8/3067 Series:
Table of Contents

Advertisement

4.6

Notes on Stack Usage

When accessing word data or longword data, the H8/3067 Group 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:
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.7 shows an example of what
happens when the SP value is odd.
(or MOV.W Rn, @–SP)
(or MOV.L ERn, @–SP)
(or MOV.W @SP+, Rn)
(or MOV.L @SP+, ERn)
Section 4 Exception Handling
Rev. 4.00 Jan 26, 2006 page 89 of 938
REJ09B0276-0400

Advertisement

Table of Contents
loading

This manual is also suitable for:

H8/3067H8/3066H8/3065H8/3067rf

Table of Contents