Epson 6200A Core Cpu Manual page 15

Core cpu cmos 4-bit single chip microcomputer
Table of Contents

Advertisement

• Index register IY
Index register IY is like the index register IX: it has a
4-bit page part (YP), an 8-bit register (YHL), and can
address any location in the data memory. See Figure
2.2.1.2.
YHL is divided into two 4-bit groups: the four high-
order bits (YH) and the four low-order bits (YL), and
can address any location within a page.
MY is the data memory location whose address is specified by IY.
M(Y) refers to the contents of the data memory location whose address is specified by IY.
YHL can be incremented by 1 using a post-increment instruction (LDPY, ACPY or SCPY). An
overflow occurring in YHL does not affect the flags.
• Stack pointer SP
The stack area resides in the data memory. The 8-bit, push-down/pop-up stack pointer (SP) is used to
address an element within the stack.
Since it is an 8-bit pointer, SP can only address 256
words out of the total 4,096 words of data memory.
When SP is used, the high-order 4 bits (page part) of
the data memory address are 0, giving a stack area of
256 words in the address range 000H to 0FFH.
In systems with a RAM area of less than 256 words,
the entire RAM area can be used as the stack area.
Stack area usage is shown in Table 2.2.1.2.
The PUSH instruction can be used to store registers and flags in the stack in single-word (4-bit) units.
The POP instruction is used to retrieve this data.
When an interrupt occurs or a call instruction is executed, the return address from the program counter
is pushed onto the stack. When a return instruction is executed, the return address is retrieved from the
stack and loaded into the program counter.
On an interrupt, only the program counter is saved on the stack; flag and register data are not saved.
Programs should be designed so that flag and register data are pushed onto the stack by the interrupt
service routines.
Following a system reset, SP should be initialized using the LD SPH,r or LD SPL,r instructions, where
r represents A, B, MX or MY (4 bits).
Stack pointer data can be read using LD r,SPH or LD r,SPL.
• Register pointer RP
The register pointer (RP) is a 4-bit register used to address the first 16 words of data memory, or the
register area. Direct addressing can be used to read from, write to, increment or decrement any location
within this area efficiently, using a single instruction.
Programs cannot directly access RP. It uses the
operand of direct addressing instructions. The
instructions that can access the register area of data
memory are:
LD
A,Mn
LD
B,Mn
LD
Mn,A
LD
Mn,B
INC
Mn
DEC
Mn
S1C6200/6200A CORE CPU MANUAL
A
M(n)
B
M(n)
M(n)
A
M(n)
B
M(n)
M(n) + 1
M(n)
M(n) – 1
n: 0 to F
MSB
4
Y
P
Fig. 2.2.1.2 The configuration of the index register IY
Table 2.2.1.2 Stack usage
Operation
Push-down
(SP is decremented)
Pop-up
(SP is incremented)
where M(n) is the contents of a data memory
location within the register area.
As the register area can also be indirectly accessed
using IX, IY or SP, the stack area should not grow
to address 000H to 00FH when RP is used.
EPSON
2 MEMORY AND OPERATIONS
LSB
4
4
Y
Y
H
L
Y
HL
IY
Instruction
Stack usage
Interrupt
-3
CALL or CALZ
-3
PUSH
-1
DEC SP
-1
RET, RETS or RETD
+3
POP
+1
INC SP
+1
9

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c6200S1c6200a

Table of Contents