No part of this material may be reproduced or duplicated in any form or by any means without the written permission of Seiko
Epson. Seiko Epson reserves the right to make changes to this material without notice. Seiko Epson does not assume any
liability of any kind arising out of any inaccuracies contained in this material or due to its application or use in any product or
circuit and, further, there is no representation that this material is applicable to products requiring high level reliability, such
as medical products. Moreover, no license to any intellectual property rights is granted by implication or otherwise, and there
is no representation or warranty that anything made in accordance with this material will be free from any patent or copyright
infringement of a third party. This material or portions thereof may contain technology or the subject relating to strategic
products under the control of the Foreign Exchange and Foreign Trade Law of Japan and may require an export license from
the Ministry of International Trade and Industry or other approval from another government agency.
APPENDIX A. S1C6200A (ADVANCED S1C6200) CORE CPU _________________ 84
B. INSTRUCTION INDEX ______________________________________ 87
S1C6200/6200A CORE CPU MANUALEPSONi
1 DESCRIPTION
1DESCRIPTION
The S1C6200/6200A is the Core CPU of the S1C62 Family of CMOS 4-bit single-chip microcomputers. The CPU features a highly-integrated architecture. Memory-mapped peripheral circuits can include
RAM, ROM, I/O ports, interrupt controllers, timers and LCD drivers, depending upon the application.
The memory address space is divided into program and data memory, each with data and address lines.
Program memory consists of on-chip ROM, containing instructions to be executed by the CPU. Data
memory consists of RAM and memory-mapped I/O, as determined by the design of the peripheral circuitry.
A large memory as well as instructions capable of 8-bit data manipulation enhance the functionality of the
S1C62 Family. Implementation of a common Core CPU ensures that a wide range of application-specific
devices can be designed and fabricated with the minimum turnaround time.
1.1System Features
• Common Core CPU for all S1C62 Family microcomputers
• UP to 8,192 12-bit words of program memory (ROM)
• UP to 4,096 4-bit words of data memory (RAM/peripheral circuits)
• Memory-mapped I/O
• 5, 7 or 12 clock cycle instructions
• 109 instructions
• Up to 85 levels of subroutine nesting
• 8-bit stack pointer
• Up to 15 interrupt vectors
• Two standby modes
• Low-power CMOS process
1.2Instruction Set Features
• Four addressing modes: one direct, two indirect, and one stack pointer
• Direct addressing transfers data to and from data memory with a single instruction, resulting in more
efficient code
• 8-bit load instructions and table look-up instructions
• Arithmetic operations in either hexadecimal or decimal
There are some differences in the following operation/circuit between the S1C6200 and the S1C6200A.
For the detailes of each difference, refer to the section enclosed with parentheses.
• Initial setting of D (decimal) flag (refer to Section 2.5.5, "Initial reset".)
• Interrupt circuit
–Interrupt timing (refer to Section 2.5.3, "Operation during interrupt generation".)
–Writing to interrupt mask registers and reading of interrupt flags (refer to Appendix A, "S1C6200A
(Advanced S1C6200) Core CPU".)
S1C6200/6200A CORE CPU MANUALEPSON1
1 DESCRIPTION
RAM, Peripheral I/O
(4,096 4-bit words max.)
8-bit address bus13-bit address bus
Program Counter Block
Micro-Instructions
Instruction Decorder
Instruction Register (12)
Program Memory
(8,192 12-bit words max.)
Data Memory
YHL (8)
XHL (8)
Stack Pointer (8)
12-bit data bus
ROM
RP (4)
4-bit address bus
4-bit data bus
XP (4)
YP (4)
Interrupt
Controller
A (4)
TEMPB (5)
I DZC
Oscillator
Timing
Generator
B (4)
TEMPA (5)
ALU
S1C6200 CORE CPU
Fig. 1.1 Block diagram
2EPSONS1C6200/6200A CORE CPU MANUAL
2 MEMORY AND OPERATIONS
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;;;;;;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;;;;;;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;;;
2MEMORYAND OPERATIONS
A single-chip microcomputer using the S1C6200/6200A Core CPU has four major blocks: the
program memory (ROM), the data memory (RAM and I/O), the arithmetic logic unit (ALU) and the timing
generator circuit. This section describes each of these blocks in detail.
2.1Program Memory (ROM)
Program memory contains the instructions that the CPU executes. Figure 2.1.1 shows the configuration of
the program memory.
Each instruction is a 12-bit word. Program memory can also be used for data tables for the table look-up
instructions.
There are two banks of program memory. Each bank is subdivided into 16 pages of 256 words (or steps).
That is:
Program memory = 2 banks
= 8,192 steps
1 bank= 4,096 steps
= 16 pages
1 page= 256 steps
1 step= 1 word
= 12 bits
Certain addresses in ROM have specific functions, as shown in Table 2.1.1.
Table 2.1.1 Allocated program memory
AddressFunction
Bank 0, Page 1, Step 0
Bank 0, Page 1, Step 1 to 15
Bank 0, Page 0, Step 0 to 255
Bank 1, Page 1, Step 1 to 15
Bank 1, Page 0, Step 0 to 255
Reset vector
Interrupt vectors used while a program is running in bank 0
Bank 0, page 0 area
Direct call subroutines for use by CALZ while a program is running in bank 0
Interrupt vectors used while a program is running in bank 1
Bank 1, page 0 area
Direct call subroutines for use by CALZ while a program is running in bank 1
Page 1
Bank 0
Step 0
Step 1
Step 15
Step 254
Step 255
12-bit
instructions
Reset vector
Interrupt
vectors
for Bank 0
;;;;
;;;;
;;;;
;;;;
;;;;
;;;;
Bank 0
Step 0
Step 1
Step 254
Step 255
Page 0
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
Bank 0Bank 1
Bank 0
Step 0
Step 1
Page 3
Bank 0
Page 2
Bank 0
Step 0
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
Step 254
Step 255
PCB (between banks)
;;
;;
S1C6200/6200A CORE CPU MANUALEPSON3
Fig. 2.1.1 Program memory configuration
Page 15
Bank 0
Page 14
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
PCP
(within bank)
Program or data
code area
PCS
(within bank)
Bank 1
Step 0
Step 1
Step 254
Step 255
;;
;;
Bank 1
Step 0
Page 0
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;
;;;;
;;;;
;;;;
;;;;
;;;;
;;;;
Bank 1
;;;;
Step 0
;;;;
;;;;
Step 1
;;;;
;;;;
Step 15
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
Page 3
Bank 1
Page 2
Step 254
Step 255
Program or data
code or CALZ
subloutines in
Bank 0
Page 1
;;;;;
;;;;;
Interrupt
;;;;;
;;;;;
vectors
;;;;;
for Bank 1
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;
;;
Bank 1
Step 0
Step 1
Step 254
Step 255
Program or data
code or CALZ
subloutines in
Bank 1
Bank 1
Page 14
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
Page 15
;;;;
;;;;
;;;;
;;;;
;;;;
;;;;
;;;;
;;;;
;;;;
;;;;
;;;;
;;;;
2 MEMORY AND OPERATIONS
2.1.1 Program counter block
The program counter is used to point to the next instruction step to be executed by the CPU. See Figure
2.1.1.1.
The program counter has the following registers.
Table 2.1.1.1 Program counter registers
RegisterSize
PCB (Program Counter-Bank)
PCP (Program Counter-Page)
PCS (Program Counter-Step)
NBP (New Bank Pointer)
NPP (New Page Pointer)
PCB, PCP and PCS together from a 13-bit counter which can address any location in program memory.
PCP and PCS together from a 12-bit counter which can address any location within a given bank of pro-
gram memory. Each time an instruction other than a jump is executed, this counter increments by one.
Thus, a jump instruction does not need to be executed between the last step of one page and the first step of
the next.
The contents of NBP and NPP are loaded into PCB and PCP each time an instruction is executed. On reset,
NBP and NPP are loaded with the same values as PCB and PCP.
2.1.2 Flags
The following flags are provided.
Table 2.1.2.1 Flags
FlagSize
Interrupt
Decimal mode
Zero
Carry
Menus
I
D
Z
C
1: Enabled
0: Disabled
1: Decimal
0: Hexadecimal
1: Set
0: Ignored
1: Set
0: Ignored
4EPSONS1C6200/6200A CORE CPU MANUAL
2 MEMORY AND OPERATIONS
2.1.3 Jump instructions
A jump can be made using the instructions in Table 2.1.3.1.
Table 2.1.3.1 Jump instructions
Type of jumpInstruction
Unconditional
Conditional
Subroutine call
Return
Page set
Indirect
The differences between jumps within the same page and jumps from one page to another is as follows.
• Jumps within the same page
A jump can be made within the same page using any of the following instructions:
JP, JP C, JP Z, JP NZ, JPBA or CALL
The destination address is specified by the 8-bit operand. A label can be used to specify a destination
address with the S1C62 Family cross assembler.
• Jumps from one page to another
The destination bank and page should be set using PSET before executing a JP instruction.
2.1.4 PSET with jump instructions
PSET loads the four low-order bits (page part) of its 5-bit operand to NPP (new page pointer) and loads the
high-order bit (bank part) to NBP (new bank pointer). Executing a JP instruction immediately after PSET
causes a jump to the bank specified by NBP, the page specified by NPP and the step specified by the JP
instruction operand. See Figure 2.1.4.1.
Page 14
PSET
JUMP
Step 0
Step 1
Page 15Bank 0
Jump with PSET can go anywhere
within the program memory
Jump can go between banks
Bank 1
Page 3Bank 1
Page 2Bank 1
Page 1Bank 1
Page 0Bank 1
Bank 1
Step 0
Step 1
Step 254
Step 255
Page 15Bank 1
Page 14
JUMP
Jump without PSET
can go anywhere
Step 0
Step 1
Step 254
Step 255
Bank 0
Page 3Bank 0
Page 2Bank 0
Page 1Bank 0
Page 0Bank 0
Bank 0
Step 0
Step 1
Step 254
Step 255
within one page
Step 254
Step 255
Fig. 2.1.4.1 The PSET and jump instructions
2.1.5 Call instructions
As only the page data specified by NPP is loaded to PCP when a call instruction is executed, subroutine
calls between banks are not possible. Jumps between banks can only be made using JP instructions.
S1C6200/6200A CORE CPU MANUALEPSON5
2 MEMORY AND OPERATIONS
2.1.6 PSET instruction
Jump or call instructions must follow PSET immediately in order for PSET to affect the destination address.
When a jump or call is not immediately preceded by PSET, the destination address is within the current
page.
Some examples using PSET are shown in Table 2.1.6.1.
Table 2.1.6.1 PSET examples
Bank Page StapInstruction
PSET
JP
PSET
NOP5
JP
SCF
PSET
JP
RFC
PSET
JP
JP
13H
08H
•
•
15H
09H
•
•
14H
C, 07H
•
•
05H
C, 08H
09H
•
•
0
01H
10H
0
01H
11H
•
•
•
•
•
•
0
01H
21H
0
01H
22H
0
01H
23H
•
•
•
•
•
•
0
01H
55H
0
01H
56H
0
01H
57H
•
•
•
•
•
•
0
01H
60H
0
01H
61H
0
01H
62H
0
01H
63H
•
•
•
•
•
•
The program jumps to bank 1, page 3, step 8.
The data set by PSET is canceled.
The program jumps to bank 0, page 1, step 9.
C flag is set.
The program jumps to bank 1, page 4, step 7 because C flag = 1.
C flag is reset.
No jump occurs because C flag = 0.
The data set by PSET is canceled, and the program jumps to bank 0, page 1, step 9.
Operation
2.1.7 CALZ instruction
CALZ is a direct subroutine call instruction. It calls a subroutine, in page 0 of the current bank, from any
page without requiring the use of PSET.
If CALZ is executed immediately after PSET, the bank and page set by PSET is canceled. This allows direct
subroutine calls to page 0, minimizing repeated code and unnecessary use of PSET. See Figure 2.1.7.1.
Bank 0 Page 0
EEE....................
RET
Bank 0 Page 2
PSET
CALZ
LD
0AH
EEE
A,0
Fig. 2.1.7.1 The use of the CALZ instruction
Not effect
on destination
of CALZ
6EPSONS1C6200/6200A CORE CPU MANUAL
The difference between CALL and CALZ is shown in Figure 2.1.7.2.
2 MEMORY AND OPERATIONS
CALL with PSET
can go anywhere
within a bank
Bank 1
Page 1Bank 1
Page 0Bank 1
Step 0
Step 1
Page 3
CALZ
Bank 1
Step 0
Step 1
Step 254
Step 255
Page 15Bank 1
Page 14
CALL
Step 0
Step 1
Bank 0Bank 1
Bank 0
Page 3
Page 1Bank 0
Page 0Bank 0
CALZ
Bank 0
Step 0
Step 1
Step 254
Step 255
Page 15Bank 0
Page 14
PSET
CALL
CALL without PSET
can go anywhere
in a page
Step 254
Step 255
CALL and CALZ
cannot go
between banks
Step 254
Step 255
CALZ can only go to page 0
of the current bank
Fig. 2.1.7.2 The difference between CALL and CALZ instructions
2.1.8 RET and RETS instructions
The RET instruction causes a return from a subroutine to the address immediately following the address
from where that subroutine was called. The RETS instruction causes a return to the address following this
address. Proper use of RET and RETS allows simple conditional exits subroutines back to the main routine.
See Figure 2.1.8.1.
Bank 0 Page 0
Program memory
PSET
0AH
CALL
DDD
LD
Bank 0 Page 10
Program memory
LD
A,0
B,0
DDD....................
RET
RETS
Fig. 2.1.8.1 Difference between RET and RETS instructions
2.1.9 Stack considerations for call instructions
When a subroutine is called, the return address is loaded into the stack and retrieved when control is
returned to the calling program. Nesting allows efficient usage of the stack area.
As the stack area resides in the data memory, care should be taken to ensure that the stack area is not
corrupted by other data.
S1C6200/6200A CORE CPU MANUALEPSON7
2 MEMORY AND OPERATIONS
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
2.2Data Memory
The data memory area comprises 4,096 4-bit words. The RAM, timer, I/O and other peripheral circuits are
mapped into this memory according to the designer's specifications. Figure 2.2.1 shows the data memory
configuration.
Page 15
SP
Page 0
only
RP
Page 0
only
Page 0
Step 0
Step 1
Step 15
Step 254
Step 255
Page 2
Page 1
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
Page 14
Step 0
Step 1
Page 3
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
Step 254
Step 255
4-bit data
Fig. 2.2.1 Data memory configuration
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
;;;;;
XHL or YHL
(within page)
XP or YP
(page specification)
;;
Memory or I/O
;;
;;
Register area
;;
2.2.1 Data memory addressing
The following registers and pointers, which are described in detail below, are used to address the data
memory.
Table 2.2.1.1 Registers and pointer for data memory addressing
Register/Pointer
Index Register X
Index Register Y
Stack Pointer
Register
• Index register IX
Index register IX has a 4-bit page part (XP) and an 8bit register (XHL), and can address any location in
the data memory. See Figure 2.2.1.1.
XHL is divided into two 4-bit groups: the four highorder bits (XH) and the four low-order bits (XL), and
can address any location within a page.
–MX is the data memory location whose address is specified by IX.
–M(X) refers to the contents of the data memory location whose address is specified by IX.
–XHL can be incremented by 1 or 2 using a post-increment instruction (LDPX, ACPX, SCPX, LBPX or
RETD). An overflow occurring in XHL does not affect the flags.
Mnemonic
IX
IY
SP
RP
Size (bits)
12
12
8
4
MSB
4
XP
44
XHXL
XHL
IX
Fig. 2.2.1.1 The configuration of the index register IX
LSB
8EPSONS1C6200/6200A CORE CPU MANUAL
2 MEMORY AND OPERATIONS
Push-down
(SP is decremented)
Pop-up
(SP is incremented)
OperationInstruction
Stack usage
-3
-3
-1
-1
+3
+1
+1
Interrupt
CALL or CALZ
PUSH
DEC SP
RET, RETS or RETD
POP
INC SP
• 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.
MSB
4
YP
44
YHYL
YHL
IY
Fig. 2.2.1.2 The configuration of the index register IY
–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.
LSB
• 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.
Table 2.2.1.2 Stack usage
• 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
LD
LD
S1C6200/6200A CORE CPU MANUALEPSON9
LD
INC
DEC
A,Mn
B,Mn
Mn,A
Mn,B
Mn
Mn
A ← M(n)
B ← M(n)
M(n) ← A
M(n) ← B
M(n) ← M(n) + 1
M(n) ← M(n)
n: 0 to F
where M(n) is the contents of a data memory
location within the register area.
As the register area can also be indirectly accessed
–
1
using IX, IY or SP, the stack area should not grow
to address 000H to 00FH when RP is used.
2 MEMORY AND OPERATIONS
2.3ALU (Arithmetic Logic Unit) and Registers
Table 2.3.1 shows ALU operations between the 4-bit registers, TEMPA and TEMPB.
Table 2.3.1 ALU register operation
OperationInstruction
Add, without carry
Add, with carry
Subtract, without borrow
Subtract, with borrow
Logical-AND
Logical-OR
Exclusive-OR
Comparison
Flag bit test
Rotate right, with carry
Rotate left, with carry
Invert
The Z (zero) flag is set when the result of ALU operation is
C3210
X0000X: Don't care.
The C (carry) flag is set when an add operation causes a carry or when a subtract operation causes a
borrow.
ADD
ADC
SUB
SBC
AND
OR
XOR
CP
FAN
RRC
RLC
NOT
2.3.1 D (decimal) flag and decimal operations
Setting the D (decimal) flag activates the decimal mode, allowing decimal addition and subtraction. Table
2.3.1.1 shows the relations of actual (decimal) results, ALU outputs, and the values of the C and Z flags.
Table 2.3.1.1 Results of hexadecimal and decimal operations
A
B
C
D
E
F
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
10EPSONS1C6200/6200A CORE CPU MANUAL
2 MEMORY AND OPERATIONS
Hexadecimal operations will not always produce the correct result if performed in decimal mode.
Note that:
• An add instruction with carry (for example, ADC XH,i) which uses index registers XH, XL, YH and YL,
does not involve decimal correction even if it is performed in the decimal mode. This is because it uses
an 8-bit field for 4-bit data.
• The results of the compare instruction (CP) is not decimal-corrected, because the carry flag is ignored.
• The result of the register memory increment instruction (INC Mn) and decrement instruction (DEC Mn)
are not decimal-corrected.
2.3.2 A and B registers
The A and B registers are 4-bit general-purpose registers used as accumulators. They transfer data and
perform ALU operations with other registers, data memory and immediate data.
The data in A can be paired with that in B for use as an indirect jump address by the JPBA instruction.
2.4Timing Generator
S1C6200/6200A instructions can be divided into three different types depending on the number of clock
cycles per instruction: 5, 7 or 12 clock cycles. The more complex the instruction, the more cycles it requires.
Note that the number of clock cycles determines the duration of instructions which, in turn, will affect any
timing performed in software.
As shown in Figure 2.4.1, the first state of all instructions is a fetch cycle. This is followed by a number of
execute cycles.
5-clock/7-clock instructions
Clock
Status
Instruction
register
Date
memory
FetchExecuteFetch
State
0
State
1
Execute
State2State0State
1
State
2
State
3
12-clock instructions
Clock
Status
Instruction
register
Fetch
State
0
State
1
State
2
Execute
State3State4State
5
State
6
Fig. 2.4.1 Instruction execution timing
2.4.1 HALT and SLP (sleep) modes
HALT and SLP cause the CPU to store the return address on the stack and then stop. HALT will only stop
the CPU; the system clock will continue to run. SLP also stops the system clock, resulting in reduced power
consumption. The CPU can be restarted by an interrupt.
As interrupts are not automatically enabled by the execution of HALT or SLP, programs should always
enable interrupts before executing HALT or SLP, otherwise they will hang waiting for an interrupt.
S1C6200/6200A CORE CPU MANUALEPSON11
2 MEMORY AND OPERATIONS
2.5Interrupts
The S1C6200/6200A can have up to 15 interrupt vectors. When used with peripheral circuits, these allow
internal and external interrupts to be processed easily. See Figure 2.5.3.1 through 2.5.3.4.
2.5.1 Interrupt vectors
The interrupt vectors are assigned to steps 1 to 15 in page 1 of each bank of the program memory. When an
interrupt occurs, the program jumps to the appropriate interrupt vector in the current bank.
The priority and linking of these vectors to actual outside events depends on the configuration of the
peripheral circuits and therefore is device-specific. This information can be found in the technical manuals
for the specific device.
2.5.2 I (interrupt) flag
The I (interrupt) flag enables or disables all interrupts.
When DI or RST F is used to reset the I flag, interrupts are disabled with that instruction step. When EI or
SET F is used to set the I flag, interrupts are enabled after the following instruction step. For example, to
return control from the interrupt subroutine to the main routine, the sequence EI, RET, does not enable
interrupts until after RET has been executed.
The I flag is reset to 0 (DI) on reset.
2.5.3 Operation during interrupt generation
When an interrupt is generated, the program is halted, the program counter (PCP and PCS) is stored on the
stack, the I flag is reset to DI mode and NPP is set to 1. The program then branches to the interrupt vector
corresponding to the interrupt request. Registers and flags are unaffected by an interrupt.
Register and flag data must be saved by the program since they are not automatically stored on the stack.
The I flag can be set to 1 (EI) within the interrupt subroutine, because nesting of multiple interrupts is
available.
If an interrupt is generated while the CPU is in HALT or SLP mode, the CPU is restarted and the interrupt
serviced. When the interrupt service routine is completed, the program resumes from the instruction
following the HALT or SLP.
<Differences between S1C6200 and S1C6200A>
In the S1C6200 and the S1C6200A, the time it takes to complete interrupt processing by hardware after the
Core CPU receives the interrupt request is different as follows:
Table 2.5.3.1 Required interrupt processing time
Item
a) During instruction execution
b) At HALT mode
c) During PSET instruction execution
Program Counter Step
Program Counter Page
Program Counter Bank
New Page Pointer
New Bank Pointer
Stack Pointer
Index Register
Index Register
Register Pointer
General Register
General Register
Interrupt Flag
Decimal Flag
Zero Flag
Carry Flag
PCS
PCP
PCB
NPP
NBP
SP
IX
IY
RP
A
B
I
D
Z
C
8
4
1
4
1
8
12
12
4
4
4
1
1
1
1
<Difference between S1C6200 and S1C6200A>
There is a difference in the setting value of the D (decimal) flag at initial reset between the S1C6200 and the
S1C6200A.
Table 2.5.4.2 D (decimal) flag initial setting
CPU Core
D (decimal) flag setting
S1C6200A
When using the model loaded with the S1C6200 Core CPU, set or reset the D flag in the user's initial
routine before using an arithmetic instruction. (refer to the SDF and RDF instructions.)
S1C6200/6200A CORE CPU MANUALEPSON15
3 INSTRUCTION SET
3INSTRUCTION SET
This chapter describes the entire instruction set of the S1C6200/6200A Core CPU.
A subset is allocated to each device within the S1C62 Family according to the configuration of the device.
Therefore not all instructions are available in every device. The relevant information is in the technical
manual for each device.
The source format and a description of the assembler is in the series-specific cross assembler manuals.
The instruction set contains 109 instructions. Each instruction comprises of one 12-bit word.
3.1Instruction Indices
Three index tables are used for easy reference instructions.
a. Index by function
The instructions are arranged by function.
1. Branch
2. System control
3. Flag operation
4. Stack operation
5. Index operation
6. Data transfer
7. Arithmetic and logical operation
b. Index in alphabetical order
The instructions are arranged in alphabetical order. Page number references are provided.
c. Index by operation code
The instructions are arranged in numerical order by operation code.
16EPSONS1C6200/6200A CORE CPU MANUAL
3.1.1 By function
3 INSTRUCTION SET
ClassificationOperandClock
Branch
instructions
System
control
instructions
Index
operation
instructions
Mne-
monic
PSET
JP
JPBA
CALL
CALZ
RET
RETS
RETD
NOP5
NOP7
HALT
SLP
INC
LD
ADC
p
s
C, s
NC, s
Z, s
NZ, s
s
s
e
X
Y
X, e
Y, e
XP, r
XH, r
XL, r
YP, r
YH, r
YL, r
r, XP
r, XH
r, XL
r, YP
r, YH
r, YL
XH, i
XL, i
YH, i
YL, i
B
1
0
0
0
0
0
1
0
0
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Operation CodeFlag
A
9
8
7
6
5
4
1
1
0
0
1
0
p4
p3
0
0
0
s7
s6
s5
s4
s3
0
1
0
s7
s6
s5
s4
s3
0
1
1
s7
s6
s5
s4
s3
1
1
0
s7
s6
s5
s4
s3
1
1
1
s7
s6
s5
s4
s3
1
1
1
1
1
1
0
1
0
0
s7
s6
s5
s4
s3
1
0
1
s7
s6
s5
s4
s3
1
1
1
1
1
0
1
1
1
1
1
1
0
1
0
0
1
e7
e6
e5
e4
e3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
0
1
1
1
1
0
1
1
e7
e6
e5
e4
e3
0
0
0
e7
e6
e5
e4
e3
1
1
0
1
0
0
0
1
1
0
1
0
0
0
1
1
0
1
0
0
0
1
1
0
1
0
0
1
1
1
0
1
0
0
1
1
1
0
1
0
0
1
1
1
0
1
0
1
0
1
1
0
1
0
1
0
1
1
0
1
0
1
0
1
1
0
1
0
1
1
1
1
0
1
0
1
1
1
1
0
1
0
1
1
0
1
0
0
0
0
0
0
1
0
0
0
0
1
0
1
0
0
0
1
0
0
1
0
0
0
1
1
3
2
1
0
IDZC
p2
p1
p0
s2
s1
s0
s2
s1
s0
s2
s1
s0
s2
s1
s0
s2
s1
s0
1
0
0
0
s2
s1
s0
s2
s1
s0
1
1
1
1
1
1
1
0
e2
e1
e0
1
0
1
1
1
1
1
1
1
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
e2
e1
e0
e2
e1
e0
0
0
r1
r0
0
1
r1
r0
1
0
r1
r0
0
0
r1
r0
0
1
r1
r0
1
0
r1
r0
0
0
r1
r0
0
1
r1
r0
1
0
r1
r0
0
0
r1
r0
0
1
r1
r0
1
0
r1
r0
i3
i2
i1
i0
i3
i2
i1
i0
i3
i2
i1
i0
i3
i2
i1
i0
5
5
5
5
5
5
5
7
7
7
12
12
5
7
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
↑
↑
7
↓
↓
↑
↑
7
↓
↓
↑
↑
7
↓
↓
↑
↑
7
↓
↓
Operation
←
p4, NPP ← p3~p0
NBP
←
NBP, PCP ← NPP, PCS ← s7~s0
PCB
←
NBP, PCP ← NPP, PCS ← s7~s0 if C=1
PCB
←
NBP, PCP ← NPP, PCS ← s7~s0 if C=0
PCB
←
NBP, PCP ← NPP, PCS ← s7~s0 if Z=1
PCB
←
NBP, PCP ← NPP, PCS ← s7~s0 if Z=0
PCB
←
NBP, PCP ← NPP, PCSH ← B, PCSL ← A
PCB
←
M(SP-1)
SP
M(SP-1)
SP
PCSL
SP
PCSL
SP
PCSL
SP
PCP, M(SP-2) ← PCSH, M(SP-3) ← PCSL+1
←
SP-3, PCP ← NPP, PCS ← s7~s0
←
PCP, M(SP-2) ← PCSH, M(SP-3) ← PCSL+1
←
SP-3, PCP ← 0, PCS ← s7~s0
←
M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)
←
SP+3
←
M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)
←
SP+3, PC ← PC+1
←
M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)
←
SP+3, M(X) ← e3~e0, M(X+1) ← e7~e4, X ← X+2
No operation (5 clock cycles)
No operation (7 clock cycles)
Halt (stop clock)
SLEEP (stop oscillation)
A, Mn
B, Mn
Mn, A
Mn, B
r, i
r, q
r, SPH
r, SPL
r, XH
r, XL
r, XP
r, YH
r, YL
r, YP
SPH, r
SPL, r
XH, r
XL, r
XP, r
X, e
YH, r
YL, r
YP, r
Y, e
MX, i
r, q
MY, i
r, q
No operation (5 clock cycles)
No operation (7 clock cycles)
←
r
r
←
rVi3~i0
r
←
rVq
r
←
M(SP), SP ← SP+1
F
←
M(SP), SP ← SP+1
r
←
M(SP), SP ← SP+1
XH
←
M(SP), SP ← SP+1
XL
←
M(SP), SP ← SP+1
XP
←
M(SP), SP ← SP+1
YH
←
M(SP), SP ← SP+1
YL
←
M(SP), SP ← SP+1
YP
S1C6200/6200A CORE CPU MANUALEPSON21
3 INSTRUCTION SET
Mne-
PageOperandClock
monic
67
PSET
68
PUSH
68
69
69
70
70
71
71
RCF
72
RDF
72
RET
73
RETD
73
RETS
74
RLC
74
RRC
75
RST
75
RZF
76
SBC
76
77
SCF
77
SCPX
78
SCPY
78
SDF
79
SET
79
SLP
80
SUB
80
SZF
81
XOR
81
82
p
F
r
XH
XL
XP
YH
YL
YP
e
r
r
F, i
r, i
r, q
MX, r
MY, r
F, i
r, q
r, i
r, q
B
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Operation CodeFlag
A
9
8
7
6
5
4
1
1
0
0
1
0
p4
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
1
1
1
0
1
0
1
1
1
1
1
1
0
1
0
0
1
e7
e6
e5
e4
1
1
1
1
1
0
1
0
1
0
1
1
1
1
1
1
0
1
0
0
0
1
1
1
0
1
0
1
1
1
1
0
1
0
1
1
0
1
0
1
r1
r0
0
1
0
1
0
1
1
1
1
1
0
1
0
0
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
0
1
0
0
1
1
1
0
1
0
0
1
1
1
1
1
1
1
0
1
0
1
0
1
0
1
1
1
0
1
0
0
1
0
1
0
0
r1
r0
0
1
0
1
1
1
0
3
2
1
0
IDZC
p3
p2
p1
p0
1
0
1
0
0
0
r1
r0
0
1
0
1
0
1
1
0
0
1
0
0
1
0
0
0
1
0
0
1
0
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
e3
e2
e1
e0
1
1
1
0
r1
r0
r1
r0
1
1
r1
r0
i3
1
i3
r1
r0
0
1
1
0
i3
1
r1
r0
0
i3
r1
r0
↓
i2
i1
i0
1
0
1
i2
i1
i0
q1
q0
0
0
1
0
r1
r0
1
r1
r0
1
0
0
↑
i2
i1
i0
0
0
1
q1
q0
0
1
0
i2
i1
i0
q1
q0
5
5
5
5
5
5
5
5
5
↓
7
↓
7
7
12
12
↑
↑
7
↓
↓
↑
↑
5
↓
↓
↓
↓
↓
7
↓
7
★
↑
↑
7
↓
↓
★
↑
↑
7
↓
↓
↑
7
★
↑
↑
7
↓
↓
★
↑
↑
7
↓
↓
↑
7
↑
↑
↑
7
5
★
↑
↑
7
↓
↓
↑
7
↑
7
↓
↑
7
↓
Operation
←p4, NPP←p3~p0
NBP
←SP-1, M(SP)←F
SP
←SP-1, M(SP)←r
SP
←SP-1, M(SP)←XH
SP
←SP-1, M(SP)←XL
SP
←SP-1, M(SP)←XP
SP
←SP-1, M(SP)←YH
SP
←SP-1, M(SP)←YL
SP
←SP-1, M(SP)←YP
SP
←0
C
←0 (Decimal Adjuster OFF)
D
←M(SP), PCSH←M(SP+1), PCP←M(SP+2)
PCSL
←SP+3
SP
←M(SP), PCSH←M(SP+1), PCP←M(SP+2)
PCSL
←SP+3, M(X)←e3~e0, M(X+1)←e7~e4, X←X+2
SP
←M(SP), PCSH←M(SP+1), PCP←M(SP+2)
PCSL
←SP+3, PC←PC+1
SP
←d2, d2←d1, d1←d0, d0←C, C←d3
d3
←C, d2←d3, d1←d2, d0←d1, C←d0
d3
←FΛi3~i0
F
←0
Z
←r-i3~i0-C
r
←r-q-C
r
←1
C
←M(X)-r-C, X←X+1
M(X)
←M(Y)-r-C, Y←Y+1
M(Y)
←1 (Decimal Adjuster ON)
D
←FVi3~i0
F
SLEEP (stop oscillation)
←r-q
r
←1
Z
←r∀i3~i0
r
←r∀q
r
22EPSONS1C6200/6200A CORE CPU MANUAL
3.1.3 By operation code
3 INSTRUCTION SET
Operation
Code (HEX)
000 to 0FF
100 to 1FF
200 to 2FF
300 to 3FF
400 to 4FF
500 to 5FF
600 to 6FF
700 to 7FF
800 to 8FF
900 to 9FF
A00 to A0F
A10 to A1F
A20 to A2F
A30 to A3F
A40 to A4F
A50 to A5F
A60 to A6F
A70 to A7F
A80 to A8F
A90 to A9F
AA0 to AAF
AB0 to ABF
AC0 to ACF
AD0 to ADF
AE0 to AEF
AF0 to AFF
B00 to BFF
C00 to C3F
C40 to C7F
C80 to CBF
CC0 to CFF
D00 to D3F
D0F to D3F
D40 to D7F
D80 to DBF
DC0 to DFF
E00 to E3F
Mne-
OperandClock
monic
JP
RETD
JP
JP
CALL
CALZ
JP
JP
LD
LBPX
ADC
ADC
ADC
ADC
CP
CP
CP
CP
ADD
ADC
SUB
SBC
AND
OR
XOR
RLC
LD
ADD
ADC
AND
OR
XOR
NOT
SBC
FAN
CP
LD
s
e
C, s
NC, s
s
s
Z, s
NZ, s
Y, e
MX, e
XH, i
XL, i
YH, i
YL, i
XH, i
XL, i
YH, i
YL, i
r, q
r, q
r, q
r, q
r, q
r, q
r, q
r
X, e
r, i
r, i
r, i
r, i
r, i
r
r, i
r, i
r, i
r, i
E40 to E5F
E60 to E6F
E70 to E7F
E80 to E83
E84 to E87
E88 to E8B
E8C to E8F
E90 to E93
E94 to E97
E98 to E9B
EA0 to EA3
EA4 to EA7
EA8 to EAB
EB0 to EB3
EB4 to EB7
EB8 to EBB
EC0 to ECF
EE0
EE0 to EEF
EF0
EF0 to EFF
F00 to F0F
F10 to F1F
F28 to F2B
F2C to F2F
F38 to F3B
F3C to F3F
F40 to F4F
F41
F42
F44
F48
F50 to F5F
F57
F5B
F5D
F5E
F60 to F6F
F70 to F7F
F80 to F8F
Mne-
OperandClock
monic
PSET
LDPX
LDPY
LD
LD
LD
RRC
LD
LD
LD
LD
LD
LD
LD
LD
LD
LD
INC
LDPX
INC
LDPY
CP
FAN
ACPX
ACPY
SCPX
SCPY
SET
SCF
SZF
SDF
EI
RST
DI
RDF
RZF
RCF
INC
DEC
LD
p
MX, i
MY, i
XP, r
XH, r
XL, r
r
YP, r
YH, r
YL, r
r, XP
r, XH
r, XL
r, YP
r, YH
r, YL
r, q
X
r, q
Y
r, q
r, q
r, q
MX, r
MY, r
MX, r
MY, r
F, i