HD6433640 HITACHI [Hitachi Semiconductor], HD6433640 Datasheet - Page 89

no-image

HD6433640

Manufacturer Part Number
HD6433640
Description
H8/3644 Series Hardware Manual
Manufacturer
HITACHI [Hitachi Semiconductor]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
HD6433640RA78H
Manufacturer:
HITACHI/日立
Quantity:
20 000
Part Number:
HD6433640RB90H
Manufacturer:
RENESAS/瑞萨
Quantity:
20 000
3.4
3.4.1
When word data is accessed in the H8/3644 Series, 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.
Legend:
PC
PC
R1L:
SP:
H
L
:
:
SP
Upper byte of program counter
Lower byte of program counter
General register R1L
Stack pointer
Application Notes
Notes on Stack Area Use
SP set to H'FEFF
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
79

Related parts for HD6433640