hd64338342hw Renesas Electronics Corporation., hd64338342hw Datasheet - Page 150

no-image

hd64338342hw

Manufacturer Part Number
hd64338342hw
Description
Renesas 8-bit Single-chip Microcomputer H8 Family/h8/300l Super Low Power Series
Manufacturer
Renesas Electronics Corporation.
Datasheet
Section 3 Exception Handling
3.4
3.4.1
When word data is accessed in the H8/3847R Group, the least significant bit of the address is
regarded as 0. Access to the stack always takes place in word size, so the stack pointer (SP: R7)
should never indicate an odd address. Use PUSH Rn (MOV.W Rn, @–SP) or POP Rn (MOV.W
@SP+, Rn) to save or restore register values.
Setting an odd address in SP may cause a program to crash. An example is shown in figure 3.6.
When CCR contents are saved to the stack during interrupt exception handling or restored when
RTE is executed, this also takes place in word size. Both the upper and lower bytes of word data
are saved to the stack; on return, the even address contents are restored to CCR while the odd
address contents are ignored.
Rev. 6.00 Aug 04, 2006 page 114 of 680
REJ09B0145-0600
SP
Legend:
PC
PC
R1L:
SP:
SP set to H'FEFF
Application Notes
Notes on Stack Area Use
H
L
:
:
Upper byte of program counter
Lower byte of program counter
General register R1L
Stack pointer
Figure 3.6 Operation when Odd Address is Set in SP
BSR instruction
SP
Stack accessed beyond SP
PC
PC
H
L
MOV. B R1L, @ R7
SP
Contents of PC are lost
PC
R1L
L
H
H'FEFC
H'FEFD
H'FEFF

Related parts for hd64338342hw