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.
Starting April 1, 2001, the product number will be changed as listed below. To order from April 1,
2001 please use the new product number. For further information, please contact Epson sales
representative.
Configuration of product number
Devices
S1C63158F0A01
Development tools
S5U1
∗1: For details about tool types, see the tables below. (In some manuals, tool types are represented by one digit.)
∗2: Actual versions are not written in the manuals.
C63000A11
00
Packing specification
Specification
Package (D: die form; F: QFP)
Model number
Model name (C: microcomputer, digital products)
Product classification (S1: semiconductor)
00
Packing specification
Version (1: Version 1 ∗2)
Tool type (A1: Assembler Package ∗1)
Corresponding model number
(63000: common to S1C63 Family)
Tool classification (C: microcomputer use)
Product classification
(S5U1: development tool for semiconductor products)
This manual explains the architecture, operation and instruction of the core CPU S1C63 of the CMOS 4-bit
single chip microcomputer S1C63 Family.
Also, since the memory configuration and the peripheral circuit configuration is different for each device
of the S1C63 Family, you should refer to the respective manuals for specific details other than the basic
functions.
4.4 Detailed Explanation of Instructions ........................................................... 60
iiEPSONS1C63000 CORE CPU MANUAL
CHAPTER 1: OUTLINE
CHAPTER 1OUTLINE
The S1C63000 is the core CPU of the 4-bit single chip microcomputer S1C63 Family that utilizes
original EPSON architecture. It has a large and linear addressable space, maximum 64K words (13 bits/
word) program memory (code ROM area) and maximum 64K words (4 bits/word) data memory (RAM,
data ROM and I/O area), and high speed, abundant instruction sets. It operates in a wide range of supply
voltage and features low power consumption. Furthermore, modularization of programs can be done
easily because the program memory does not need bank and page management and relocatable programming is possible.
In addition, it has adopted a unified architecture and a peripheral circuit interface in memory mapped I/O
method to flexibly meet future expansion of the S1C63 Family.
1.1Features
The S1C63000 boasts the below features.
Program memoryMaximum 64K × 13 bits (linear address, non-page method)
Data memoryMaximum 64K × 4 bits
Basic instruction set47 types with 5 types of basic addressing modes and 3 types of extended
(1) It adopts high efficiency machine cycles, high speed and abundant instruction set.
Almost all standard instructions operate in 1 cycle (2 clock).
(2) Both the program space and the data space are designed as a 64K-word linear space without page
concept and can be addressed with 1 instruction.
(3) The instruction system includes relocatable jump instructions and allows a relocatable programming.
Thus modular programming and software library development can be realized easily, and it increases
an efficiency for developing applications.
(4) Memory management can be done easily by 5 types of basic addressing modes, 3 types of extended
addressing modes with the address extension register and 16-bit operation function that is useful in
address calculations.
(5) 8-bit data processing is possible using the table look-up instruction and other instructions.
(6) Some instructions support a numbering system, thus binary to hexadecimal software counters can be
made easily.
S1C63000 CORE CPU MANUALEPSON1
CHAPTER 1: OUTLINE
1.3Block Diagram
Figure 1.3.1 shows the S1C63000 block diagram.
M00
DATA ADDRESS LATCH
–M15
IA00
–IA15
PC (16)
QUEUE (16)
X (16)
Y (16)
SP2 (8)
SP1 (8)
DA00
–DA15
RDWRRDIV
BS16
DBS0
DBS1
BUS
CONTROL
CLKSRPKPLSTOP
TIMING & INTERRUPT
Port APort B
16-bit ADDER
USLP
CONTROL
EXT (8)
ADDRESS
OPERATOR
IRQ
NMI
IACK
Fig. 1.3.1 S1C63000 block diagram
NACK
SS
FETCH
VDDV
POWER
SUPPLY
A (4)
Port APort B
S1C63000
INSTRUCTION
4-bit ALU
I00
–I12
IR (13)
DECODER
µ Instruction
B (4)
F (4)
IF
D0
–D3
1.4Input-Output Signals
Tables 1.4.1 (a) and 1.4.1 (b) show the input/output signals between the S1C63000 and peripheral circuits.
Table 1.4.1(a) Input/output signal list (1)
TypeI/O
Power supply
VDD (VD1)
Power supply (+)
I
Inputs a plus supply voltage.
VSS (VS1)
Power supply (-)
I
Inputs a minus supply voltage.
Clock
CLK
I
Clock input
Inputs the system clock from the peripheral circuit.
PK
PL
2-phase divided clock output
O
Outputs the 2-phase divided signals to be generated from the system clock
input to the CLK terminal as following phase.
CLK
PK
PL
1 cycle
Address bus
IA00–IA15
Instruction address output
O
Outputs an instruction (code ROM) address.
DA00–DA15
Data address output
O
Outputs a data (RAM, I/O) address.
2EPSONS1C63000 CORE CPU MANUAL
FunctionTerminal name
TypeI/O
Data bus
Bus control
signal
System control
signal
Interrupt signal
Status signal
I00–I12
M00–M15
D0–D3
RD
WR
RDIV
SR
USLP
NMI
IRQ
IACK
NACK
FETCH
STOP
IF
BS16
DBS0
DBS1
CHAPTER 1: OUTLINE
Table 1.4.1(b) Input/output signal list (2)
FunctionTerminal name
I
Instruction bus
Inputs an instruction code.
I/O
16-bit data bus
A bidirectional data bus to connect to the RAM (stack RAM) for 16-bit accessing.
I/O
4-bit data bus
A bidirectional data bus to connect to the RAM and I/O.
O
Data read
Goes to a low level when the CPU reads data (from RAM, I/O).
O
Data write
Goes to a low level when the CPU writes data (to RAM, I/O).
O
Read interrupt vector
Goes to a low level when the CPU reads an interrupt vector.
I
Reset input
A low level input resets the CPU.
O
Micro sleep
Goes to a low level when the CPU executes the SLP instruction.
The peripheral circuit stops oscillation on the basis of this signal.
I
Non-maskable interrupt request
An interrupt request terminal for an interrupt that cannot be masked by software.
It is accepted at the falling edge of an input signal to this terminal.
I
Interrupt request
An interrupt request terminal for interrupts that can be masked by software.
It is accepted by a low level signal input to this terminal.
O
Interrupt acknowledge
Goes to a low level while executing an NMI or IRQ interrupt response cycle.
O
Non-maskable interrupt acknowledge
Goes to a low level while executing a non-maskable interrupt response cycle.
O
Fetch cycle
Goes to a low level when the CPU fetches an instruction.
O
Stop signal
Goes to a low level when the CPU is in stop status after executing the HALT
or SLP instruction, or in reset status (SR is low).
O
Interrupt flag
Outputs a status (inverted value) of the interrupt flag in the flag (F) register.
O
16-bit access
Goes to a low level when the CPU accesses to a 16-bit RAM.
O
Data bus status
Outputs data bus status (for both the 4-bit and 16-bit data bus).
DBS1
DBS0
State
0
0
High impedance
0
1
Interrupt vector read
1
0
Memory write
1
1
Memory read
See Chapter 3, "CPU OPERATION", for the timing of the signals.
S1C63000 CORE CPU MANUALEPSON3
CHAPTER 2: ARCHITECTURE
CHAPTER 2ARCHITECTURE
This chapter explains the S1C63000 ALU, registers, configuration of the program memory area and
data memory area, and addressing.
2.1ALU and Registers
2.1.1 ALU
The ALU (Arithmetic and Logic Unit) loads 4-bit data from a memory or a register and operates the data
according to the instruction. Table 2.1.1.1 shows the ALU operation functions.
Table 2.1.1.1 ALU operation functions
Function classification
Arithmetic
Logic
Rotate / shift
MnemonicOperation
ADD
ADC
SUB
SBC
CMP
INC
DEC
AND
OR
XOR
BIT
CLR
SET
TST
RL
RR
SLL
SRL
Addition
Addition with carry
Subtraction
Subtraction with carry
Comparison
Increment (adds 1)
Decrement (subtracts 1)
Logical product
Logical sum
Exclusive OR
Bit test
Bit clear
Bit set
Bit test
Rotate to left with carry
Rotate to right with carry
Logical shift to left
Logical shift to right
The operation result is stored to a register or memory according to the instruction.
In addition, the Z (zero) flag and C (carry) flag are set/reset according to the operation result.
2.1.2 Register configuration
Figure 2.1.2.1 shows the register configuration of the S1C63000.
150
150
XH
70
150
YH
70
150
00H
Fig. 2.1.2.1 Register configuration
4EPSONS1C63000 CORE CPU MANUAL
PC
X
07
XL
Y
07
YL
QUEUE
SP1
7
7
7
70
B
30
0
SP2
EXT
BA
03
30
Program counter
Index register X
Index register Y
Queue register
Stack pointer 1
00000000
Stack pointer 2
0
Extension register
0
Data register B & A
A
F
Flag register
ZCIE
CHAPTER 2: ARCHITECTURE
• A and B registers
The A and B registers are respective 4-bit data registers that are used for data transfer and operation
with other registers, data memories or immediate data. They are used independently for 4-bit trans-
fer/operations and used in a BA pair that makes the B register the high-order 4 bits for 8-bit transfer/
operations.
• X and Y registers
The X and Y registers are respective 16-bit index registers that are used for indirect addressing of the
data memory. These registers are configured as an 8-bit register pair (high-order 8 bits: XH/YH, low-
order 8 bits: XL/YL) and data transfer/operations can be done in an 8-bit unit or a 16-bit unit.
• PC (program counter)
The PC is a 16-bit counter to address a program memory and indicates the following address to be
executed.
• SP1 and SP2 (stack pointers)
The SP1 and SP2 are respective 8-bit registers that indicate a stack address in the data memory. 8 bits
of the SP1 correspond to the DA02 to DA09 bits of the address bus for 16-bit data accessing (address
stacking) and it is used to operate the stack in a 4-word (16-bit) unit. 8 bits of the SP2 correspond to
the low-order 8 bits (DA01 to DA07) of the address bus for 4-bit data accessing and it is used to
operate stack in 1-word (4-bit) unit.
See Section 2.3.3, "Stack and stack pointer" for details of the stack operation.
• EXT register
The EXT register is an 8-bit data register that is used when an address or data is extended into 16 bits.
See Section 2.1.5, "EXT register and data extension", for details.
• F register
The F register includes 4 bits of flags; Z and C flags that are changed by operation results, I flag that is
used to enable/disable interrupts, and E flag that indicates extended addressing mode.
• Queue register
The queue register is used as a queue buffer for data when the SP1 processes 16-bit stack operations.
This register is provided in order to process 16-bit data pop operations from the SP1 stack at high-
speed. The queue register is accessed by the hardware, so it is not necessary to be aware of the register
operation when programming.
2.1.3 Flags
The S1C63000 contains a 4-bit flag register (F register) that indicates such things as the operation result
status within the CPU.
30
F
Flag register
ZCIE
Z (zero) flag
C (carry) flag
I (interrupt) flag
E (extension mode) flag
Fig. 2.1.3.1 F (flag) register
• Z (zero) flag
The Z flag is set to "1" when the execution result of an arithmetic instruction or a shift/rotate instruc-
tion has become "0" and is reset to "0'" when the result is other than "0".
The Z flag is used for condition judgments when executing the conditional jump ("JRZ sign8" and
"JRNZ sign8") instructions, thus it is possible to branch processing to a routine according to the
operation result.
• C (carry) flag
The C flag is set to "1" when a carry (carry from the most significant bit) or a borrow (the most significant bit borrows) has been generated by the execution of an arithmetic instruction and a shift/rotate
instruction, otherwise the flag is set to "0".
Arithmetic instructions that change the C flag:
ADD, ADC, SUB, SBC, CMP, INC, DEC
(It is different from the Z flag, the logic operation instructions except for the instruction that operates
the F register does not change the C flag. In addition, the ADD instructions for the X and Y register
operations and the INC and DEC instructions for the stack pointer operation does not change the C
flag.)
Shift/Rotate instructions that change the C flag:
SLL, SRL, RL, RR
The C flag is used for condition judgments when executing the conditional jump ("JRC sign8" and
"JRNC sign8") instructions, thus it is possible to branch processing to a routine according to the
operation result.
• I flag
The I flag permits and forbids the hardware interrupts except for the NMI. By setting the I flag to "1",
the CPU enters in the EI (enable interrupts) status and the hardware interrupts are enabled. When the
I flag is set to "0", the CPU is in the DI (disable interrupts) and the interrupts except for NMI are
disabled. Furthermore, when a hardware interrupt (including the NMI) is generated, the I flag is reset
to "0" and interrupts after that point are disabled. The multiple interrupts can be accepted by setting
the I flag to "1" in the interrupt processing routine.
The NMI (non-maskable interrupt) is accepted regardless of the I flag setting.
The software interrupts are accepted regardless of the I flag and do not reset the I flag.
The I flag is set to "0" (DI status) at an initial reset, therefore it is necessary to set "1" before using
interrupts by software.
See Section 3.5, "Interrupts" for details.
• E (extension mode) flag
The E flag indicates whether an extended addressing that uses the EXT (extension) register is valid or
invalid. When data is loaded into the EXT register, this flag is set to "1" and the data of the instruction
immediately after that (extended addressable instructions only) is extended with the EXT register.
Then the instruction is executed and the E flag is reset to "0".
See Section 2.1.5, "EXT register and data extension" for details.
• Flag operations
As described above, the flags are automatically set/reset by the hardware. However, it is necessary to
set by software, especially the I flag. The following instructions are provided in order to operate the F
flag.
LD%A,%FReads all the flag data
LD%F,%AWrites all the flag data
LD%F,imm4Writes all the flag data
AND%F,imm4Resets flag(s)
OR%F,imm4Sets flag(s)
∗ The RETI instruction is used to return from interrupt processing routines (including software
interrupts), and returns the F register data that was evacuated when the interrupt was generated.
XOR%F,imm4Inverts flag(s)
PUSH %FEvacuates the F register
POP%FReturns the F register
RETIReturns the F register∗
6EPSONS1C63000 CORE CPU MANUAL
CHAPTER 2: ARCHITECTURE
2.1.4 Arithmetic operations with numbering system
In the S1C63000, some instructions support a numbering system. These instructions are indicated with
the following notations in the instruction list.
(See "Instruction List" or "Detailed Explanation of Instructions" for the contents of the operand.)
"n4" is a radix, and can be specified from 1 to 16. The additions/subtractions are done in the numbering
system with n4 as the radix. Various counters (such as binary, octal, decimal and hexadecimal) can be
realized easily by software.
The Z flag indicates that an operation result is "0" or not in arithmetics with any numbering system. The
C flag indicates a carry/borrow according to the radix.
The following shows examples of these operation.
Example 1) Octal addition ADC %B,%A,8 (C flag is "0" before operation)
LDB%EXT,0; Counter base address [0010H]
LD%XL,0x10
LDB[%X]+,0; Initial value setting [100]
LDB[%X]+,0
LDB[%X]+,1
:
:
CTDOWN:; Count down subroutine----------
LDB%EXT,0; Counter base address [0010H]
LD%XL,0x10
DEC[%X]+,10; Decrements digit 1
SBC[%X]+,0,10; Decrements carry from digit 2
SBC[%X],0,10; Decrements carry from digit 3
CALR CTDISP; Count number display routine
LD%A,0; Zero check
ADD%A,[%X]
ADD%X,-1
ADD%A,[%X]
ADD%X,-1
JRNZ CTEXIT; Return if counter is not zero
CALR CTOVER; Count over processing routine
CTEXIT:
RET
This routine constructs a 3-digit BCD counter using the decimal operation instructions underlined.
Calling the CTDOWN subroutine decrements the counter, and then returns to the main routine. If the
counter has to be zero, the CTOVER subroutine is called before returning to the main routine to
process the end of counting.
S1C63000 CORE CPU MANUALEPSON7
CHAPTER 2: ARCHITECTURE
• Notes in numbering operations
When performing a numbering operation, set operands in correct notation according to the radix
before operation.
For example, if a decimal operation is done for hexadecimal values (AH to FH), the correct operation
result is not obtained as shown in the following example.
Example 1 operates correctly because a decimal value is loaded in the B and A registers.
Examples 3 and 4 do not operate correctly.
Example 2 operates correctly even though it is a wrong setting.
2.1.5 EXT register and data extension
The S1C63000 has a linear 64K-word addressable space, therefore it is required to handle 16-bit address
data. The EXT register and the F flag that extend 8-bit data into 16-bit data permit 16-bit data processing.
The EXT register is an 8-bit register for storing extension data. The E flag indicates that the EXT register
data is valid (extended addressing mode), and is set to "1" by writing data to the EXT register. The E flag
is reset at 1 cycle after setting (during executing the next instruction), therefore an EXT register data is
valid only for the executable instruction immediately after writing. However, that executable instruction
must be a specific instruction which permits the extended addressing to extend the data using the EXT
register. These instructions are specified in "Instruction List" and "Detailed Explanation of Instructions".
Make sure of the instructions when programming.
Note: Do not use instructions (see Instruction List) which are invalid for the extended addressing when
the E flag is set to "1". (Do not use them following instructions that write data to the EXT register or
that set the E flag.) Normal operations cannot be guaranteed if such instructions are used.
(1)Operation for EXT register and E flag (flag register)
The following explains the operation for the EXT register and the E flag (flag register).
• Data setting to the EXT register
The following two instructions are provided to set data in the EXT register.
LDB%EXT,imm8Loads an 8-bit immediate data to the EXT register
LDB%EXT,%BALoads the content of the BA register to the EXT register
By executing the instruction, the EXT flag is set to "1" and it indicates that the content of the EXT
register is valid (the content of the EXT register will be used for data extension in the following
instructions).
Furthermore, the content of the EXT register can be read using the instruction below.
LDB%BA,%EXTLoads the content of the EXT register to the BA register
• Setting/resetting the E flag
As mentioned above, the E flag is set to "1" by data setting to the EXT register and reset to "0" while
executing the next instruction.
In addition, the E flag can be set/reset using the following instructions that operate the flags.
LD%F,%AWrites all the flag data
LD%F,imm4Writes all the flag data
AND%F,imm4Resets flag(s)
OR%F,imm4Sets flag(s)
XOR%F,imm4Inverts flag(s)
8EPSONS1C63000 CORE CPU MANUAL
CHAPTER 2: ARCHITECTURE
The EXT register maintains the data set previously until new data is written or an initial reset. In other
words, the content of the EXT register becomes valid by only setting the E flag using an above instruc-
tion without the register writing and is used for an extended addressing. However, the EXT register is
undefined at an initial reset, therefore, do not directly set the E flag except when the content of the
EXT register has been set for certain.
The following shows the other instructions related to flag data transfer.
LD%A,%FReads all the flag data
PUSH %FEvacuates the F register
POP%FReturns the F register
RETIReturns the F register ∗
∗ The RETI instruction is used to return from interrupt processing routines (including software inter-
rupts), and returns the F register data that was evacuated when the interrupt was generated.
If an interrupt (including NMI) is generated while fetching an instruction, such as a "LDB %EXT, ••"
instruction or an instruction which writes data to the flag register (the E flag may be set), the interrupt
is accepted after fetching (and executing) the next instruction. In normal processing, data extension
processing is not performed after returning from the interrupt service routine because the interrupt
processing including the F register evacuation is performed after the data extension has finished (E
flag is reset). However, if the stack data in the memory is directly changed in the interrupt service
routine, the F register in which the E flag is set may return. In this case, the instruction immediately
after returning by the RETI instruction is executed in the extended addressing mode by the E flag set
to "1". Pay attention to the F register setting except when consciously describing such a processing. It
is necessary to pay the same attention when returning the F register using the "POP %F" instruction.
(2)Extension with E flag
The following explains the instructions that can be executed when the E flag is set to "1" and its
operation.
• Modifying the indirect addressing with the X and Y registers (for 4-bit data access)
The indirect addressing instructions, which contain [%X] or [%Y] as an operand and accesses 4-bit
data using the X or Y register, functions as an absolute addressing that uses the EXT register data
together with the E flag (= "1").
When an 8-bit immediate data (imm8) is written to the EXT register and the E flag is set immediately
before these instructions, the instruction is modified executing as [%X] = [0000H + imm8] or [%Y] =
[FF00H + imm8]. Therefore, the addressable space with this function is data memory address from
0000H to 00FFH when [%X] is used, and from FF00H to FFFFH when [%Y] is used. Generally, data
that are often used are allocated to the data memory from 0000H to 00FFH and the area from FF00H to
FFFFH is assigned to the I/O memory area (for peripheral circuit control), so these areas are fre-
quently accessed. To access these areas by a normal indirect addressing (if the E flag has not been set)
using the X or Y register, two or three steps of instructions are necessary for setting an address data. In
other words, using this function promotes efficiency of the entire program. See Section 2.3, "Data
Memory" for details of the data memory.
Examples:
LDB%EXT,0x37
LD%A,[%X]...Works as "LD %A, [0x0037]"
LDB%EXT,0x9C
ADD[%Y],5...Works as "ADD [0xFF9C], 5"
Note: This function can be used by only the specific instructions which permits the extended addressing
(see "Instruction List"). Be aware that the operation cannot be guaranteed if the instructions
indicated below are used.
1.Instructions which have a source and /or a destination operand with the post-increment function,
[%X]+ and [%Y]+.
2.Instructions which have [%X] and/or [%Y] in both the source and destination operands.
3.The RETD instruction and the LDB instructions which transfers 8-bit data.
S1C63000 CORE CPU MANUALEPSON9
CHAPTER 2: ARCHITECTURE
• 16-bit data transfer/arithmetic for the index registers X and Y
The following six instructions, which handle the X or Y register and have an 8-bit immediate data as
the operand, permit the extended addressing.
When data is written to the EXT register and the E flag is set immediately before these instructions,
the data is processed after extending into 16-bit; imm8 (sign8) is used as the low-order 8 bits and the
content of the EXT register is used as the high-order 8 bits.
Examples:
LDB%EXT,0x15
LDB%XL,0x7D...Works as "LD %X,0x157D"
LDB%EXT,0xB8
ADD%X,0x4F...Works as "ADD %X, 0xB84F"
LDB%EXT,0xE6
CMP%X,0xA2...Works as "CMP %X, 0x19A2"
∗ 19H = FFH - [EXT] (E6H)
Above examples use the X register, but work the same even when the Y register is used.
Note: The CMP instruction performs a subtraction with a complement, therefore it is necessary to set the
complement (1's complement) of the high-order 8-bit data in the EXT register.
EXT register
←
[FFH - High-order 8-bit data]
• Extending branch addresses
The following PC relative branch instructions, which have a signed 8-bit relative address as the
operand, permit extended addressing.
When data is written to the EXT register and the E flag is set immediately before these instructions,
the relative address is processed after extending into signed 16-bit; sign8 is used as the low-order 8
bits and the content of the EXT register is as the high-order 8 bits.
Examples:
LDB%EXT,0x64
JR0x29...Works as "JR 0x6429"
LDB%EXT,0x00
JR127...Works as "JR 127"
LDB%EXT,0xFF
JR-128...Works as "JR -128"
LDB%EXT,0x3A
JR∗0x88...Works as "JR∗ 0x3A88" (∗ = C, NC, Z, or NZ)
LDB%EXT,0xF8
CALR 0x62...Works as "CALR 0xF862"
See Section 2.2.3, "Branch instructions" for the branch instructions.
10EPSONS1C63000 CORE CPU MANUAL
CHAPTER 2: ARCHITECTURE
2.2Program Memory
2.2.1 Configuration of program memory
The S1C63000 can access a maximum 64K-word (× 13 bits) program memory space. In the individual
model of the S1C63 Family, the ROM of which size is decided depending on the model is connected to
this space to write a program and static data.
Figure 2.2.1.1 shows the program memory map of the S1C63000.
Address
0000H
00FFH
0100H
0101H
010FH
0110H
0111H
013FH
0140H
Program area
Common subroutine, etc.
NMI interrupt vector
Hardware interrupt vectors
Program start address
Software interrupt vectors
Program area
13-bit
FFFFH
Fig. 2.2.1.1 S1C63000 program memory map
The S1C63000 can access 64K-word space linearly without any page management used in current 4-bit
microcomputers.
As shown in Figure 2.2.1.1, the program start address after an initial reset is fixed at 0110H independent
of the S1C63 Family models. Programming should be done so that the execution program starts from that
address.
The address 0100H to 010FH is the hardware interrupt vector's area in which up to 16 interrupt vectors
can be assigned. Address 0100H is for the exclusive use of NMI (non-maskable interrupt). The number of
interrupt vectors is dependent on the interrupt function of the S1C63 Family models. Branch instructions
to the interrupt service routines should be written in this area. See Section 3.5, "Interrupts" for details of
the interrupts.
The address 0111H to 013FH is the software interrupt vector's area. Up to 63 software interrupts can be
set up together with the hardware interrupt vector area. Set branch instructions to the interrupt service
routines in this area similarly to the hardware interrupts.
Addresses from 0000H to 00FFH and from 0140H to FFFFH are program area. A call instruction (CALZ)
that is for the exclusive use of the area from 0000H to 00FFH is provided so that the area is useful to store
common subroutines that are called from relocatable modules.
2.2.2 PC (program counter)
The PC (program counter) is a 16-bit counter that keeps the program address to be executed next. The PC
is incremented by executing every instruction step to execute a program sequentially. When a branch
instruction is executed or an interrupt is generated, the content of the PC is modified to branch the
process flow.
The PC covers the entire program memory space alone, therefore processing such as page management
are unnecessary.
At initial reset, the PC is initialized to 0110H and the program starts executing from that address.
S1C63000 CORE CPU MANUALEPSON11
CHAPTER 2: ARCHITECTURE
2.2.3 Branch instructions
Various branch instructions are provided for program repeat and subroutine calls that change a sequential program flow controlled with the PC. The branch instruction modifies the PC to branch the program
to an optional address. The types of the branch instructions are classified as follows, according to their
operation differences.
Table 2.2.3.1 Types of branch instructions
Type
PC relative jump
PC relative jump
Indirect jump
Absolute call
PC relative call
Return
Software interrupt
• PC relative jump instructions (JR)
The PC relative jump instruction adds the relative address specified in the operand to the PC that has
indicated the next address, and branches to that address. It permits relocatable programming.
The relative address to be specified in the operand is a displacement from the PC value (address of the
next instruction) when the branch instruction is executed to the branch destination address. When
programming using the S1C63 Family assembler, it is not necessary to calculate displacements
because a branch destination address can be defined as a label and it can be used as an operand.
However, the range of branch destination addresses is different depending on the number of data bits
that are handled as relative addresses.
The following explains the PC relative jump instructions and the relative addresses.
These instructions branch the program sequence with the sign8 specified in the operand as a
signed 8-bit relative address. The range that can be branched is from the next instruction address 128 to +127. A value within the range from -128 to +127 should be used if specifying a value for
jumping in the assembler. Generally branch destination labels such as "JR LABEL" are used, and
they are expanded into the actual address by the assembler.
These instructions permit the extended addressing with the E flag, and the 8-bit relative address
can be extended into 16 bits (the contents of the EXT register become the high-order 8 bits). In this
case, the range that can be branched is from the next instruction address -32768 to +32767. Consequently, in the extended addressing mode these instructions can branch the entire 64K program
memory.
Examples:
JR-100...Jumps to the instruction 99 steps before
LDB%EXT,100...(100 × 256) = 25600
JR100...Jumps to the instruction 25701 steps after
The unconditional jump instruction "JR sign8" jumps to the branch destination unconditionally
when it is executed.
The conditional jump instructions jump according to the status of C flag or the Z flag.
JRCsign8...Jumps if the C flag is "1", or executes the next instruction if the C flag is "0"
JRNC sign8...Jumps if the C flag is "0", or executes the next instruction if the C flag is "1"
JRZsign8...Jumps if the Z flag is "1", or executes the next instruction if the Z flag is "0"
JRNZ sign8...Jumps if the Z flag is "0", or executes the next instruction if the Z flag is "1"
12EPSONS1C63000 CORE CPU MANUAL
CHAPTER 2: ARCHITECTURE
(2) Instruction with a 4-bit A register data that specifies a relative address
JR%A
This instruction branches the program sequence with the content of the A register as an unsigned
4-bit relative address. The range that can be branched is from the next instruction address +0 to
+15 (absolute value in the A register). This instruction is useful when operation results are used as
the 4-bit relative addresses.
Example:
LD%A,4
JR%A...Jumps to the instruction 5 steps after
(3) Instruction with an 8-bit BA register data that specifies a relative address
JR%BA
This instruction branches the program sequence with the content of the BA register as an unsigned
8-bit relative address ( the B register data becomes the high-order 4 bits). The range that can be
branched is from the next instruction address +0 to +255 (absolute value in the BA register). This
instruction is useful when operation results are used as the 8-bit relative addresses.
Example:
LDB%BA,29
JR%BA...Jumps to the instruction 30 steps after
(4) Instruction with a data memory address within 0000H to 003FH in which the content specifies a 4-bit
relative address
JR[addr6]
This instruction branches the program sequence with the content of the data memory specified by
the [addr6] as an unsigned 4-bit relative address. The operand [addr6] can specify a data memory
address within 0000H to 003FH. The range that can be branched is from the next instruction
address +0 to +15 (absolute value in the specified data memory). For the data memory area that is
specified with [addr6], bit operation instructions (CLR, SET, TST) are provided so that various
flags can be set simply. This jump instruction can be used as a conditional jump according to these
flags.
Example: When the content of the address 0010H is 4 (0100B).
SET[0x0010],0...Sets the bit 0 in the address 0010H to "1" ([0010H] = 5)
JR[0x0010]...Jumps to the instruction 6 steps after
• Indirect jump instruction (JP)
The indirect jump instruction "JP %Y" loads the content of the Y register into the PC to branch to that
address unconditionally. This instruction can branch entire 64K program memory because the 16-bit
data in the Y register becomes a branch destination address as it is.
Example:
LDB%EXT,0x24
LDB%YL,0x00...Y = 2400H
JP%Y...Jumps to the address 2400H
Figure 2.2.3.1 shows the operation of the jump instructions and the branch range.
S1C63000 CORE CPU MANUALEPSON13
CHAPTER 2: ARCHITECTURE
0000H
xxxxH-127
xxxxH
xxxxH+128
FFFFH
0000H
xxxxH
xxxxH+16
FFFFH
Program memory
Program memoryProgram memoryProgram memory
0000H
∗
xxxxH-32767
xxxxH-1
JR sign8
xxxxH+32768
LDB %EXT,imm8
xxxxH
JR sign8
∗
FFFFH
∗ In the extended addressing mode,
this instruction can branch the
entire 64K program memory.
Program memoryData memory
JR [addr6]
[addr6]=0 → xxxxH+1
:
[addr6]=15 → xxxxH+16
PC relative jump instructions
Fig. 2.2.3.1 Operation of jump instructions
xxxxH+16
0000H
addr6
003FH
FFFFH
0000H
xxxxH
FFFFH
JR %A
A=0 → xxxxH+1
:
A=15 → xxxxH+16
0000H
xxxxH
xxxxH+256
FFFFH
Program memory
0000H
JP %Y
FFFFH
Y → Branch destination
absolute address
Indirect jump instruction
JR %BA
BA=0 → xxxxH+1
:
BA=255 → xxxxH+256
• Absolute call instruction (CALZ)
The absolute call instruction "CALZ imm8" calls a subroutine within addresses 0000H to 00FFH. A
subroutine start address (absolute address) should be specified to imm8. When the call instruction is
executed, the PC value (address of the next instruction) is saved into the stack for return, then it
branches to the specified address.
Generally common subroutines that are called from two or more modules are placed in this area when
the program is developed as multiple modules.
Example:
CALZ 0x50...Calls the subroutine located at the address 0050H
See Section 2.3.3, "Stack and stack pointer" for stack.
• PC relative call instructions (CALR)
The PC relative call instruction adds the relative address specified in the operand to the PC that has
indicated the next address, and calls a subroutine started from that address. It permits relocatable
programming.
The relative address to be specified in the operand is same as the PC related jump instruction.
The PC value (address of the next instruction) is saved into the stack before branching.
(1) Instructions with a signed 8-bit immediate data sign8 that specifies a relative address
CALR sign8
This instruction branches the program sequence with the sign8 specified in the operand as a
signed 8-bit relative address. The range that can be branched is from the next instruction address 128 to +127. A value within the range from -128 to +127 should be used if specifying a value for
calling in the assembler. Generally branch destination labels such as "CALR LABEL" are used, and
they are expanded into the actual address by the assembler.
14EPSONS1C63000 CORE CPU MANUAL
CHAPTER 2: ARCHITECTURE
This instruction permits the extended addressing with the E flag, and the 8-bit relative address can
be extended into 16 bits (the contents of the EXT register becomes the high-order 8 bits). In this
case, the range that can be branched is from the next instruction address -32768 to +32767. Consequently, in the extended addressing mode this instruction can call subroutines over a 64K program
memory.
Examples:
CALR -50...Calls the subroutine 49 steps before
LDB%EXT,50...(50 × 256) = 17800
CALR 50...Calls the subroutine 17851 steps after
(2) Instruction with a data memory address within 0000H to 003FH in which the content specifies a 4-bit
relative address
CALR [addr6]
This instruction branches the program sequence with the content of the data memory specified by
the [addr6] as an unsigned 4-bit relative address. The operand [addr6] can specify a data memory
address within 0000H to 003FH. The range that can be branched is from the next instruction
address +0 to +15. Same with the "JR [addr6]", this call instruction can be used as a conditional
call according to the flags that are set in the memory specified with [addr6].
Example: When the content of the address 0010H is 4 (0100B).
SET[0x0010],0 ...Sets the bit 0 in the address 0010H to "1" ([0010H] = 5)
CALR [0x0010]...Calls the subroutine 6 steps after
Figure 2.2.3.2 shows the operation of the call instructions and the branch range.
0000H
xxxxH-127
xxxxH
xxxxH+128
FFFFH
Program memory
xxxxH-32767
CALR sign8
xxxxH+32768
Program memoryProgram memoryData memory
0000H
∗
xxxxH-1
LDB %EXT,imm8
xxxxH
CALR sign8
xxxxH
xxxxH+16
CALR [addr6]
∗
FFFFH
∗ In the extended addressing mode,
this instruction can call subroutines
over a 64K program memory.
FFFFH
[addr6]=0 → xxxxH+1
:
[addr6]=15 → xxxxH+16
PC relative call instructions
Program memory
0000H
00FFH
CALZ imm8
0000H
addr6
003FH
FFFFH
FFFFH
imm → Branch destination
absolute address
Absolute call instruction
Fig. 2.2.3.2 Operation of call instructions
S1C63000 CORE CPU MANUALEPSON15
CHAPTER 2: ARCHITECTURE
• Return instructions (RET, RETS, RETD, RETI)
A return instruction is used to return from a subroutine called by the call instruction to the routine
that called the subroutine. Return operation is done by loading the PC value (address next to the call
instruction) that was stored in the stack when the subroutine was called into the PC.
The RET instruction operates only to return the PC value in the stack, and the processing is continued
from the address next to the call instruction.
The RETS instruction returns the PC value then adds "1" to the PC. It skips executing an instruction
next to the call instruction.
Figure 2.2.3.3 shows return operations from a subroutine.
MainroutineSubroutine
:
:
Address
xxxxH
xxxxH+1
xxxxH+2Return to
:
CALR sign8
JR
sign8
LD
%A,[%X]
:
ADD
A,B
:
JR
NC,1
RET (RETD)
RETS
xxxxH+1
Return to
xxxxH+2
Fig. 2.2.3.3 Return from subroutine
The RETD instruction performs the same operation as the RET instruction, then stores the 8-bit data
specified in the operand into the memory specified with the X register. This function is useful to create
data tables that will be explained in the next section.
The RETI instruction is for the exclusive use of hardware and software interrupt service routines.
When an interrupt is generated, the content of the F register is saved into the stack with the current
PC value. The RETI instruction returns them.
• Software interrupt instruction (INT)
The software interrupt instruction "INT imm6" specifies a vector address within the addresses from
0111H to 013FH to execute its interrupt service routine. It can also call a hardware interrupt service
routine because it can specify an address from 0100H. It performs the same operation with the call
instruction, but the F register is also saved into the stack before branching. Consequently, the RETI
instruction must be used for returning from interrupt service routines. See Section 3.5, "Interrupts" for
details of the interrupt.
2.2.4 Table look-up instruction
The RETD instruction, one of the return instructions, has an 8-bit data in the operand, and stores the data
in the memory specified with the X register (the low-order 8 bits are stored in [X] and the high-order 8
bits are stored in [X+1]) immediately after returning.
By using the RETD instruction combined with the "JR %BA" or "JR %A" instructions, an 8-bit data table
for an LCD segment data conversion or similar can simply be constructed in the code ROM.
Example: The following is an example of a table for converting a BCD data (0 to 9) in the A register
into an ASCII code (30H to 39H). The conversion result is stored in the addresses 0040H
(low-order 4 bits) and 0041H (high-order 4 bits).
LD%A,3;Sets data to be converted
CALR TOASCII;Calls converting routine
LDB%BA,[%X]+ ;Loads result from memory to BA register
:
:
As shown in the example, operation results in the A or BA register can simply be converted into other
formats.
2.3Data Memory
2.3.1 Configuration of data memory
In addition to the program memory space, the S1C63000 can also access 64K-word (× 4 bits) data memory.
In the individual model of the S1C63 Family, RAM of which size is decided depending on the model and
I/O memory are connected to this space.
Figure 2.3.1.1 shows the data memory map of the S1C63000.
4-bit
Address
0000H
00FFH
0100H
03FFH
0400H
FEFFH
FF00H
FFFFH
Fig. 2.3.1.1 S1C63000 data memory map
The S1C63000 can access 64K-word space linearly without any of the page management commonly used
in current 4-bit microcomputers.
The S1C63000 has a built-in 16-bit data bus for the address stack (SP1), and a RAM that permits 16-bit
data accessing can be connected to the addresses 0000H to 03FFH. The 16-bit accessible area is different
depending on the individual models. That area permits normal 4-bit accessing. Switching between 4-bit
accessing and 16-bit accessing is done according to the instruction by the hardware. A normal 4-bit data
stack (SP2) is assigned within the addresses 0000H to 00FFH.
SP1, SP2 stack area
Data
and
Data
and
SP1 stack area
Data area
I/O memory area
The addresses FF00H to FFFFH are used for an I/O memory area to control the peripheral circuits.
S1C63000 CORE CPU MANUALEPSON17
CHAPTER 2: ARCHITECTURE
2.3.2 Addressing for data memory
For addressing to access the data memory, the index registers X and Y, and stack pointers SP1 and SP2 are
used. (The next section will explain the stack pointers.)
Index registers X and Y are both 16-bit registers and cover the entire 64K data memory space. The data
memory is accessed by setting an address in the register.
Example:
LDB%EXT,0x00
LDB%XL,0x10...Sets 0010H in the X register
LDA,[%X]...Loads the content of the memory address 0010H into the A register
The indirect addressing with the X or Y register permits use of the post-increment function and processing for continuous addresses can be done efficiently. This function can be used in the instruction with
[%X]+ or [%Y]+ as an operand. [%X]+ indicates that the content of the X register is incremented after end
of transfer or operation, therefore the next address can be accessed without the X register re-setting. It is
the same in case of the Y register.
Example: To copy the 3-word data from the address specified with the X register to the area specified
with the Y register
LD [%Y]+,[%X]+
LD [%Y]+,[%X]+
LD [%Y],[%X]
In addition, the S1C63000 has also provided instructions in order to efficiently access only the area which
is accessed frequently such as the I/O memory and lower addresses.
One of that is the addressing using the EXT register explained in Section 2.1.5.
• Accessing for addresses 0000H to 00FFH
For absolute addressing in this area, the EXT register and an indirect instruction with the X register
([%X]) are used. To access this area, first write an 8-bit low-order address (00H to FFH) in the EXT
register, then execute an indirect addressing instruction with an operand [%X] (only the instruction
that permits the extended addressing). In this case, the content of the X register does not affect the
address to be accessed. Also the content of the X register is not changed.
Example:
LDB%EXT,0x37
LD%A,[%X]...Works as "LD %A, [0x0037]"
• Accessing for addresses FF00H to FFFFH (I/O memory area)
For absolute addressing in this area, the EXT register and an indirect instruction with the Y register
([%Y]) are used. To access this area, first write an 8-bit low-order address (00H to FFH) in the EXT
register, then execute an indirect addressing instruction with an operand [%Y] (only the instruction
that permits the extended addressing). In this case, the content of the Y register does not affect the
address to be accessed. Also the content of the Y register is not changed.
Example:
LDB%EXT,0x9C
ADD[%Y],5...Works as "ADD [0xFF9C], 5"
Note: The extended addressing function using the EXT register is effective only for the instruction
following immediately after writing data to the EXT register or setting the E flag to "1". For that
instruction, do not use instructions other than the instructions that permit the extended addressing.
Operation cannot be guaranteed if used.
In addition to the above functions, some 6-bit addressing instructions are provided to directly access
that area. These instructions have a [addr6] as the operand and can alone directly access the area
0000H to 003FH or FFC0H to FFFFH.
18EPSONS1C63000 CORE CPU MANUAL
CHAPTER 2: ARCHITECTURE
• Accessing for addresses 0000H to 003FH
Data in this area is used for a relative address by the "JR [addr6]" and "CALR [addr6]" explained in
Section 2.2.3. This area is suitable for setting up various flags and counters since the bit operation
instructions (CLR, SET, TST) and increment/decrement instructions (INC, DEC) are provided for
accessing this area.
• Accessing for addresses FFC0H to FFFFH (I/O memory area)
The bit operation instructions (CLR, SET, TST) are provided for accessing this area. Therefore, control
bits in the I/O memory can be operated simply.
Examples:
CLR[0xFFC0],0...Clears the D0 bit in the I/O memory address FFC0H to "0"
SET[0xFFD2],3...Sets the D3 bit in the I/O memory address FFD2H to "1"
2.3.3 Stack and stack pointer
The stack is a memory that is accessed in the LIFO (Last In, First Out) format and is allocated to the RAM
area of the address 0000H to 03FFH. The stack area can be set from an optional address (toward the lower
address) using the stack pointer.
The S1C63000 contains two stack pointers SP1 and SP2.
(1)Stack pointer SP1
The SP1 is used for the address data stack, and permits 16-bit data accessing.
D0D1D2D9D10D15
0SP1700000000
Stack pointer 1
8 bits to be modified
Fig. 2.3.3.1 SP1 configuration
As shown in the figure, the D0, D1 and D10–D15 within the 16 bits are fixed at "0". 8 bits of the D2–D9
can be set by software. Furthermore, the hardware also operates for this 8-bit field. Therefore, addressing by the SP1 is done in 4-word units, and a 16-bit address data can be transferred in one
accessing. Since the SP1 performs 16-bit data accessing, this stack area is limited to the 16-bit accessible RAM area even though it is within the addresses 0000H to 03FFH.
This stack is used to evacuate return addresses when the call instructions are executed or the interrupts are generated. It is also used when the 16-bit data in the X or Y register is evacuated using the
PUSH instruction. The return address data is written into the stack as shown in Figure 2.3.3.2.
The SP1 is decremented after the data is evacuated and is incremented when a return instruction is
executed or after returning data by executing the POP instruction.
Program memory
ROM
Address
1234H
1235H
:
CALR sign8
:
Subroutine
:
RET
PC
1235H
PC
1235H
Address
00FFH
00FEH
00FDH
00FCH
00FFH
00FEH
00FDH
00FCH
ROM
Stack (SP1)
5H
3H
2H
1H
5H
3H
2H
1H
SP1
40H
(= Address 100H)
(= Address FCH)
3FH
SP1
40H
(= Address 100H)
(= Address FCH)
3FH
Fig. 2.3.3.2 Address stack operation
S1C63000 CORE CPU MANUALEPSON19
CHAPTER 2: ARCHITECTURE
The SP1 increment/decrement affects only the 8-bit field shown in Figure 2.3.3.1, and its operation is
performed cyclically. In other words, if the SP1 is decremented by the PUSH instruction or other
conditions when the SP1 is 00H (indicating the memory address 0000H), the SP1 becomes FFH
(indicating the memory address 03FCH). Similarly, if the SP1 is incremented by the POP instruction or
other conditions when the SP1 is FFH (indicating the memory address 03FCH), the SP1 becomes 00H
(indicating the memory address 0000H).
• Queue register
The queue register is provided in order to reduce the process time of the 16-bit data transfer by
the SP1. The queue register retains 16-bit data in the RAM indicated with the SP1. It is accessed
when the following instructions are executed, not by programs directly.
1. When the call instruction or the PUSH instruction is executed, and when an interrupt is generated
When the CALR or CALZ instruction is executed, a software interrupt by the INT instruction is
generated, and a hardware interrupt is generated, the PC value for returning is written in the
memory [SP1-1]. When the "PUSH %X" or "PUSH %Y" instruction is executed, the content of
the X register or Y register is written in the memory [SP1-1]. At this time, the same data which
is written in the memory [SP1-1] is also written to the queue register.
2. When the return instruction or the POP instruction is executed
When the RET, RETS, RETD, RETI, "POP %X" or "POP %Y" instructions are executed, the data
retained in the queue register is returned to the PC, X register or Y register. Since the SP1 is
incremented, the content of the queue register is renewed (it generates a bus cycle to load the
content of the memory [SP1+1] to the queue register).
3. When the "LDB %SP1, %BA", "INC SP1" or "DEC SP1" instructions are executed
When these instructions are executed, the content of the queue register is also renewed (it
generates a bus cycle to load the content of the memory [SP1] to the queue register).
Note: As shown above, the memory content that is indicated by the SP1 is written to the queue register
according to the SP1 changes. Therefore, the queue register is not renewed even if the memory
[SP1] is directly modified when the SP1 is not changed. Be aware that intended return and POP
operations cannot be performed if such an operation is done.
(2)Stack pointer SP2
The SP2 is used for the normal 4-bit data stack.
D0D7D8D15
Stack pointer 2
SP2
00H
7
8 bits to be modified
Fig. 2.3.3.3 SP2 configuration
In the case of the SP1, the D8–D15 within the 16 bits are fixed at "0". 8 bits of the D0–D7 can be set by
software. Furthermore, the hardware also operates for this 8-bit field. The address range that can be
used for the data stack is limited to within 0000H to 00FFH. Data evacuation/return is done in 1-word
units.
This stack is used to evacuate the F register data when an interrupt is generated. It is also used when
the 4-bit register data (A, B, F) is evacuated using the PUSH instruction. The register data is written
into the stack as shown in Figure 2.3.3.4.
The SP2 is decremented after the data is evacuated and is incremented when the data is returned.
0
20EPSONS1C63000 CORE CPU MANUAL
CHAPTER 2: ARCHITECTURE
Program memory
:
PUSH A
:
POPA
A register
6H
A register
6H
Address
004FH
004EH
004FH
004EH
ROM
Stack (SP2)
6H
6H
SP2
50H
4FH
SP2
50H
4FH
Fig. 2.3.3.4 4-bit stack operation
The SP2 increment/decrement affects only the 8-bit field shown in Figure 2.3.3.3, and its operation is
performed cyclically. In other words, if the SP2 is decremented by the PUSH instruction or other
conditions when the SP2 is 00H (indicating the memory address 0000H), the SP2 becomes FFH
(indicating the memory address 00FFH). Similarly, if the SP2 is incremented by the POP instruction or
other conditions when the SP2 is FFH (indicating the memory address 00FFH), the SP2 becomes 00H
(indicating the memory address 0000H).
(3)Notes for using the stack pointer
• The SP1 and SP2 are undefined at an initial reset. Therefore, both the stack pointers must be initialized
by software.
For safety, all the interrupts including NMI are masked until both the SP1 and SP2 are set by software.
Furthermore, if either the SP1 or SP2 is re-set, all the interrupts are masked again until the other is reset. Therefore be sure to set the SP1 and SP2 as a pair.
• The increment/decrement for the SP1 and SP2 is operated cyclically from 0000H to 03FFH (SP1) and
from 0000H to 00FFH (SP2) regardless of the memory capacity/allocation set up in each model.
Control with the program so that the stacks do not cross over the upper/lower limits of the mounted
memory.
• The SP1 must be set in the RAM area that permits 16-bit accessing depending on the model. The SP1
address stack cannot be allocated to other than the 16-bit accessible area even if the address is less
than 03FFH.
• The area management for the SP1 stack, SP2 stack and data RAM should be done by the user. Pay
attention to these areas so that they do not overlap in the same addresses.
2.3.4 Memory mapped I/O
The S1C63 Family contains the S1C63000 as the core CPU and various types of peripheral circuits, such as
input/output ports. The S1C63000 has adopted a memory mapped I/O system for controlling the
peripheral circuits, and the control bits and the registers for exchanging data are arranged in the data
memory area.
The I/O memory for controlling the peripheral circuits is assigned to the area from FF00H to FFFFH, and
is distinguished from RAM and others. However, the accessing method is the same as RAM, so indirect
addressing can be done using the X or Y register. In addition, since the I/O memory is accessed frequently, the exclusive instructions for this area are also provided. (See Section 2.3.2.)
Refer to the manual for the individual model of the S1C63 Family for the I/O memory and the peripheral
circuits.
S1C63000 CORE CPU MANUALEPSON21
CHAPTER 3: CPU OPERATION
CHAPTER 3CPU OPERATION
This section explains the CPU operations and the operation timings.
3.1Timing Generator and Bus Cycle
The S1C63000 has a built-in timing generator. The timing generator of the S1C63000 generates the twophase divided signals PK and PL based on the clock (CLK) input externally (∗) to make states. One state
is a 1/2 cycle of the CLK and the one bus cycle that becomes the instruction execution unit is composed
of four states.
∗ The clock that is input to the S1C63000 is generated by an oscillation circuit provided outside of the
CPU. The S1C63 Family models have a built-in oscillation circuit.
StateStateStateState
T1T2T3T4
CLK
PK
PL
Bus cycle
Fig. 3.1.1 State and bus cycle
The number of cycles which is stated in the instruction list indicates the number of bus cycles.
3.2Instruction Fetch and Execution
The S1C63000 executes the instructions indicated with the PC (program counter) one by one. That
operation for an instruction is divided into two stages; one is a fetch cycle to read an instruction, and
another is an execution cycle to execute the instruction that has been read.
All the S1C63000 instructions are composed of one step (word), and are fetched in one bus cycle. An
instruction code that is written in the ROM is read out during the fetch cycle and is analyzed by the
instruction decoder. The FETCH signal goes to a low level during that time. In addition, the PC is
incremented at the end of each fetch.
The analyzed instruction is executed from the next bus cycle. The number of execution cycles is shown in
the instruction list and it is one, two or three bus cycles depending on the instruction.
The S1C63000 contains two different buses for the program memory and the data memory. Consequently,
a fetch cycle for the next instruction can be executed to overlap with the last execution cycle, and it
increases the processing speed. In the one-cycle instructions, the next instruction is fetched at the same
time an instruction is executed.
The S1C63000 output the data bus status in each bus cycle externally on the DBS0 and DBS1 signals as a
2-bit status. The peripheral circuits perform the direction control of the bus driver and other controls with
these signals. The data bus statuses indicated by the DBS0 and DBS1 are as shown in Table 3.3.1.1.
Table 3.3.1.1 Data bus status
DBS1
3.3.2 High-impedance control
The data bus goes to a high-impedance during an execution cycle (∗) that accesses only the internal
registers in the CPU. During the bus cycle period, both the read signal RD and write signal WR are fixed
at a high level and a dummy address is output on the address bus.
CLK
DBS0
0
0
1
1
0
High impedance
1
Interrupt vector read
0
Memory write
1
Memory read
T1T2T3T4
State
PK
PL
DA00–DA15
WR
RD
D0–D3
DBS1
DBS0
Dummy address
Bus cycle
Fig. 3.3.2.1 Bus cycle during accessing internal register
∗ Data is output on the data bus only when the stack pointer SP1 is accessed because a data transfer is
performed between the queue register and the data memory. In this case, the data bus status becomes a
memory write or a memory read depending on the instruction that accesses the SP1.
S1C63000 CORE CPU MANUALEPSON23
CHAPTER 3: CPU OPERATION
3.3.3 Interrupt vector read
When an interrupt is generated, the CPU reads the interrupt vector output to the data bus by the peripheral circuit that has generated the interrupt. The interrupt vector read status indicates this bus cycle. The
peripheral circuit outputs the interrupt vector to the data bus during this status, and the CPU reads the
data between the T2 and T3 states. At this time, the CPU outputs the RDIV signal (for exclusive use of the
interrupt vector read) as a read signal, not the RD signal that is used for normal data memory read. The
address bus outputs a dummy address during this bus cycle. See Section 3.5 for the operation when an
interrupt is generated.
CLK
PK
PL
DA00–DA15
RDIV
WR
RD
D0–D3
DBS1
T1T2T3T4
Dummy address
Interrupt vector
DBS0
Bus cycle
Fig. 3.3.3.1 Bus cycle during reading interrupt vector
3.3.4 Memory write
In an execution cycle that writes data to the data memory, the writing data is output to the data bus
between the T2 and T4 states and the write signal WR is output in the T3 state. The address bus outputs
the target address during this bus cycle.
The S1C63000 contains a 4-bit data bus (D0–D3) and a 16-bit data bus (M00–M15) for an address stacking.
The CPU switches the data bus according to the instruction. The BS16 signal is provided for this switching.
DA00–DA15
CLaK
PK
PL
WR
RD
D0–D3
BS16
DBS1
DBS0
T1T2T3T4
Address
Write data
CLK
PK
PL
DA00–DA15
WR
RD
M00–M15
BS16
DBS1
DBS0
T1T2T3T4
Address
Write data
Bus cycle
Bus cycle
(a) During 4-bit data access(b) During 16-bit data access
Fig. 3.3.4.1 Bus cycle during memory write
24EPSONS1C63000 CORE CPU MANUAL
CHAPTER 3: CPU OPERATION
3.3.5 Memory read
In an execution cycle that reads data from the data memory, the read signal RD is output between the T2
and T3 states and data is read from the data bus. The address bus outputs the target address during this
bus cycle.
The 4-bit/16-bit access is the same as the memory write.
CLK
PK
PL
DA00–DA15
WR
RD
D0–D3
BS16
DBS1
DBS0
T1T2T3T4
Address
Read data
CLK
PK
PL
DA00–DA15
WR
RD
M00–M15
BS16
DBS1
DBS0
T1T2T3T4
Address
Read data
Bus cycle
Bus cycle
(a) During 4-bit data access(b) During 16-bit data access
Fig. 3.3.5.1 Bus cycle during memory read
3.4Initial Reset
The S1C63000 has a reset (SR) terminal in order to start the program after initializing the circuit when the
power is turned on or other situations. The following explains the operation at an initial reset and the
initial setting of the internal registers.
3.4.1 Initial reset sequence
The S1C63000 enters into an initial reset status immediately after setting the SR terminal to a low level,
and the internal circuits are initialized. During an initial reset, the data bus goes to a high-impedance and
the RD and WR signals go to a high level.
When the SR terminal goes to a high level, the initial reset is released and the program starts executing
from address 0110H. The release of an initial reset (the SR terminal goes a high level) is accepted at the
rising edge of the CPU operation clock (CLK), and the first bus cycle ( fetching the instruction of the
address 0110H) starts from 1 clock after.
Fig. 3.4.1.1 Initial reset status and sequence after releasing
S1C63000 CORE CPU MANUALEPSON25
CHAPTER 3: CPU OPERATION
After an initial reset, all the interrupts including NMI are masked until both the stack pointers SP1 and
SP2 are set by software.
3.4.2 Initial setting of internal registers
An initial reset initializes the internal registers in the CPU as shown in Table 3.4.2.1.
Table 3.4.2.1 Initial setting of internal registers
Name
Data register A
Data register B
Extension register EXT
Index register X
Index register Y
Program counter
Stack pointer SP1
Stack pointer SP2
Zero flag
Carry flag
Interrupt flag
Extension flag
Queue register
Symbol
A
B
EXT
X
Y
PC
SP1
SP2
Z
C
I
E
Q
Number of bits
4
4
8
16
16
16
8
8
1
1
1
1
16
Setting value
Undefined
Undefined
Undefined
Undefined
Undefined
0110H
Undefined
Undefined
Undefined
Undefined
0
0
Undefined
The registers and flags which are not initialized at an initial reset should be initialized in the program if
necessary.
Be sure to set both the stack pointers SP1 and SP2. All the interrupts cannot be accepted if they are not set
as a pair.
3.5Interrupts
Interrupt is a function to process factors, that generate asynchronously with program execution, such as a
key entry and an end of a peripheral circuit operation. When the CPU accepts an interrupt request that is
sent by the hardware, the CPU stops executing the current sequence of the program and shifts into the
interrupt processing. When all the interrupt processing has finished, the interrupted program is resumed.
The S1C63000 has the hardware interrupt function for the peripheral circuits including an NMI (nonmaskable interrupt) and the hardware interrupt function. The hardware interrupts excluding the NMI
can be set to the DI (disable interrupts) status by setting the I (interrupt) flag.
I flag = "1": EI (enable interrupts) status ...The CPU accepts interrupt requests from the peripheral
circuits.
I flag = "0": DI (disable interrupts) status ...The CPU does not accept interrupt requests from the periph-
eral circuits. (excluding NMI and software interrupts)
The I flag is set to "0" at an initial reset. Furthermore, all the interrupts including NMI are masked and
cannot be accepted regardless of the I flag setting until both the stack pointers SP1 and SP2 are set in the
program after an initial reset.
3.5.1 Interrupt vectors
Interrupt vectors are provided to execute a interrupt service routine corresponding to the interrupt
generated.
The interrupt vectors are assigned to the following addresses in the ROM.
NMI interrupt vector:0100H
Hardware interrupt vectors:0101H to 010FH
Software in t e r r u p t v e c t o r s :0111H to 013FH
26EPSONS1C63000 CORE CPU MANUAL
CHAPTER 3: CPU OPERATION
Each of the addresses listed above corresponds to an interrupt factor individually. A branch (jump)
instruction to the interrupt service routine should be written to these addresses.
Up to 15 hardware interrupt vectors are available, however, the number of vectors is different depending
on the S1C63 Family models. The addresses, that are not assigned to the hardware interrupt vector within
the addresses 0101H to 010FH, can be used as software interrupt vectors. In addition, since the hardware
interrupt service routines can be executed using the software interrupt, up to 63 software interrupts can
be used (excluding the address 0110H because it is the program start address).
3.5.2 Interrupt sequence
• Hardware interrupts
Hardware interrupts including NMI are generated by the peripheral circuits. The peripheral circuit
that contains the interrupt function outputs an interrupt request to the CPU when the interrupt factor
is generated. The NMI terminal for NMI or IRQ terminal for other interrupts goes low. Sampling the
NMI signal is done at the falling edge by the CPU. Sampling the IRQ signal is done at the rising edge
of the T3 state in the bus cycle. The CPU executes the following process after accepting an interrupt
request.
Bus cycle 0Sampling the interrupt request.
Bus cycle 1The last execution cycle of the instruction under execution becomes a dummy fetch
cycle. This cycle turns the interrupt acknowledge signal low (both NACK and IACK for
NMI, IACK only for a normal interrupt), which indicates that the interrupt has been
accepted.
Bus cycle 2Saves the F register into the stack indicated by the SP2, then resets the I flag to "0" to
prohibit following interrupts (excluding NMI).
Bus cycle 3Sets the data bus status DBS1/DBS0 to "01B". Then, turns the vector read signal RDIV
low and reads the interrupt vector (4 bits) output from the peripheral circuit to the data
bus.
When NMI is generated, this cycle becomes a dummy cycle because the interrupt vector
is fixed at 0100H.
The NACK and/or IACK are returned to high at the end of this cycle.
Bus cycle 4Fetches the instruction in the interrupt vector (data that is read in Bus cycle 3 becomes
the low-order 4 bits of the vector) and saves the content of the PC (address immediately
after the instruction that is executed in Bus cycle 0 or branch destination address when
it is a branch instruction) to the stack indicated by the SP1.
Bus cycle 5Executes the instruction fetched in Bus cycle 4. (If it is 1-cycle instruction, the next
instruction is fetched at the same time.)
• Exceptional acceptance of interrupt
For all the interrupts including NMI that are generated during fetching the following instructions
are accepted after the next instruction is fetched (it is executed) even in the EI (enable interrupts)
status.
1. Instructions that set the E flag
LDB %EXT,imm8LDB %EXT,%BA
2. Instructions that write data in the F (flag) register
These instructions set the E flag or may set it. Therefore, if an extended addressing instruction
follows them, it is executed previous to the interrupt processing.
Further, these instructions may modify the content of the I flag. If these instructions set the I flag
(EI status), the interrupt processing is done after executing the next instruction. If these instructions reset the I flag (DI status), interrupts generated after the instruction fetch cycle are masked.
S1C63000 CORE CPU MANUALEPSON27
CHAPTER 3: CPU OPERATION
3. Instructions that set the stack pointer
LDB %SP1,%BALDB %SP2,%BA
These two instructions are also accepted after fetching the next instruction. However, these
instructions must be executed as a pair. When one of them is fetched at first, all the interrupts
including NMI are masked (interrupts cannot be accepted). Then, when the other instruction is
fetched, that mask is released and interrupts can be accepted after the next instruction is fetched.
CLK
PK
PC
FETCH
BS16
DBS1/0
WR
RD
RDIV
DA00–DA15
D0–D3
M00–M15
NMI
IACK
NACK
PL
pc-2pc-10100HANY
ANYANYDUMMY(0100H)ANY
IF
Interrupt sampling
012345
pc
ANY212ANY
DUMMY
SP2-1DUMMYSP1-1ANY
F reg.ANY
pc
Interrupt processing by the hardware Executing the interrupt service routine
4–6 cycle
Fig. 3.5.2.1 NMI sequence
(normal acceptance)
CLK
PK
PC
FETCH
BS16
DBS1/0
WR
RD
RDIV
DA00–DA15
D0–D3
M00–M15
NMI
IACK
NACK
PL
pc-3pc-10100HANY
ANY
IF
Interrupt sampling
Interrupt sampling
012345
pc-2
LDB %EXT,imm8
ANY
ANY
DUMMY(0100H)ANY
LD %A,[%X]
03
00xxH
[00xxH]
Interrupt processing by the hardware
pc
212ANY
DUMMY
SP2-1DUMMYSP1-1
F reg.ANY
pc
Executing the interrupt service routine
In this chart, the dummy fetch
cycle starts after fetching the
"LD %A, [%X]" instruction
that follows the "LDB %EXT,
imm8" instruction.
Fig. 3.5.2.2 NMI sequence
(interrupt acceptance
after 1 instruction)
28EPSONS1C63000 CORE CPU MANUAL
CHAPTER 3: CPU OPERATION
CLK
FETCH
BS16
DBS1/0
WR
RD
RDIV
DA00–DA15
D0–D3
M00–M15
IRQ
IACK
NACK
012345
PK
PL
pc-2pc-1010xHANY
PC
ANYANYDUMMY(010xH)ANY
ANY212ANY
IF
Interrupt sampling
Interrupt processing by the hardware Executing the interrupt service routine
The software interrupts are generated by the INT instruction. Time of the interrupt generation is
determined by the software, so the I flag setting does not affect the interrupt. That processing is the
same as the subroutine that evacuates the F register into the stack.
This interrupt does not change the interrupt control signals between the CPU and the peripheral
circuits, or the I flag either. An address that is specified with the operand of the INT instruction is
used as it is as the interrupt vector.
12345
CLK
PK
PL
PC
FETCH
BS16
DBS1/0
WR
RD
RDIV
DA00–DA15
D0–D3
M00–M15
IRQ
IACK
pc-2pc-101addr6HANY
ANYANYINT addr6(01addr6H)ANY
ANY232ANY
IF
pc+1pc
DUMMY
SP2-1DUMMYSP1-1ANY
F reg.xH
pc+1
Fig. 3.5.2.5 Software interrupt sequence
3.5.3 Notes for interrupt processing
(1) After an initial reset, all the interrupts including NMI are masked and cannot be accepted regardless
of the I flag setting until both the stack pointers SP1 and SP2 are set in the program. Be sure to set the
SP1 and SP2 in the initialize routine.
Further, when re-setting the stack pointer, the SP1 and SP2 must be set as a pair. When one of them is
set, all the interrupts including NMI are masked and interrupts cannot be accepted until the other one
is set.
(2) The interrupt processing is the same as a subroutine call that branches to the interrupt vector address.
At that time, the F register is evacuated into the stack. Therefore, the interrupt service routine should
be made as a subroutine and the RETI instruction that returns the F register must be used for return.
(3) If an interrupt (including NMI) is generated while fetching an instruction, that sets the E flag or writes
data to the F (flag) register, the interrupt is accepted after fetching (and executing) the next instruction. Therefore, the extended addressing with the EXT register is processed before executing the
interrupt processing. However, if the stack data in the memory is directly changed in the interrupt
service routine, the F register in which the E flag is set may return. In this case, the instruction immediately after returning by the RETI instruction is executed in the extended addressing mode by the E
flag that is set to "1". Pay attention to the F register setting except when describing such a processing
consciously.
30EPSONS1C63000 CORE CPU MANUAL
CHAPTER 3: CPU OPERATION
3.6Standby Status
The S1C63000 has a function that stops the CPU operation and it can greatly reduce power consumption.
This function should be used to stop the CPU when there is no processing to be executed in the CPU,
example while the application program waits an interrupt. This is a standby status where the CPU has
been stopped to shift it to low power consumption.
This status is available in two types, a HALT status and a SLEEP status.
3.6.1 HALT status
The HALT status is the status in which only the CPU stops and shifting to it can be done using the HALT
instruction. The HALT status is released by a hardware interrupt including NMI, and the program
sequence returns to the step immediately after the HALT instruction by the RETI instruction in the
interrupt service routine. The peripheral circuits including the oscillation circuit and timer operate all
through the HALT status. Moreover during HALT status, the contents of the registers in the CPU that
have been set before shifting are maintained.
Figure 3.6.1.1 shows the sequence of shifting to the HALT status and restarting.
In the HALT status the Th1 and Th2 states are continuously inserted. During this period, interrupt
sampling is done at the falling edge of the Th2 state and the generation of an interrupt factor causes it to
shift to the interrupt processing.
Th1
Th1
Th1
Th1
Th1
Th2
Th2
Th1
Th2
T1T2 T3 T4
CLK
T2 T3 T4
T1
Th2
Th2
Th2
PK
PL
PC
FETCH
DBS1/0
STOP
IRQ
IACK
pc
HALT
ANY
HALT status
pc+1
DUMMY
02
Interrupt processing
Interrupt sampling
Fig. 3.6.1.1 Sequence of shifting to HALT status and restarting
3.6.2 SLEEP status
The SLEEP status is the status in which the CPU and the peripheral circuits within the MCU stop operating and shifting it can be done using the SLP instruction.
The SLEEP status is released by a reset or a specific interrupt (it differs depending on the model). When
the SLEEP status is released by a reset, the program restarts from the program start address (0110H).
When it is released by an interrupt, the program sequence returns to the step immediately after the SLP
instruction by the RETI instruction in the interrupt service routine.
Power consumption in the SLEEP status can be greatly reduced in comparison with the the HALT status,
because such peripheral circuits as the oscillation circuit are also stopped. However, since stabilization
time is needed for the oscillation circuit when restarting, it is effective when used for extended standby
where instantaneous restarting is not necessary.
S1C63000 CORE CPU MANUALEPSON31
CHAPTER 3: CPU OPERATION
During SLEEP status, as in the HALT status, the contents of the registers in the CPU that have been set
before shifting are maintained if rated voltage is supplied.
Figure 3.6.2.1 shows the sequence of shifting to the SLEEP status and restarting.
When an interrupt that releases the SLEEP status is generated, the oscillation circuit begins to oscillate.
When the oscillation starts, the CLK input to the CPU is masked by the peripheral circuit and the input to
the CPU begins after stabilization waiting time (several 10 msec–several msec) has elapsed. The CPU
samples the interrupt at the falling edge of the initially input CLK and starts the interrupt processing.
OSC
CLK
PK
PL
T1
T2 T3 T4
T1T2 T3 T4
PC
FETCH
DBS1/0
STOP
IRQ
pc
SLP
ANY
pc+1
02
Oscillation stable
waiting time
SLEEP status
Fig. 3.6.2.1 Sequence of the shift to SLEEP status and restarting
DUMMY
Interrupt processing
32EPSONS1C63000 CORE CPU MANUAL
CHAPTER 4: INSTRUCTION SET
CHAPTER 4INSTRUCTION SET
The S1C63000 offers high machine cycle efficiency and a high speed instruction set. It has 47 basic
instructions (412 instructions in all) that are designed as an instruction system permitting relocatable
programming.
This chapter explains about the addressing modes for memory management and about the details of each
instruction.
4.1Addressing Mode
The S1C63000 has the following 8 types of addressing modes and the address specifications corresponding to the various statuses are done concisely and accurately.
• Types of addressing modes
Basic addressing modes (5 types)
1) Immediate data addressing
2) Register direct addressing
3) Register indirect addressing
4) 6-bit absolute addressing
5) Signed 8-bit PC relative addressing
Extended addressing modes (3 types)
1) 16-bit immediate data addressing
2) 8-bit absolute addressing
3) Signed 16-bit PC relative addressing
4.1.1 Basic addressing modes
The basic addressing mode is an addressing function independent of the instruction.
• Immediate data addressing
The immediate data addressing is the addressing mode in which the immediate data is used for
operations and is used as transfer data. Values that are specified in the operand are directly used as
data or addresses. In the instruction list, the following symbols are used to write immediate data.
Table 4.1.1.1 Symbol and size of immediate data
Symbol
imm2
Specifying a bit No. in 4-bit data
imm4
4-bit general-purpose data
imm6
Specifying a software interrupt vector
imm8
8-bit general-purpose data
sign8
Signed 8-bit general-purpose data
n4
Specifying a radix
Examples:
CLR[addr6],imm2...Clears a bit specified with imm2 within a 4-bit data in an address [addr6]
LD%A,imm4...Loads a 4-bit data imm4 into the A register
INTimm6...A software interrupt of which the vector address is specified with imm6
LDB%BA,imm8...Loads an 8-bit data imm8 into the BA register
CALZ imm8...Calls a subroutine that starts from an address imm8
(Address specifiable range is 0000H to 00FFH.)
ADD%X,sign8...Adds a signed 8-bit data sign8 to the X register
ADC%B,%A,n4...Adds data in the A register to the B register with a radix n4 specification
Use
Size
2 bits
4 bits
6 bits
8 bits
8 bits
4 bits
Specifiable range
0–3
0–15
0–63
0–255
-128–127
1–16
S1C63000 CORE CPU MANUALEPSON33
CHAPTER 4: INSTRUCTION SET
• Register direct addressing
The register direct addressing is the addressing mode when specifying a register for the source and/
or destination. Register names should be written with % in front.
Instructions in which the operand has the following register name operate in this addressing mode.
ADD%A,%B...Adds the data in the B register to the A register
LDB%BA,%XL...Loads the data in the XL register into the BA register
DEC%SP1...Decrements the stack pointer SP1
JR%A...Jumps using the content of the A register as a relative address
JP%Y...Jumps to the address indicated with the Y register
• Register indirect addressing
The register indirect addressing is the addressing mode for accessing the data memory and it indirectly specifies the data memory address with the index register X or Y. To write the instructions,
place % in front of the index register name and enclose them with [ ].
Indirect addressing with the X register:Instructions which have [%X] or [%X]+ as the operand
Indirect addressing with the Y register:Instructions which have [%Y] or [%Y]+ as the operand
The content of the X register or Y register regarded as an address, and operations and transfers are
performed for the data stored in the address or the address.
"+" in the [%X]+ and [%Y]+ indicates a post-increment function. Instructions that have these operands
increment the content of the X register or Y register after executing the transfer or operation. This
function is useful to access a continuous addresses in the data memory.
Examples:
SUB%A,[%X]...Subtracts the content of a memory specified with the X register from the A
register
LD[%X]+,[%Y]+...Transfers the content of a memory specified with the Y register to a memory
specified with the X register. Then increments the contents of the X register
and Y register
• 6-bit absolute addressing
The 6-bit absolute addressing is the addressing mode for accessing within the 6-bit address range
from 0000H or FFC0H. Instructions that have [addr6] as the operand operate in this addressing mode.
The address range that can be specified with the addr6 is 0000H to 003FH or FFC0H to FFFFH.
(1) Instructions that access from 0000H to 003FH
For this area, the following instructions, which are used in this area as counters and flags, are
provided. An address within 0000H to 003FH is specified with the addr6.
INC[addr6]...Increments the content of a memory specified with the addr6
DEC[addr6]...Decrements the content of a memory specified with the addr6
CLR[addr6],imm2 ...
SET[addr6],imm2 ...Sets a bit specified with the imm2 in a memory specified with the addr6
TST[addr6],imm2 ...Tests a bit
In addition, the following branch instructions, which permit a conditional branch according to the
contents of this area, are provided.
JR[addr6]...PC relative jump instruction that uses the content of a memory specified
CALR [addr6]...PC relative call instruction that uses the content of a memory specified with
34EPSONS1C63000 CORE CPU MANUAL
Clears a bit specified with the imm2 in a memory specified with the addr6
specified with the imm2 in a memory specified with the addr6
with addr6 as a relative address
addr6 as a relative address
CHAPTER 4: INSTRUCTION SET
These instructions perform a PC relative branch using the content (4 bits) of a memory specified
with the [addr6] as a relative address. The branch destination address is [the address next to the
branch instruction] + [the contents (0 to 15) of the memory specified with the addr6].
(2) Instructions that access from FFC0H to FFFFH
This area is reserved for the I/O memory in the S1C63 Family and the following instructions are
provided to operate the control bits of the peripheral circuits.
An address within FFC0H to FFFFH is specified with the addr6. However the addr6 is handled as
0 to 3FH in the machine codes.
CLR[addr6],imm2 ...
SET[addr6],imm2 ...Sets a bit specified with the imm2 in a memory specified with the addr6
TST[addr6],imm2 ...
Write only or read only control bits may have been assigned depending on the peripheral circuit.
Pay attention when using the above-mentioned instructions for such bits or addresses containing
such bits.
Clears a bit specified with the imm2 in a memory specified with the addr6
Tests a bit specified with the imm2 in a memory specified with the addr6
• Signed 8-bit PC relative addressing
The signed 8-bit PC relative addressing is the addressing mode used for the branch instructions. The
signed 8-bit relative address (-128 to 127) that is specified in the operand is added to the address next
to the branch instruction to branch to that address.
The following instructions operate in this addressing mode.
Jump instructions:JRsign8
JRCsign8
JRNC sign8
JRZsign8
JRNZ sign8
Call instruction:CALR sign8
4.1.2 Extended addressing mode
In the S1C63000, when data is written to the EXT register (the E flag is set) and a specific instruction
follows, the data specified by that instruction is extended with the EXT register data (see Section 2.1.5).
When the E flag is set, instructions are extended in an addressing mode different from the mode that is
specified in each instruction. This is the extended addressing mode that will be explained below.
However, instructions that can operate in the extended addressing mode are limited to those indicated in
the instruction list, so check it when programming.
Further the extended addressing mode is effective only for the instruction following immediately after
writing data to the EXT register and setting the E flag to "1" (the E flag is reset to "0" by executing that
instruction). When using an instruction in the extended addressing mode, write data to be extended to
the EXT register or set the E flag (when the E register has already been set).
• 16-bit immediate data addressing
The addressing mode of the following instructions, which have an 8-bit immediate data as the
operand, change to the 16-bit immediate data addressing when the E flag is set to "1". Consequently, it
is possible to transfer and operate a 16-bit immediate data to the X or Y register.
Instructions that operate in the 16-bit immediate data addressing mode with the E flag
The data is extended into 16 bits in which the E register data is the high-order 8 bits and the immediate data specified with the above instruction is the low-order 8 bit.
S1C63000 CORE CPU MANUALEPSON35
CHAPTER 4: INSTRUCTION SET
Examples:
LDB%EXT,0x15
LDB%XL,0x7D...Works as "LD %X, 0157D"
LDB%EXT,0xB8
ADD%X,0x4F...Works as "ADD %X, 0xB84F"
LDB%EXT,0xE6
CMP%X,0xA2...Works as "CMP %X, 0x19A2"
∗ 19H = FFH - [EXT] (E6H)
Above examples use the X register, but they work the same even when the Y register is used.
Note: The CMP instruction performs a subtraction with a complement, therefore it is necessary to set the
complement (1’s complement) of the high-order 8-bit data in the EXT register.
EXT register
←
[FFH - High-order 8-bit data]
• 8-bit absolute addressing
The 8-bit absolute addressing is the addressing mode for accessing within the 8-bit address range
from 0000H or FF00H. To enter this mode, write the low-order 8 bits (00H to FFH) of the address to
the EXT register, then execute an indirect addressing instruction which has [%X] or [%Y] as the source
operand or the destination operand. When [%X] is used, the memory from 0000H to 00FFH can be
accessed, and when [%Y] is used, FF00H to FFFFH can be accessed.
Instructions that operate in the 8-bit absolute addressing mode with the E flag
∗ "r" indicates the A or B register. Instructions with an operand other than above or the post-incre-
ment function do not have the extended addressing function.
Examples:
LDB%EXT,0x37
LD%A,[%X]...Works as "LD %A, [0x0037]"
LDB%EXT,0x9C
ADD[%Y],5...Works as "ADD [0xFF9C]"
36EPSONS1C63000 CORE CPU MANUAL
CHAPTER 4: INSTRUCTION SET
• Signed 16-bit PC relative addressing
The addressing mode of the following branch instructions, which have an 8-bit relative address as the
operand, change to the signed 16-bit PC relative addressing with the E flag set to "1". Consequently, it
is possible to extend the branch range to the next address -32768 to +32767. (In this mode these
instructions can branch the entire 64K program memory.)
Instructions that operate in the signed 16-bit PC relative addressing mode with the E flag
LDB%EXT,0x3A
JR∗0x88...Works as "JR∗ 0x3A88" (∗ = C, NC, Z, or NZ)
LDB%EXT,0xF8
CALR 0x62...Works as "CALR 0xF862"
4.2Instruction List
4.2.1 Function classification
Table 4.2.1.1 lists the function classifications of the instructions.
Table 4.2.1.1 Instruction function classifications
Function classification
Arithmetic
Logic
Transfer
MnemonicOperation
ADD
ADC
SUB
SBC
CMP
INC
DEC
AND
OR
XOR
BIT
CLR
SET
TST
LD
LDB
EX
Addition
Addition with carry
Subtraction
Subtraction with carry
Comparison
Increment (adds 1)
Decrement (subtracts 1)
Logical product
Logical sum
Exclusive OR
Bit test
Bit clear
Bit set
Bit test
Load (4-bit data)
Load (8-bit data)
Exchange (4-bit data)
Function classification
Rotate / shift
Stack control
Branch
System control
MnemonicOperation
RL
RR
SLL
SRL
PUSH
POP
JR
JP
CALZ
CALR
RET
RETS
RETD
RETI
INT
NOP
HALT
SLP
Rotate to left with carry
Rotate to right with carry
Logical shift to left
Logical shift to right
Push
Pop
Relative jump
Indirect jump
Absolute call
Rrelative call
Return
Return and skip
Return and data set
Interrupt return
Software interrupt
No operation
Shift to HALT status
Shift to SLEEP status
S1C63000 CORE CPU MANUALEPSON37
CHAPTER 4: INSTRUCTION SET
4.2.2 Symbol meanings
The following indicates the meanings of the symbols used in the instruction list.
Register names
A........................... Data register A (4 bits)
B ........................... Data register B (4 bits)
BA ........................ BA register pair (8 bit s , t h e B regi s t e r i s t h e h i g h - o rder 4 b i t s )
X ........................... Index register X (16 bits)
XH........................ XH register (high-order 8 bits of the X register)
XL......................... XL register (low-order 8 bits of the X register)
Y ........................... Index register Y (16 bits)
YH........................ YH register (high-order 8 bits of the Y register)
YL......................... YL register (low-order 8 bits of the Y register)
F............................ Flag register F (4 bits)
SP1 ....................... Stack pointer SP1 (16 bits, however the setting data is 8 bits of D2 to D9)
SP2 ....................... Stack pointer SP2 (16 bits, however the setting data is 8 bits of D0 to D7)
PC ........................ Program counter PC (16 bits)
In the notation with mnemonics, the register names should be written with a % placed in front of them,
according to the S1C63 Family assembler source format.
%A ....................... A register
%B ........................ B register
%BA..................... BA register
%X........................ X registe r
%XH .................... XH regis t e r
%XL ..................... XL register
%Y........................ Y register
%YH .................... YH regis t e r
%YL ..................... YL register
%F ........................ F register
%EXT................... EXT register
%SP1.................... Stack pointer SP1
%SP2.................... Stack pointer SP2
Immediate data
imm2 ................... 2-bit immediate data (0 to 3)
imm4 ................... 4-bit immediate data (0 to 15)
imm6 ................... Software interrupt vector (0100H to 013FH)
imm8 ................... 8-bit immediate data ( 0 to 255)
i7–i0 ..................... Each bit in immX
n4 ......................... 4-bit radix specification data (1 to 16)
n3–n0 ................... Each bit in n4
sign8 .................... Signed 8-bit immediate data (-128 to 127)
s7–s0 .................... Each bit in sign8
addr6 ................... 6-bit address (00H to 3FH)
a5–a0.................... Each bit in addr6
00addr6 ............... addr6 which specifies an address within 0000H to 003FH
FFaddr6............... addr6 which specifies an address within FFC0H to FFFFH
38EPSONS1C63000 CORE CPU MANUAL
Memory
[%X], [X] ............. Memory where the X register specifies
[%Y], [Y] ............. Memory where the Y register specifies
[00addr6] ............ Memory within 0000H to 003FH where the addr6 specifies
[FFaddr6] ............ Memory within FFC0H to FFFFH where the addr6 specifies
[%SP1], [SP1]...... 16-bit address stack where the SP1 specifies
[%SP2], [SP2]...... 4-bit data stack where the SP2 specifies
Flags
Z ........................... Zero flag
C ...........................Carry fl a g
I ............................ In t e r rup t f l a g
E ...........................Extension flag
↑ ...........................Flag is set
↓ ...........................Flag is reset
↕ ............................Flag is set or reset
–............................Flag is not changed
Operations and others
+ ...........................Addition
- ............................ Subtraction
∧ ...........................Logical product
∨ ...........................Logical sum
∀...........................Exclusive OR
←..........................Data load
↔..........................Data exchange
CHAPTER 4: INSTRUCTION SET
Extended addressing mode (EXT.mode)
●● ..........................Can be u se d
×............................Cannot be used (prohibit use)
A ← A
A ← B
A ← F
A ← imm4
A ← [X]
A ← [X], X ← X+1
A ← [Y]
A ← [Y], Y ← Y+1
B ← A
B ← B
B ← imm4
B ← [X]
B ← [X], X ← X+1
B ← [Y]
B ← [Y], Y ← Y+1
F ← A
F ← imm4
[X] ← A
[X] ← B
[X] ← imm4
[X] ← [Y]
[X] ← [Y], Y ← Y+1
[X] ← A, X ← X+1
[X] ← B, X ← X+1
[X] ← imm4, X ← X+1
[X] ← [Y], X ← X+1
[X] ← [Y], X ← X+1, Y ← Y+1
[Y] ← A
[Y] ← B
[Y] ← imm4
[Y] ← [X]
[Y] ← [X], X ← X+1
[Y] ← A, Y ← Y+1
[Y] ← B, Y ← Y+1
[Y] ← imm4, Y ← Y+1
[Y] ← [X], Y ← Y+1
[Y] ← [X], Y ← Y+1, X ← X+1
A ↔ B
A ↔ [X]
A ↔ [X], X ← X+1
A ↔ [Y]
A ↔ [Y], Y ← Y+1
B ↔ [X]
B ↔ [X], X ← X+1
B ↔ [Y]
B ↔ [Y], Y ← Y+1
A ← A+A
A ← A+B
A ← A+imm4
A ← A+[X]
A ← A+[X], X ← X+1
A ← A+[Y]
A ← A+[Y], Y ← Y+1
B ← B+A
B ← B+B
B ← B+imm4
B ← B+[X]
B ← B+[X], X ← X+1
B ← B+[Y]
B ← B+[Y], Y ← Y+1
[X] ← [X]+A
[X] ← [X]+B
[X] ← [X]+imm4
[X] ← [X]+A, X ← X+1
[X] ← [X]+B, X ← X+1
[X] ← [X]+imm4, X ← X+1
[Y] ← [Y]+A
[Y] ← [Y]+B
[Y] ← [Y]+imm4
[Y] ← [Y]+A, Y ← Y+1
[Y] ← [Y]+B, Y ← Y+1
[Y] ← [Y]+imm4, Y ← Y+1
A ← A+A+C
A ← A+B+C
A ← A+imm4+C
A ← A+[X]+C
A ← A+[X]+C, X ← X+1
A ← A+[Y]+C
A ← A+[Y]+C, Y ← Y+1
B ← B+A+C
B ← B+B+C
B ← B+imm4+C
B ← B+[X]+C
B ← B+[X]+C, X ← X+1
B ← B+[Y]+C
B ← B+[Y]+C, Y ← Y+1
[X] ← [X]+A+C
[X] ← [X]+B+C
[X] ← [X]+imm4+C
[X] ← [X]+A+C, X ← X+1
[X] ← [X]+B+C, X ← X+1
[X] ← [X]+imm4+C, X ← X+1
[Y] ← [Y]+A+C
[Y] ← [Y]+B+C
[Y] ← [Y]+imm4+C
[Y] ← [Y]+A+C, Y ← Y+1
[Y] ← [Y]+B+C, Y ← Y+1
[Y] ← [Y]+imm4+C, Y ← Y+1
A ← A-A
A ← A-B
A ← A-imm4
A ← A-[X]
A ← A-[X], X ← X+1
A ← A-[Y]
A ← A-[Y], Y ← Y+1
B ← B-A
B ← B-B
B ← B-imm4
B ← B-[X]
B ← B-[X], X ← X+1
B ← B-[Y]
B ← B-[Y], Y ← Y+1
[X] ← [X]-A
[X] ← [X]-B
[X] ← [X]-imm4
[X] ← [X]-A, X ← X+1
[X] ← [X]-B, X ← X+1
[X] ← [X]-imm4, X ← X+1
[Y] ← [Y]-A
[Y] ← [Y]-B
[Y] ← [Y]-imm4
[Y] ← [Y]-A, Y ← Y+1
[Y] ← [Y]-B, Y ← Y+1
[Y] ← [Y]-imm4, Y ← Y+1
A ← A-A-C
A ← A-B-C
A ← A-imm4-C
A ← A-[X]-C
A ← A-[X]-C, X ← X+1
A ← A-[Y]-C
A ← A-[Y]-C, Y ← Y+1
B ← B-A-C
B ← B-B-C
B ← B-imm4-C
B ← B-[X]-C
B ← B-[X]-C, X ← X+1
B ← B-[Y]-C
B ← B-[Y]-C, Y ← Y+1
[X] ← [X]-A-C
[X] ← [X]-B-C
[X] ← [X]-imm4-C
[X] ← [X]-A-C, X ← X+1
[X] ← [X]-B-C, X ← X+1
[X] ← [X]-imm4-C, X ← X+1
[Y] ← [Y]-A-C
[Y] ← [Y]-B-C
[Y] ← [Y]-imm4-C
[Y] ← [Y]-A-C, Y ← Y+1
[Y] ← [Y]-B-C, Y ← Y+1
[Y] ← [Y]-imm4-C, Y ← Y+1
A-A
A-B
A-imm4
A-[X]
A-[X], X ← X+1
A-[Y]
A-[Y], Y ← Y+1
B-A
B-B
B-imm4
B-[X]
B-[X], X ← X+1
B-[Y]
B-[Y], Y ← Y+1
[X]-A
[X]-B
[X]-imm4
[X]-A, X ← X+1
[X]-B, X ← X+1
[X]-imm4, X ← X+1
[Y]-A
[Y]-B
[Y]-imm4
[Y]-A, Y ← Y+1
[Y]-B, Y ← Y+1
[Y]-imm4, Y ← Y+1
[00addr6] ← [00addr6]+1
[00addr6] ← [00addr6]-1
B ← N's adjust (B+A+C)
B ← N's adjust (B+[X]+C)
B ← N's adjust (B+[X]+C), X ← X+1
B ← N's adjust (B+[Y]+C)
B ← N's adjust (B+[Y]+C), Y ← Y+1
[X] ← N's adjust ([X]+B+C)
[X] ← N's adjust ([X]+0+C)
[X] ← N's adjust ([X]+B+C), X ← X+1
[X] ← N's adjust ([X]+0+C), X ← X+1
[Y] ← N's adjust ([Y]+B+C)
[Y] ← N's adjust ([Y]+0+C)
[Y] ← N's adjust ([Y]+B+C), Y ← Y+1
[Y] ← N's adjust ([Y]+0+C), Y ← Y+1
B ← N's adjust (B-A-C)
B ← N's adjust (B-[X]-C)
B ← N's adjust (B-[X]-C), X ← X+1
B ← N's adjust (B-[Y]-C)
B ← N's adjust (B-[Y]-C), Y ← Y+1
[X] ← N's adjust ([X]-B-C)
[X] ← N's adjust ([X]-0-C)
[X] ← N's adjust ([X]-B-C), X ← X+1
[X] ← N's adjust ([X]-0-C), X ← X+1
[Y] ← N's adjust ([Y]-B-C)
[Y] ← N's adjust ([Y]-0-C)
[Y] ← N's adjust ([Y]-B-C), Y ← Y+1
[Y] ← N's adjust ([Y]-0-C), Y ← Y+1
[X] ← N's adjust ([X]+1)
[X] ← N's adjust ([X]+1), X ← X+1
[Y] ← N's adjust ([Y]+1)
[Y] ← N's adjust ([Y]+1), Y ← Y+1
[X] ← N's adjust ([X]-1)
[X] ← N's adjust ([X]-1), X ← X+1
[Y] ← N's adjust ([Y]-1)
[Y] ← N's adjust ([Y]-1), Y ← Y+1
In the ADC and INC instructions, the assembler converts the "n4" into a complement, and places it at the low-order 4 bits in
the machine code.
In the SBC and DEC instructions, the "n4" is placed as it is at the low-order 4 bits in the machine code.
(However, when 16 is specified to n4, the machine code is generated with 0000H as the low-order 4 bits.)
A ← A∀A
A ← A∀B
A ← A∀imm4
A ← A∀[X]
A ← A∀[X], X ← X+1
A ← A∀[Y]
A ← A∀[Y], Y ← Y+1
B ← B∀A
B ← B∀B
B ← B∀imm4
B ← B∀[X]
B ← B∀[X], X ← X+1
B ← B∀[Y]
B ← B∀[Y], Y ← Y+1
F ← F∀imm4
[X] ← [X]∀A
[X] ← [X]∀B
[X] ← [X]∀imm4
[X] ← [X]∀A, X ← X+1
[X] ← [X]∀B, X ← X+1
[X] ← [X]∀imm4, X ← X+1
[Y] ← [Y]∀A
[Y] ← [Y]∀B
[Y] ← [Y]∀imm4
[Y] ← [Y]∀A, Y ← Y+1
[Y] ← [Y]∀B, Y ← Y+1
[Y] ← [Y]∀imm4, Y ← Y+1
A (C←D3←D2←D1←D0←0)
B (C←D3←D2←D1←D0←0)
[X] (C←D3←D2←D1←D0←0)
[X] (C←D3←D2←D1←D0←0), X ← X+1
[Y] (C←D3←D2←D1←D0←0)
[Y] (C←D3←D2←D1←D0←0), Y ← Y+1
A (0→D3→D2→D1→D0→C)
B (0→D3→D2→D1→D0→C)
[X] (0→D3→D2→D1→D0→C)
[X] (0→D3→D2→D1→D0→C), X ← X+1
[Y] (0→D3→D2→D1→D0→C)
[Y] (0→D3→D2→D1→D0→C), Y ← Y+1
A (C←D3←D2←D1←D0←C)
B (C←D3←D2←D1←D0←C)
[X] (C←D3←D2←D1←D0←C)
[X] (C←D3←D2←D1←D0←C), X ← X+1
[Y] (C←D3←D2←D1←D0←C)
[Y] (C←D3←D2←D1←D0←C), Y ← Y+1
A (C→D3→D2→D1→D0→C)
B (C→D3→D2→D1→D0→C)
[X] (C→D3→D2→D1→D0→C)
[X] (C→D3→D2→D1→D0→C), X ← X+1
[Y] (C→D3→D2→D1→D0→C)
[Y] (C→D3→D2→D1→D0→C), Y ← Y+1
BA ← XL
BA ← XH
BA ← YL
BA ← YH
BA ← EXT
BA ← SP1
BA ← SP2
BA ← imm8
A ← [X], B ← [X+1], X ← X+2
A ← [Y], B ← [Y+1], Y ← Y+2
XL ← BA
XL ← imm8
XH ← BA
YL ← BA
YL ← imm8
YH ← BA
EXT ← BA
EXT ← imm8
SP1 ← BA
SP2 ← BA
[X] ← A, [X+1] ← B, X ← X+2
[X] ← i3~0, [X+1] ← i7~4, X ← X+2
[Y] ← A, [Y+1] ← B, Y ← Y+2
X ← X+BA
X ← X+sign8 (sign8=-128~127)
Y ← Y+BA
Y ← Y+sign8 (sign8=-128~127)
X-imm8 (imm8=0~255)
Y-imm8 (imm8=0~255)
SP1 ← SP1+1
SP2 ← SP2+1
SP1 ← SP1-1
SP2 ← SP2-1
[SP2-1] ← A, SP2 ← SP2-1
[SP2-1] ← B, SP2 ← SP2-1
[SP2-1] ← F, SP2 ← SP2-1
([(SP1-1)∗4+3]~[(SP1-1)∗4]) ← X, SP1 ← SP1-1
([(SP1-1)∗4+3]~[(SP1-1)∗4]) ← Y, SP1 ← SP1-1
A ← [SP2], SP2 ← SP2+1
B ← [SP2], SP2 ← SP2+1
F ← [SP2], SP2 ← SP2+1
X ← ([SP1∗4+3]~[SP1∗4]), SP1 ← SP1+1
Y ← ([SP1∗4+3]~[SP1∗4]), SP1 ← SP1+1
OperationCyclePage
PC ← PC+sign8+1 (sign8=-128~127)
PC ← PC+A+1
PC ← PC+BA+1
PC ← PC+[00addr6]+1
If C=1 then PC ← PC+sign8+1 (sign8=-128~127)
If C=0 then PC ← PC+sign8+1 (sign8=-128~127)
If Z=1 then PC ← PC+sign8+1 (sign8=-128~127)
If Z=0 then PC ← PC+sign8+1 (sign8=-128~127)
PC ← Y
([(SP1-1)∗4+3]~[(SP1-1)∗4]) ← PC+1,
SP1 ← SP1-1, PC ← imm8
([(SP1-1)∗4+3]~[(SP1-1)∗4]) ← PC+1,
SP1 ← SP1-1, PC ← PC+sign8+1
([(SP1-1)∗4+3]~[(SP1-1)∗4]) ← PC+1,
SP1 ← SP1-1, PC ← PC+[00addr6]+1
[SP2-1] ← F, SP2 ← SP2-1
([(SP1-1)∗4+3]~[(SP1-1)∗4]) ← PC+1,
SP1 ← SP1-1, PC ← imm6 (imm6=0100H~013FH)
PC ← ([SP1∗4+3]~[SP1∗4]), SP1 ← SP1+1
PC ← ([SP1∗4+3]~[SP1∗4]), SP1 ← SP1+1
PC ← PC+1
PC ← ([SP1∗4+3]~[SP1∗4]), SP1 ← SP1+1
[X] ← i3~0, [X+1] ← i7~4, X ← X+2
PC ← ([SP1∗4+3]~[SP1∗4]), SP1 ← SP1+1
F ← [SP2], SP2 ← SP2+1
Note: • The extended addressing (combined with the E flag) is available only for the instructions indi-
cated with
●●
in the EXT. mode row. Operation of other instructions (indicated with ×) cannot be
guaranteed, therefore do not write data to the EXT register or do not set the E flag immediately
before those instructions.
• X in the machine code row indicates that the bit is valid even though it is "0" or "1", but the
assembler generates it as "0". When entering the code directly, such as for debugging, "0"
should be entered.
A ← A+A+C
A ← A+B+C
A ← A+imm4+C
A ← A+[X]+C
A ← A+[X]+C, X ← X+1
A ← A+[Y]+C
A ← A+[Y]+C, Y ← Y+1
B ← B+A+C
B ← N's adjust (B+A+C)
B ← B+B+C
B ← B+imm4+C
B ← B+[X]+C
B ← N's adjust (B+[X]+C)
B ← B+[X]+C, X ← X+1
B ← N's adjust (B+[X]+C), X ← X+1
B ← B+[Y]+C
B ← N's adjust (B+[Y]+C)
B ← B+[Y]+C, Y ← Y+1
B ← N's adjust (B+[Y]+C), Y ← Y+1
[X] ← [X]+A+C
[X] ← [X]+B+C
[X] ← N's adjust ([X]+B+C)
[X] ← [X]+imm4+C
[X] ← N's adjust ([X]+0+C)
[X] ← [X]+A+C, X ← X+1
[X] ← [X]+B+C, X ← X+1
[X] ← N's adjust ([X]+B+C), X ← X+1
[X] ← [X]+imm4+C, X ← X+1
[X] ← N's adjust ([X]+0+C), X ← X+1
[Y] ← [Y]+A+C
[Y] ← [Y]+B+C
[Y] ← N's adjust ([Y]+B+C)
[Y] ← [Y]+imm4+C
[Y] ← N's adjust ([Y]+0+C)
[Y] ← [Y]+A+C, Y ← Y+1
[Y] ← [Y]+B+C, Y ← Y+1
[Y] ← N's adjust ([Y]+B+C), Y ← Y+1
[Y] ← [Y]+imm4+C, Y ← Y+1
[Y] ← N's adjust ([Y]+0+C), Y ← Y+1
A ← A+A
A ← A+B
A ← A+imm4
A ← A+[X]
A ← A+[X], X ← X+1
A ← A+[Y]
A ← A+[Y], Y ← Y+1
B ← B+A
B ← B+B
B ← B+imm4
B ← B+[X]
B ← B+[X], X ← X+1
B ← B+[Y]
B ← B+[Y], Y ← Y+1
X ← X+BA
X ← X+sign8 (sign8=-128~127)
Y ← Y+BA
Y ← Y+sign8 (sign8=-128~127)
[X] ← [X]+A
[X] ← [X]+B
[X] ← [X]+imm4
[X] ← [X]+A, X ← X+1
[X] ← [X]+B, X ← X+1
[X] ← [X]+imm4, X ← X+1
[Y] ← [Y]+A
[Y] ← [Y]+B
[Y] ← [Y]+imm4
[Y] ← [Y]+A, Y ← Y+1
[Y] ← [Y]+B, Y ← Y+1
[Y] ← [Y]+imm4, Y ← Y+1
∧
A
A ← A
∧
B
A ← A
∧
imm4
A ← A
∧
[X]
A ← A
∧
[X], X ← X+1
A ← A
∧
[Y]
A ← A
∧
[Y], Y ← Y+1
A ← A
∧
A
B ← B
∧
B
B ← B
∧
imm4
B ← B
∧
[X]
B ← B
∧
[X], X ← X+1
B ← B
∧
[Y]
B ← B
∧
[Y], Y ← Y+1
B ← B
∧
imm4
F ← F
∧
[X] ← [X]
[X] ← [X]
[X] ← [X]
[X] ← [X]
[X] ← [X]
[X] ← [X]
[Y] ← [Y]
[Y] ← [Y]
[Y] ← [Y]
[Y] ← [Y]
[Y] ← [Y]
[Y] ← [Y]
A
A
A
A
A
A
A
B
B
B
B
B
B
B
[X]
[X]
[X]
[X]
[X]
[X]
[Y]
[Y]
[X] ← N's adjust ([X]+1)
[X] ← N's adjust ([X]+1), X ← X+1
[Y] ← N's adjust ([Y]+1)
[Y] ← N's adjust ([Y]+1), Y ← Y+1
[00addr6] ← [00addr6]+1
[SP2-1] ← F, SP2 ← SP2-1
([(SP1-1)∗4+3]~[(SP1-1)∗4]) ← PC+1,
SP1 ← SP1-1, PC ← imm6 (imm6=0100H~013FH)
PC ← Y
PC ← PC+A+1
PC ← PC+BA+1
PC ← PC+sign8+1 (sign8=-128~127)
PC ← PC+[00addr6]+1
If C=1 then PC ← PC+sign8+1 (sign8=-128~127)
If C=0 then PC ← PC+sign8+1 (sign8=-128~127)
If Z=0 then PC ← PC+sign8+1 (sign8=-128~127)
If Z=1 then PC ← PC+sign8+1 (sign8=-128~127)
A ← A
A ← B
A ← F
A ← imm4
A ← [X]
A ← [X], X ← X+1
A ← [Y]
A ← [Y], Y ← Y+1
B ← A
B ← B
B ← imm4
B ← [X]
B ← [X], X ← X+1
B ← [Y]
B ← [Y], Y ← Y+1
F ← A
F ← imm4
[X] ← A
[X] ← B
[X] ← imm4
[X] ← [Y]
[X] ← [Y], Y ← Y+1
[X] ← A, X ← X+1
[X] ← B, X ← X+1
[X] ← imm4, X ← X+1
[X] ← [Y], X ← X+1
[X] ← [Y], X ← X+1, Y ← Y+1
[Y] ← A
[Y] ← B
[Y] ← imm4
[Y] ← [X]
[Y] ← [X], X ← X+1
[Y] ← A, Y ← Y+1
[Y] ← B, Y ← Y+1
[Y] ← imm4, Y ← Y+1
[Y] ← [X], Y ← Y+1
[Y] ← [X], Y ← Y+1, X ← X+1
BA ← EXT
BA ← SP1
BA ← SP2
BA ← XH
BA ← XL
BA ← YH
BA ← YL
BA ← imm8
A ← [X], B ← [X+1], X ← X+2
A ← [Y], B ← [Y+1], Y ← Y+2
EXT ← BA
EXT ← imm8
SP1 ← BA
SP2 ← BA
XH ← BA
XL ← BA
XL ← imm8
YH ← BA
YL ← BA
YL ← imm8
[X] ← A, [X+1] ← B, X ← X+2
[X] ← i3~0, [X+1] ← i7~4, X ← X+2
[Y] ← A, [Y+1] ← B, Y ← Y+2
No operation (PC ← PC+1)
[X] (C←D3←D2←D1←D0←0)
[X] (C←D3←D2←D1←D0←0), X ← X+1
[Y] (C←D3←D2←D1←D0←0)
[Y] (C←D3←D2←D1←D0←0), Y ← Y+1
Sleep
A (0→D3→D2→D1→D0→C)
B (0→D3→D2→D1→D0→C)
[X] (0→D3→D2→D1→D0→C)
[X] (0→D3→D2→D1→D0→C), X ← X+1
[Y] (0→D3→D2→D1→D0→C)
[Y] (0→D3→D2→D1→D0→C), Y ← Y+1
A ← A-A
A ← A-B
A ← A-imm4
A ← A-[X]
A ← A-[X], X ← X+1
A ← A-[Y]
A ← A-[Y], Y ← Y+1
B ← B-A
B ← B-B
B ← B-imm4
B ← B-[X]
B ← B-[X], X ← X+1
B ← B-[Y]
B ← B-[Y], Y ← Y+1
[X] ← [X]-A
[X] ← [X]-B
[X] ← [X]-imm4
[X] ← [X]-A, X ← X+1
[X] ← [X]-B, X ← X+1
[X] ← [X]-imm4, X ← X+1
[Y] ← [Y]-A
[Y] ← [Y]-B
[Y] ← [Y]-imm4
[Y] ← [Y]-A, Y ← Y+1
[Y] ← [Y]-B, Y ← Y+1
[Y] ← [Y]-imm4, Y ← Y+1
[00addr6]
[FFaddr6]
A ← A∀A
A ← A∀B
A ← A∀imm4
A ← A∀[X]
A ← A∀[X], X ← X+1
A ← A∀[Y]
A ← A∀[Y], Y ← Y+1
B ← B∀A
B ← B∀B
B ← B∀imm4
B ← B∀[X]
B ← B∀[X], X ← X+1
B ← B∀[Y]
B ← B∀[Y], Y ← Y+1
F ← F∀imm4
[X] ← [X]∀A
[X] ← [X]∀B
[X] ← [X]∀imm4
[X] ← [X]∀A, X ← X+1
[X] ← [X]∀B, X ← X+1
[X] ← [X]∀imm4, X ← X+1
[Y] ← [Y]∀A
[Y] ← [Y]∀B
[Y] ← [Y]∀imm4
[Y] ← [Y]∀A, Y ← Y+1
[Y] ← [Y]∀B, Y ← Y+1
[Y] ← [Y]∀imm4, Y ← Y+1
LDB %EXT,imm8
ADC %r,[%Y]r ← r + [FFimm8] + C (FFimm8 = FF00H + 00H to FFH)
ADC %r,[%ir]+Add with carry location [ir reg.] to r reg. and increment ir reg.1 cycle
Function: r ← r + [ir] + C, ir ← ir + 1
Adds the content of the data memory addressed by the ir register (X or Y) and carry (C) to the r
register (A or B). Then increments the ir register (X or Y). The flags change due to the operation
result of the r register and the increment result of the ir register does not affect the flags.
LDB %EXT,imm8
ADC [%Y],%r[FFimm8] ← [FFimm8] + r + C (FFimm8 = FF00H + 00H to FFH)
ADC [%ir]+,%rAdd with carry r reg. to location [ir reg.] and increment ir reg.2 cycles
Function: [ir] ← [ir] + r + C, ir ← ir + 1
Adds the content of the r register (A or B) and carry (C) to the data memory addressed by the ir
register (X or Y). Then increments the ir register (X or Y). The flags change due to the operation
result of the data memory and the increment result of the ir register does not affect the flags.
LDB %EXT,imm8
ADC [%Y],imm4[FFimm8] ← [FFimm8] + imm4 + C (FFimm8 = FF00H + 00H to FFH)
Add with carry immediate data imm4 to location [ir reg.]2 cycles
ADC [%ir]+,imm4
Function: [ir] ← [ir] + imm4 + C, ir ← ir + 1
Adds the immediate data imm4 and carry (C) to the data memory addressed by the ir register
(X or Y). Then increments the ir register (X or Y). The flags change due to the operation result
of the data memory and the increment result of the ir register does not affect the flags.
Add with carry immediate data imm4 to location [ir reg.] and increment ir reg. 2 cycles
64EPSONS1C63000 CORE CPU MANUAL
CHAPTER 4: INSTRUCTION SET
ADC %B,%A,n4Add with carry A reg. to B reg. in specified radix2 cycles
Function: B ← N's adjust (B + A + C)
Adds the content of the A register and carry (C) to the B register. The operation result is
adjusted with n4 as the radix. The C flag is set by a carry according to the radix.
Code:
Flags:EICZ
Mode:Src: Register direct
Note:n4 should be specified with a value from 1 to 16.
MnemonicMSBLSB
ADC %B,%A,n4100001101 [10H-n4]10D0H–10DFH
↓–↕↕
Dst: Register direct
Extended addressing: Invalid
ADC %B,[%ir],n4Add with carry location [ir reg.] to B reg. in specified radix2 cycles
Function: B ← N's adjust (B + [ir] + C)
Adds the content of the data memory addressed by the ir register (X or Y) and carry (C) to the
B register. The operation result is adjusted with n4 as the radix. The C flag is set by a carry
according to the radix.
Code:
Flags:EICZ
Mode:Src: Register indirect
Extended LDB%EXT,imm8
operation: ADC %B,[%X],n4B ← N’s adjust (B + [00imm8] + C) (00imm8 = 0000H + 00H to FFH)
Note:n4 should be specified with a value from 1 to 16.
LDB %EXT,imm8
ADC %B,[%Y],n4B ← N’s adjust (B + [FFimm8] + C) (FFimm8 = FF00H + 00H to FFH)
CHAPTER 4: INSTRUCTION SET
ADC %B,[%ir]+,n4
Function: B ← N's adjust (B + [ir] + C), ir ← ir + 1
Adds the content of the data memory addressed by the ir register (X or Y) and carry (C) to the
B register. The operation result is adjusted with n4 as the radix. Then increments the ir register
(X or Y). The flags change due to the operation result of the B register and the increment result
of the ir register does not affect the flags. The C flag is set by a carry according to the radix.
Code:
Flags:EICZ
Mode:Src: Register indirect
Note:n4 should be specified with a value from 1 to 16.
Add with carry location [ir reg.] to B reg. in specified radix and increment ir reg. 2 cycles
ADC [%ir],%B,n4Add with carry B reg. to location [ir reg.] in specified radix2 cycles
Function: [ir] ← N's adjust ([ir] + B + C)
Adds the content of the B register and carry (C) to the data memory addressed by the ir
register (X or Y). The operation result is adjusted with n4 as the radix. The C flag is set by a
carry according to the radix.
Code:
Flags:EICZ
Mode:Src: Register direct
Extended LDB%EXT,imm8
operation: ADC [%X],%B,n4[00imm8] ← N’s adjust ([00imm8] + B + C)
Note:n4 should be specified with a value from 1 to 16.
LDB %EXT,imm8
ADC [%Y],%B,n4[FFimm8] ← N’s adjust ([FFimm8] + B + C)
(FFimm8 = FF00H + 00H to FFH)
66EPSONS1C63000 CORE CPU MANUAL
CHAPTER 4: INSTRUCTION SET
ADC [%ir]+,%B,n4
Function: [ir] ← N's adjust ([ir] + B + C), ir ← ir + 1
Adds the content of the B register and carry (C) to the data memory addressed by the ir
register (X or Y). The operation result is adjusted with n4 as the radix. Then increments the ir
register (X or Y). The flags change due to the operation result of the data memory and the
increment result of the ir register does not affect the flags. The C flag is set by a carry according
to the radix.
Code:
Flags:EICZ
Mode:Src: Register direct
Note:n4 should be specified with a value from 1 to 16.
Add with carry B reg. to location [ir reg.] in specified radix and increment ir reg. 2 cycles
ADC [%ir],0,n4Add carry to location [ir reg.] in specified radix2 cycles
Function: [ir] ← N's adjust ([ir] + 0 + C)
Adds the carry (C) to the data memory addressed by the ir register (X or Y). The operation
result is adjusted with n4 as the radix. The C flag is set by a carry according to the radix. This
instruction is useful for a carry processing to the highest digit of n based counters.
Function: [ir] ← N's adjust ([ir] + 0 + C), ir ← ir + 1
Adds the carry (C) to the data memory addressed by the ir register (X or Y). The operation
result is adjusted with n4 as the radix. Then increments the ir register (X or Y). The flags
change due to the operation result of the data memory and the increment result of the ir
register does not affect the flags. The C flag is set by a carry according to the radix. This
instruction is useful for a carry processing of n based counters.
Code:
Flags:EICZ
Mode:Src: Register direct
Note:n4 should be specified with a value from 1 to 16.
LDB %EXT,imm8
ADD %r,[%Y]r ← r + [FFimm8] (FFimm8 = FF00H + 00H to FFH)
S1C63000 CORE CPU MANUALEPSON69
CHAPTER 4: INSTRUCTION SET
ADD %r,[%ir]+Add location [ir reg.] to r reg. and increment ir reg.1 cycle
Function: r ← r + [ir], ir ← ir + 1
Adds the content of the data memory addressed by the ir register (X or Y) to the r register (A or
B). Then increments the ir register (X or Y). The flags change due to the operation result of the r
register and the increment result of the ir register does not affect the flags.
LDB %EXT,imm8
ADD [%Y],%r[FFimm8] ← [FFimm8] + r (FFimm8 = FF00H + 00H to FFH)
CHAPTER 4: INSTRUCTION SET
ADD [%ir]+,%rAdd r reg. to location [ir reg.] and increment ir reg.2 cycles
Function: [ir] ← [ir] + r, ir ← ir + 1
Adds the content of the r register (A or B) to the data memory addressed by the ir register (X or
Y). Then increments the ir register (X or Y). The flags change due to the operation result of the
data memory and the increment result of the ir register does not affect the flags.
Adds the 4-bit immediate data imm4 to the data memory addressed by the ir register (X or Y).
Then increments the ir register (X or Y). The flags change due to the operation result of the data
memory and the increment result of the ir register does not affect the flags.
ADD %ir,sign8Add immediate data sign8 to ir reg.1 cycle
Function: ir ← ir + sign8
Adds the signed 8-bit immediate data sign8 (-128 to 127) to the ir register (X or Y). This instruction does not affect the C flag regardless of the operation result.
AND %r,%r'Logical AND of r' reg. and r reg.1 cycle
Function: r ← r ∧ r'
Performs a logical AND operation of the content of the r' register (A or B) and the content of
the r register (A or B), and stores the result in the r register.
Code:
Flags:EICZ
Mode:Src: Register direct
S1C63000 CORE CPU MANUALEPSON73
MnemonicMSBLSB
AND %A,%A110100111000X1A70H, (1A71H)
AND %A,%B110100111001X1A72H, (1A73H)
AND %B,%A110100111010X1A74H, (1A75H)
AND %B,%B110100111011X1A76H, (1A77H)
↓––↕
Dst: Register direct
Extended addressing: Invalid
CHAPTER 4: INSTRUCTION SET
AND %r,imm4Logical AND of immediate data imm4 and r reg.1 cycle
Function: r ← r ∧ imm4
Performs a logical AND operation of the 4-bit immediate data imm4 and the content of the r
register (A or B), and stores the result in the r register.
Code:
Flags:EICZ
Mode:Src: Immediate data
MnemonicMSBLSB
AND %A,imm4110100100i3i2i1i01A40H–1A4FH
AND %B,imm4110100101i3i2i1i01A50H–1A5FH
↓––↕
Dst: Register direct
Extended addressing: Invalid
AND %F,imm4Logical AND of immediate data imm4 and F reg.1 cycle
Function: F ← F ∧ imm4
Performs a logical AND operation of the 4-bit immediate data imm4 and the content of the F
(flag) register, and stores the result in the r register. It is possible to reset any flag.
Code:
Flags:EICZ
Mode:Src: Immediate data
74EPSONS1C63000 CORE CPU MANUAL
MnemonicMSBLSB
AND %F,imm4100001000i3i2i1i01080H–108FH
↓↓↓↓
Dst: Register direct
Extended addressing: Invalid
CHAPTER 4: INSTRUCTION SET
AND %r,[%ir]
Function: r ← r ∧ [ir]
Performs a logical AND operation of the content of the data memory addressed by the ir
register (X or Y) and the content of the r register (A or B), and stores the result in the r register.
Code:
Flags:EICZ
Mode:Src: Register indirect
Extended LDB%EXT,imm8
operation: AND %r,[%X]r ← r ∧ [00imm8] (00imm8 = 0000H + 00H to FFH)
MnemonicMSBLSB
AND %A,[%X]11010011000001A60H
AND %A,[%Y]11010011000101A62H
AND %B,[%X]11010011001001A64H
AND %B,[%Y]11010011001101A66H
↓––↕
Dst: Register direct
Extended addressing: Valid
LDB %EXT,imm8
AND %r,[%Y]r ← r ∧ [FFimm8] (FFimm8 = FF00H + 00H to FFH)
Logical AND of location [ir reg.] and r reg.1 cycle
AND %r,[%ir]+Logical AND of location [ir reg.] and r reg. and increment ir reg.1 cycle
Function: r ← r ∧ [ir], ir ← ir + 1
Performs a logical AND operation of the content of the data memory addressed by the ir
register (X or Y) and the content of the r register (A or B), and stores the result in the r register.
Then increments the ir register (X or Y). The flags change due to the operation result of the r
register and the increment result of the ir register does not affect the flags.
Code:
Flags:EICZ
Mode:Src: Register indirect
MnemonicMSBLSB
AND %A,[%X]+11010011000011A61H
AND %A,[%Y]+11010011000111A63H
AND %B,[%X]+11010011001011A65H
AND %B,[%Y]+11010011001111A67H
↓––↕
Dst: Register direct
Extended addressing: Invalid
S1C63000 CORE CPU MANUALEPSON75
CHAPTER 4: INSTRUCTION SET
AND [%ir],%rLogical AND of r reg. and location [ir reg.]2 cycles
Function: [ir] ← [ir] ∧ r
Performs a logical AND operation of the content of the r register (A or B) and the content of the
data memory addressed by the ir register (X or Y), and stores the result in that address.
Code:
Flags:EICZ
Mode:Src: Register direct
Extended LDB%EXT,imm8
operation: AND [%X],%r[00imm8] ← [00imm8] ∧ r (00imm8 = 0000H + 00H to FFH)
MnemonicMSBLSB
AND [%X],%A11010011010001A68H
AND [%X],%B11010011011001A6CH
AND [%Y],%A11010011010101A6AH
AND [%Y],%B11010011011101A6EH
↓––↕
Dst: Register indirect
Extended addressing: Valid
LDB %EXT,imm8
AND [%Y],%r[FFimm8] ← [FFimm8] ∧ r (FFimm8 = FF00H + 00H to FFH)
AND [%ir]+,%rLogical AND of r reg. and location [ir reg.] and increment ir reg. 2 cycles
Function: [ir] ← [ir] ∧ r, ir ← ir + 1
Performs a logical AND operation of the content of the r register (A or B) and the content of the
data memory addressed by the ir register (X or Y), and stores the result in that address. Then
increments the ir register (X or Y). The flags change due to the operation result of the data
memory and the increment result of the ir register does not affect the flags.
Code:
Flags:EICZ
Mode:Src: Register direct
76EPSONS1C63000 CORE CPU MANUAL
MnemonicMSBLSB
AND [%X]+,%A11010011010011A69H
AND [%X]+,%B11010011011011A6DH
AND [%Y]+,%A11010011010111A6BH
AND [%Y]+,%B11010011011111A6FH
AND [%ir],imm4Logical AND of immediate data imm4 and location [ir reg.]2 cycles
Function: [ir] ← [ir] ∧ imm4
Performs a logical AND operation of the 4-bit immediate data imm4 and the content of the
data memory addressed by the ir register (X or Y), and stores the result in that address.
Code:
Flags:EICZ
Mode:Src: Immediate data
Extended LDB%EXT,imm8
operation: AND [%X],imm4[00imm8] ← [00imm8] ∧ imm4 (00imm8 = 0000H + 00H to FFH)
AND [%ir]+,imm4
Function: [ir] ← [ir] ∧ imm4, ir ← ir + 1
MnemonicMSBLSB
AND [%X],imm4110100000i3i2i1i01A00H–1A0FH
AND [%Y],imm4110100010i3i2i1i01A20H–1A2FH
↓––↕
Dst: Register indirect
Extended addressing: Valid
LDB %EXT,imm8
AND [%Y],imm4[FFimm8] ← [FFimm8] ∧ imm4 (FFimm8 = FF00H + 00H to FFH)
Logical AND of immediate data imm4 and location [ir reg.] and increment ir reg. 2 cycles
Performs a logical AND operation of the 4-bit immediate data imm4 and the content of the
data memory addressed by the ir register (X or Y), and stores the result in that address. Then
increments the ir register (X or Y). The flags change due to the operation result of the data
memory and the increment result of the ir register does not affect the flags.
Code:
Flags:EICZ
Mode:Src: Immediate data
S1C63000 CORE CPU MANUALEPSON77
MnemonicMSBLSB
AND [%X]+,imm4110100001i3i2i1i01A10H–1A1FH
AND [%Y]+,imm4110100011i3i2i1i01A30H–1A3FH
Performs a logical AND of the content of the r’ register (A or B) and the content of the r register
(A or B) to check the bits of the r register. The Z flag is changed due to the operation result, but
the content of the register is not changed.
Code:
Flags:EICZ
Mode:Src: Register direct
MnemonicMSBLSB
BIT %A,%A110101111000X1AF0H, (1AF1H)
BIT %A,%B110101111001X1AF2H, (1AF3H)
BIT %B,%A110101111010X1AF4H, (1AF5H)
BIT %B,%B110101111011X1AF6H, (1AF7H)
↓––↕
Dst: Register direct
Extended addressing: Invalid
BIT %r,imm4Test bit of r reg. with immediate data imm41 cycle
Function: r ∧ imm4
Performs a logical AND of the 4-bit immediate data imm4 and the content of the r register (A
or B) to check the bits of the r register. The Z flag is changed due to the operation result, but the
content of the register is not changed.
Code:
Flags:EICZ
Mode:Src: Immediate data
78EPSONS1C63000 CORE CPU MANUAL
MnemonicMSBLSB
BIT %A,imm4110101100i3i2i1i01AC0H–1ACFH
BIT %B,imm4110101101i3i2i1i01AD0H–1ADFH
↓––↕
Dst: Register direct
Extended addressing: Invalid
CHAPTER 4: INSTRUCTION SET
BIT %r,[%ir]
Function: r ∧ [ir]
Performs a logical AND of the content of the data memory addressed by the ir register (X or Y)
and the content of the r register (A or B) to check the bits of the r register. The Z flag is changed
due to the operation result, but the content of the register is not changed.
BIT %r,[%ir]+Test bit of r reg. with location [ir reg.] and increment ir reg.1 cycle
Function: r ∧ [ir], ir ← ir + 1
Performs a logical AND of the content of the data memory addressed by the ir register (X or Y)
and the content of the r register (A or B) to check the bits of the r register. The Z flag is changed
due to the operation result, but the content of the register is not changed. Then increments the
ir register (X or Y). The increment result of the ir register does not affect the flags.
Code:
Flags:EICZ
Mode:Src: Register indirect
MnemonicMSBLSB
BIT %A,[%X]+11010111000011AE1H
BIT %A,[%Y]+11010111000111AE3H
BIT %B,[%X]+11010111001011AE5H
BIT %B,[%Y]+11010111001111AE7H
↓––↕
Dst: Register direct
Extended addressing: Invalid
S1C63000 CORE CPU MANUALEPSON79
CHAPTER 4: INSTRUCTION SET
BIT [%ir],%rTest bit of location [ir reg.] with r reg.1 cycle
Function: [ir] ∧ r
Performs a logical AND of the content of the r register (A or B) and the content of the data
memory addressed by the ir register (X or Y) to check the bits of the memory. The Z flag is
changed due to the operation result, but the content of the memory is not changed.
Code:
Flags:EICZ
Mode:Src: Register direct
Extended LDB%EXT,imm8
operation: BIT[%X],%r[00imm8] ∧ r (00imm8 = 0000H + 00H to FFH)
MnemonicMSBLSB
BIT [%X],%A11010111010001AE8H
BIT [%X],%B11010111011001AECH
BIT [%Y],%A11010111010101AEAH
BIT [%Y],%B11010111011101AEEH
↓––↕
Dst: Register indirect
Extended addressing: Valid
LDB %EXT,imm8
BIT[%Y],%r[FFimm8] ∧ r (FFimm8 = FF00H + 00H to FFH)
BIT [%ir]+,%rTest bit of location [ir reg.] with r reg. and increment ir reg.1 cycle
Function: [ir] ∧ r, ir ← ir + 1
Performs a logical AND of the content of the r register (A or B) and the content of the data
memory addressed by the ir register (X or Y) to check the bits of the memory. The Z flag is
changed due to the operation result, but the content of the memory is not changed. Then
increments the ir register (X or Y). The increment result of the ir register does not affect the
flags.
Code:
Flags:EICZ
Mode:Src: Register direct
80EPSONS1C63000 CORE CPU MANUAL
MnemonicMSBLSB
BIT [%X]+,%A11010111010011AE9H
BIT [%X]+,%B11010111011011AEDH
BIT [%Y]+,%A11010111010111AEBH
BIT [%Y]+,%B11010111011111AEFH
Performs a logical AND of the 4-bit immediate data imm4 and the content of the data memory
addressed by the ir register (X or Y) to check the bits of the memory. The Z flag is changed due
to the operation result, but the content of the memory is not changed.
Test bit of location [ir reg.] with immediate data imm41 cycle
BIT [%ir]+,imm4
Function: [ir] ∧ imm4, ir ← ir + 1
Performs a logical AND of the 4-bit immediate data imm4 and the content of the data memory
addressed by the ir register (X or Y) to check the bits of the memory. The Z flag is changed due
to the operation result, but the content of the memory is not changed. Then increments the ir
register (X or Y). The increment result of the ir register does not affect the flags.
Code:
Flags:EICZ
Mode:Src: Immediate data
MnemonicMSBLSB
BIT [%X]+,imm4110101001i3i2i1i01A90H–1A9FH
BIT [%Y]+,imm4110101011i3i2i1i01AB0H–1ABFH
Test bit of location [ir reg.] with immediate data imm4 and increment ir reg. 1 cycle
S1C63000 CORE CPU MANUALEPSON81
CHAPTER 4: INSTRUCTION SET
CALR [addr6]Call subroutine at relative location [addr6]2 cycles
Function: ([(SP1-1)*4+3]~[(SP1-1)*4]) ← PC + 1, SP1 ← SP1 - 1, PC ← PC + [addr6] + 1
(addr6 = 0000H–003FH)
Saves the address next to this instruction to the stack as a return address, then adds the content
of the data memory (0000H–003FH) specified with the addr6 to that address to unconditionally
call the subroutine started from the address. Branch destination range is the next address of
this instruction +0 to 15.
Code:
Flags:EICZ
Mode:6-bit absolute
MnemonicMSBLSB
CALR [addr6]1111100a5a4a3a2a1a01F00H–1F3FH
↓–––
Extended addressing: Invalid
CALR sign8Call subroutine at relative location sign81 cycle
Function: ([(SP1-1)*4+3]~[(SP1-1)*4]) ← PC + 1, SP1 ← SP1 - 1, PC ← PC + sign8 + 1 (sign8 = -128~127)
Saves the address next to this instruction to the stack as a return address, then adds the related
address specified with the sign8 to that address to unconditionally call the subroutine started
from the address. Branch destination range is the next address of this instruction -128 to +127.
PC ← PC + sign16 + 1
(sign16 = -32768 to 32767, upper 8-bit: imm8, lower 8-bit: sign8)
82EPSONS1C63000 CORE CPU MANUAL
CHAPTER 4: INSTRUCTION SET
CALZ imm8Call subroutine at location imm81 cycle
Function: ([(SP1-1)*4+3]~[(SP1-1)*4]) ← PC + 1, SP1 ← SP1 - 1, PC ← imm8
Saves the address next to this instruction to the stack as a return address, then unconditionally
calls the subroutine started from the address (0000H–00FFH) specified with the imm8.
Code:
MnemonicMSBLSB
CALZ imm800011i7i6i5i4i3i2i1i00300H–03FFH
Flags:EICZ
↓–––
Mode:Immediate data
Extended addressing: Invalid
CLR [addr6],imm2 Clear bit imm2 in location [addr6]2 cycles
Function: [addr6] ← [addr6] ∧ not (2
(addr6 = 0000H–003FH or FFC0H–FFFFH)
Clears the bit specified with the imm2 in the data memory specified with the addr6 to "0".
Subtracts the content of the r ’ register (A or B) from the content of the r register (A or B). It
changes the flags (Z and C), but does not change the content of the register.
CMP %r,imm4Compare r reg. with immediate data imm41 cycle
Function: r - imm4
Subtracts the 4-bit immediate data imm4 from the content of the r register (A or B). It changes
the flags (Z and C), but does not change the content of the register.
Subtracts the content of the data memory addressed by the ir register (X or Y) from the content
of the r register (A or B). It changes the flags (Z and C), but does not change the content of the
register.
Subtracts the content of the data memory addressed by the ir register (X or Y) from the content
of the r register (A or B). It changes the flags (Z and C), but does not change the content of the
register. Then increments the ir register (X or Y). The increment result of the ir register does not
affect the flags.
Compare r reg. with location [ir reg.] and increment ir reg.1 cycle
S1C63000 CORE CPU MANUALEPSON85
CHAPTER 4: INSTRUCTION SET
CMP [%ir],%r
Function: [ir] - r
Subtracts the content of the r register (A or B) from the content of the data memory addressed
by the ir register (X or Y). It changes the flags (Z and C), but does not change the content of the
memory.
Code:
Flags:EICZ
Mode:Src: Register direct
Extended LDB%EXT,imm8
operation: CMP [%X],%r[00imm8] - r (00imm8 = 0000H + 00H to FFH)
LDB %EXT,imm8
CMP [%Y],%r[FFimm8] - r (FFimm8 = FF00H + 00H to FFH)
Compare location [ir reg.] with r reg.1 cycle
CMP [%ir]+,%rCompare location [ir reg.] with r reg. and increment ir reg.1 cycle
Function: [ir] - r, ir ← ir + 1
Subtracts the content of the r register (A or B) from the content of the data memory addressed
by the ir register (X or Y). It changes the flags (Z and C), but does not change the content of the
memory. Then increments the ir register (X or Y). The increment result of the ir register does
not affect the flags.
Subtracts the 4-bit immediate data imm4 from the content of the data memory addressed by
the ir register (X or Y). It changes the flags (Z and C), but does not change the content of the
memory.
Compare location [ir reg.] with immediate data imm41 cycle
CMP [%ir]+,imm4
Function: [ir] - imm4, ir ← ir + 1
Subtracts the 4-bit immediate data imm4 from the content of the data memory addressed by
the ir register (X or Y). It changes the flags (Z and C), but does not change the content of the
memory. Then increments the ir register (X or Y). The increment result of the ir register does
not affect the flags.
Compare location [ir reg.] with immediate data imm4 and increment ir reg. 1 cycle
S1C63000 CORE CPU MANUALEPSON87
CHAPTER 4: INSTRUCTION SET
CMP %ir,imm8
Function: ir - imm8
Subtracts the 8-bit immediate data imm8 from the content of the ir register (X or Y). It changes
the flags (Z and C), but does not change the register.
DEC [ir]+,n4Decrement location [ir] in specified radix and increment ir reg.2 cycles
Function: [ir] ← N’s adjust ([ir] - 1), ir ← ir + 1
Decrements (-1) the content of the data memory addressed by the ir register (X or Y). The
operation result is adjusted with n4 as the radix. Then increments the ir register (X or Y). The
increment result of the ir register does not affect the flags.
Code:
Flags:EICZ
Mode:Src: Immediate data
Note:n4 should be specified with a value from 1 to 16. When 16 is specified for n4, the low-order 4
S1C63000 CORE CPU MANUALEPSON89
MnemonicMSBLSB
DEC [%X]+,n4111001001n3n2n1n01C90H–1C9FH
DEC [%Y]+,n4111001011n3n2n1n01CB0H–1CBFH
EX %r,[%ir]+Exchange r reg. and location [ir reg.] and increment ir reg.2 cycles
Function: r ↔ [ir], ir ← ir + 1
Exchanges the contents of the r register (A or B) and data memory addressed by the ir register
(X or Y). Then increments the ir register (X or Y). The increment result of the ir register does not
affect the flags.
Code:
Flags:EICZ
Mode:Src: Register indirect
S1C63000 CORE CPU MANUALEPSON91
MnemonicMSBLSB
EX %A,[%X]+100001111100110F9H
EX %A,[%Y]+100001111101110FBH
EX %B,[%X]+100001111110110FDH
EX %B,[%Y]+100001111111110FFH
↓–––
Dst: Register direct
Extended addressing: Invalid
CHAPTER 4: INSTRUCTION SET
HALTSet CPU to HALT mode2 cycles
Function: Halt
Sets the CPU to HALT status.
The CPU stops operating, thus the power consumption is reduced. Peripheral circuits such as
the oscillation circuit still operate.
An interrupt causes it to return from HALT status to the normal program execution status.
Code:
Flags:EICZ
MnemonicMSBLSB
HALT11111111111001FFCH
↓–––
INC [addr6]Increment location [addr6]2 cycles
Function: [addr6] ← [addr6] + 1
(addr6 = 0000H–003FH)
Increments (+1) the content of the data memory addressed by the addr6.
Code:
MnemonicMSBLSB
INC [addr6]1000001a5a4a3a2a1a01040H–107FH
Flags:EICZ
↓–↕↕
Mode:6-bit absolute
Extended addressing: Invalid
92EPSONS1C63000 CORE CPU MANUAL
CHAPTER 4: INSTRUCTION SET
INC [ir],n4Increment location [ir] in specified radix2 cycles
Function: [ir] ← N’s adjust ([ir] + 1)
Increments (+1) the content of the data memory addressed by the ir register (X or Y). The
operation result is adjusted with n4 as the radix.
INC [ir]+,n4Increment location [ir] in specified radix and increment ir reg.2 cycles
Function: [ir] ← N’s adjust ([ir] + 1), ir ← ir + 1
Increments (+1) the content of the data memory addressed by the ir register (X or Y). The
operation result is adjusted with n4 as the radix. Then increments the ir register (X or Y). The
increment result of the ir register does not affect the flags.
Code:
Flags:EICZ
Mode:Src: Immediate data
Note:n4 should be specified with a value from 1 to 16.
(imm6 = 0100H–013FH)
Saves the content of the F register and the return address (this instruction address + 1) to the
stack, then executes the software interrupt routine that starts from the vector address (0100H–
013FH) specified by the imm6.
Code:
Flags:EICZ
Mode:Immediate data
Note:The RETI instruction, which returns the content of the F register, should be used for returning
MnemonicMSBLSB
INT imm61111110i5i4i3i2i1i01F80H–1FBFH
↓–––
Extended addressing: Invalid
from the interrupt routine that is executed by this instruction.
94EPSONS1C63000 CORE CPU MANUAL
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.