9
CHAPTER 2 MEMORY SPACE
2.2.1 Data Area
The F
2
MC-8FX CPU data area can be divided into the following three for each purpose:
• General-purpose register bank area
• Stack area
• Direct area
■ General-Purpose Register Bank Area
The general-purpose register bank area in the F
2
MC-8FX CPU is assigned to 0100
H
to 01FF
H
. The general-
purpose register numbers are converted to the actual addresses according to the conversion rule shown in
Figure 2.2-2 by using the register bank pointer (RP) and the lower 3 bits of the OP code.
Figure 2.2-2 Conversion Rule for Actual Addresses of General-purpose Register Bank Area
■ Stack Area
The stack area in the F
2
MC-8FX CPU is used as the saving area for return addresses and dedicated
registers when the subroutine call instruction is executed and when an interrupt occurs. Before pushing data
into the stack area, decrease the contents of the 16-bit stack pointer (SP) by 2 and then write the data to be
saved to the address indicated by the SP. To pop data off the stack area, return data from the address
indicated by the SP and then increase the contents of the SP by 2. This shows that the most recently pushed
data in the stack is stored at the address indicated by the SP. Figure 2.2-3 and Figure 2.2-4 give examples of
saving data in the stack area and returning data from it.
RP
R4 R3 R2 R1 R0 b2 b1 b0
A15 A14 A13 A12A11A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
Lower bits of OP code
Transaction address
"0"
"0""0"
"0"
"0"
"0"
"0"
"1"