MF658-04

CMOS 8-BIT SINGLE CHIP MICROCOMPUTER E0C88 Family E0C88 CORE CPU MANUAL NOTICE 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 Control Law of Japan and may require an export license from the Ministry of International Trade and Industry or other approval from another government agency. Please note that "E0C" is the new name for the old product "SMC". If "SMC" appears in other manuals understand that it now reads "E0C".

© SEIKO EPSON CORPORATION 1999 All rights reserved. CONTENTS

E0C88 Core CPU Manual

PREFACE This manual explains the architecture, operation and instruction of the core CPU E0C88 of the CMOS 8-bit single chip microcomputer E0C88 Family. Also, since the memory configuration and the peripheral circuit configuration is different for each device of the E0C88 Family, you should refer to the respective manuals for specific details other than the basic functions. CONTENTS 1 OUTLINE ______1 1.1 Features ...... 1 1.2 Instruction Set Features ...... 1 1.3 Block Diagram ...... 1 1.4 Input-Output Signal ...... 2

2 ARCHITECTURE ______4 2.1 Address Space and CPU Model ...... 4 2.2 ALU and Registers...... 5 2.2.1 ALU ...... 5 2.2.2 Register configuration ...... 5 2.2.3 Flags ...... 6 2.2.4 Complimentary operation and overflow ...... 8 2.2.5 Decimal operation and unpack operation ...... 10 2.2.6 Multiplication and division ...... 11 2.3 Program Memory ...... 12 2.3.1 Configuration of the program memory ...... 12 2.3.2 PC () and CB (Code bank register) ...... 13 2.3.3 Bank management ...... 14 2.3.4 Branch instruction ...... 14 2.4 Data Memory ...... 17 2.4.1 Data memory configuration ...... 17 2.4.2 Page registers EP, XP, YP ...... 18 2.4.3 Stack ...... 18 2.4.4 Memory mapped I/O ...... 20

3 CPU OPERATION AND PROCESSING STATUS ______21 3.1 Timing Generator and Bus Control...... 21 3.1.1 Bus cycle ...... 21 3.1.2 Wait state ...... 22 3.2 Outline of Processing Statuses ...... 23 3.3 Reset Status...... 24 3.4 Program Execution Status ...... 25 3.5 Exception Processing Status ...... 25 3.5.1 Exception processing types and priority...... 26 3.5.2 Exception processing factor and vectors ...... 27 3.5.3 Interrupts ...... 27 3.5.4 Exception processing sequence ...... 28

E0C88 CORE CPU MANUAL EPSON i CONTENTS

3.6 Bus Authority Release Status ...... 31 3.7 Standby Status ...... 33 3.7.1 HALT status ...... 33 3.7.2 SLEEP status ...... 34

4 INSTRUCTION SETS ______35 4.1 Addressing Mode ...... 35 4.2 Instruction Format ...... 39 4.3 Instruction Set List...... 40 4.3.1 Function classification ...... 40 4.3.2 Symbol meanings ...... 41 4.3.3 Instruction list by functions ...... 42 4.4 Detailed Explanation of Instructions ...... 59

APPENDIX A Operation Code Map ______195

B Instruction List by Addressing Mode ______198

C Instruction Index ______210

White

ii EPSON E0C88 CORE CPU MANUAL 1 OUTLINE

1 OUTLINE The E0C88 is the core CPU of the 8-bit single chip microcomputer E0C88 Family that utilizes original EPSON architecture. It has a maximum 16M bytes address space and high speed, abundant instruction sets. It handles a wide range of operating voltages and features low power consumption. In addition, it has adopted a unified architecture and a peripheral circuit interface for its memory mapped I/O mode to flexibly meet future expansion of the E0C88 Family. 1.1 Features 1.2 Instruction Set Features The E0C88 boasts the below features. (1) It adopts high efficiency machine cycle plus Address space Maximum 16M bytes high speed and abundant instruction sets. (2) Memory management can be done easily by 12 Instruction cycle 1–15 cycles (1 cycle = 2 clocks) types of addressing modes. Instruction set 608 types (3) It has effective 16 bit operation functions including address calculation. Register configuration Data registers 2 Index registers 3 (4) It includes powerful decimal operation func- (One is used as a data register) tions such as a decimal operation mode and Program counter pack/unpack instruction. Stack pointer (5) It supports the realization of various types of System condition flag special service microcomputers through Customize condition flag customized flag instructions. Exception processing factors Reset, zero division and (6) It is composed of an instruction system that interrupt enables relocatable programming, thus permit- Exception processing vectors Maximum 128 vectors ting easy development of software libraries. Standby function HALT/SLEEP 1.3 Block Diagram Peripheral circuit interface Memory mapped I/O system Figure 1.3.1 shows the E0C88 block diagram.

B A

H L IX TEMP 1 TEMP 0

IY 8-bit Single Chip Microcomputer ALU SP Core CPU E0C88 PC SC TEMP 2 BR LR

Micro Instruction Instruction Instruction Decoder Register

EP Internal Data Bus (16-bit) XP CC YP System Clock CB Code Power Timing Bus System Interrupt Status Address Supply Generator Controler Controler Controler Controler Generator NB DD SS PL PK SR RD WR V V NMI CLK IACK RDIV WAIT USLP STOP BACK SYNC BREQ F0~F3 MODE IMASK I0F, I1F IRQ1~IRQ3 SPP0~SPP7 DBS0, DBS1 Data Bus D0~D7 To ROM, RAM and Peripheral Circuits Address Bus A16~A23 Address Bus A00~A15 Fig. 1.3.1 E0C88 block diagram

E0C88 CORE CPU MANUAL EPSON 1 1 OUTLINE

1.4 Input-Output Signal Tables 1.4.1 (a) and 1.4.1 (b) show the input/output signals between the E0C88 and the peripheral circuits. Table 1.4.1(a) Input/output signal list (1) Type Name Signal name I/O Function Power Power VDD I Inputs the + side power. Ground VSS I Inputs the - side power (GND). Clock Clock input CLK I Inputs the system clock from the peripheral circuit. Clock output PK O Outputs the two phase divided signals to be generated from the system clock PL input to the CLK terminal as following phase. CLK PK PL 1 cycle Address bus Address bus A00ÐA23 O A 24-bit address bus. Data bus Data bus D0ÐD7 I/O An 8-bit bidirectional data bus. Bus control Wait WAIT I Controls the wait state insertion for the access time extension during signal memory access. This control will become valid with LOW level input. Read RD O A memory (and peripheral circuit) read signal. It shifts to LOW level during readout. Write WR O A memory (and peripheral circuit) write signal. It shifts to LOW level during writing. Read interrupt RDIV O An interrupt vector address read signal. vector address It shifts to LOW level during readout of the vector address. System Reset SR I A LOW level input shifts the CPU into the reset status. control signal Mode setting MODE I Sets the CPU operation mode by means of the peripheral circuit. LOW: Minimum mode HIGH: Maximum mode Customize F0ÐF3 I A status signal input by a peripheral circuit. condition flag The meaning of the signal differs depending on the peripheral circuit. Micro sleep USLP O The USLP is set to HIGH level 1 cycle prior to the CPU's entry into the SLEEP status as a result of the SLP (SLEEP) instruction. The peripheral circuit controls the oscillation stop based on this signal. Bus authority BREQ I This is the bus authority request signal when the peripheral circuit makes request a DMA transmission. LOW level input to this terminal causes the CPU to release bus. The address bus, data bus and read/write signal shift to the high impedance status. Bus authority BACK O This is response signal that indicates a bus authorization has been released acknowledge to the peripheral circuit. It shifts to LOW level when bus authorization has been released. Stack pointer SPP0ÐSPP7 I This is a page address of the stack pointer that is specified by the peripheral page circuit. When the stack pointer accesses the memory, this address is output to the page section (AD16ÐAD23) of the address bus. Refer to Chapter 3, "CPU OPERATION AND PROCESSING STATUSES" for the timing of each signal and related information.

2 EPSON E0C88 CORE CPU MANUAL 1 OUTLINE

Table 1.4.1(b) Input/output signal list (2) Type Name Signal name I/O Function Interrupt Non-maskable NMI I This is an interrupt signal not permitting masking by the software. signal interrupt The input is sensed at the falling edge. Interrupt IRQ3 I This is an interrupt signal permitting masking by the software. request 3 The interrupt priority is level 3 and the input is sensed at a LOW level. Interrupt IRQ2 I This is an interrupt signal permitting masking by the software. request 2 The interrupt priority is level 2 and the input is sensed at a LOW level. Interrupt IRQ1 I This is an interrupt signal permitting masking by the software. request 1 The interrupt priority is level 1 and the input is sensed at a LOW level. Interrupt mask IMASK I This is an interrupt mask signal input by the peripheral circuit. When the page section, etc. of the stack pointer configured on the peripheral circuit section is accessed, LOW level is input to this terminal and the below interrupt is masked. NMI, IRQ3, IRQ2, IRQ1 Interrupt IACK O This is a response signal that indicates that an interrupt request has been acknowledge received. It shifts to LOW level when an interrupt has been received. The peripheral circuit receives this signal and holds the vector address. This signal also shifts to LOW level when exceptional processing is executed by reset and zero division. I0F O A status of the interrupt flag (I0, I1) in the system condition flag (SC) I1F is output. Status signal First operation SYNC O This is a signal that becomes active when the CPU fetches the first operation code fetch signal code. It shifts to HIGH level during the bus cycle of the first operation code fetch. The interrupt is sampled at the rising edge of this signal. Stop signal STOP O This is a signal that becomes low level when the CPU shifts into the following status: ¥ CPU stops by HALT instruction ¥ CPU stops by SLP instruction ¥ The bus authorization has been released by LOW level input to the

BREQ terminal. Data bus status DBS0 O This is a 2 bit status signal that indicates the data bus status as follows. DBS1 DSB1 DSB0 State 0 0 High impedance 0 1 Interrupt vector address read 1 0 Memory write 1 1 Memory read

Note: Input/output signals may differ from the above table, for example, a peripheral circuit signal may be added by each device of the E0C88 Family.

E0C88 CORE CPU MANUAL EPSON 3 2 ARCHITECTURE

2 ARCHITECTURE The E0C88 has a maximum 16M bytes The program memory is managed by dividing the address space and can thus respond to large scale bank for each 32K bytes and the data memory into applications. Here we will explain such points as one page for each 64K bytes. this address space and memory control as well as See "2.3 Program Memory" and "2.4 Data Memory". the configuration of the registers. Note: The memory configuration varies for the respective devices of the E0C88 Family. 2.1 Address Space and CPU Model Refer to the manual for each device. CPU models of the four types MODEL0 to MODEL3 are set in the E0C88 according to the size Table 2.1.1 CPU model of the address space and whether or not there is a CPU Address Multiplication multiplication/division instruction. The differences model space division instruction in each model are as shown in Table 2.1.1 and have MODEL0 64K bytes Not available been designed to permit selection according to the MODEL1 64K bytes Available microcomputer service and the scope of the MODEL2 16M bytes Not available application as per Table 2.1.1. MODEL3 16M bytes Available Either the minimum mode that makes the pro- gramming field a maximum 64K bytes or the Table 2.1.2 Setting of the operation mode (MODEL2/3) maximum mode that makes it a maximum 8M MODE Operation mode Programming area bytes for MODEL2 and MODEL3 can be selected, 0 Minimum mode Maximum 64K bytes depending on the MODE terminal setting of CPU. Figure 2.1.1 shows the memory map concept for 1 Maximum mode Maximum 8M bytes each CPU model.

MODEL0/1 MODEL2/3(minimum mode) MODEL2/3(maximum mode) ROM RAM, peripheral I/O ROM RAM, peripheral I/O ROM RAM, peripheral I/O 000000H Bank 0 Bank 0 Bank 0 007FFFH (32K bytes) Page 0 (32K bytes) Page 0 (32K bytes) Page 0 008000H Bank 1 (64K bytes) (64K bytes) Bank 1 (64K bytes) 00FFFFH (32K bytes) (32K bytes) 010000H Bank 2 017FFFH Page 1 (32K bytes) Page 1 018000H Bank X (64K bytes) Bank 3 (64K bytes) 01FFFFH (32K bytes) (32K bytes) 020000H : 7EFFFFH 7F0000H Bank 254 7F7FFFH Page 127 (32K bytes) Page 127 7F8000H (64K bytes) Bank 255 (64K bytes) 7FFFFFH (32K bytes) 800000H Bank X is one Page 128 Page 128 80FFFFH optional bank (64K bytes) (64K bytes) 810000H from bank 1 Page 129 Page 129 81FFFFH to bank 255 (64K bytes) (64K bytes) 820000H : FEFFFFH FF0000H Page 255 Page 255 FFFFFFH (64K bytes) (64K bytes)

Fig. 2.1.1 Memory map

4 EPSON E0C88 CORE CPU MANUAL 2 ARCHITECTURE

2.2 ALU and Registers Table 2.2.1.1 ALU operation functions Arithmetic Arithmetic 16-bit 2.2.1 ALU function instruction operation The ALU (arithmetic and logic unit) performs the Addition ADD, ADC ● operation between the 8-bit and the 16-bit data Subtraction SUB, SBC ● stored in the two types of temporary registers Logical product AND TEMP 0 and TEMP 1. The ALU functions are as Logical sum OR indicated in Table 2.2.1.1. Exclusive OR XOR After having been stored in the 16-bit temporary Comparison CP ● register TEMP 2, the operation result is either Bit test BIT stored in the register/memory or used as address Increment/decrement INC, DEC ● data according to the operation instruction. Multiplication MLT In addition, the Z (zero) flag, C (carry) flag V Division DIV (overflow) flag and N (negative) flag are set/reset Compliment CPL, NEG according to the operation result. See "2.2.3 Flags". Rotate RL, RLC, RR, RRC Shift SLA, SLL, SRA, SRL 2.2.2 Register configuration Pack/unpack PACK, UPCK Figure 2.2.2.1 shows the register configuration of Code extension SEP the E0C88. Standard section (Common for MODEL0ÐMODEL3) Expansion section (MODEL2, MODEL3)

7 (15) B 0 7 A 0 Data register A, B (BA) 7 NB 0 New code bank register

7 (15) H 0 7 L 0 Index (data) register HL, (H and L) 7 CB 0 Code bank register

15 IX 0 Index register IX 7 EP 0 Expand page register

15 IY 0 Index register IY 7 XP 0 Expand page register for IX

15 PC 0 Program counter 7 YP 0 Expand page register for IY

15 SP 0 Stack pointer

7 BR 0 Base register

SC I1 I0 U D N V C Z System condition flag

CC F3 F2 F1 F0 Custmize condition flag Fig. 2.2.2.1 Register configuration

A and B registers It can also be used as a data register by splitting it The A and B registers are respective 8-bit data into respective 8-bit H and L registers. In this case, registers and they perform data transfer and the L register can also be used as a displacement at operation with other registers and/or data memo- the time of indirect addressing by the IX and IY ries, transfer of immediate data and operations. registers. They are respectively used independently for 8-bit See "2.4 Data Memory". transfer/operations and used in a BA pair that See "4.1 Addressing Mode". makes the B register the upper 8-bit for 16-bit transfer/operations. IX and IY registers The IX and IY registers are respective 16-bit index HL register registers that are used for indirect addressing of the The HL register is a 16-bit index register that is data memory (specification of the address within used for indirect addressing of the data memory the page). They perform 16-bit data transfer and/or (specification of the address within the page). It operations with other registers and/or data performs 16-bit data transfer and operations with memories. other registers and/or memories. See "2.4 Data Memory". See "4.1 Addressing Mode".

E0C88 CORE CPU MANUAL EPSON 5 2 ARCHITECTURE

PC (Program Counter) EP, XP and YP (Expand Page Registers) The PC is a 16-bit counter register that does the These registers are 8-bit registers that specify the addressing of the program memory and it indicates data memory page. the following address to be executed. The EP register is used at the time of indirect See "2.3 Program Memory". addressing by the HL register or absolute address- ing by the immediate data. SP (Stack Pointer ) The XP register and YP register are used at the time The SP is a 16-bit counter register that indicates the of indirect addressing by the IX register or indirect stack address (address within the stack page). It addressing by the IY register, respectively. performs 16-bit data transfer and/or operations These registers are set by the CPU models with the other registers and/or data memories. MODEL2 and MODEL3. See "2.4.3 Stack". See "2.4.2 Page registers EP, XP, YP". See "4.1 Addressing Mode". BR (Base Register) The BR is an 8-bit index register and is used for 2.2.3 Flags upper 8-bit address specification within the page at the time of 8-bit absolute addressing (specifies the The system condition flag (SC) that indicates such lower 8 bits with immediate data.). things as the operation result status within the See "4.1 Addressing Mode". CPU and the customize condition flag (CC) that indicates the peripheral circuit status are set for the SC (System Condition Flag) E0C88. The SC is an 8-bit flag and is configured with Z, C, V and Z flags that indicate the operation result, D System condition flag (SC) and U flags that set the operation mode, and I0 and SC I1 I0 U D N V C Z I1 flags that set the interrupt priority level. Z (zero) flag See "2.2.3 Flags". C (carry) flag CC (Customize Condition Flag) V (overflow) flag The CC is a 4-bit flag that indicates the various N (negative) flag types of statuses that are selected by the peripheral D (decimal) flag circuit. It is set/reset by the peripheral circuit and U (unpack) flag is used as a branch instruction condition. See "2.2.3 Flags". I0 (interrupt 0) flag I1 (interrupt 1) flag NB (New Code Bank Register) Fig. 2.2.3.1 System condition flag The NB register is an 8-bit register that specifies the program memory bank. The NB register is set for Figure 2.2.3.1 indicates the system condition flags the CPU models MODEL2 and MODEL3. and is composed of the register SC that is See "2.3 Program Memory". configured by an 8-bit flag. The system condition flags Z (zero), C (carrier), V CB (Code Bank Register) (overflow) and N (negative) flags are set/reset The CB register is an 8-bit register that indicates the according to the operation results and the I0 and I1 currently selected bank of the program memory. (interrupt) flags are set/reset by the interrupt. When the data has been set to the NB register, the These flags can also be operated by the below data is loaded into the CB register and a new bank instructions. is selected. AND SC,#nn (Resets the optional flag) The CB register is set for the CPU models MODEL2 OR SC,#nn (Sets the optional flag) and MODEL3. XOR SC,#nn (Inverts the optional flag) See "2.3 Program Memory". LD SC,#nn (Flag write) LD SC,A (Flag write) POP SC (Flag return) RETE (Flag evacuation)

6 EPSON E0C88 CORE CPU MANUAL 2 ARCHITECTURE

The Z, C, N and V flags are used for condition When performing a complimentary operation judgments at the time of conditional jump/call that is likely to overflow, the V flag must be instruction execution for JRS instructions and/or checked and the operation result corrected CARS instructions. when it is '1'. See "4.4 Detailed Explanation of Instructions". See "2.2.4 Complimentary operation and overflow".

Here following the respective flags are explained. (4) N (negative) flag When the result of a performed operation is (1) Z (zero) flag minus (The most significant bit is '1'), N flag is The Z flag is set to '1' when the arithmetic set to '1' and when it is plus (The most signifi- instruction execution result has become '0' and cant bit is '0'), N flag is reset to '0'. However, the is set at '0' when the result is other than '0'. N flag does not change according to the (2) C (carry) flag execution of an 1 increment-decrement instruc- When a carry (carry from the most significant tion (INC and DEC instructions). bit) has been generated by the execution of an (5) D (decimal) flag addition instruction, or when a borrow (borrow The D flag is the bit that sets the CPU such that to the most significant bit) has been generated it performs a decimal operation (The operation by the execution of an addition instruction/ result is decimal corrected) at the time of comparison instruction, the C flag is set to '1' execution of an 8-bit addition subtraction and otherwise is set to '0'. However, the C flag instruction. Setting it to '1' causes it to perform will not vary depending on the execution of an a decimal operation and it performs a hexadeci- 1 addition-subtraction instruction (INC and mal operation at '0'. DEC instructions). See "2.2.5 Decimal operation and unpack operation". The C flag also varies according to the execu- tion of the rotate/shift instruction. (6) U (unpack) flag It is reset to '0' when multiplication-division The U flag is the bit that sets the CPU such that instructions (MLT and DIV instructions) have it performs an unpack operation (executes the been executed. operation for the upper 4 bits as '0') upon execution of an 8-bit addition-subtraction (3) V (overflow) flag operation. Setting it to '1' causes it to perform a The V flag is set to '1' when the result of the unpack operation and it performs a 8-bit operation exceeds the range of the complemen- operation at '0'. tary representation by 8 bits or 16 bits and is See "2.2.5 Decimal operation and unpack operation". reset to '0', when it is within the range. 8 bits become (7) I0 and I1 (interrupt) flags -128–127 for the range of the complimentary The I0 and I1 flags are the bits that set the representation and 16 bits become -32768– interrupt priority level. The CPU accepts 32767. interrupts that are set higher level than inter- However, the V flag will not change according rupt priority level set with these two bits. Also to the execution of an logic operation instruc- when an interrupt is generated, it is automati- tion (AND, OR and XOR instructions, exclud- cally set to new value that it will mask the ing cases where the destination is SC) and a 1 interrupts for that level and below. increment-decrement instruction (INC and See "3.5.3 Interrupts". DEC instructions) even within an operation We have indicated the flags that change due to instruction. When a multiplication instruction execution of an instruction by "↕" in the instruction (MLT instruction) has been executed, it is reset set lists and other documents. The D and U flags to '0'. When a division instruction (DIV instruc- have a "★" attached to them, indicating that those tion) has been executed, it is set to '1' when the instructions permit decimal operations and unpack quotient is exceeded the 8-bit data range. operations. The V flag indicates the overflow of a comple- mentary operation, in contrast to the fact that the C flag indicates an over (under) flow of an absolute value operation.

E0C88 CORE CPU MANUAL EPSON 7 2 ARCHITECTURE

Customize condition flag (CC) 2.2.4 Complimentary operation and overflow CC F3 F2 F1 F0 Complementary representations are used within Terminal the E0C88 for the handling of minus data. Here F0 following we will explain about operations using complimentary expressions and compliments. F1 Peripheral F2 circuit status Compliments When a minus number is handled by the micro- F3 computer a complimentary representation is Fig. 2.2.3.2 Customize condition flag generally used. Compliments contain two types of expressions, 1 compliment and 2 compliment type. The customize condition flags are as shown in Normally when referring simply to a compliment Figure 2.2.3.2 and consist of the CC registers that the 2 compliment type is indicated. In the E0C88 as are made up of 4-bit flags. well, a minus number is expressed by 2 compli- Each of the CC flags consist of the names F0–F3 ments. and vary according to the signals that are input to the F0–F3 terminals of the E0C88 from the periph- Compliments of the optional number N are eral circuit. Since the signal indicating the status of expressed by the following expression and the the peripheral circuit is input here, the program range where a 2 compliment representation is can be branched according to the status of the permissible is -128–127 in the case of 8 bits and peripheral circuit reflected for each flag. -32768–32767 in the case of 16 bits. The range The E0C88 has been conceived to permit special where a 1 compliment representation is possible is purpose microcomputers to be created easily. -127–127 in the case of 8 bits and -32767–32767 in The CC flag is used for condition judgment at the the case of 16 bits. time of a conditional jump/call instruction execu- When an complement representation is used, the tion of a JRS instruction and/or a CARS instruc- most superior bit of the minus number must tion. absolutely become '1', the content of the most See "4.4 Detailed Explanation of Instructions". superior bit is reflected in the N (negative) flag. In addition, the "CPL" instruction (conversion to 1 compliment) and a "NEG" instruction (conversion to 2 compliments) are prepared for conversion of 8 bits data to compliment. The "SEP" instruction is prepared for expanding the 8 bit compliment to 16 bits.

Example: NEG instruction and SEP instruction

Instruction B reg. A reg. N flag LD A,#127 0000 0000 0111 1111 0 NEG A 0000 0000 1000 0001 1 SEP 1111 1111 1000 0001 1

8 EPSON E0C88 CORE CPU MANUAL 2 ARCHITECTURE

2 compliment 1 compliment 8-bit -N = 28 - N = 256 - N 8-bit -N = 28 - 1 - N = 255 - N (= N) 127 = 0111 1111b 127 = 0111 1111b 126 = 0111 1110b 126 = 0111 1110b : : 2 = 0000 0010b 2 = 0000 0010b 1 = 0000 0001b 1 = 0000 0001b 0 = 0000 0000b 0 = 0000 0000b -1 = 1111 1111b (= 1 0000 0000b - 0000 0001b) -1 = 1111 1110b (= 1111 1111b - 0000 0001b) -2 = 1111 1110b (= 1 0000 0000b - 0000 0010b) -2 = 1111 1101b (= 1111 1111b - 0000 0010b) : : -127 = 1000 0001b (= 1 0000 0000b - 0111 1111b) -126 = 1000 0001b (= 1111 1111b - 0111 1110b) -128 = 1000 0000b (= 1 0000 0000b - 1000 0000b) -127 = 1000 0000b (= 1111 1111b - 0111 1111b)

16-bit -N = 216 - N = 65536 - N 16-bit -N = 216 - 1 - N = 65535 - N (= N) 32767 = 0111 1111 1111 1111b 327677 = 0111 1111 1111 1111b 32766 = 0111 1111 1111 1110b 327666 = 0111 1111 1111 1110b : : 2 = 0000 0000 0000 0010b 2 = 0000 0000 0000 0010b 1 = 0000 0000 0000 0001b 1 = 0000 0000 0000 0001b 0 = 0000 0000 0000 0000b 0 = 0000 0000 0000 0000b -1 = 1111 1111 1111 1111b -1 = 1111 1111 1111 1110b (= 1 0000 0000 0000 0000b - 0000 0000 0000 0001b) (= 1111 1111 1111 1111b - 0000 0000 0000 0001b) -2 = 1111 1111 1111 1110b -2 = 1111 1111 1111 1101b (= 1 0000 0000 0000 0000b - 0000 0000 0000 0010b) (= 1111 11111111 1111b - 0000 0000 0000 0010b) : : -32767 = 1000 0000 0000 0001b -32766 = 1000 0000 0000 0001b (= 1 0000 0000 0000 0000b - 0111 1111 1111 1111b) (= 1111 11111111 1111b - 0111 1111 1111 1110b) -32768 = 1000 0000 0000 0000b -32767 = 1000 0000 0000 0000b (= 1 0000 0000 0000 0000b - 1000 0000 0000 0000b) (= 1111 11111111 1111b - 0111 1111 1111 1111b)

Compliment expression and V (overflow) flag Since in this case the V flag has no meaning, the V In the case of an operation by an absolute value flag must not be verified by the program. Since such as an address operation, a correct operation only a complimentary operation can judge an result is obtained in the range of 0–255 with 8 bits overflow by the V flag, you should judge it by and in the range of 0–65535 with 16 bits. When an whether or not the data handled by the application overflow or an underflow has occurred due to an has an attached code. operation and it misses the range, the C (carrier) Here following are indicated examples of 8-bit flag is set to '1'. operations and the changes of the V and C flags The correct operation result range when the resulting from their operation results. operands have become compliments is -128–127 for Example: 8 bits and -32768–32767 for 16 bits and whether Addition example (ADD A,B) operation result is correct or not cannot only be A reg. B reg. Result (A reg.) V flag C flag judged by the C flag. To perform this judgment, the 0101 1010 1010 0101 1111 1111 0 0 V (overflow) flag is set and the V flag is set to '1', when it has exceeded the compliment representa- 0101 1011 1010 0101 0000 0000 0 1 tion range. 0101 1011 0010 0101 1000 0000 1 0 Since the ALU does not differentiate absolute Subtraction example (SUB A,B) operations and complementary operations, the A reg. B reg. Result (A reg.) V flag C flag setting/resetting of the C flag and V flag is done by 0101 1010 0101 1010 0000 0000 0 0 whether or not the operation result is within the 0101 1010 0101 1011 1111 1111 0 1 above mentioned range. Consequently, when the V 0101 1010 1101 1010 1000 0000 1 1 flag may also be set to '1' for absolute value operations.

E0C88 CORE CPU MANUAL EPSON 9 2 ARCHITECTURE

2.2.5 Decimal operation Examples: Instruction Setting value Result SC and unpack operation A reg. B reg. A reg. N V C Z When executing the below 8-bit arithmetic instruc- ADD A,B 55 28 83 0 0 0 0 tions on the E0C88, you can set it to perform ADD A,B 74 98 72 0 0 1 0 decimal operations in addition to the normal SUB A,B 55 55 00 0 0 0 1 hexadecimal operations, unpack operations and SUB A,B 55 28 27 0 0 0 0 operations by combinations of these. These settings SUB A,B 74 98 76 0 0 1 0 are done by the D (decimal) flag and the U (un- bits of operands are disregarded (considered as '0) pack) flag. and the operation for the lower 4 bits alone is done. Arithmetic instructions permitting 10 decimal and unpack operations Unpack operation When executing an 8-bit arithmetic (ADD, ADC, ADD, ADC, SUB, SBC, NEG SUB, SBC, NEG) instruction by setting the U flag to They are all 8-bit arithmetic instructions and '1', you can perform the operation in the below attaching a "★" to the D flag and U flag sections in indicated unpack format. the instruction set list indicates that a decimal The unpack operation disregards the upper 4-bit operation and unpack operation is possible. data and performs the operation for the lower 4 bits alone. After execution, only the operation Decimal operation results for the lower 4 bits are output and '0' is output for the upper 4 bits. When the arithmetic instruction (ADD, ADC, SUB, Since the unpack operation stores 1 digit of data for SBC or NEG) has been executed in the status where the memory address, the digit matching of the the D flag is set to '1', a decimal operation can be operand can be done easily. (The digit matching in done. The operation result is obtained by the BCD this case, becomes memory address pointing (binary-coded decimal) code. alone.) When a decimal operation is done, an "OR SC,#00010000B" or similar instruction sets the D flag to '1' and the operands to BCD code prior to MSB 24 23 LSB execution the arithmetic instruction. Undefined Augend Register or memory When the operands are not in BCD code, the correct result may sometimes not be obtained. +) Undefined Addend Register or memory

• SC flag at the time of a decimal operation 0 Result (sum) Register or memory Following execution of the decimal operation, the N/V/C/Z flags of the SC are set according to the • SC flag at the time of an unpack operation operation result, as shown below. Since an unpack operation is only affects the lower 4-bit data, the SC flag also changes according to the N: Always Reset (0) operation result for the lower 4 bits. Following V: Always Reset (0) execution of the unpack operation, the N/V/C/Z C: When there has been a carry from the 2-digit flags of the SC are set according to the operation decimal value or a borrow to the 2-digit result, as shown below. decimal value Set (1) 3 When there has not been Reset (0) N: When the 2 bit is '1' Set (1) 3 Z: When the operation result = 0 Set (1) When the 2 bit is '0' Reset (0) When the operation result ≠ 0 Reset (0) V: When it exceeds the 4-bit complementary range (-8 to 7) Set (1) When it is within the range Reset (0) C: When there has been a carry from the 23 bit and a borrow to the 23 bit Set (1) When there has not been Reset (0) Z: When the lower 4 bits = 0 Set (1) When the lower 4 bits ≠ 0 Reset (0)

10 EPSON E0C88 CORE CPU MANUAL 2 ARCHITECTURE

Example: ADD A,B N: When the MSB of Setting value Result SC the HL register (product) is '1' Set (1) A reg. B reg. A reg. N V C Z When it is '0' Reset (0) 20H D0H 00H 0 0 0 1 V: Always Reset (0) 2EH 53H 01H 0 0 1 0 C: Always Reset (0) C7H 52H 09H 1 1 0 0 Z: When the HL register (product) is 0000H Set (1) • Auxiliary unpack operation instruction When other than 0000H Reset (0) "PACK" and "UPCK" instructions have been prepared that mutually convert the unpack format Here below are shown execution examples of the and the pack format (normal 8-bit data format), MLT instruction. permitting easy format conversion. Example: (Result: HL reg. = product) PACK instruction: Setting value Result SC Converts the unpack format data of the BA register L reg. A reg. HL reg. N V C Z into pack format and stores it in the A register. 00H 64H 0000H 0 0 0 1 B reg. A reg. A reg. 64H 58H 2260H 0 0 0 0 *m* n→ mn C8H 58H 44C0H 0 0 0 0 A5H 93H 5EBFH 0 0 0 0 C8H A5H 80E8H 1 0 0 0 Example: PACK instruction Since multiplication handles the above set value as Setting value Result SC 8-bit data without a sign and an operation without BA reg. A reg. N V C Z a sign is executed, the N flag that is set according to 38C4H 84H Unchanged the operation result does not indicate a sign. UPCK instruction: Consequently, even when negative number are × Converts the 8-bit data of the A register into multiplied with each other such as C8H A5H in unpack format and stores it in the BA register. the above mentioned example, the N flag may at A reg. B reg. A reg. times not be set to '0'. → mn 0m0 n Division Example: UPCK instruction Division is done using the DIV instruction. When executing the DIV instruction, an HL register Setting value Result SC ÷ A register operation is executed, the quotient A reg. BA reg. N V C Z being stored in the L register and the remainder in 84H 0804H Unchanged the H register. When the quotient exceeds 8 bits, the V flag 2.2.6 Multiplication and division (overflow) is set and the content of the HL register is held by the preceding dividend. The E0C88 MODEL1 and MODEL3 possess When a DIV instruction is executed by setting the multiplication and division functions. In MODEL0 A register to '0', a zero division exception process- and MODEL2, these functions and the multiplica- ing is generated. tion/division instructions explained below cannot The N/V/C/Z flags of the SC are set as follows, be used. according to the result of this operation. Multiplication N: When the MSB of Multiplication is done using the MLT instruction. the L register (quotient) is '1' Set (1) When executing an MLT instruction, a L register × When it is '0' Reset (0) A register operation is performed and the product V: When the quotient is not restricted is stored in the HL register. The N/V/C/Z flags of to 8 bits or less Set (1) the SC are set as following according to this When it is restricted Reset (0) operation result. C: Always Reset (0) Z: When the L register (quotient) is 00H Set (1) When it is other than 00H Reset (0)

E0C88 CORE CPU MANUAL EPSON 11 2 ARCHITECTURE

Example: SC operating examples 2.3 Program Memory Setting value SC Comment HL reg. A reg. N V C Z 2.3.1 Configuration of nz nz ↕↕0 ↕ 0000H nz 0001 the program memory nz00H1100 Zero division exception 0000H 00H 1100 processing has occured The first 8M bytes (address 000000H–7FFFFFH) within the 16M byte of address space of the E0C88 nz indicates other than '0' of 8-bit or 16-bit data. are designed to be used as a programming field. However, since the address space is limited to a • Division and multiplication execution examples maximum 64K bytes for MODEL0 and MODEL1, Below are indicated execution examples of DIV the programming field is also limited to that or instructions. less. Setting value Result SC Logic space Physical space HL reg. A reg. L reg. H reg. A reg. N V C Z 0000H Common area Bank 0 000000H 1A16H 64H 42H 4EH 64H 0 0 0 0 7FFFH (32K byte) (32K byte) 007FFFH 332CH 64H 83H 00H 64H 1 0 0 0 8000H Bank area Bank 1 008000H FFFFH (32K byte) (32K byte) 00FFFFH 0000H 58H 00H 00H 58H 0 0 0 1 Bank 2 010000H 0301H 02H 01H 03H 02H 1 1 0 0 (32K byte) 017FFFH (Result: L reg. = quotient, H reg. = remainder) Bank 3 018000H (32K byte) 01FFFFH Since the quotient exceeds 8 bits in the 0301H ÷ 020000H 02H in the above example, the value of the HL : register is held and the result is not output. In cases 7EFFFFH Bank 254 7F0000H such as this, it performs the division by separating (32K byte) 7F7FFFH the dividend into the upper 8 bits and the lower 8 Bank 255 7F8000H bits as shown below. (32K byte) 7FFFFFH

Fig. 2.3.1.1 Configuration of program memory LD HL,#0003H ; Dividend = upper 8 bits LD A,#02H ; Divisor The E0C88 has adopted a bank mapping system to DIV ; L = quotient, H = remainder manage memory that exceeds the 64K bytes logic LD [hhll],L ; Stores the quotient space of the 8-bit CPU. The maximum 8M bytes ; (upper 8 bits) into memory program memory is respectively divided into 32K LD L,#01H ; Dividend bytes banks from bank 0 up to bank 255. ; = H register + upper 8 bits They are laid out on the 64K bytes logic space, such DIV ; that two banks logically continue as the address 0000H–FFFFH. It executes the program within that Setting value Result SC address space. The addressing within the logic HL reg. A reg. L reg. H reg. A reg. N V C Z space is done by the PC (program counter). 0003H 02H 01H 01H 02H 0 0 0 0 The bank 0 (address 000000H–007FFFH) as a 0101H 02H 80H 01H 02H 1 0 0 0 common bank in the logic space address 000000H– Remainder: 01H 007FFFH. It normally becomes fixed for this Quotient: 0180H physical address. The address 000000H–0000FFH is allocated by the exception processing (such as interrupt) vector. See "3.5.2 Exception processing factor and vectors". Since the common area is fixed, there is no need to allocate an exception processing vector for each bank. General purpose subroutines can also be described into the common area.

12 EPSON E0C88 CORE CPU MANUAL 2 ARCHITECTURE

The selected bank is laid out by the CB (code bank) As shown in the figure, 15 bits excluding the most register in the latter half address 8000H–FFFFH significant bit are output to the address bus within bank area. the 16-bit PC. Its content is output to the address The banks that it lays out in this section can be bus A00–A14. The most significant bit of the PC optionally selected by the program. However, for indicates the common area at '0' and the bank area MODEL0 and MODEL1, they are fixed in bank 1 at '1', and this content determines whether or not it and for the minimum modes of MODEL2 and will output CB to the address bus. In the case of the MODEL3, they are fixed in one optionally selected common area, 00H is output to A15–A22 of the bank. address bus and in the case of the bank area, the content 8 bits of the CB are output. A23 of the 2.3.2 PC (Program counter) address bus is for the exclusive use of data memory area and it always outputs '0' at the time of maxi- and CB (Code bank register) mum 8M byte program memory access. As indi- The PC (program counter) holds the program cated above, since the most significant bit of the PC address to be executed. The PC content is the is not output to the address bus, you should be address within the 64K bytes logic space and it aware of this at the time of system development. addresses as program memory logically continuing The PC content is output as is for MODEL0 and each 32K common area and bank area each that is MODEL1, because the address bus is 16 bits. not continued by a physical address. The common area is fixed to bank 0 of the physical address, but one optional bank from among 256 Value of program counter when "LD BA, PC" or banks can be selected for the bank area (MODEL2 "LD HL, PC" instruction is executed and MODEL3). The instruction "LD BA, PC" and "LD HL, PC" CB (code bank) is the register that indicates the load the current value of the program counter bank address (0–255) allocated to this bank area. into the BA and HL registers, respectively. The physical address that is output to the address Remember that when the processor fetches one bus to actually access the memory is created within of these load instruction, it increments the the CPU as shown in Figure 2.3.2.1. program counter by two to point to next instruc- tion. So when "LD BA, PC" or "LD HL, PC" is Common area access (0000HÐ7FFFH) executed, the value of the program counter that Logical address is loaded is not the address of the load instruc- 7015 0 tion, but the address of the instruction following 00H 0 PC (15) it. In other words, PC =

+ 2. For example, if the instruction

23 22 15 14 0 "LD BA, PC" is at address 100H, 102H is loaded 0 00H PC (15) into the BA register. Physical address

Bank area access (8000HÐFFFFH) Logical address 7015 0 CB (8) 1 PC (15)

23 22 15 14 0 0 CB (8) PC (15) Physical address

Fig. 2.3.2.1 Logic address and physical address (MODEL2/3)

E0C88 CORE CPU MANUAL EPSON 13 2 ARCHITECTURE

2.3.3 Bank management NB CB PC Current bank Current bank xxxxH Specifies The execution of the program is basically limited to the branch Branch destination bank Current bank yyyyH within the bank allocated to the logic space. The destination bank bank is only modified at the time of a branch Branch instruction is executed when another bank is Branch destination bank Branch destination bank zzzzH specified by a program. Fig. 2.3.3.1 Bank modification Note: The CB will not be updated even if the PC count has been overflow by the program 2.3.4 Branch instruction execution. It will be reexecuted from the Branch instruction modifies the PC and CB to beginning of the common area. branch the program to an optional address. Here following we will explain the bank specifica- The types of branch instructions are classified as tion method and the operation during branch follows, according to their operation differences. instruction execution. Table 2.3.4.1 Types of branch instructions In addition, the items indicated related to bank Type Condition Instruction modification are summarized for only MODEL2 PC relative jump Conditional JRS, JRL, DJR and MODEL3. Unconditional Bank setting at the time of resetting Indirect jump Unconditional JP At the time of the initial resetting, the CB is PC relative call Conditional CARS, CARL initialized to '1' and bank 1 is allocated to the bank Unconditional area. Indirect call Unconditional CALL Since the common area is fixed to bank 0, the logic Return Unconditional RET, RETS, RETE address becomes the same as the physical address. Software interrupt Unconditional INT This setting is specified by another bank in the program and is not modified until the branching is There are unconditional branch instructions that actually executed by the branch instruction. also unconditionally branch into the respective above mentioned instructions and several types of Bank specification conditional branch instructions that branch The CB that indicates the bank that has been according to the flag status. selected cannot be directly modified by the pro- When the condition for a conditional branch gram. instruction has not been met, it does not branch The NB (new code bank) register has been pre- and instead executes the instruction following that pared for bank specification and it writes the bank branch instruction. address (0–255) of the branch address before See "4.4 Detailed Explanation of Instructions". executing the branch instruction.

LD NB,A (specified by the A register) PC relative jump instruction (JRS, JRL, DJR) LD NB,#bb (specified by the 8-bit immediate data) The PC relative jump is an instruction that adds the relative address that is specified by the operand for The content of the NB is loaded into the CB at the the PC and is branched to that address. It permits point where the branching is actually done by relocatable programming. execution of the branch instruction there following The relative address is a displacement from the and a new bank is selected for the bank area. When address at branching to the branch destination the conditions to not fit for a condition jump or the address, and is specified by one or two bytes. like, branching is not done and the content of the The relative address that can be specified is the CB is conversely loaded into the NB. Consequently, range of -128–127 where the "JRS" instruction is an it is set up, such that when it executes a branch 8-bit complementary and -32768–32767 where the instruction instead of setting the value for the NB, "JRL" instruction is a 16-bit complementary. at that point it will branch into the logic space. In addition, the branch destination address that is added to the PC becomes the logic address for this relative address.

14 EPSON E0C88 CORE CPU MANUAL 2 ARCHITECTURE

Bank 1

Physical Logical : NB CB PC address address 00A06DH A06DH LD NB,#2 01H 01H A06DH

00A070H A070H JRL $+57H 02H 01H A070H

00A073H A073H :

Bank 2 :

0120C7H A0C7H LD A,B 02H 02H A070H + 57H = A0C7H

:

Fig. 2.3.4.1 PC relative jump operation

It can be branched to another bank by prior setting The "JP HL" instruction unconditionally branches of the NB, but the branch destination strictly the content of the HL register as an address. Since cannot specify a physical address within the logic this instruction can convert operation results as space. they are into branch destination addresses, it is Figure 2.3.4.1 shows the operation of the PC effective for such things as the creation of jump relative jump. tables. The "JRS" instruction is set by an unconditional PC relative call instruction (CARS, CARL) jump and 20 types of conditional jump instruc- tions. The PC relative call is the instruction that adds the The "JRL" instruction is set by an unconditional relative address specified by the operand to the PC jump and 4 types of conditional jump instructions. and calls subroutines from that address. The relative address is a displacement from the The "DJR NZ,rr" instruction does '1' subtraction of address at branching to the branch destination B register and when the corresponding result is address, and is specified by one or two bytes. other than '0', it executes the "JRS" unconditional The relative address that can be indicated are the jump instruction. ranges -128–127 where the "CARS" instruction is an This instruction permits the simple entry of the 8-bit complimentary indication and -32768–32767 repeat routine for that initial value portion making where the "CARS" instruction is an 16-bit compli- B register the counter. mentary indication. In addition, since this relative address is added to Example: Wait routine for a 50 cycle time the PC, the branch destination banks becomes the LD B,#12 ;Sets the initial value for the B register (2 cycle) DJR NZ,$ ;Repeats until the B register becomes '0' (48 cycle) logic address. Branching to other addresses as well can be done Indirect jump instruction (JP) by prior setting of the NB, but the branch destina- tion strictly cannot specify a physical relative The indirect jump is the instruction that indirectly address within a logic space. specifies branch destination address. At the time of execution of a subroutine call, the PC The "JP [kk]" instruction loads the content of the value (top address of the instruction following the address 00kk (kk = 00H–FFH, page is fixed at 0) of call instruction) is pushed into the stack as return the memory into the lower 8 bits of the PC and information. loads the content of the address 00kk+1 of the In the maximum mode of MODEL2/3, in addition memory into the upper 8 bits of the PC, then to the PC value, the CB value is also pushed onto unconditionally branches into those addresses. The the stack. When returning from a subroutine, the address 00kk it specifies here is set up as the vector program sequence returns to the bank where the field for exception processing and software subroutine was called. interrupts.

E0C88 CORE CPU MANUAL EPSON 15 2 ARCHITECTURE

In the minimum mode of Bank 1 MODEL2/3, only the PC Physical Logical : NB CB PC value is pushed onto the address address 00A06DH A06DH LD NB,#2 01H 01H A06DH stack, as with MODEL0/1. Consequently, program 00A070H A070H CARL $+57H 02H 01H A070H memory of 64K bytes or Stack 00A073H A073H : +3 more cannot be used. 73H Figure 2.3.4.2 shows the PC Bank 2 A0H 01H relative call operation. : The "CARS" instruction is 0120C7H A0C7H LD A,B 02H 02H A070H + 57H = A0C7H set by an unconditional call : : : and 20 types of conditional call instructions. The 012110H A110H RET 02H 02H A110H "CARL" instruction is set by Bank 1 Stack an unconditional call and 4 types of conditional call : 73H A0H instructions. 00A06DH A06DH LD NB,#2 01H

00A070H A070H CARL $+57H

00A073H A073H : 01H 01H A073H

Fig. 2.3.4.2 PC relative call operation

Indirect call instruction (CALL) In the minimum mode of MODEL2/3, only the PC The indirect call is a call instruction that indirectly value is popped, as with MODEL0/1. When the specifies the subroutine address. bank is changed at the time of the execution or The "CALL [hhll]" instruction loads the content of after execution of the call instruction, return to the the memory address hhll (hhll = 0000H–FFFFH, correct address is impossible even if the return page is specified by EP register) into the lower 8 instruction is executed. bits of the PC and loads the content of the memory The "RET" instruction returns the processing to the address hhll+1 into the upper 8 bits of the PC to top address of the instruction following the call unconditionally call the subroutines for those instruction with the return information as is. addresses. At the time of execution of a subroutine Since the "RETS" instruction returns by adding a '2' call, the PC value (top address of the instruction to the PC value of the return information, it can following the call instruction) and the CB value (in skip the 1 byte instruction following the call case of the MODEL2/3 maximum mode) are instruction. pushed into the stack as return information. Main routine Subroutine : : Return instructions (RET, RETS and RETE) Logical A return instruction is an instruction for returning address : ADD A,B to the routine called from the subroutine accessed 1000H CARS rr : by the call instruction. The return instruction pops 1002H JRS rr JRS NC,$+3 the PC value (top address of the instruction following the call instruction) that was pushed 1004H LD B,H RET Return onto the stack on executing the subroutine call to to 1002H : RETS Return the program counter PC. to 1004H In the maximum mode of MODEL2/3, the CB Fig. 2.3.4.3 Return from subroutine value is also popped from the stack and the program returns to the bank where the subroutine was called.

16 EPSON E0C88 CORE CPU MANUAL 2 ARCHITECTURE

2.4 Data Memory The "RETE" instruction is the return instruction exclusively for the software interrupt routine and 2.4.1 exception processing routine and differs from the Data memory configuration "RET" instruction in that the content of the SC Everything within the address space (maximum (system condition flag) is contained in the return 16M bytes) of the E0C88, with the exception of the information. field it uses as program memory can be used as See "3.5 Exceptional Processing Status". data memory. RAM, display memory, I/O memory controlling Software interrupt instruction (INT) the peripheral circuits and like memory is laid out The software interrupt instruction "INT [kk]" is an in the data memory field. instruction that specifies the vector address of the The data memory is managed by making 64K bytes address 00kk (kk = 00H–FFH, page is fixed at 0) to one page. Figure 2.4.1.1 shows the data memory execute its interrupt routine. It is a type of indirect configuration. call instruction, but the SC (system condition flag) Since the address space is 64K bytes, it is not is also pushed into the stack before branching. necessary to consider management by page for Consequently, the interrupt routines executed by MODEL0/1. MODEL2/3 is configured with 255 this instruction must invariably return by the pages (maximum). "RETE" instruction. See "3.5 Exceptional Processing Status". MODEL0/1 MODEL2/3 0000H 000000H Page 0 Page 0 Value of program counter when relative branch (64K byte) (64K byte) instruction is executed FFFFH 00FFFFH 010000H JRS, CARS and DJR instructions Page 1 The JRS, CARS and DJR instructions are signed (64K byte) 01FFFFH 8-bit relative branch instructions in which 020000H relative address rr (-128 to 127) added to the Page 2 current value of the program counter with sign (64K byte) to determine which address control is branched 02FFFFH to. This branch address is given by following : equation: =

+ rr + (n - 1) FE0000H Page 254 n ... length of the branch instruction (64K byte) For example, if the instruction "JRS LE,rr" is at FEFFFFH address 100H, branch address is set to 102H + rr. FF0000H Page 255 JRL and CARL instructions (64K byte) FFFFFFH The JRL and CARL instructions are signed 16-bit relative branch instructions in which relative Fig. 2.4.1.1 Data memory configuration address qqrr (-32768 to 32767) added to the current value of the program counter with sign to determine which address control is branched to. This branch address is given by following equation: =
+ qqrr + 2 For example, if the instruction "JRL C,qqrr" is at address 100H, branch address is set to 102H + qqrr.

E0C88 CORE CPU MANUAL EPSON 17 2 ARCHITECTURE

Page specification Address specification

Addressing mode 7 XP 0 15 IX 0

7 YP 0 15 IY 0 Register indirect

7 EP 0 15 HL 0

7 EP 0 15 0 16-bit absolute

70EP 0 7 BR 70 8-bit absolute

Physical address Physical address A16ÐA23 A0ÐA15 Page 0

255 Fig. 2.4.2.1 Data memory addressing

2.4.2 Page registers EP, XP, YP Stack pointer SP The physical space of the data memory is logically Data is sequentially pushed from the uppermost delimited into 64K bytes of page. Consequently, address of the stack and, conversely, when data the upper 8 bits of the physical address are man- will be removed it is popped in order, from the last aged as page sections and the lower 16 bits as pushed data. The register that indicates the stack logical addresses. The address specification within address that does this push and pop is the SP (stack a page is done primarily by index register and pointer). immediate data according to the addressing mode. The SP is subtracts '1' (pre-decrement) by one byte The 3 page registers EP, XP and YP are set for data push and adds '1' (post-increment) by one specification of the page sections in MODEL2 and byte data pop. 1 Initial status MODEL3. They are appropriately used according SP Stack to the addressing mode specification. Figure 2.4.2.1 Address 0000H shows the correspondence of the page registers FFFFH with the addressing modes. FFFEH FFFDH 2 Push "data 1" See "4.1 Addressing Mode". :

2.4.3 Stack Address SP FFFFH Data 1 FFFFH (SP = SP - 1) The stack is memory that is accessed in the LIFO FFFEH (Last In, First Out) format and in the E0C88 it is FFFDH allocated to the RAM field of the data memory. : 3 Push "data 2" When a subroutine call, exception processing Address (interrupt), or the like has been generated, the stack FFFFH Data 1 SP is used for register information evacuation by the FFFEH Data 2 FFFEH (SP = SP - 1) CPU. In addition, it can effect such operations as FFFDH 4 Pop data register evacuation at an optional program loca- : tion. Address SP Here following we will describe the storing of data FFFFH Data 1 FFFFH (SP = SP + 1) in a stack as "push" and the removal of stored data FFFEH Data 2 as "pop". FFFDH Data 2 :

Fig. 2.4.3.1 Operation of stack

18 EPSON E0C88 CORE CPU MANUAL 2 ARCHITECTURE

The stack position within the physical memory Exception processing and stack decided by the SPP0–SPP7 (stack pointer page) The return information is pushed to the stack the signal that is input to the core CPU from the same as for a subroutine call, at the time of an peripheral circuit as a page address and when the exception processing (such as interrupt) generation stack is accessed, the content of the SPP0–SPP7 is as well. An SC is included in the return informa- output as is to the page section (A16–A23) of the tion at this time, in addition to the return addresses address. PC and CB (in case of the MODEL2/3 maximum The address within that page is specified by SP. mode). Generally, setting the address 0000H as the initial Stack value of the SP causes the data to be sequentially SP pushed toward the lower address from the final address FFFFH of that page. CB, PC and SC are Note: Since the SP (stack pointer) is undefined at pushed when an exception the time of the initial resetting, you should processing is generated be sure to initialize using the program ("LD CB SP,**" instruction) before the stack is used. PC(H) PC(L) SC SP = SP - 4 Subroutine call and stack When executing a call instruction, the top address of the instruction following the call instruction and Fig. 2.4.3.3 Stack consumption when an exception the CB (in case of MODEL 2/3 maximum mode) processing is generated are pushed into the stack as return addresses prior to the branching to the subroutine. In the maximum mode of MODEL2/3, the genera- Return information that has been pushed into a tion of an exception processing (such as interrupt) stack is popped by execution of a return instruction causes a 4 bytes (PC, CB and SC) consumption of and reset to PC and CB. the stack. In the minimum mode of MODEL2/3 The type of nesting that calls another separate and MODEL0/1, it consumes a 3 bytes portion of subroutine from within a subroutine is possible up PC and SC, except for CB. to any level within the usable page memory allocated by the stack. Other stack operations Stack The return information by the subroutine call or SP exception processing (such as interrupt) is auto- matically pushed, but the general purpose register is not pushed. When you want to return from the CB and PC are pushed subroutine or exception processing routine, when a subroutine call maintaining the contents of general purpose is executed register as it was prior to branching, instructions to CB push and pop the contents of the register must be PC(H) arranged at the beginning and end of the routine, PC(L) SP = SP - 3 respectively. The push/pop of the register is done by the "PUSH" instruction and the "POP" instruction. The Fig. 2.4.3.2 Stack consumption at the time of a registers that can push/pop according to this subroutine call execution instruction are as follows. In the maximum mode of MODEL2/3, a subrou- A, B, L, H, BR, SC, EP*, IP (XP and YP)*, BA, HL, tine call causes a 3 bytes (CB and PC) consumption IX, IY of the stack. In the minimum mode of MODEL2/3 Those with an asterisk "*" do not exist in and MODEL0/1, it consumes a 2 bytes portion of MODEL0/1. PC, except for CB.

E0C88 CORE CPU MANUAL EPSON 19 2 ARCHITECTURE

The "PUSH ALL"/"PUSH ALE" (for MODEL2/3) Data register instruction that pushes all the above mentioned registers except for SC with 1 instruction and the Input/output I/O data "POP ALL"/"POP ALE" (for MODEL2/3) instruc- memory tion that pops with 1 instruction have been pre- D7 D0 pared. Peripheral PUSH ALL = PUSH BA POP ALL = POP BR Control bit circuit PUSH HL POP IY PUSH IX POP IX Status bit PUSH IY POP IY PUSH BR POP BA Control/ PUSH ALE = PUSH BA POP ALE = POP IP PUSH HL POP EP Fig. 2.4.4.1 Peripheral circuit and memory mapped I/O PUSH IX POP BR PUSH IY POP IY Models with built-in LCD driver use part of the PUSH BR POP IX data memory as the display memory for segment PUSH EP POP HL data. Each bit of the display memory field corre- PUSH IP POP BA sponds 1 to 1 with the segment and the turning on/off of the bit causes the corresponding segment "ALL" in the operand is for MODEL0/1. "ALE" is to light/go out. for MODEL2/3, and expanded registers EP and IP The control of this segment can also be done by the (XP and YP) are also pushed/popped. normal memory access instruction. The storing of arguments transferred to subrou- tines and the like in stack field is often done for Note: Depending on the model, there may be structured programming, however, instructions instances where part of the I/O memory that control the SP without the use of the above and/or the display memory may be set up mentioned "PUSH" and "POP" instructions and for writing only. In such cases, it is not that permit easy direct access to stack field have possible effect direct bit control (read/ also been prepared. modify/write) of those sections by such means as arithmetic and logic operation ADD, SUB, CP, INC, DEC, LD instructions. When bit control is performed, a buffer storing the same contents in the Note: Since the stack is allocated to general R/W memory is secured, and the data must purpose RAM, be careful not to overlap the be modified in the buffer, then written it into data field and stack field. primary memory.

2.4.4 Memory mapped I/O Please refer to the various manuals of the E0C88 Family for details on the peripheral circuits, I/O The E0C88 Family makes the E0C88 the core CPU memory and display memory. and builds in various types of circuits, such as input/output ports into its periphery. The E0C88 has adopted a memory mapped I/O system for controlling those various peripheral circuits and registers for handling the interchanges of control bits and data of the peripheral circuits has been laid out in the data memory field. The term I/O memory is used to differentiate this memory field from general purpose RAM, but since they have the page control and access methods in common as data memories, it can control peripheral circuit using normal memory access instructions.

20 EPSON E0C88 CORE CPU MANUAL 3 CPU OPERATION AND PROCESSING STATUS

3 CPU OPERATION AND PROCESSING STATUS CPU operates in synchronising with the High impedance system clock. The CPU process also includes the During an internal register access, the data bus various types of statuses such as the status that goes into high-impedance state. Both the read sequentially executes programs and the standby signal RD and the write signal WR are fixed to a status. Here we will explain the various types of high level, and the address bus outputs a dummy processing statuses including interrupts and the address during the bus cycle period. timing of the operations. T1 T2 T3 T4

CLK

3.1 Timing Generator and Bus Control PK

First we will explain the clock and bus control on PL which the CPU operation is based. A00~A23 Dummy address 3.1.1 Bus cycle WR The timing generator of the E0C88 generates a two RD phase divided signal from the clock CLK that has D0~D7 been input and factors the CLK into states. One DBS1 state becomes 1/2 cycle of the CLK. The one bus cycle that becomes the instruction execution unit is DBS0 composed of four states. Bus cycle State State State State Fig. 3.1.1.2 Bus cycle at the time of internal register access T1 T2 T3 T4

CLK Interrupt vector address read The interrupt vector address is read from the data PK bus between the T2–T3 states. PL At the time of this read, an interrupt vector address read dedicated signal RDIV is output, instead of a Bus cycle read signal RD not being output. The address bus Fig. 3.1.1.1 State and bus cycle outputs a dummy address during the bus cycle period. The numeric values indicated as cycles in the T1 T2 T3 T4 instruction set list indicate the number of bus cycles. CLK In the E0C88, the data bus status in each bus cycle is output externally on the DBS0 and DBS1 signals PK as a 2 bit status. The peripheral circuit can easily PL effect such things as the directional control of the A00~A23 Dummy address bus driver by means of this signal. The state of data bus indicated by DBS0 and DBS1 are as shown in RDIV Table 3.1.1.1. WR

Table 3.1.1.1 Sate of data bus RD

DBS1 DBS0 State D0~D7 Interrupt vector address 0 0 High impedance DBS1 0 1 Interrupt vector address read DBS0 1 0 Memory write 1 1 Memory read Bus cycle Fig. 3.1.1.3 Bus cycle at time of the interrupt vector Here following is indicated the timing chart for address read each bus status.

E0C88 CORE CPU MANUAL EPSON 21 3 CPU OPERATION AND PROCESSING STATUS

Memory write 3.1.2 Wait state At the time of a memory write, written data is The E0C88 can extend the bus cycle by inserting a output to the data bus between T2–T4 states and wait state in order to precisely access the low speed the write signal WR is output to the T3 state. The device connected to the bus line. address bus outputs the target address during the The E0C88 has a function for inserting a WAIT for bus cycle period. access time extensions as wait states and controls it T1 T2 T3 T4 by the input signal of the WAIT terminal. CLK The WAIT signal is sampled at the CLK rising edge PK of the T3 state. When the WAIT signal at this time

PL is low level, it inserts wait states Tw1 and Tw2 between T3 state and T4 state and extends the A00~A23 Address access time. WR When the WAIT signal is high level, the wait state

RD is not inserted. The wait states Tw1 and Tw2 are continuously D0~D7 Write data inserted while the WAIT signal is low level. The DBS1 sampling for releasing the insertion of the wait DBS0 state is done at the CLK rising edge of the Tw2 state and when the WAIT signal returns to high Bus cycle level, the following wait states are not inserted, but Fig. 3.1.1.4 Bus cycle at the time of memory write rather it begins the T4 state. Memory read The wait state is inserted only when it accesses the At the time of memory reading, the read signal RD devices connected on the memory space and is not between the T2–T3 states is output it reads the data inserted when it accesses the internal register. on the data bus. The address bus outputs the target Below is shown the timing chart for wait insertion address during the bus cycle period. for each cycle of the interrupt vector address read, the memory write and the memory read. T1 T2 T3 T4 Wait states CLK T1 T2 T3 Tw1 Tw2 Tw1 Tw2 T4 PK CLK

PL PK

A00~A23 Address PL

WR A00~A23 Dummy address

RD RDIV

D0~D7 Read data WR

DBS1 RD

DBS0 D0~D7 Interrupt vector address

Bus cycle WAIT LLH

Fig. 3.1.1.5 Bus cycle at the time of memory read Bus cycle Fig. 3.1.2.1 Wait insert of the interrupt vector address read cycle

22 EPSON E0C88 CORE CPU MANUAL 3 CPU OPERATION AND PROCESSING STATUS

Wait states Wait states

T1 T2 T3 Tw1 Tw2 Tw1 Tw2 T4 T1 T2 T3 Tw1 Tw2 Tw1 Tw2 T4 CLK CLK

PK PK

PL PL

A00~A23 Address A00~A23 Address

WR WR

RD RD

D0~D7 Write data D0~D7 Read data

WAIT LLH WAIT LLH

Bus cycle Bus cycle Fig. 3.1.2.2 Wait insert of the memory write cycle Fig. 3.1.2.3 Wait insert of the memory read cycle 3.2 Outline of Processing Statuses The operations of the E0C88 can be classified by the content of their processing into five types, reset status, program execution status, exception processing status, bus authority release status and standby status. Table 3.2.1 shows the classification of the processing statuses and Figure 3.2.1 the status transition diagram.

Table 3.2.1 Classification of the processing statuses Processing status Outline Reset status Status where the CPU is reset and stopped. Program execution status Status where the CPU successively executes programs. Exception processing status Transitive status where exception processing (fetching of a vector address, PC and SC evacua- tion, setting of a branch address for the PC) is activated by an exception processing factor such as a reset or interrupt. Bus authority release status Status where an external bus is released by a bus authority request signal from outside. Standby status HALT Status where it stops the CPU and reduces power consumption. SLEEP Status where it stops the CPU and peripheral circuit and reduces power consumption.

Reset status SR = 1 Exception processing status SR = 0

Exception processing Exception processing Interrupt factor factor generation completion generation

HALT Standby status instruction HALT SLEEP

SLP Program execution status instruction BREQ = 1 BREQ = 0 BREQ = 0 Bus authority release status BREQ = 1 Fig. 3.2.1 Status transition diagram

E0C88 CORE CPU MANUAL EPSON 23 3 CPU OPERATION AND PROCESSING STATUS

3.3 Reset Status Table 3.3.1 Initial set value of the internal registers Bit Register name Symbol Initial value The reset status indicates the status where the length E0C88 is reset and stops. The E0C88 is reset by Data register A A 8 Undefined inputting a low level into the SR terminal. Since the Data register B B 8 Undefined resetting is done out of synchronization with the Index (data) register L L 8 Undefined Index (data) register H H 8 Undefined CLK, it shifts from all the processing status to Index register IX IX 16 Undefined immediate reset status. Part of the internal registers Index register IY IY 16 Undefined are initialized by the reset. Table 3.3.1 indicates the Program counter PC 16 Undefined* initial set value of the register. Stack pointer SP 16 Undefined Base register BR 8 Undefined Figure 3.3.1 shows the reset status and the se- Z 1 0 quence following reset release. C 1 0 The address bus, data bus and read/write signals V 1 0 become high impedance during the reset period Negative flag N 1 0 when the SR terminal is low level. However, since Decimal flag D 1 0 the address bus and read/write signals are pulled Unpack flag U 1 0 up within the CPU, a high level is output. Interrupt flag 0 I0 1 1 Interrupt flag 1 I1 1 1 Reset is released when the SR terminal becomes New code bank register NB 8 01H high level and it starts the first bus cycle at the Code bank register CB 8 Undefined* point where the falling edge of the CLK has been Expand page register EP 8 00H input twice. In this bus cycle, a dummy address is Expand page register for IX XP 8 00H output to the address bus and the interrupt Expand page register for IY YP 8 00H acknowledge IACK becomes enabled by the * The value stored in the top of bank 0 (000000H– following bus cycle. As a result, this starts the 000001H) is loaded into the PC by the reset exception processing for reset that loads the start exception processing. At the same time, the address stored in the vector table into the PC initial value 01H of the NB is loaded into the (program counter) which is in undefined status. At CB. this time it simultaneously also does the processing for loading the initial value 01H of the NB (new Registers NB, CB, EP, XP and YP are set for the code bank register) into the CB (code bank regis- MODEL2/3 and do not exist in the MODEL0/1. ter). As a result bank1 (008000H–00FFFFH) is selected for the bank area after resetting. Note: Use the program to initialize, if necessary, After an initial reset, the program is executed from for registers that have not been initialized by start address stored in 000000H–000001H of the resetting. memory. 12 CLK

SR

PK

PL

A00~A23 ANY ANY DUMMY DUMMY DUMMY 000000 000001 (VEC.)

D0~D7 ANY ANY DUMMY DUMMY VECL VECH INST

WR

RD

SYNC

IACK

Reset status Sequence following reset release Fig. 3.3.1 Reset status and sequence following reset release

24 EPSON E0C88 CORE CPU MANUAL 3 CPU OPERATION AND PROCESSING STATUS

3.4 Program Execution Status Figure 3.4.1 shows an example of the following program and instruction execution cycle in accord- The program execution status indicates the status ance with the conditions. where the E0C88 successively executes programs. In the E0C88, the fetching of the first operation Program list code of the instruction is done overlapping the last 001000 44 6E LD A,[BR:6EH] cycle of the immediately prior instruction. 001002 CE 10 34 SUB A,[IX+34H] Consequently, the execution cycle for 1 instruction 001005 50 LD L,A of the E0C88 begins either from the fetch cycle for 001006 69 LD [HL],B the second op-code, the read cycle for the first operand or the first execution cycle (varies depend- Register and memory conditions ing on the instruction) and terminates with the B = 7FH fetch cycle for the first op-code of the following H = 81H instruction. 1 cycle instruction only becomes the BR = 83H fetch cycle of the first op-code of the following IX = 8000H instruction. In addition, there are also instances EP = 00H where it shifts to the fetch cycle of the first op-code XP = 00H rather than interposing an execute cycle after an M(008034H) = 27H operand read cycle. M(00836EH) = 9BH In the fetch cycle of the first op-code, the SYNC signal during that period becomes high level.

CLK

PK

PL

A00~A23 001000 001001 00836E 001002 001003 001004 008034 001005 001006 008174 001007

D0~D7 446E 9B CE10 34 27 50 69 7F ANY

WR

RD

SYNC

LD A,[BR:6EH] SUB A,[IX+34H] LD L,A LD [HL],B

1st op-code Fig. 3.4.1 Example of instruction execution cycle 3.5 Exception Processing Status (processing routine set by the user) from the vector address corresponding to the exception processing Exception processing status indicates a transition factor into the PC, then branches to that processing status where the E0C88 suspends normal program routine. However, for reset exception processing, execution and changes the processing flow due to the return information is not evacuated. an exception processing factor such as an interrupt. The transitive status up to the branching to the Figure 3.5.1 shows the exception processing exception processing routine is the exception sequence. processing status and it returns to the normal Exception processing begins with the termination program execution status after branching. of the instruction cycle being executed at the time Exception processing routines created by the user when an exception processing factor has occurred. take the subroutine format, however, since the SC is As indicated in the exception processing flow, after pushed into the stack, the return instruction invari- evacuation of the return information for reopening ably uses a "RETE" instruction. The "RETE" instruc- the suspended routine into the stack, it loads the tion causes the resumption of the execution of the start address of the exception processing routine routine suspended by the exception processing.

E0C88 CORE CPU MANUAL EPSON 25 3 CPU OPERATION AND PROCESSING STATUS

Exception processing factor generation 3.5.1 Exception processing types and priority Table 3.5.1.1 indicates the types of exception Evaculation of CB processing and priorities. (code bank register) to stack A priority order is set for the exception processing

MODEL2/3 (maximum mode) factors and when multiple factors have been generated at the same time, the exception process- ing having the highest priority is executed first. Evaculation of PC (program counter) to stack When a new exception processing factor has been Exception generated for an exception processing status, a new processing exception processing is executed following the status termination of the exception processing at that time Evaculation of SC (system (prior to the execution of an exception processing condition flag) to stack routine). Reset processing For example, when an NMI has been generated factor generation during IRQ3 exception processing execution, Reading of exception process- sampling of the NMI is done at the final stage of ing vector and loading into PC the IRQ3 exception processing, and the NMI processing routine created by the user is executed ahead of the IRQ3 processing routine created by Execution of exception the user. The IRQ3 processing routine is executed processing routine : after the NMI processing routine has been termi- "RETE" instruction nated. For this reason, the exception processing due to an interrupt has been set up such that an interrupt Return to point of generation having a lower priority than that interrupt will be of exception processing factor masked. Fig. 3.5.1 Exception processing flow Since the exception processing by an INT instruc- tion can be started by the program, a priority is not set.

Table 3.5.1.1 Types of exception processing and priorities Priority Type Exception processing start timing High Reset Initial fetch cycle following change of SR terminal from low level to high level ↑ Immediately following DIV instruction when a DIV instruction (division) has been Zero division executed by divisor zero. NMI When an instruction or exception processing is terminated during execution at the point where a falling edge has been input into the NMI terminal. IRQ3 When an instruction or exception processing is terminated during execution at the point where a low level has been input into the IRQ3 terminal. IRQ2 When an instruction or exception processing is terminated during execution at the point where a low level has been input into the IRQ2 terminal. ↓ IRQ1 When an instruction or exception processing is terminated during execution at the Low point where a low level has been input into the IRQ1 terminal. None INT instruction Execution of the INT instruction

26 EPSON E0C88 CORE CPU MANUAL 3 CPU OPERATION AND PROCESSING STATUS

3.5.2 Exception processing factor and vectors An interrupt can be masked (set such that an interrupt is not accepted) by the interrupt flags I0 The start address of an exception processing and I1. When the interrupt priority level has been routine is set as the vector for the vector address set to the 2 bits I0 and I1 by the program, only corresponding to each exception processing factor. interrupts above that priority level will be ac- This vector is loaded into the PC following excep- cepted. Among them, the NMI of level 4 is always tion processing and branched to the exception accepted regardless of the I0 and I1 settings. processing routine. In addition, when exception processing is executed Table 3.5.2.1 shows the correspondence of the by the generation of an interrupt factor, I0 and I1 vector addresses with the exception processing are set to same level of the accepted interrupt and factors. interrupts of the same level or lower are masked. The vectors are fixed at the 2 bytes address infor- Since the setting of this mask is done after stack mation that indicate the logic address, regardless of evacuation of the SC (system condition flag), the the CPU model. The bank for the exception SC returns to its original status at the point where processing routine cannot be specified even in the the interrupt processing routine has been termi- maximum mode of MODEL2/3. Consequently, it is nated by an "RETE" instruction and the interrupt necessary to set the start address of the exception mask also returns to the original priority level. processing routine to within the common area When you wish to enable multiple interrupts at the (000000H–007FFFH) in order to branch from same level or lower by the interrupt processing multiple banks to a common exception processing routine, you should re-set the priority level within routine. that routine. The IRQ1 to IRQ3 vector addresses are set by a peripheral circuit. In case of an INT instruction, the Table 3.5.3.2 Interrupt mask settings instruction operand becomes the vector address as I1 I0 Acceptable interrupts is and when other exception processing factors are 1 1 NMI also included, it reserves up to a maximum of 128 1 0 NMI, IRQ3 vectors. 0 1 NMI, IRQ3, IRQ2 Table 3.5.2.1 Correspondence of vector addresses with 0 0 NMI, IRQ3, IRQ2, IRQ1 exception processing factors Exception Vector address Table 3.5.3.3 I0 and I1 following interrupt acceptance processing Vector address generation Accepted einterrupt factor I1 I0 factor source NMI 1 1 Reset 000000H–000001H Within CPU IRQ3 1 1 Zero division 000002H–000003H Within CPU NMI 000004H–000005H Within CPU IRQ2 1 0 IRQ1–IRQ3 000006H–0000FFH Peripheral circuit IRQ1 0 1 INT instruction 000000H–0000FFH Instruction operand Interrupts are disabled while the instruction to 3.5.3 Interrupts modify the contents of NB or SC is being executed. The exception processing of the interrupt gener- There are four types of interrupts NMI, IRQ3, IRQ2 ated during that period is started after the follow- and IRQ1 and they are respectively set by the ing instruction has been executed. interrupt priority levels indicated in Table 3.5.3.1. Table 3.5.3.1 Interrupt levels Priority Interrupt priority level Interrupt factor High 4 NMI ↑ 3 IRQ3 ↓ 2 IRQ2 Low 1 IRQ1

E0C88 CORE CPU MANUAL EPSON 27 3 CPU OPERATION AND PROCESSING STATUS

3.5.4 Exception processing sequence Exception processing sampling is done at the rising edge of the SYNC signal (at the start of the first op- code fetch cycle of the instruction). When an exception processing factor has been generated here, the CPU outputs an interrupt acknowledge signal IACK and begins the exception processing. In case of the IRQ1–IRQ3 interrupts, the peripheral circuit that generated the interrupt receives the IACK signal then holds the vector address. Below are indicated the sequences of each excep- tion processing.

CLK

PK

PL

A00~A23 PC PC PC 000000 000001 VEC. VEC.+1 VEC.+2 VEC.+3

D0~D7 DUMMY DUMMY VEC(L) VEC(H) CF 6E nn mm

DBS1

DBS0

RDIV

WR

RD

SYNC

IACK

I1 I0 3 Exception processing Exception processing factor sampling factor sampling

Dummy cycle Exception processing by resetting LD SP,#mmnn

Fig. 3.5.4.1 Exception processing sequence - reset -

28 EPSON E0C88 CORE CPU MANUAL 3 CPU OPERATION AND PROCESSING STATUS

In the MODEL2/3 maximum mode, CB is pushed into stack

CLK

PK

PL

A00~A23 PC PC PC SP-1 SP-2 SP-3 SP-4 000002 000003 VEC. VEC.+1

D0~D7 DUMMY DUMMY CB PC(H) PC(L) SC VEC(L) VEC(H) CF B9

DBS1

DBS0

RDIV

WR

RD

SYNC

IACK

I1 I0 No change Exception processing Exception processing factor sampling factor sampling

DIV Exception processing by zero division PUSH ALE Fig. 3.5.4.2 Exception processing sequence - zero division -

In the MODEL2/3 maximum mode, CB is pushed into stack

CLK

PK

PL

A00~A23 HL PC PC SP-1 SP-2 SP-3 SP-4 000004 000005 VEC. VEC.+1

D0~D7 ANY DUMMY DUMMY CB PC(H) PC(L) SC VEC(L) VEC(H) CF B9

DBS1

DBS0

RDIV

WR

RD

SYNC

IACK

I1 I0 ANY 3 Exception processing Exception processing factor sampling factor sampling

ADC A,[HL] Exception processing by NMI PUSH ALE Fig. 3.5.4.3 Exception processing sequence - NMI -

E0C88 CORE CPU MANUAL EPSON 29 3 CPU OPERATION AND PROCESSING STATUS

In the MODEL2/3 maximum mode, CB is pushed into stack

CLK

PK

PL

A00~A23 HL PC PC SP-1 SP-2 SP-3 SP-4 0000xx 0000xx+1 VEC. VEC.+1

D0~D7 ANY DUMMY VECA CB PC(H) PC(L) SC VEC(L) VEC(H) CF B9 (xx) DBS1

DBS0

RDIV

WR

RD

SYNC

IACK

I1 I0 (IRQ3) 0 or 1 or 2 3

I1 I0 (IRQ2) 0 or 1 2

I1 I0 (IRQ1) 0 1 Exception processing Exception processing factor sampling factor sampling

ADC A,[HL] Exception processing by IRQx PUSH ALE Fig. 3.5.4.4 Exception processing sequence - IRQ1–IRQ3 -

In the MODEL2/3 muximum mode, CB is puched into stack

CLK

PK

PL

A00~A23 HL PC PC+1 SP-1 SP-2 SP-3 SP-4 0000kk 0000kk+1 VEC. VEC.+1

D0~D7 ANY FC kk CB PC(H) PC(L) SC VEC(L) VEC(H) CF B9

DBS1

DBS0

RDIV

WR

RD

SYNC

IACK

I1 I0 No change

ADC A,[HL] Exception processing by INT instruction PUSH ALE Fig. 3.5.4.5 Exception processing sequence - INT instruction -

30 EPSON E0C88 CORE CPU MANUAL 3 CPU OPERATION AND PROCESSING STATUS

3.6 Bus Authority Release Status After shifting to the bus authority release status, the CPU inserts the Tz1 and Tz2 states and samples The E0C88 has a function that releases the bus for the BREQ signal at the falling edge of the CLK of the bus authority request from outside the CPU for the Tz2 state. The Tz1/Tz2 states are continuously such operations as DMA (direct memory access) inserted until high level is detected by this sam- transmission. pling. When high level has been detected, the CPU This status, which releases the bus by responding returns the BACK signal to high level at the rising to an external request, is called the bus authority edge of the CLK of the Tz2 state and immediately release status. after that Tz2 state has terminated, it returns to the In the bus authority release status the address bus normal bus cycle, thus resuming the processing (A00–A23), the data bus (D0–D7) and the read/ that had been suspended. write signal (RD/WR) become high impedance and The bus authority release status can be inserted at the bus master (device external to the CPU that the break-point of the bus cycle, in contrast to the issued the bus authority release request) can aforementioned exception processing status can be directly access another device, such as memory, inserted at the break-point of each instruction connected to the bus. execution cycle. Figure 3.6.1 shows the bus authority release However, during execution of the exception sequence from the program execution status. processing that outputs the IACK signal, a bus The device that becomes the bus master inputs the release request will not be accepted as long as the low level to the BREQ terminal of the CPU, then IACK signal is low level. requests a bus authority release. In the foregoing, we have explained about the shift The CPU for this signal samples twice, at the from the program execution status to the bus falling edge of the CLK of the T2 state (when WAIT authority release status, however, in the bus has been inserted, the Tw1 state) and at the falling standby status as well it can shift from the HALT edge of the CLK of the T4 state, for each bus cycle. status to the bus authority release status. When the BREQ signal was a low level following The fact that the sampling of the bus release the T2 state at the time of the sampling of the T4 request signal in the HALT status is done at the state, the CPU suspends the instruction during falling edge of the CLK of the Th2 state (described execution in that bus cycle and sets the BACK hereafter) differs from the program execution signal to low level, then shifting to the bus status. authority release status. External bus master Figure 3.6.2 shows the sequence of the bus author- receives this BACK signal, then starts the bus ity release from the HALT status. control. In addition, the external bus master must maintain the BREQ signal to low level until the use of the bus from the bus authority release request terminates.

E0C88 CORE CPU MANUAL EPSON 31 3 CPU OPERATION AND PROCESSING STATUS

Tw2 T4 T1 T2 T3 Tw1 Tw2 T4 Tz1 Tz2 Tz1 Tz2 Tz1 Tz2 Tz1 Tz2 T1 T2 T3 CLK

PK

PL

A00~A23 IX HL PC

D0~D7 (IX) (IX) ANY

WR

RD

DBS1/0 3 2 0 3

WAIT

BREQ LLLLH

BACK Program Program execution status Bus authority release status execution status

LD [HL],[IX]

Fig. 3.6.1 Bus authority release sequence from program execution status

T1 T2 T3 T4 Th1 Th2 Th1 Th2 Tz1 Tz2 Tz1 Tz2 Tz1 Tz2 Tz1 Tz2 Th1 Th2 Th1 CLK

PK

PL

A00~A23 PC PC PC

D0~D7

WR

RD

DBS1/0 0

BREQ LLLLH

BACK

Program execution statusHALT status Bus authority release status HALT status

Fig. 3.6.2 Bus authority release sequence from the HALT status

32 EPSON E0C88 CORE CPU MANUAL 3 CPU OPERATION AND PROCESSING STATUS

3.7 Standby Status 3.7.1 HALT status The E0C88 has a function that stops the CPU Since only the CPU stops, you can switch to the operation and using it can greatly reduce power HALT status using the "HALT" instruction. consumption. You can use this function to stop the You can shift from the HALT status to the excep- CPU when there is no processing to be executed in tion processing by the optional interrupts (NMI, the CPU, while there is an application program IRQ1–IRQ3) and when restarted by an interrupt, a present. This is a standby status where the CPU has "RETE" instruction following execution of an been stopped to shift it to low power consumption. exception processing routine causes it to resume This status, as explained below, is available in two program execution from the instruction following types, a HALT status and a SLEEP status. the "HALT" instruction. Since peripheral circuits such as oscillation circuit operate in the HALT status, it is not necessary to establish an interrupt circuit or the like for externally restarting a CPU of an MCU (E0C88 Family) and restarting can be done in an instant. The content of registers and the like within the CPU at the point where the "HALT" instruction was executed are also held in the HALT status. Figure 3.7.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, inter- rupt sampling is done at the falling edge of the CLK of the Th2 state and the generation of an interrupt factor causes it to shift to immediate exception processing.

T3 T4 T1 T2 T3 T4 Th1 Th2 Th1 Th2 Th1 Th2 Th1 Th2 T1 T2 T3 T4 T1 CLK

PK

PL

A00~A23 PC PC PC

D0~D7 AE ANY

WR

RD

DBS1/0 3 0 3

IRQ3

IACK

Program execution status HALT status Exception processing status

Fig. 3.7.1.1 Sequence of shifting to the HALT status and restarting

E0C88 CORE CPU MANUAL EPSON 33 3 CPU OPERATION AND PROCESSING STATUS

3.7.2 SLEEP status Figure 3.7.2.1 shows the sequence of shifting to the SLEEP status and restarting. The SLEEP status is the status where the operations When an external interrupt is generated in the of the peripheral circuits within the MCU and CPU SLEEP status, the peripheral circuit starts to stop and can be shifted to this status by the "SLP" operate and the oscillation circuit also begins to instruction. oscillate. From the SLEEP status it can be shifted to the When the oscillation starts, the CLK input to the exception processing by a reset or an interrupt CPU is masked by the peripheral circuit and the (NMI, IRQ1–IRQ3) from outside the MCU. When input to the CPU is begun after a certain stable restarted by an interrupt, the "RETE" instruction waiting time (several 10 msec–several sec) has following the execution of an exception processing elapsed. The CPU samples the interrupt at the routine permits resumption of program execution falling edge of initially input CLK and starts from the instruction following the "SLP" instruc- exception processing. tion. 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 a safety period is needed for the oscillation circuit when restarting, it is effective when used for extended standby where instantaneous restarting is not necessary. In the SLEEP status, as in the HALT status, the content at the time of execution of the "SLP" instruction is held for registers and the like within the CPU by impression of the rated voltage.

T3 T4 T1 T2 T3 T4Tstp T1 T2 T3 T4 T1 OSC

CLK

PK

PL

A00~A23 PC PC PC

D0~D7 AF ANY

WR

RD

DBS1/0 3 0 3

IRQ3 L

IACK Oscillation stable waiting time

Program execution status SLEEP status Exception processing status Fig. 3.7.2.1 Sequence of the shift to the SLEEP status and restarting

34 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

Immediate data addressing 4 INSTRUCTION Immediate data addressing is the addressing mode when immediate data is used as the operation or transmission source data. It specifies the source SETS operand of the instruction as direct source data The E0C88 offers high machine cycle with 8-bit immediate data and 16-bit immediate efficiency as well as ample, high speed instruction data following the "#". sets. It has 608 instructions (MODEL3) that are The following symbols indicate the immediate data designed as an instruction system permitting for notation of the instruction sets. relocatable programming. Table 4.1.2 Immediate data symbols Here we will explain about the addressing modes Symbol Use Size Range for memory management and about the details of #nn General purpose data 8 bits 0–255 each instruction. #hh For BR setting 8 bits 0–255 #bb For NB setting 8 bits 0–255 #pp For page setting 8 bits 0–255 4.1 Addressing Mode #mmnn General purpose data 16 bits 0–65535 The E0C88 has the 12 types of addressing modes that are explained here following and the address Example: LD A,#03H specifications corresponding to the various statuses A reg. #nn are done concisely and accurately. 05H LD A, #03H The below explanation and examples are basically focused on the source side. 03H Table 4.1.1 Types of addressing modes No. Addressing mode Fig. 4.1.1 Immediate data addressing 1 Immediate data addressing 2 Register direct addressing Register direct addressing 3 Register indirect addressing Register direct addressing is the addressing mode a 4 Register indirect addressing with displacement register is specified as the source or destination. 5 Register indirect addressing with index register It uses a register name lower then the operand for 6 8-bit absolute addressing the notation of the instruction set. 7 16-bit absolute addressing 8 8-bit indirect addressing Type of register notations 9 16-bit indirect addressing 8-bit: A, B, L, H, BR, SC, NB, EP, XP, YP 10 Signed 8-bit PC relative addressing 16-bit: BA, HL, IX, IY, PC, SP, IP (YP and XP) 11 Signed 16-bit PC relative addressing 12 Implied register addressing It can only use MODEL2/3 for NB, EP, XP, YP and IP. When it uses this mode for the source operand, the content of the specified register becomes the source data for the operation or transmission. When used for the destination operand, such operations as the storage of data and calculations can be done for that register.

Example: LD A,B A reg. B reg. 05H LD A, B 03H

03H

Fig. 4.1.2 Register direct addressing

E0C88 CORE CPU MANUAL EPSON 35 4 INSTRUCTION SETS

Register indirect addressing When this mode has been used as the source The register indirect addressing is the addressing operand, the value resulting from adding displace- mode for accessing the data memory and it ment to the content of the specified register indirectly specifies the address of the data memory becomes the data memory address and the content by means of the index register. stored in that address becomes the source data. There are three types of index registers used for When used for the destination operand, such address specification, HL, IX and IY, and their operations as the storage of data and calculations content becomes the data memory address that is can be done for the specified data memory. accessed. In MODEL2/3, it is also necessary to specify the For instruction sets, the index register names are page section and the expand page registers XP (for surrounded by parentheses [ ] and are thus noted IX) and YP (for IY) are used for this purpose. When as [HL], [IX] and [IY]. using a SP (stack pointer), the content of the page When it uses this mode for the source operand, the register for the SP that is set for peripheral circuit content of the specified index register becomes the of each model is used for the page specification. address of the data memory and the content stored Example: LD A,[IX+2] in that address becomes the source data. When IX reg. used for the destination operand, such operations A reg. 3200H as the storage of data and calculations can be done 05H LD A,[ IX +]2 + for the specified data memory. dd 2 In MODEL2/3, specification of the page section is Data memory also necessary and the expand page registers EP 03H XP (for HL), XP (for IX) and YP (for IY) are used for 1AH 1AH 00 3202H this purpose. : 00 3203H

Example: LD A,[HL] XP: Page setting in MODEL2/3 A reg. HL reg. Fig. 4.1.4 Register indirect addressing with 05H LD A, [HL] 3200H displacement

Data memory Register indirect addressing EP 03H 03H 00 3200H with index register 1AH 00 3201H Register indirect addressing with index register is : the same mode as the register indirect addressing with displacement and uses content of the L EP: Page setting in MODEL2/3 register rather than 8-bit data for displacement. Fig. 4.1.3 Register indirect addressing In this case, the content of the L register is handled as signed 8-bit data (-128–127). Register indirect addressing Index registers IX and IY are used for address specification and the register used as displacement with displacement is fixed as the L register. [IX+L] and [IY+L] are Register indirect addressing with displacement is noted for the instruction sets. the addressing mode for accessing the data memory and it specifies the data memory address In MODEL2/3, specification of the page section as by displacement with the register. The data well is necessary and the expand page register XP memory address becomes the value resulting from (for IX) and YP (for IY) are used for this purpose. the adding of the displacement (signed 8-bit data, -128–127) to the content of the specified register. The registers used for address specification are IX, IY and SP. They use the symbol dd for displace- ment by the signed 8-bit data and are noted as [IX+dd], [IY+dd] and [SP+dd].

36 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

16-bit absolute addressing Example: LD A,[IY+L] IY reg. The 16-bit absolute addressing is an addressing A reg. 3200H mode for accessing the data memory and it directly 05H LD A,[ IY +]L + specifies the address by 16-bit absolute addresses. 02H L reg. The symbol hhll is used for the 16-bit absolute Data memory address (0–65535) that performs the address specification for the instruction set and it is noted 03H YP ll 1AH 1AH 00 3202H as [hh ]. : 00 3203H When this mode has been used as the source operand, the specified 16-bit absolute address YP: Page setting in MODEL2/3 becomes the direct data memory address and the content stored in that address becomes the source Fig. 4.1.5 Register indirect addressing with index data. When a destination operand has been used register such operations as storage of data and calculations can be done for the specified data memory. 8-bit absolute addressing 8-bit absolute addressing is the addressing mode In MODEL2/3, it is also necessary to specify a page for accessing the data memory and it directly section and the expand page register EP is used for specifies the lower 8 bits of the address according this purpose. to the 8-bit absolute address. The upper 8 bits of Example: LD A,[3202H] the address are indirectly specified by the BR register content. A reg. hhll It uses the symbol ll for the 8-bit absolute address 05H LD A, [3202H] that specifies the address and notes it as [BR:ll]. When this mode has been used as the source Data memory operand, the content stored in the data memory 03H EP whose address has been specified becomes the 1AH 1AH 00 3202H source data, making the content of the BR register : 00 3203H the upper 8 bits of the address and specified the 8- bit absolute address as the lower 8 bits. When a EP: Page setting in MODEL2/3 destination operand has been used such operations as storage of data and calculations can be done for Fig. 4.1.7 16-bit absolute addressing the specified data memory. 8-bit indirect addressing In MODEL2/3, it is also necessary to specify a page 8-bit indirect addressing is the addressing mode section and the expand page register EP is used for that uses the content of the vector field (000000H– this purpose. 0000FFH) as the branch destination address for the branch instruction and it specifies the vector Example: LD A,[BR:2] address with an 8-bit absolute address. It branches ll A reg. by loading the content of the specified memory 05H LD A, [BR: 2 ] BR reg. address into the lower 8 bits of the PC (program 32H 02H counter) and the content of the following address Data memory into the upper 8 bits of the PC. : EP In MODEL2/3, the branch destination bank can 1AH 1AH 00 3202H also be selected by setting the NB register. 03H 00 3203H The symbol kk is used for the 8-bit absolute address (0–255) that does the address specification EP: Page setting in MODEL2/3 and it is noted as [kk]. Fig. 4.1.6 8-bit absolute addressing There are two types of instructions for this address- ing mode, "JP [kk]" and "INT [kk]".

E0C88 CORE CPU MANUAL EPSON 37 4 INSTRUCTION SETS

Example: JP [80H] The PC value at that time becomes as follows. 2 bytes instruction: PC = instruction top address + 1 CB PC kk 3 bytes instruction: PC = instruction top address + 2 01H A102H JP [80H] For notation of the instruction set, it uses the symbol rr for signed 8-bit PC relative address (-128– Vector area 127). NB 00H 00 0080H 02H 02H 2000H 20H 00 0081H In MODEL2/3, the branch destination bank can : also be selected by setting the NB register.

NB/CB: Bank setting in MODEL2/3 Example: JRS $+38 rr CB PC Fig. 4.1.8 8-bit indirect addressing Front address of JRS (38)-1 01H A102H the instruction (2 byte instruction: +1) 16-bit indirect addressing 01H A103H Current address 16-bit indirect addressing is the addressing mode + of the "CALL [hhll]" instruction and it indirectly 25H specifies the branch destination address by the 16- NB CB bit absolute address (0–65535). It branches the 02H 02H A128H content of the specified data memory address to NB/CB: Bank setting in MODEL2/3 the lower 8 bits of the PC (program counter) and Fig. 4.1.10 Signed 8-bit PC relative addressing the content of the following address to the upper 8 bits of the PC. Signed 16-bit PC relative addressing In MODEL2/3, it is also necessary to specify a page Signed 16-bit PC relative addressing is the address- section and the expand page register EP is used for ing mode used by the branch instruction. A signed this purpose. The branch destination bank can also 16-bit PC relative value (-32768–32767) specified by be selected by setting the NB register. an operand is added to the PC at that time and it branches to that address. Example: CALL [3280H] The PC value at that time becomes the instruction CB PC hhll top address + 2. 01H 3102H CALL [3280H] For notation of the instruction set, it uses the symbol qqrr for signed 16-bit PC relative address Data memory (-32768–32767). EP NB 00H 00 3280H In MODEL2/3, the branch destination bank can 02H 02H 4000H 40H 00 3281H also be selected by setting the NB register. : Example: JRL $-3000H NB/CB: Bank setting in MODEL2/3 qqrr CB PC Front address of EP: Page setting in MODEL2/3 JRL (-3000H)-2 01H A102H the instruction Fig. 4.1.9 16-bit indirect addressing (3 byte instruction: +2) 01H A104H Current address Signed 8-bit PC relative addressing + Signed 8-bit PC relative addressing is the address- CFFEH ing mode used by the branch instruction. A signed NB CB 8-bit PC relative value (-128–127) specified by an 02H 02H 7102H operand is added to the PC at that time and it NB/CB: Bank setting in MODEL2/3 branches to that address. Fig. 4.1.11 Signed 16-bit PC relative addressing

38 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

Implied register addressing Op-code The implied register addressing does not have an The instruction set of the E0C88 has 608 types operand, but rather becomes the register direct (MODEL3) of instructions and it cannot express all addressing implicitly specified by the register. the instructions in 1 byte op-code (operation code). There are five types of instructions for this address- Hence, it makes CEH and CFH of the code into an ing mode, MLT, DIV, SEP, PACK and UPCK. expanded and uses it for the first op-code and expands the instruction by making the following 1 4.2 Instruction Format byte the second op-code. The 16-bit arithmetic/ transfer instructions and stack control instructions One instruction of the E0C88 is configured as are expanded by using code CFH, and the other follows by a 1 byte to 4 bytes code. instructions are expanded by using code CEH. The addressing mode for each instruction is 1 Op-code specified by the lower 3 bits of the first op-code or second op-code. The instructions for register direct 2 Op-code Op-code addressing, register indirect addressing, register (CEH/CFH) indirect addressing with index register are com- 3 Op-code Operand posed of op-codes alone.

Operands 4 Op-code Op-code Operand The instructions for 8-bit immediate data address- (CEH/CFH) ing, register indirect addressing with displacement, 5 Op-code Operand Operand 8-bit absolute addressing (when the source has been specified by register), 8-bit indirect address- 6 Op-code Op-code Operand Operand ing and signed 8-bit PC relative addressing have 1 (CEH/CFH) byte operand and the values specified by the 8-bit data as they are, become operands. Fig. 4.2.1 Instruction format The instructions for 16-bit immediate data address- ing, 8-bit absolute addressing (when the source has been specified by immediate data), 16-bit absolute addressing, 16-bit indirect addressing and signed 16-bit PC relative addressing have 2-byte operands and the lower 8 bits of the value specified by the 16-bit data becomes the first operand and the upper 8 bits becomes the second operand. (In case of the 8-bit absolute addressing, the address specification becomes the first operand and the immediate data becomes the second operand.)

E0C88 CORE CPU MANUAL EPSON 39 4 INSTRUCTION SETS

4.3 Instruction Set List Here has been provided a list classifying the instruction sets of the E0C88 by function. Since a list by addressing modes is also provided in the "APPENDIX," you should refer to them as neces- sary.

4.3.1 Function classification Table 4.3.1.1 indicates the function classifications of the instructions.

Table 4.3.1.1 Instruction function classifications Function Function Mnemonic Operation Mnemonic Operation classification classification 8-bit arithmetic ADD Addition Auxiliary PACK Pack and logic ADC Addition with carry operation UPCK Unpack operation SUB Subtraction SEP Code extension SBC Subtraction with carry 16-bit arithmetic ADD Addition operation ADC Addition with carry AND Logical product SUB Subtraction OR Logical sum SBC Subtraction with carry XOR Exclusive OR CP Comparison CP Comparison INC 1 increment BIT Bit test 16-bit transfer DEC 1 decrement INC 1 increment LD Load DEC 1 decrement Stack control EX Word exchange MLT Multiplication PUSH Push DIV Division Branch POP Pop CPL Complement of 1 JRS Relative short jump NEG Complement of 2 JRL Relative long jump 8-bit transfer LD Load JP Indirect jump EX Byte exchange DJR Loop CARS Relative short call SWAP Nibble exchange CARL Relative long call Rotate/shift RL Rotate to left with carry CALL Indirect call RLC Rotate to left RET Return RR Rotate to right with carry RETE Exception processing return RRC Rotate to right RETS Return and skip SLA Arithmetic shift to left System control INT Software interrupt SLL Logical shift to left NOP No operation SRA Arithmetic shift to right HALT Shifts to HALT status SRL Logical shift to right SLP Shifts to SLEEP status

40 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

4.3.2 Symbol meanings Table 4.3.2.1 indicates the meanings of the symbols used in the instruction list by function for the following items. Table 4.3.2.1 Symbol meanings Register relationship Memory relationship A Data register A [HL] Memory specified by HL register A(H) Upper 4 bits of A register [HL](H) Upper 4 bits of [HL] A(L) Lower 4 bits of A register [HL](L) Lower 4 bits of [HL] B Data register B [HL] Memory specified by HL register BA BA pair register [IX] Memory specified by IX register H Data register H [IX+dd] Memory specified by IX register + dd L Data register L [IX+L] Memory specified by IX register + L register HL Index register HL [IY] Memory specified by IY register IX Index register IX [IY+dd] Memory specified by IY register + dd IX(H) Upper 8 bits of IX register [IY+L] Memory specified by IY register + L register IX(L) Lower 8 bits of IX register [BR:ll] Memory specified by BR register and "ll" IY Index register IY [hhll] Memory specified by "hhll" IY(H) Upper 8 bits of IY register [kk] Vector specified by "kk" IY(L) Lower 8 bits of IY register [SP] Stack specified by SP SP Stack pointer SP [SP+dd] Stack specified by SP+ dd BR Base register BR Flag relationship SC System condition flag SC Z Zero flag CC Customize condition flag CC C Carry flag PC Program counter PC V Overflow flag PC(H) Upper 8 bits of PC N Negative flag PC(L) Lower 8 bits of PC D Decimal flag NB New code bank register NB U Unpack flag CB Code bank register CB I0 Interrupt flag 0 EP Expand page register EP I1 Interrupt flag 1 XP Expand page register XP for IX ↕ Setting/resetting of flag YP Expand page register YP for IY – No change IP XP and YP register 0 Resetting of flag Immediate data F0 Customize condition flag F0 nn 8-bit immediate data (unsigned) F1 Customize condition flag F1 hh Absolute address (upper 8 bits) setting data (unsigned) F2 Customize condition flag F2 ll Absolute address (lower 8 bits) setting data (unsigned) F3 Customize condition flag F3 pp Page setting data (unsigned) Calculation operations and other bb Bank setting data (unsigned) + Addition dd Signed 8-bit displacement - Subtraction rr 8-bit relative address setting data (signed) * Multiplication kk Vector address setting data (unsigned) / Division mmnn 16-bit immediate data (unsigned) ∧ Logical product hhll 16-bit absolute address setting data (unsigned) ∨ Logical sum qqrr 16-bit relative address setting data (signed) ∀ Exclusive OR ★ Instruction permitting decimal and unpack operation

E0C88 CORE CPU MANUAL EPSON 41 4 INSTRUCTION SETS

4.3.3 Instruction list by functions 8-bit Trnsfer Instructions (1/3) SC Mnemonic Operation Cycle Byte Comment Page I1 I0 U D N V C Z LD A,A 40 A←A 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 A,B 41 A←B 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 A,L 42 A←L 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 A,H 43 A←H 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 A,BR CE,C0 A←BR 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 115 A,SC CE,C1 A←SC 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 115 A,#nn B0,nn A←nn 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 122 A,[BR:ll] 44,ll A←[BR:ll] 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 125 A,[hhll] CE,D0,ll,hh A←[hhll] 5 4 Ð Ð Ð Ð Ð Ð Ð Ð 127 A,[HL] 45 A←[HL] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 127 A,[IX] 46 A←[IX] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 129 A,[IY] 47 A←[IY] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 130 A,[IX+dd] CE,40,dd A←[IX+dd] 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 132 A,[IY+dd] CE,41,dd A←[IY+dd] 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 133 A,[IX+L] CE,42 A←[IX+L] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 135 A,[IY+L] CE,43 A←[IY+L] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 136 A,NB CE,C8 A←NB 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 116 A,EP CE,C9 A←EP 2 2 Ð Ð Ð Ð Ð Ð Ð Ð MODEL2/3 116 A,XP CE,CA A←XP 2 2 Ð Ð Ð Ð Ð Ð Ð Ð only 116 A,YP CE,CB A←YP 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 116 LD B,A 48 B←A 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 B,B 49 B←B 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 B,L 4A B←L 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 B,H 4B A←H 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 B,#nn B1,nn B←nn 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 122 B,[BR:ll] 4C,ll B←[BR:ll] 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 125 B,[hhll] CE,D1,ll,hh B←[hhll] 5 4 Ð Ð Ð Ð Ð Ð Ð Ð 127 B,[HL] 4D B←[HL] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 127 B,[IX] 4E B←[IX] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 129 B,[IY] 4F B←[IY] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 130 B,[IX+dd] CE,48,dd B←[IX+dd] 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 132 B,[IY+dd] CE,49,dd B←[IY+dd] 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 133 B,[IX+L] CE,4A B←[IX+L] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 135 B,[IY+L] CE,4B B←[IY+L] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 136 LD L,A 50 L←A 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 L,B 51 L←B 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 L,L 52 L←L 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 L,H 53 L←H 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 L,#nn B2,nn L←nn 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 122 L,[BR:ll] 54,ll L←[BR:ll] 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 125 L,[hhll] CE,D2,ll,hh L←[hhll] 5 4 Ð Ð Ð Ð Ð Ð Ð Ð 127 L,[HL] 55 L←[HL] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 127 L,[IX] 56 L←[IX] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 129 L,[IY] 57 L←[IY] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 130 L,[IX+dd] CE,50,dd L←[IX+dd] 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 132 L,[IY+dd] CE,51,dd L←[IY+dd] 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 133 L,[IX+L] CE,52 L←[IX+L] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 135 L,[IY+L] CE,53 L←[IY+L] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 136 * New code bank register NB and expand page registers EP/XP/YP are set only for MODEL2/3. In MODEL0/1, instructions that access these registers cannot be used.

42 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

8-bit Trnsfer Instructions (2/3) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z LD H,A 58 H←A 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 H,B 59 H←B 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 H,L 5A H←L 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 H,H 5B H←H 1 1 Ð Ð Ð Ð Ð Ð Ð Ð 115 H,#nn B3,nn H←nn 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 122 H,[BR:ll] 5C,ll H←[BR:ll] 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 125 H,[hhll] CE,D3,ll,hh H←[hhll] 5 4 Ð Ð Ð Ð Ð Ð Ð Ð 127 H,[HL] 5D H←[HL] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 127 H,[IX] 5E H←[IX] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 129 H,[IY] 5F H←[IY] 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 130 H,[IX+dd] CE,58,dd H←[IX+dd] 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 132 H,[IY+dd] CE,59,dd H←[IY+dd] 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 133 H,[IX+L] CE,5A H←[IX+L] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 135 H,[IY+L] CE,5B H←[IY+L] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 136 LD BR,A CE,C2 BR←A 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 116 BR,#hh B4,hh BR←hh 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 122 LD SC,A CE,C3 SC←A 3 2 ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ 116 SC,#nn 9F,nn SC←nn 3 2 ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ 122 LD [BR:ll],A 78,ll [BR:ll]←A 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 117 [BR:ll],B 79,ll [BR:ll]←B 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 117 [BR:ll],L 7A,ll [BR:ll]←L 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 117 [BR:ll],H 7B,ll [BR:ll]←H 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 117 [BR:ll],#nn DD,ll,nn [BR:ll]←nn 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 124 [BR:ll],[HL] 7D,ll [BR:ll]←[HL] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 128 [BR:ll],[IX] 7E,ll [BR:ll]←[IX] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 129 [BR:ll],[IY] 7F,ll [BR:ll]←[IY] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 131 LD [hhll],A CE,D4,ll,hh [hhll]←A 5 4 Ð Ð Ð Ð Ð Ð Ð Ð 118 [hhll],B CE,D5,ll,hh [hhll]←B 5 4 Ð Ð Ð Ð Ð Ð Ð Ð 118 [hhll],L CE,D6,ll,hh [hhll]←L 5 4 Ð Ð Ð Ð Ð Ð Ð Ð 118 [hhll],H CE,D7,ll,hh [hhll]←H 5 4 Ð Ð Ð Ð Ð Ð Ð Ð 118 LD [HL],A 68 [HL]←A 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 118 [HL],B 69 [HL]←B 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 118 [HL],L 6A [HL]←L 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 118 [HL],H 6B [HL]←H 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 118 [HL],#nn B5,nn [HL]←nn 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 124 [HL],[BR:ll] 6C,ll [HL]←[BR:ll] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 126 [HL],[HL] 6D [HL]←[HL] 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 128 [HL],[IX] 6E [HL]←[IX] 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 129 [HL],[IY] 6F [HL]←[IY] 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 131 [HL],[IX+dd] CE,60,dd [HL]←[IX+dd] 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 132 [HL],[IY+dd] CE,61,dd [HL]←[IY+dd] 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 134 [HL],[IX+L] CE,62 [HL]←[IX+L] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 135 [HL],[IY+L] CE,63 [HL]←[IY+L] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 137 LD [IX],A 60 [IX]←A 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 119 [IX],B 61 [IX]←B 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 119 [IX],L 62 [IX]←L 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 119 [IX],H 63 [IX]←H 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 119 [IX],#nn B6,nn [IX]←nn 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 125

E0C88 CORE CPU MANUAL EPSON 43 4 INSTRUCTION SETS

8-bit Trnsfer Instructions (3/3) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z LD [IX],[BR:ll] 64,ll [IX]←[BR:ll] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 126 [IX],[HL] 65 [IX]←[HL] 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 128 [IX],[IX] 66 [IX]←[IX] 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 130 [IX],[IY] 67 [IX]←[IY] 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 131 [IX],[IX+dd] CE,68,dd [IX]←[IX+dd] 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 133 [IX],[IY+dd] CE,69,dd [IX]←[IY+dd] 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 134 [IX],[IX+L] CE,6A [IX]←[IX+L] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 136 [IX],[IY+L] CE,6B [IX]←[IY+L] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 137 LD [IY],A 70 [IY]←A 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 119 [IY],B 71 [IY]←B 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 119 [IY],L 72 [IY]←L 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 119 [IY],H 73 [IY]←H 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 119 [IY],#nn B7,nn [IY]←nn 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 125 [IY],[BR:ll] 74,ll [IY]←[BR:ll] 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 126 [IY],[HL] 75 [IY]←[HL] 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 128 [IY],[IX] 76 [IY]←[IX] 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 130 [IY],[IY] 77 [IY]←[IY] 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 131 [IY],[IX+dd] CE,78,dd [IY]←[IX+dd] 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 133 [IY],[IY+dd] CE,79,dd [IY]←[IY+dd] 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 134 [IY],[IX+L] CE,7A [IY]←[IX+L] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 136 [IY],[IY+L] CE,7B [IY]←[IY+L] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 137 LD [IX+dd],A CE,44,dd [IX+dd]←A 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 120 [IX+dd],B CE,4C,dd [IX+dd]←B 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 120 [IX+dd],L CE,54,dd [IX+dd]←L 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 120 [IX+dd],H CE,5C,dd [IX+dd]←H 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 120 LD [IY+dd],A CE,45,dd [IY+dd]←A 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 120 [IY+dd],B CE,4D,dd [IY+dd]←B 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 120 [IY+dd],L CE,55,dd [IY+dd]←L 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 120 [IY+dd],H CE,5D,dd [IY+dd]←H 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 120 LD [IX+L],A CE,46 [IX+L]←A 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 121 [IX+L],B CE,4E [IX+L]←B 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 121 [IX+L],L CE,56 [IX+L]←L 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 121 [IX+L],H CE,5E [IX+L]←H 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 121 LD [IY+L],A CE,47 [IY+L]←A 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 121 [IY+L],B CE,4F [IY+L]←B 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 121 [IY+L],L CE,57 [IY+L]←L 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 121 [IY+L],H CE,5F [IY+L]←H 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 121 LD NB,A CE,CC NB←A 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 117 NB,#bb CE,C4,bb NB←bb 4 3 Ð Ð Ð Ð Ð Ð Ð Ð 123 LD EP,A CE,CD EP←A 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 117 EP,#pp CE,C5,pp EP←pp 3 3 Ð Ð Ð Ð Ð Ð Ð Ð MODEL2/3 123 LD XP,A CE,CE XP←A 2 2 Ð Ð Ð Ð Ð Ð Ð Ð only 117 XP,#pp CE,C6,pp XP←pp 3 3 Ð Ð Ð Ð Ð Ð Ð Ð 123 LD YP,A CE,CF YP←A 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 117 YP,#pp CE,C7,pp YP←pp 3 3 Ð Ð Ð Ð Ð Ð Ð Ð 124 EX A,B CC A↔B 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 105 A,[HL] CD A↔[HL] 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 105 SWAP A F6 A(H)↔A(L) 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 188 [HL] F7 [HL](H)↔[HL](L) 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 188 * New code bank register NB and expand page registers EP/XP/YP are set only for MODEL2/3. In MODEL0/1, instructions that access these registers cannot be used.

44 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

16-bit Trnsfer Instructions (1/2) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z LD BA,BA CF,E0 BA←BA 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 BA,HL CF,E1 BA←HL 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 BA,IX CF,E2 BA←IX 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 BA,IY CF,E3 BA←IY 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 BA,SP CF,F8 BA←SP 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 BA,PC CF,F9 BA←PC+2 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 BA,#mmnn C4,nn,mm BA←mmnn 3 3 Ð Ð Ð Ð Ð Ð Ð Ð 143 BA,[hhll] B8,ll,hh A←[hhll], B←[hhll+1] 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 144 BA,[HL] CF,C0 A←[HL], B←[HL+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 145 BA,[IX] CF,D0 A←[IX], B←[IX+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 146 BA,[IY] CF,D8 A←[IY], B←[IY+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 146 BA,[SP+dd] CF,70,dd A←[SP+dd], B←[SP+dd+1] 6 3 Ð Ð Ð Ð Ð Ð Ð Ð 147 LD HL,BA CF,E4 HL←BA 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 HL,HL CF,E5 HL←HL 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 HL,IX CF,E6 HL←IX 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 HL,IY CF,E7 HL←IY 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 HL,SP CF,F4 HL←SP 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 139 HL,PC CF,F5 HL←PC+2 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 139 HL,#mmnn C5,nn,mm HL←mmnn 3 3 Ð Ð Ð Ð Ð Ð Ð Ð 143 HL,[hhll] B9,ll,hh L←[hhll], H←[hhll+1] 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 144 HL,[HL] CF,C1 L←[HL], H←[HL+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 145 HL,[IX] CF,D1 L←[IX], H←[IX+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 146 HL,[IY] CF,D9 L←[IY], H←[IY+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 146 HL,[SP+dd] CF,71,dd L←[SP+dd], H←[SP+dd+1] 6 3 Ð Ð Ð Ð Ð Ð Ð Ð 147 LD IX,BA CF,E8 IX←BA 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 IX,HL CF,E9 IX←HL 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 IX,IX CF,EA IX←IX 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 IX,IY CF,EB IX←IY 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 IX,SP CF,FA IX←SP 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 139 IX,#mmnn C6,nn,mm IX←mmnn 3 3 Ð Ð Ð Ð Ð Ð Ð Ð 143 IX,[hhll] BA,ll,hh IX(L)←[hhll], IX(H)←[hhll+1] 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 144 IX,[HL] CF,C2 IX(L)←[HL], IX(H)←[HL+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 145 IX,[IX] CF,D2 IX(L)←[IX], IX(H)←[IX+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 146 IX,[IY] CF,DA IX(L)←[IY], IX(H)←[IY+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 146 IX,[SP+dd] CF,72,dd IX(L)←[SP+dd], IX(H)←[SP+dd+1] 6 3 Ð Ð Ð Ð Ð Ð Ð Ð 147 LD IY,BA CF,EC IY←BA 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 IY,HL CF,ED IY←HL 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 IY,IX CF,EE IY←IX 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 IY,IY CF,EF IY←IY 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 138 IY,SP CF,FE IY←SP 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 139 IY,#mmnn C7,nn,mm IY←mmnn 3 3 Ð Ð Ð Ð Ð Ð Ð Ð 143 IY,[hhll] BB,ll,hh IY(L)←[hhll], IY(H)←[hhll+1] 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 144 IY,[HL] CF,C3 IY(L)←[HL], IY(H)←[HL+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 145 IY,[IX] CF,D3 IY(L)←[IX], IY(H)←[IX+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 146 IY,[IY] CF,DB IY(L)←[IY], IY(H)←[IY+1] 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 146 IY,[SP+dd] CF,73,dd IY(L)←[SP+dd], IY(H)←[SP+dd+1] 6 3 Ð Ð Ð Ð Ð Ð Ð Ð 147

E0C88 CORE CPU MANUAL EPSON 45 4 INSTRUCTION SETS

16-bit Trnsfer Instructions (2/2) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z LD SP,BA CF,F0 SP←BA 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 140 SP,[hhll] CF,78,ll,hh SP(L)←[hhll], SP(H)←[hhll+1] 6 4 Ð Ð Ð Ð Ð Ð Ð Ð 145 SP,HL CF,F1 SP←HL 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 140 SP,IX CF,F2 SP←IX 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 140 SP,IY CF,F3 SP←IY 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 140 SP,#mmnn CF,6E,nn,mm SP←mmnn 4 4 Ð Ð Ð Ð Ð Ð Ð Ð 144 LD [hhll],BA BC,ll,hh [hhll]←A, [hhll+1]←B 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 140 [hhll],HL BD,ll,hh [hhll]←L, [hhll+1]←H 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 140 [hhll],IX BE,ll,hh [hhll]←IX(L), [hhll+1]←IX(H) 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 140 [hhll],IY BF,ll,hh [hhll]←IY(L), [hhll+1]←IY(H) 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 140 [hhll],SP CF,7C,ll,hh [hhll]←SP(L), [hhll+1]←SP(H) 6 4 Ð Ð Ð Ð Ð Ð Ð Ð 141 LD [HL],BA CF,C4 [HL]←A, [HL+1]←B 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 141 [HL],HL CF,C5 [HL]←L, [HL+1]←H 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 141 [HL],IX CF,C6 [HL]←IX(L), [HL+1]←IX(H) 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 141 [HL],IY CF,C7 [HL]←IY(L), [HL+1]←IY(H) 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 141 LD [IX],BA CF,D4 [IX]←A, [IX+1]←B 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 142 [IX],HL CF,D5 [IX]←L, [IX+1]←H 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 142 [IX],IX CF,D6 [IX]←IX(L), [IX+1]←IX(H) 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 142 [IX],IY CF,D7 [IX]←IY(L), [IX+1]←IY(H) 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 142 LD [IY],BA CF,DC [IY]←A, [IY+1]←B 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 142 [IY],HL CF,DD [IY]←L, [IY+1]←H 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 142 [IY],IX CF,DE [IY]←IX(L), [IY+1]←IX(H) 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 142 [IY],IY CF,DF [IY]←IY(L), [IY+1]←IY(H) 5 2 Ð Ð Ð Ð Ð Ð Ð Ð 142 LD [SP+dd],BA CF,74,dd [SP+dd]←A, [SP+dd+1]←B 6 3 Ð Ð Ð Ð Ð Ð Ð Ð 143 [SP+dd],HL CF,75,dd [SP+dd]←L, [SP+dd+1]←H 6 3 Ð Ð Ð Ð Ð Ð Ð Ð 143 [SP+dd],IX CF,76,dd [SP+dd]←IX(L), [SP+dd+1]←IX(H) 6 3 Ð Ð Ð Ð Ð Ð Ð Ð 143 [SP+dd],IY CF,77,dd [SP+dd]←IY(L), [SP+dd+1]←IY(H) 6 3 Ð Ð Ð Ð Ð Ð Ð Ð 143 EX BA,HL C8 BA↔HL 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 105 BA,IX C9 BA↔IX 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 105 BA,IY CA BA↔IY 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 105 BA,SP CB BA↔SP 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 105

46 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

8-bit Arithmetic and Logic Operation Instructions (1/4) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z ADD A,A 00 A←A+A 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 67 A,B 01 A←A+B 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 67 A,#nn 02,nn A←A+nn 2 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 67 A,[BR:ll] 04,ll A←A+[BR:ll] 3 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 67 A,[hhll] 05,ll,hh A←A+[hhll] 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 68 A,[HL] 03 A←A+[HL] 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 68 A,[IX] 06 A←A+[IX] 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 68 A,[IY] 07 A←A+[IY] 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 68 A,[IX+dd] CE,00,dd A←A+[IX+dd] 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 69 A,[IY+dd] CE,01,dd A←A+[IY+dd] 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 69 A,[IX+L] CE,02 A←A+[IX+L] 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 69 A,[IY+L] CE,03 A←A+[IY+L] 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 69 [HL],A CE,04 [HL]←[HL]+A 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 70 [HL],#nn CE,05,nn [HL]←[HL]+nn 5 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 70 [HL],[IX] CE,06 [HL]←[HL]+[IX] 5 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 71 [HL],[IY] CE,07 [HL]←[HL]+[IY] 5 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 71 ADC A,A 08 A←A+A+C 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 60 A,B 09 A←A+B+C 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 60 A,#nn 0A,nn A←A+nn+C 2 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 60 A,[BR:ll] 0C,ll A←A+[BR:ll]+C 3 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 60 A,[hhll] 0D,ll,hh A←A+[hhll]+C 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 61 A,[HL] 0B A←A+[HL]+C 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 61 A,[IX] 0E A←A+[IX]+C 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 62 A,[IY] 0F A←A+[IY]+C 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 62 A,[IX+dd] CE,08,dd A←A+[IX+dd]+C 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 62 A,[IY+dd] CE,09,dd A←A+[IY+dd]+C 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 62 A,[IX+L] CE,0A A←A+[IX+L]+C 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 63 A,[IY+L] CE,0B A←A+[IY+L]+C 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 63 [HL],A CE,0C [HL]←[HL]+A+C 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 63 [HL],#nn CE,0D,nn [HL]←[HL]+nn+C 5 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 64 [HL],[IX] CE,0E [HL]←[HL]+[IX]+C 5 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 64 [HL],[IY] CE,0F [HL]←[HL]+[IY]+C 5 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 64 SUB A,A 10 A←A-A 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 180 A,B 11 A←A-B 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 180 A,#nn 12,nn A←A-nn 2 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 180 A,[BR:ll] 14,ll A←A-[BR:ll] 3 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 180 A,[hhll] 15,ll,hh A←A-[hhll] 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 181 A,[HL] 13 A←A-[HL] 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 181 A,[IX] 16 A←A-[IX] 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 181 A,[IY] 17 A←A-[IY] 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 181 A,[IX+dd] CE,10,dd A←A-[IX+dd] 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 182 A,[IY+dd] CE,11,dd A←A-[IY+dd] 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 182 A,[IX+L] CE,12 A←A-[IX+L] 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 182 A,[IY+L] CE,13 A←A-[IY+L] 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 182 [HL],A CE,14 [HL]←[HL]-A 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 183 [HL],#nn CE,15,nn [HL]←[HL]-nn 5 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 183 [HL],[IX] CE,16 [HL]←[HL]-[IX] 5 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 184 [HL],[IY] CE,17 [HL]←[HL]-[IY] 5 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 184

E0C88 CORE CPU MANUAL EPSON 47 4 INSTRUCTION SETS

8-bit Arithmetic and Logic Operation Instructions (2/4) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z SBC A,A 18 A←A-A-C 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 167 A,B 19 A←A-B-C 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 167 A,#nn 1A,nn A←A-nn-C 2 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 167 A,[BR:ll] 1C,ll A←A-[BR:ll]-C 3 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 167 A,[hhll] 1D,ll,hh A←A-[hhll]-C 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 168 A,[HL] 1B A←A-[HL]-C 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 168 A,[IX] 1E A←A-[IX]-C 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 168 A,[IY] 1F A←A-[IY]-C 2 1 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 168 A,[IX+dd] CE,18,dd A←A-[IX+dd]-C 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 169 A,[IY+dd] CE,19,dd A←A-[IY+dd]-C 4 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 169 A,[IX+L] CE,1A A←A-[IX+L]-C 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 169 A,[IY+L] CE,1B A←A-[IY+L]-C 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 169 [HL],A CE,1C [HL]←[HL]-A-C 4 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 170 [HL],#nn CE,1D,nn [HL]←[HL]-nn-C 5 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 170 [HL],[IX] CE,1E [HL]←[HL]-[IX]-C 5 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 171 [HL],[IY] CE,1F [HL]←[HL]-[IY]-C 5 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 171 AND A,A 20 A←A∧A 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 75 A,B 21 A←A∧B 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 75 A,#nn 22,nn A←A∧nn 2 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 75 A,[BR:ll] 24,ll A←A∧[BR:ll] 3 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 75 A,[hhll] 25,ll,hh A←A∧[hhll] 4 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 76 A,[HL] 23 A←A∧[HL] 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 76 A,[IX] 26 A←A∧[IX] 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 76 A,[IY] 27 A←A∧[IY] 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 76 A,[IX+dd] CE,20,dd A←A∧[IX+dd] 4 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 77 A,[IY+dd] CE,21,dd A←A∧[IY+dd] 4 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 77 A,[IX+L] CE,22 A←A∧[IX+L] 4 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 77 A,[IY+L] CE,23 A←A∧[IY+L] 4 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 77 B,#nn CE,B0,nn B←B∧nn 3 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 78 L,#nn CE,B1,nn L←L∧nn 3 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 78 H,#nn CE,B2,nn H←H∧nn 3 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 78 SC,#nn 9C,nn SC←SC∧nn 3 2 79 [BR:ll],#nn D8,ll,nn [BR:ll]←[BR:ll]∧nn 5 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 79 [HL],A CE,24 [HL]←[HL]∧A 4 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 79 [HL],#nn CE,25,nn [HL]←[HL]∧nn 5 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 80 [HL],[IX] CE,26 [HL]←[HL]∧[IX] 5 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 80 [HL],[IY] CE,27 [HL]←[HL]∧[IY] 5 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 80 OR A,A 28 A←A∨A 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 149 A,B 29 A←A∨B 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 149 A,#nn 2A,nn A←A∨nn 2 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 149 A,[BR:ll] 2C,ll A←A∨[BR:ll] 3 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 150 A,[hhll] 2D,ll,hh A←A∨[hhll] 4 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 150 A,[HL] 2B A←A∨[HL] 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 150 A,[IX] 2E A←A∨[IX] 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 151 A,[IY] 2F A←A∨[IY] 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 151 A,[IX+dd] CE,28,dd A←A∨[IX+dd] 4 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 151 A,[IY+dd] CE,29,dd A←A∨[IY+dd] 4 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 151 A,[IX+L] CE,2A A←A∨[IX+L] 4 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 152

48 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

8-bit Arithmetic and Logic Operation Instructions (3/4) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z OR A,[IY+L] CE,2B A←A∨[IY+L] 4 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 152 B,#nn CE,B4,nn B←B∨nn 3 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 152 L,#nn CE,B5,nn L←L∨nn 3 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 152 H,#nn CE,B6,nn H←H∨nn 3 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 153 SC,#nn 9D,nn SC←SC∨nn 3 2 153 [BR:ll],#nn D9,ll,nn [BR:ll]←[BR:ll]∨nn 5 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 153 [HL],A CE,2C [HL]←[HL]∨A 4 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 154 [HL],#nn CE,2D,nn [HL]←[HL]∨nn 5 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 154 [HL],[IX] CE,2E [HL]←[HL]∨[IX] 5 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 154 [HL],[IY] CE,2F [HL]←[HL]∨[IY] 5 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 154 XOR A,A 38 A←A∀A 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 189 A,B 39 A←A∀B 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 189 A,#nn 3A,nn A←A∀nn 2 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 189 A,[BR:ll] 3C,ll A←A∀[BR:ll] 3 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 189 A,[hhll] 3D,ll,hh A←A∀[hhll] 4 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 190 A,[HL] 3B A←A∀[HL] 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 190 A,[IX] 3E A←A∀[IX] 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 190 A,[IY] 3F A←A∀[IY] 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 190 A,[IX+dd] CE,38,dd A←A∀[IX+dd] 4 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 191 A,[IY+dd] CE,39,dd A←A∀[IY+dd] 4 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 191 A,[IX+L] CE,3A A←A∀[IX+L] 4 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 191 A,[IY+L] CE,3B A←A∀[IY+L] 4 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 191 B,#nn CE,B8,nn B←B∀nn 3 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 192 L,#nn CE,B9,nn L←L∀nn 3 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 192 H,#nn CE,BA,nn H←H∀nn 3 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 192 SC,#nn 9E,nn SC←SC∀nn 3 2 ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ 193 [BR:ll],#nn DA,ll,nn [BR:ll]←[BR:ll]∀nn 5 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 193 [HL],A CE,3C [HL]←[HL]∀A 4 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 193 [HL],#nn CE,3D,nn [HL]←[HL]∀nn 5 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 194 [HL],[IX] CE,3E [HL]←[HL]∀[IX] 5 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 194 [HL],[IY] CE,3F [HL]←[HL]∀[IY] 5 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 194 CP A,A 30 A-A 2 1 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 90 A,B 31 A-B 2 1 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 90 A,#nn 32,nn A-nn 2 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 90 A,[BR:ll] 34,ll A-[BR:ll] 3 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 90 A,[hhll] 35,ll,hh A-[hhll] 4 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 91 A,[HL] 33 A-[HL] 2 1 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 91 A,[IX] 36 A-[IX] 2 1 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 92 A,[IY] 37 A-[IY] 2 1 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 92 A,[IX+dd] CE,30,dd A-[IX+dd] 4 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 92 A,[IY+dd] CE,31,dd A-[IY+dd] 4 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 92 A,[IX+L] CE,32 A-[IX+L] 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 93 A,[IY+L] CE,33 A-[IY+L] 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 93 B,#nn CE,BC,nn B-nn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 93 L,#nn CE,BD,nn L-nn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 94 H,#nn CE,BE,nn H-nn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 94 BR,#hh CE,BF,hh BR-hh 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 94 [BR:ll],#nn DB,ll,nn [BR:ll]-nn 4 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 95

E0C88 CORE CPU MANUAL EPSON 49 4 INSTRUCTION SETS

8-bit Arithmetic and Logic Operation Instructions (4/4) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z CP [HL],A CE,34 [HL]-A 3 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 95 [HL],#nn CE,35,nn [HL]-nn 4 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 96 [HL],[IX] CE,36 [HL]-[IX] 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 96 [HL],[IY] CE,37 [HL]-[IY] 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 96 BIT A,B 94 A∧B 2 1 Ð Ð Ð Ð ↕ Ð Ð ↕ 81 A,#nn 96,nn A∧nn 2 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 81 B,#nn 97,nn B∧nn 2 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 81 [BR:ll],#nn DC,ll,nn [BR:ll]∧nn 4 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 82 [HL],#nn 95,nn [HL]∧nn 3 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 82 INC A 80 A←A+1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 106 B 81 B←B+1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 106 L 82 L←L+1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 106 H 83 H←H+1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 106 BR 84 BR←BR+1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 106 [BR:ll] 85,ll [BR:ll]←[BR:ll]+1 4 2 Ð Ð Ð Ð Ð Ð Ð ↕ 107 [HL] 86 [HL]←[HL]+1 3 1 Ð Ð Ð Ð Ð Ð Ð ↕ 107 DEC A 88 A←A-1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 102 B 89 B←B-1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 102 L 8A L←L-1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 102 H 8B H←H-1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 102 BR 8C BR←BR-1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 102 [BR:ll] 8D,ll [BR:ll]←[BR:ll]-1 4 2 Ð Ð Ð Ð Ð Ð Ð ↕ 102 [HL] 8E [HL]←[HL]-1 3 1 Ð Ð Ð Ð Ð Ð Ð ↕ 103 CPL A CE,A0 A←A 3 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 101 B CE,A1 B←B 3 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 101 [BR:ll] CE,A2,ll [BR:ll]←[BR:ll] 5 3 Ð Ð Ð Ð ↕ Ð Ð ↕ 101 [HL] CE,A3 [HL]←[HL] 4 2 Ð Ð Ð Ð ↕ Ð Ð ↕ 101 NEG A CE,A4 A←0-A 3 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 148 B CE,A5 B←0-B 3 2 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 148 [BR:ll] CE,A6,ll [BR:ll]←0-[BR:ll] 5 3 Ð Ð ★ ★ ↕ ↕ ↕ ↕ 148 * Multiplication and division instructions are set only for MODEL1/3. ← ★ ★ ↕ ↕ ↕ ↕ In[HL] MODEL0/2,CE,A7 these instructions[HL] 0-[HL]cannot be used. 4 2 Ð Ð 148 MLT CE,D8 HL←L*A 12 2 Ð Ð Ð Ð ↕ 0 0 ↕ MODEL1/3 147 DIV CE,D9 L←HL/A, H←Remainder 13 2 Ð Ð Ð Ð ↕ ↕ 0 ↕ only 104

50 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

16-bit Arithmetic Operation Instructions (1/2) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z ADD BA,BA CF,00 BA←BA+BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 71 BA,HL CF,01 BA←BA+HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 71 BA,IX CF,02 BA←BA+IX 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 71 BA,IY CF,03 BA←BA+IY 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 71 BA,#mmnn C0,nn,mm BA←BA+mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 72 HL,BA CF,20 HL←HL+BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 72 HL,HL CF,21 HL←HL+HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 72 HL,IX CF,22 HL←HL+IX 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 72 HL,IY CF,23 HL←HL+IY 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 72 HL,#mmnn C1,nn,mm HL←HL+mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 72 IX,BA CF,40 IX←IX+BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 73 IX,HL CF,41 IX←IX+HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 73 IX,#mmnn C2,nn,mm IX←IX+mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 73 IY,BA CF,42 IY←IY+BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 73 IY,HL CF,43 IY←IY+HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 73 IY,#mmnn C3,nn,mm IY←IY+mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 74 SP,BA CF,44 SP←SP+BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 74 SP,HL CF,45 SP←SP+HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 74 SP,#mmnn CF,68,nn,mm SP←SP+mmnn 4 4 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 74 ADC BA,BA CF,04 BA←BA+BA+C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 65 BA,HL CF,05 BA←BA+HL+C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 65 BA,IX CF,06 BA←BA+IX+C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 65 BA,IY CF,07 BA←BA+IY+C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 65 BA,#mmnn CF,60,nn,mm BA←BA+mmnn+C 4 4 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 65 HL,BA CF,24 HL←HL+BA+C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 66 HL,HL CF,25 HL←HL+HL+C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 66 HL,IX CF,26 HL←HL+IX+C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 66 HL,IY CF,27 HL←HL+IY+C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 66 HL,#mmnn CF,61,nn,mm HL←HL+mmnn+C 4 4 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 66 SUB BA,BA CF,08 BA←BA-BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 184 BA,HL CF,09 BA←BA-HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 184 BA,IX CF,0A BA←BA-IX 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 184 BA,IY CF,0B BA←BA-IY 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 184 BA,#mmnn D0,nn,mm BA←BA-mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 185 HL,BA CF,28 HL←HL-BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 185 HL,HL CF,29 HL←HL-HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 185 HL,IX CF,2A HL←HL-IX 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 185 HL,IY CF,2B HL←HL-IY 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 185 HL,#mmnn D1,nn,mm HL←HL-mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 185 IX,BA CF,48 IX←IX-BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 186 IX,HL CF,49 IX←IX-HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 186 IX,#mmnn D2,nn,mm IX←IX-mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 186 IY,BA CF,4A IY←IY-BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 186 IY,HL CF,4B IY←IY-HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 186 IY,#mmnn D3,nn,mm IY←IY-mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 187 SP,BA CF,4C SP←SP-BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 187 SP,HL CF,4D SP←SP-HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 187 SP,#mmnn CF,6A,nn,mm SP←SP-mmnn 4 4 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 187

E0C88 CORE CPU MANUAL EPSON 51 4 INSTRUCTION SETS

16-bit Arithmetic Operation Instructions (2/2) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z SBC BA,BA CF,0C BA←BA-BA-C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 171 BA,HL CF,0D BA←BA-HL-C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 171 BA,IX CF,0E BA←BA-IX-C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 171 BA,IY CF,0F BA←BA-IY-C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 171 BA,#mmnn CF,62,nn,mm BA←BA-mmnn-C 4 4 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 172 HL,BA CF,2C HL←HL-BA-C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 172 HL,HL CF,2D HL←HL-HL-C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 172 HL,IX CF,2E HL←HL-IX-C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 172 HL,IY CF,2F HL←HL-IY-C 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 172 HL,#mmnn CF,63,nn,mm HL←HL-mmnn-C 4 4 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 172 CP BA,BA CF,18 BA-BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 97 BA,HL CF,19 BA-HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 97 BA,IX CF,1A BA-IX 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 97 BA,IY CF,1B BA-IY 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 97 BA,#mmnn D4,nn,mm BA-mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 97 HL,BA CF,38 HL-BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 98 HL,HL CF,39 HL-HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 98 HL,IX CF,3A HL-IX 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 98 HL,IY CF,3B HL-IY 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 98 HL,#mmnn D5,nn,mm HL-mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 98 IX,#mmnn D6,nn,mm IX-mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 99 IY,#mmnn D7,nn,mm IY-mmnn 3 3 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 99 SP,BA CF,5C SP-BA 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 100 SP,HL CF,5D SP-HL 4 2 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 100 SP,#mmnn CF,6C,nn,mm SP-mmnn 4 4 Ð Ð Ð Ð ↕ ↕ ↕ ↕ 100 INC BA 90 BA←BA+1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 107 HL 91 HL←HL+1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 107 IX 92 IX←IX+1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 107 IY 93 IY←IY+1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 107 SP 87 SP←SP+1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 108 DEC BA 98 BA←BA-1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 103 HL 99 HL←HL-1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 103 IX 9A IX←IX-1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 103 IY 9B IY←IY-1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 103 SP 8F SP←SP-1 2 1 Ð Ð Ð Ð Ð Ð Ð ↕ 103

Auxiliary Operation Instructions SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z PACK DE BA A 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 155 * m * nmn UPCK DF ABA2 1 Ð Ð Ð Ð Ð Ð Ð Ð 188 mn 0m0 n SEP CE,A8 B A B A 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 173 0******* 00000000 0******* 1******* 11111111 1*******

52 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

Rotate/Shift Instructions (1/2) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z ↕ ↕ ↕ RL A CE,90 C 76543210 3 2 Ð Ð Ð Ð Ð 162 A ↕ ↕ ↕ B CE,91 C 76543210 3 2 Ð Ð Ð Ð Ð 162 B ↕ ↕ ↕ [BR:ll] CE,92,ll C 76543210 5 3 Ð Ð Ð Ð Ð 163 [BR:ll] ↕ ↕ ↕ [HL] CE,93 C 76543210 4 2 Ð Ð Ð Ð Ð 163 [HL] ↕ ↕ ↕ RLC A CE,94 C 76543210 3 2 Ð Ð Ð Ð Ð 163 A ↕ ↕ ↕ B CE,95 C 76543210 3 2 Ð Ð Ð Ð Ð 163 B ↕ ↕ ↕ [BR:ll] CE,96,ll C 76543210 5 3 Ð Ð Ð Ð Ð 164 [BR:ll] ↕ ↕ ↕ [HL] CE,97 C 76543210 4 2 Ð Ð Ð Ð Ð 164 [HL] ↕ ↕ ↕ RR A CE,98 76543210 C 3 2 Ð Ð Ð Ð Ð 164 A ↕ ↕ ↕ B CE,99 76543210 C 3 2 Ð Ð Ð Ð Ð 164 B ↕ ↕ ↕ [BR:ll] CE,9A,ll 76543210 C 5 3 Ð Ð Ð Ð Ð 165 [BR:ll] ↕ ↕ ↕ [HL] CE,9B 76543210 C 4 2 Ð Ð Ð Ð Ð 165 [HL] ↕ ↕ ↕ RRC A CE,9C 76543210 C 3 2 Ð Ð Ð Ð Ð 166 A ↕ ↕ ↕ B CE,9D 76543210 C 3 2 Ð Ð Ð Ð Ð 166 B ↕ ↕ ↕ [BR:ll] CE,9E,ll 76543210 C 5 3 Ð Ð Ð Ð Ð 166 [BR:ll] ↕ ↕ ↕ [HL] CE,9F 76543210 C 4 2 Ð Ð Ð Ð Ð 166 [HL] ↕ ↕ ↕ ↕ SLA A CE,80 C 76543210 0 3 2 Ð Ð Ð Ð 173 A ↕ ↕ ↕ ↕ B CE,81 C 76543210 0 3 2 Ð Ð Ð Ð 173 B ↕ ↕ ↕ ↕ [BR:ll] CE,82,ll C 76543210 0 5 3 Ð Ð Ð Ð 174 [BR:ll] ↕ ↕ ↕ ↕ [HL] CE,83 C 76543210 0 4 2 Ð Ð Ð Ð 174 [HL] ↕ ↕ ↕ SLL A CE,84 C 76543210 0 3 2 Ð Ð Ð Ð Ð 175 A ↕ ↕ ↕ B CE,85 C 76543210 0 3 2 Ð Ð Ð Ð Ð 175 B ↕ ↕ ↕ [BR:ll] CE,86,ll C 76543210 0 5 3 Ð Ð Ð Ð Ð 175 [BR:ll] ↕ ↕ ↕ [HL] CE,87 C 76543210 0 4 2 Ð Ð Ð Ð Ð 176 [HL]

E0C88 CORE CPU MANUAL EPSON 53 4 INSTRUCTION SETS

Rotate/Shift Instructions (2/2) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z ↕ ↕ ↕ SRA A CE,88 76543210 C 3 2 Ð Ð Ð Ð 0 177 A ↕ ↕ ↕ B CE,89 76543210 C 3 2 Ð Ð Ð Ð 0 177 B ↕ ↕ ↕ [BR:ll] CE,8A,ll 76543210 C 5 3 Ð Ð Ð Ð 0 177 [BR:ll] ↕ ↕ ↕ [HL] CE,8B 76543210 C 4 2 Ð Ð Ð Ð 0 178 [HL] ↕ ↕ SRL A CE,8C 0 76543210 C 3 2 Ð Ð Ð Ð 0 Ð 178 A ↕ ↕ B CE,8D 0 76543210 C 3 2 Ð Ð Ð Ð 0 Ð 178 B ↕ ↕ [BR:ll] CE,8E,ll 0 76543210 C 5 3 Ð Ð Ð Ð 0 Ð 179 [BR:ll] ↕ ↕ [HL] CE,8F 0 76543210 C 4 2 Ð Ð Ð Ð 0 Ð 179 [HL]

Stack Control Instructions SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z PUSH A CF,B0 [SP-1]←A, SP←SP-1 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 158 B CF,B1 [SP-1]←B, SP←SP-1 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 158 L CF,B2 [SP-1]←L, SP←SP-1 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 158 H CF,B3 [SP-1]←H, SP←SP-1 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 158 BR A4 [SP-1]←BR, SP←SP-1 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 159 SC A7 [SP-1]←SC, SP←SP-1 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 160 BA A0 [SP-1]←B, [SP-2]←A, SP←SP-2 4 1 Ð Ð Ð Ð Ð Ð Ð Ð 158 HL A1 [SP-1]←H, [SP-2]←L, SP←SP-2 4 1 Ð Ð Ð Ð Ð Ð Ð Ð 158 IX A2 [SP-1]←IX(H), [SP-2]←IX(L), SP←SP-2 4 1 Ð Ð Ð Ð Ð Ð Ð Ð 158 IY A3 [SP-1]←IY(H), [SP-2]←IY(L), SP←SP-2 4 1 Ð Ð Ð Ð Ð Ð Ð Ð 158 EP A5 [SP-1]←EP, SP←SP-1 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 159 IP A6 [SP-1]←XP, [SP-2]←YP, SP←SP-2 4 1 Ð Ð Ð Ð Ð Ð Ð Ð 159 PUSH ALL CF,B8 PUSH BA, HL, IX, IY, BR 12 2 Ð Ð Ð Ð Ð Ð Ð Ð 160 ALE CF,B9 PUSH BA, HL, IX, IY, BR, EP, IP 15 2 Ð Ð Ð Ð Ð Ð Ð Ð MODEL2/3 only 160 POP A CF,B4 A←[SP], SP←SP+1 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 155 B CF,B5 B←[SP], SP←SP+1 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 155 L CF,B6 L←[SP], SP←SP+1 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 155 H CF,B7 H←[SP], SP←SP+1 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 155 BR AC BR←[SP], SP←SP+1 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 156 SC AF SC←[SP], SP←SP+1 2 1 ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ 156 BA A8 A←[SP], B←[SP+1], SP←SP+2 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 155 HL A9 L←[SP], H←[SP+1], SP←SP+2 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 155 IX AA IX(L)←[SP], IX(H)←[SP+1], SP←SP+2 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 155 IY AB IY(L)←[SP], IY(H)←[SP+1], SP←SP+2 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 155 EP AD EP←[SP], SP←SP+1 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 156 IP AE YP←[SP], XP←[SP+1], SP←SP+2 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 156 POP ALL CF,BC POP BR, IY, IX, HL, BA 11 2 Ð Ð Ð Ð Ð Ð Ð Ð 157 ALE CF,BD POP IP, EP, BR, IY, IX, HL, BA 14 2 Ð Ð Ð Ð Ð Ð Ð Ð MODEL2/3 only 157 * New code bank register NB and expand page registers EP/XP/YP are set only for MODEL2/3. In MODEL0/1, instructions that access these registers cannot be used.

54 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

Branch Instructions (1/4) SC Mnemonic Machine Condition Operation Cycle Byte Page Code I1 I0UDNVCZ JRS rr F1,rr Unconditionable MODEL0/1 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 112 PC←PC+rr+1 MODEL2/3 PC←PC+rr+1, CB←NB JRS C,rr E4,rr C=1 MODEL0/1 2 2 Ð Ð Ð Ð Ð Ð Ð Ð 113 If Condition is true, NC,rr E5,rr C=0 then PC←PC+rr+1 else PC←PC+2 Z,rr E6,rr Z=1 MODEL2/3 If Condition is true, NZ,rr E7,rr Z=0 then PC←PC+rr+1, CB←NB else PC←PC+2, NB←CB JRS LT,rr CE,E0,rr [N∀V]=1 3 3 Ð Ð Ð Ð Ð Ð Ð Ð 113 LE,rr CE,E1,rr Z∨[N∀V]=1 GT,rr CE,E2,rr Z∨[N∀V]=0 MODEL0/1 GE,rr CE,E3,rr [N∀V]=0 If Condition is true, V,rr CE,E4,rr V=1 then PC←PC+rr+2 NV,rr CE,E5,rr V=0 else PC←PC+3 P,rr CE,E6,rr N=0 M,rr CE,E7,rr N=1 F0,rr CE,E8,rr F0=1 F1,rr CE,E9,rr F1=1 F2,rr CE,EA,rr F2=1 MODEL2/3 F3,rr CE,EB,rr F3=1 If Condition is true, NF0,rr CE,EC,rr F0=0 then PC←PC+rr+2, CB←NB NF1,rr CE,ED,rr F1=0 else PC←PC+3, NB←CB NF2,rr CE,EE,rr F2=0 NF3,rr CE,EF,rr F3=0 JRL qqrr F3,rr,qq Unconditionable MODEL0/1 3 3 Ð Ð Ð Ð Ð Ð Ð Ð 110 PC←PC+qqrr+2 MODEL2/3 PC←PC+qqrr+2, CB←NB JRL C,qqrr EC,rr,qq C=1 MODEL0/1 3 3 Ð Ð Ð Ð Ð Ð Ð Ð 111 If Condition is true, NC,qqrr ED,rr,qq C=0 then PC←PC+qqrr+2 else PC←PC+3 Z,qqrr EE,rr,qq Z=1 MODEL2/3 If Condition is true, NZ,qqrr EF,rr,qq Z=0 then PC←PC+qqrr+2, CB←NB else PC←PC+3, NB←CB DJR NZ,rr F5,rr B=0 MODEL0/1 4 2 Ð Ð Ð Ð Ð Ð Ð ↕ 104 B←B-1, If B=0, then PC←PC+rr+1 else PC←PC+2 MODEL2/3 B←B-1, If B=0, then PC←PC+rr+1, CB←NB else PC←PC+2, NB←CB

E0C88 CORE CPU MANUAL EPSON 55 4 INSTRUCTION SETS

Branch Instructions (2/4) SC Mnemonic Machine Condition Operation Cycle Byte Page Code I1 I0UDNVCZ JP HL F4 Unconditionable MODEL0/1 PC←HL 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 109 MODEL2/3 PC←HL, CB←NB [kk] FD,kk Unconditionable MODEL0/1 PC(L)←[00kk], 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 109 PC(H)←[00kk+1] MODEL2/3 PC(L)←[00kk] PC(H)←[00kk+1], CB←NB CARS rr F0,rr Unconditionable MODEL0/1 4 2 Ð Ð Ð Ð Ð Ð Ð Ð 86 [SP-1]←PC(H), [SP-2]←PC(L), SP←SP-2, PC←PC+rr+1 MODEL2/3 (Minimum mode) [SP-1]←PC(H), [SP-2]←PC(L), SP←SP-2, PC←PC+rr+1, CB←NB MODEL2/3 (Maximum mode) 5 [SP-1]←CB, [SP-2]←PC(H), [SP-3]←PC(L), SP←SP-3, PC←PC+rr+1, CB←NB CARS C,rr E0,rr C=1 MODEL0/1 2 Ð Ð Ð Ð Ð Ð Ð Ð 87 If Condition is true then [SP-1]←PC(H), [SP-2]←PC(L), 4 SP←SP-2, PC←PC+rr+1 ← NC,rr E1,rr C=0 else PC PC+2 2 MODEL2/3 (Minimum mode) If Condition is true then [SP-1]←PC(H), [SP-2]←PC(L), 4 SP←SP-2, PC←PC+rr+1, Z,rr E2,rr Z=1 CB←NB else PC←PC+2, NB←CB 2 MODEL2/3 (Maximum mode) If Condition is true NZ,rr E3,rr Z=0 then [SP-1]←CB, [SP-2]←PC(H), 5 [SP-3]←PC(L), SP←SP-3, PC←PC+rr+1, CB←NB else PC←PC+2, NB←CB 2 CARS LT,rr CE,F0,rr [N∀V]=1 MODEL0/1 3 Ð Ð Ð Ð Ð Ð Ð Ð 88 LE,rr CE,F1,rr Z∨[N∀V]=1 If Condition is true ← ← GT,rr CE,F2,rr Z∨[N∀V]=0 then [SP-1] PC(H), [SP-2] PC(L), 5 ← ← GE,rr CE,F3,rr [N∀V]=0 SP SP-2, PC PC+rr+2 ← V,rr CE,F4,rr V=1 else PC PC+3 3 MODEL2/3 (Minimum mode) NV,rr CE,F5,rr V=0 If Condition is true P,rr CE,F6,rr N=0 then [SP-1]←PC(H), [SP-2]←PC(L), 5 M,rr CE,F7,rr N=1 SP←SP-2, PC←PC+rr+2, F0,rr CE,F8,rr F0=1 CB←NB F1,rr CE,F9,rr F1=1 else PC←PC+3, NB←CB 3 F2,rr CE,FA,rr F2=1 MODEL2/3 (Maximum mode) F3,rr CE,FB,rr F3=1 If Condition is true NF0,rr CE,FC,rr F0=0 then [SP-1]←CB, [SP-2]←PC(H), 6 NF1,rr CE,FD,rr F1=0 [SP-3]←PC(L), SP←SP-3, NF2,rr CE,FE,rr F2=0 PC←PC+rr+2, CB←NB NF3,rr CE,FF,rr F3=0 else PC←PC+3, NB←CB 3

56 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

Branch Instructions (3/4) SC Mnemonic Machine Condition Operation Cycle Byte Page Code I1 I0UDNVCZ CARL qqrr F2,rr,qq Unconditionable MODEL0/1 5 3 Ð Ð Ð Ð Ð Ð Ð Ð 84 [SP-1]←PC(H), [SP-2]←PC(L), SP←SP-2, PC←PC+qqrr+2 MODEL2/3 (Minimum mode) [SP-1]←PC(H), [SP-2]←PC(L), SP←SP-2, PC←PC+qqrr+2, CB←NB MODEL2/3 (Maximum mode) 6 [SP-1]←CB, [SP-2]←PC(H), [SP-3]←PC(L), SP←SP-3, PC←PC+qqrr+2, CB←NB CARL C,qqrr E8,rr,qq C=1 MODEL0/1 3 Ð Ð Ð Ð Ð Ð Ð Ð 85 If Condition is true then [SP-1]←PC(H), [SP-2]←PC(L), 5 SP←SP-2, PC←PC+qqrr+2 ← NC,qqrr E9,rr,qq C=0 else PC PC+3 3 MODEL2/3 (Minimum mode) If Condition is true then [SP-1]←PC(H), [SP-2]←PC(L), 5 SP←SP-2, PC←PC+qqrr+2, Z,qqrr EA,rr,qq Z=1 CB←NB else PC←PC+3, NB←CB 3 MODEL2/3 (Maximum mode) If Condition is true NZ,qqrr EB,rr,qq Z=0 then [SP-1]←CB, [SP-2]←PC(H), 6 [SP-3]←PC(L), SP←SP-3, PC←PC+qqrr+2, CB←NB else PC←PC+3, NB←CB 3 CALL [hhll] FB,ll,hh Unconditionable MODEL0/1 7 3 Ð Ð Ð Ð Ð Ð Ð Ð 83 [SP-1]←PC(H), [SP-2]←PC(L), SP←SP-2, PC(L)←[hhll], PC(H)←[hhll+1] MODEL2/3 (Minimum mode) [SP-1]←PC(H), [SP-2]←PC(L), SP←SP-2, PC(L)←[hhll], PC(H)←[hhll+1], CB←NB MODEL2/3 (Maximum mode) 8 [SP-1]←CB, [SP-2]←PC(H), [SP-3]←PC(L), SP←SP-3, PC(L)←[hhll], PC(H)←[hhll+1], CB←NB

E0C88 CORE CPU MANUAL EPSON 57 4 INSTRUCTION SETS

Branch Instructions (4/4) SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z INT [kk] FC,kk MODEL0/1 7 2 Ð Ð Ð Ð Ð Ð Ð Ð 108 [SP-1]←PC(H), [SP-2]←PC(L), [SP-3]←SC, SP←SP-3, PC(L)←[00kk], PC(H)←[00kk+1] MODEL2/3 (Minimum mode) [SP-1]←PC(H), [SP-2]←PC(L), [SP-3]←SC, SP←SP-3, PC(L)←[00kk], PC(H)←[00kk+1], CB←NB MODEL2/3 (Maximum mode) 8 [SP-1]←CB, [SP-2]←PC(H), [SP-3]←PC(L), [SP-4]←SC, SP←SP-4, PC(L)←[00kk], PC(H)←[00kk+1], CB←NB RET F8 MODEL0/1, MODEL2/3 (Minimum mode) 3 1 Ð Ð Ð Ð Ð Ð Ð Ð 161 PC(L)←[SP], PC(H)←[SP+1], SP←SP+2 MODEL2/3 (Maximum mode) 4 PC(L)←[SP], PC(H)←[SP+1], CB←[SP+2], NB←CB, SP←SP+3 RETE F9 MODEL0/1, MODEL2/3 (Minimum mode) 4 1 ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ 161 SC←[SP], PC(L)←[SP+1], PC(H)←[SP+2], SP←SP+3 MODEL2/3 (Maximum mode) 5 SC←[SP], PC(L)←[SP+1], PC(H)←[SP+2], CB←[SP+3], NB←CB, SP←SP+4 RETS FA MODEL0/1, MODEL2/3 (Minimum mode) 5 1 Ð Ð Ð Ð Ð Ð Ð Ð 162 PC(L)←[SP], PC(H)←[SP+1], SP←SP+2, PC←PC+2 MODEL2/3 (Maximum mode) 6 PC(L)←[SP], PC(H)←[SP+1], CB←[SP+2], NB←CB, SP←SP+3, PC←PC+2

System Control Instructions SC Mnemonic Machine Code Operation Cycle Byte Comment Page I1 I0 U D N V C Z NOP FF No Operation 2 1 Ð Ð Ð Ð Ð Ð Ð Ð 149 HALT CE,AE HALT 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 106 SLP CE,AF SLEEP 3 2 Ð Ð Ð Ð Ð Ð Ð Ð 176

58 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

4.4 Detailed Explanation of Instructions Here we will explain each instruction individually. This explanation will be given according to the following format. View of the explanation

Mnemonic Mnemonic meaning Number of bus cycles

ADC A, r |||||||||||||||||||||||| Add with carry r reg. to A reg. |||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A + r + C Mode Src: Register direct Addressing Function Adds the content of the r register (A/B) and Dst: Register direct mode explanation carry (C) to the A register. Example Set Value Result Src indicates Code MSB LSB SC the source and ABCA Object code 0000100r08H/09H✽ NVCZ Dst indicates ✽ r Mnemonic Code • D=0, U=0 18H 25H 0 3DH 0 0 0 0 the destination When multiple A 0 ADC A, A 08H 18H 25H 1 3EH 0 0 0 0 instructions B 1 ADC A, B 09H 30H D0H 0 00H 0 0 1 1 are explained 30H F0H 0 20H 0 0 1 0 Flag I1 I0 U D N V C Z in one point, 30H 50H 0 80H 1 1 0 0 ––★★↕↕↕↕ we will note • D=1, U=0 18 25 1 44 0 0 0 0 such things as • D=1, U=1 18 25 1 04 0 0 1 0 bits that Notes the hexadecimal for instructions Instruction execution change by defined by codes example instruction. Status of the flag following instruction execution – Does not change 0 Reset ↕ Set/reset by execution result ★ Decimal operation/ unpack operation enable

The meaning of the symbols are the same as for the instruction list. See section "4.3.2 Symbol meanings". We will use the below symbols when explaining multiple registers as aggregations. r ...... Data registers A/B, or A/B/L/H ir ...... Index registers IX/IY rp ...... 16-bit (pair) registers BA/HL or 16-bit registers (BA)/HL/IX/IY/(SP) er ...... New code bank register NB and expand page registers EP/XP/YP cc1 ..... Branch conditions C/NC/Z/NZ cc2 ..... Branch conditions LT/LE/GT/GE/V/NV/P/M/F0/F1/F2/F3/NF0/NF1/NF2/NF3 Instructions for which the number of bus cycles differ in the maximum mode and minimum mode are indicated with (MAX) and (MIN) for the number of cycles. MIN includes the MODEL0/1.

E0C88 CORE CPU MANUAL EPSON 59 4 INSTRUCTION SETS

ADC A, r |||||||||||||||||||||||| Add with carry r reg. to A reg. |||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A + r + C Mode Src: Register direct Adds the content of the r register (A/B) and Dst: Register direct carry (C) to the A register. Example Set Value Result Code MSB LSB SC ABCA 0000100r08H/09H✽ NVCZ ✽ r Mnemonic Code • D=0, U=0 18H 25H 0 3DH 0 0 0 0 A 0 ADC A, A 08H 18H 25H 1 3EH 0 0 0 0 B 1 ADC A, B 09H 30H D0H 0 00H 0 0 1 1 30H F0H 0 20H 0 0 1 0 I1 I0 U D N V C Z Flag 30H 50H 0 80H 1 1 0 0 ––★★↕↕↕↕ • D=1, U=0 18 25 1 44 0 0 0 0 • D=1, U=1 18 25 1 04 0 0 1 0

ADC A, #nn ||||||||||||||||| Add with carry immediate data nn to A reg. ||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A + nn + C Mode Src: Immediate data Adds 8-bit immediate data nn and carry (C) Dst: Register direct to the A register. Example Set Value Result Code MSB LSB SC AnnC A 000010100AH NVCZ nn nn • D=0, U=0 18H 25H 0 3DH 0 0 0 0 18H 25H 1 3EH 0 0 0 0 Flag I1 I0 U D N V C Z 30H D0H 0 00H 0 0 1 1 ★★↕↕↕↕ –– 30H F0H 0 20H 0 0 1 0 30H 50H 0 80H 1 1 0 0 • D=1, U=0 18 25 1 44 0 0 0 0 • D=1, U=1 18 25 1 04 0 0 1 0

ADC A, [BR:ll] |||||||||| Add with carry location [BR:ll] to A reg. ||||||||||||||||||||||||||||||||||| 3 cycles ||| Function A ← A + [BR:ll] + C Mode Src: 8-bit absolute Adds the content of the data memory and the Dst: Register direct carry (C) to the A register. The data memory Example Set Value Result address has been specified by the content of SC the BR register (upper byte specification) and A [BR:ll] CA the 8-bit absolute address ll (lower byte NVCZ specification). • D=0, U=0 18H 25H 0 3DH 0 0 0 0 The content of the EP register becomes the 18H 25H 1 3EH 0 0 0 0 page address of the data memory (MODEL2/3). 30H D0H 0 00H 0 0 1 1

Code MSB LSB 30H F0H 0 20H 0 0 1 0 000011000CH 30H 50H 0 80H 1 1 0 0 • D=1, U=0 18 25 1 44 0 0 0 0 ll ll • D=1, U=1 18 25 1 04 0 0 1 0 Flag I1 I0 U D N V C Z ––★★↕↕↕↕

60 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

ADC A, [hhll] ||||||||||||| Add with carry location [hhll] to A reg. ||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function A ← A + [hhll] + C Mode Src: 16-bit absolute Adds the content of the data memory and the Dst: Register direct carry (C) to the A register. The data memory Example Set Value Result address has been specified by the 16-bit SC absolute address hhll. A [hhll]C A The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). • D=0, U=0 18H 25H 0 3DH 0 0 0 0 18H 25H 1 3EH 0 0 0 0 Code MSB LSB 30H D0H 0 00H 0 0 1 1 000011010DH 30H F0H 0 20H 0 0 1 0 ll ll 30H 50H 0 80H 1 1 0 0 hh hh • D=1, U=0 18 25 1 44 0 0 0 0 • D=1, U=1 18 25 1 04 0 0 1 0 Flag I1 I0 U D N V C Z ––★★↕↕↕↕

ADC A, [HL] ||||||||||||||| Add with carry location [HL] to A reg. ||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A + [HL] + C Mode Src: Register indirect Adds the content of the data memory and the Dst: Register direct carry (C) to the A register. The data memory Example Set Value Result address has been specified by the HL register. SC The content of the EP register becomes the A [HL] C A page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 18H 25H 0 3DH 0 0 0 0 Code MSB LSB 18H 25H 1 3EH 0 0 0 0 000010110BH 30H D0H 0 00H 0 0 1 1 Flag I1 I0 U D N V C Z 30H F0H 0 20H 0 0 1 0 ––★★↕↕↕↕ 30H 50H 0 80H 1 1 0 0 • D=1, U=0 18 25 1 44 0 0 0 0 • D=1, U=1 18 25 1 04 0 0 1 0

E0C88 CORE CPU MANUAL EPSON 61 4 INSTRUCTION SETS

ADC A, [ir] ||||||||||||||||||| Add with carry location [ir reg.] to A reg. |||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A + [ir] + C Mode Src: Register indirect Adds the content of the data memory and the Dst: Register direct carry (C) to the A register. The data memory Example Set Value Result address has been specified by the ir register SC (IX/IY). A [ir] C A The content of the XP register (at time of IX NVCZ specification) or the YP register (at time of • D=0, U=0 18H 25H 0 3DH 0 0 0 0 IY specification) becomes the page address 18H 25H 1 3EH 0 0 0 0 of the data memory (MODEL2/3). 30H D0H 0 00H 0 0 1 1

Code MSB LSB 30H F0H 0 20H 0 0 1 0 0000111ir0EH/0FH✽ 30H 50H 0 80H 1 1 0 0 • D=1, U=0 18 25 1 44 0 0 0 0 ✽ ir Mnemonic Code • D=1, U=1 18 25 1 04 0 0 1 0 IX 0 ADC A, [IX] 0EH IY 1 ADC A, [IY] 0FH

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

ADC A, [ir+dd] ||||||||| Add with carry location [ir reg. + dd] to A reg. ||||||||||||||||||||||||| 4 cycles ||| Function A ← A + [ir+dd] + C Mode Src: Register indirect with displacement Adds the content of the data memory and the Dst: Register direct carry (C) to the A register. The data memory Example Set Value Result address has been specified by the sum of the SC content of the ir register (IX/IY) and the A [ir+dd] CA displacement dd. NVCZ The displacement dd is handled as signed • D=0, U=0 18H 25H 0 3DH 0 0 0 0 data and the range is -128 to 127. 18H 25H 1 3EH 0 0 0 0 The content of the XP register (at time of IX 30H D0H 0 00H 0 0 1 1 specification) or the YP register (at time of 30H F0H 0 20H 0 0 1 0 IY specification) becomes the page address 30H 50H 0 80H 1 1 0 0 of the data memory (MODEL2/3). • D=1, U=0 18 25 1 44 0 0 0 0 Code MSB LSB • D=1, U=1 18 25 1 04 0 0 1 0 11001110CEH

0000100ir08H/09H✽

dd dd

✽ ir Mnemonic Code IX 0 ADC A, [IX+dd] 08H IY 1 ADC A, [IY+dd] 09H

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

62 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

ADC A, [ir+L] |||||||||||| Add with carry location [ir reg. + L] to A reg. ||||||||||||||||||||||||||| 4 cycles ||| Function A ← A + [ir+L] + C Mode Src: Register indirect with index register Adds the content of the data memory and the Dst: Register direct carry (C) to the A register. The data memory Example Set Value Result address has been specified by the sum of the SC content of the ir register (IX/IY) and the A [ir+L] C A content of the L register. NVCZ The content of the L register is handled as • D=0, U=0 18H 25H 0 3DH 0 0 0 0 signed data and the range is -128 to 127. 18H 25H 1 3EH 0 0 0 0 The content of the XP register (at time of IX 30H D0H 0 00H 0 0 1 1 specification) or the YP register (at time of 30H F0H 0 20H 0 0 1 0 IY specification) becomes the page address 30H 50H 0 80H 1 1 0 0 of the data memory (MODEL2/3). • D=1, U=0 18 25 1 44 0 0 0 0 Code MSB LSB • D=1, U=1 18 25 1 04 0 0 1 0 11001110CEH

0000101ir0AH/0BH✽

✽ ir Mnemonic Code IX 0 ADC A, [IX+L] 0AH IY 1 ADC A, [IY+L] 0BH

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

ADC [HL], A ||||||||||||||| Add with carry A reg. to location [HL] ||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [HL] ← [HL] + A + C Mode Src: Register direct Adds the content of the A register and the Dst: Register indirect carry (C) to the data memory that has been Example Set Value Result address specified by the HL register. SC The content of the EP register becomes the [HL] A C [HL] page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 18H 25H 0 3DH 0 0 0 0 Code MSB LSB 18H 25H 1 3EH 0 0 0 0 11001110CEH 30H D0H 0 00H 0 0 1 1 000011000CH 30H F0H 0 20H 0 0 1 0 30H 50H 0 80H 1 1 0 0 Flag I1 I0 U D N V C Z • D=1, U=0 18 25 1 44 0 0 0 0 ––★★↕↕↕↕ • D=1, U=1 18 25 1 04 0 0 1 0

E0C88 CORE CPU MANUAL EPSON 63 4 INSTRUCTION SETS

ADC [HL], #nn ||||||||| Add with carry immediate data nn to location [HL] ||||||||||||||||||| 5 cycles ||| Function [HL] ← [HL] + nn + C Mode Src: Immediate data Adds the 8-bit immediate data nn and the Dst: Register indirect carry (C) to the data memory that has been Example Set Value Result address specified by the HL register. SC The content of the EP register becomes the [HL] nn C [HL] page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 18H 25H 0 3DH 0 0 0 0 Code MSB LSB 18H 25H 1 3EH 0 0 0 0 11001110CEH 30H D0H 0 00H 0 0 1 1 000011010DH 30H F0H 0 20H 0 0 1 0 30H 50H 0 80H 1 1 0 0 nn nn • D=1, U=0 18 25 1 44 0 0 0 0 Flag I1 I0 U D N V C Z • D=1, U=1 18 25 1 04 0 0 1 0 ––★★↕↕↕↕

ADC [HL], [ir] |||||||||||| Add with carry location [ir reg.] to location [HL] ||||||||||||||||||||| 5 cycles ||| Function [HL] ← [HL] + [ir] + C Mode Src: Register indirect Adds the content of the data memory that has Dst: Register indirect been address specified by the ir register (IX/ Example Set Value Result IY) and the carry (C) to the data memory that SC has been address specified by the HL register. [HL] [ir] C [HL] The content of the EP register becomes the NVCZ page address of the data memory [HL] and • D=0, U=0 18H 25H 0 3DH 0 0 0 0 the content of the XP register (at time of IX 18H 25H 1 3EH 0 0 0 0 specification) or the YP register (at time of 30H D0H 0 00H 0 0 1 1 IY specification) becomes the page address 30H F0H 0 20H 0 0 1 0 of the data memory [ir] (MODEL2/3). 30H 50H 0 80H 1 1 0 0 Code MSB LSB • D=1, U=0 18 25 1 44 0 0 0 0 11001110CEH • D=1, U=1 18 25 1 04 0 0 1 0

0000111ir0EH/0FH✽

✽ ir Mnemonic Code IX 0 ADC [HL], [IX] 0EH IY 1 ADC [HL], [IY] 0FH

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

64 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

ADC BA, rp ||||||||||||||||| Add with carry rp reg. to BA reg. ||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function BA ← BA + rp + C Mode Src: Register direct Adds the content of the rp register (BA/HL/ Dst: Register direct IX/IY) and the carry (C) to the BA register. Example Set Value Result Code MSB LSB SC BA rp C BA 11001111CFH NVCZ 000001 rp 04H–07H✽ 1380H 3546H 0 48C6H 0000 1380H 3546H 1 48C7H 0000 ✽ rp Mnemonic Code 1380H EC80H 0 0000H 0011 BA 00 ADC BA, BA 04H 5218H 4174H 0 938CH 1100 HL 01 ADC BA, HL 05H 5342H C32AH 1 166DH 0010 IX 10 ADC BA, IX 06H (rp≠BA) IY 11 ADC BA, IY 07H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

ADC BA, #mmnn ||| Add with carry immediate data mmnn to BA reg. |||||||||||||||||||||| 4 cycles ||| Function BA ← BA + mmnn + C Mode Src: Immediate data Adds the 16-bit immediate data mmnn and Dst: Register direct the carry (C) to the BA register. Example Set Value Result Code MSB LSB SC BA mmnn C BA 11001111CFH NVCZ 0110000060H 1380H 3546H 0 48C6H 0000 1380H 3546H 1 48C7H 0000 nn nn 1380H EC80H 0 0000H 0011 mm mm 5218H 4174H 0 938CH 1100 5342H C32AH 1 166DH 0010 Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 65 4 INSTRUCTION SETS

ADC HL, rp ||||||||||||||||| Add with carry rp reg. to HL reg. |||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function HL ← HL + rp + C Mode Src: Register direct Adds the content of the rp register (BA/HL/ Dst: Register direct IX/IY) and the carry (C) to the HL register. Example Set Value Result Code MSB LSB SC HL rp C HL 11001111CFH NVCZ 001001 rp 24H–27H✽ 1380H 3546H 0 48C6H 0000 1380H 3546H 1 48C7H 0000 ✽ rp Mnemonic Code 1380H EC80H 0 0000H 0011 BA 00 ADC HL, BA 24H 5218H 4174H 0 938CH 1100 HL 01 ADC HL, HL 25H 5342H C32AH 1 166DH 0010 IX 10 ADC HL, IX 26H (rp≠HL) IY 11 ADC HL, IY 27H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

ADC HL, #mmnn ||| Add with carry immediate data mmnn to HL reg. ||||||||||||||||||||||| 4 cycles ||| Function HL ← HL + mmnn + C Mode Src: Immediate data Adds the 16-bit immediate data mmnn and Dst: Register direct the carry (C) to the HL register. Example Set Value Result Code MSB LSB SC HL mmnn C HL 11001111CFH NVCZ 0110000161H 1380H 3546H 0 48C6H 0000 1380H 3546H 1 48C7H 0000 nn nn 1380H EC80H 0 0000H 0011 mm mm 5218H 4174H 0 938CH 1100 5342H C32AH 1 166DH 0010 Flag I1 I0 U D N V C Z ––––↕↕↕↕

66 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

ADD A, r |||||||||||||||||||||||| Add r reg. to A reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A + r Mode Src: Register direct Adds the content of the r register (A/B) to the Dst: Register direct A register. Example Set Value Result Code MSB LSB SC ABA 0000000r00H/01H✽ NVCZ ✽ r Mnemonic Code • D=0, U=0 18H25H3DH0000 A 0 ADD A, A 00H 30HD0H00H0011 B 1 ADD A, B 01H 30HF0H20H0010 30H50H80H1100 I1 I0 U D N V C Z Flag • D=1, U=0 1824420000 ––★★↕↕↕↕ • D=1, U=1 1824020010

ADD A, #nn ||||||||||||||||| Add immediate data nn to A reg. |||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A + nn Mode Src: Immediate data Adds 8-bit immediate data nn to the A Dst: Register direct register. Example Set Value Result Code MSB LSB SC AnnA 0000001002H NVCZ nn nn • D=0, U=0 18H25H3DH0000 30HD0H00H0011 Flag I1 I0 U D N V C Z 30HF0H20H0010 ★★↕↕↕↕ –– 30H50H80H1100 • D=1, U=0 1824420000 • D=1, U=1 1824020010

ADD A, [BR:ll] |||||||||| Add location [BR:ll] to A reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function A ← A + [BR:ll] Mode Src: 8-bit absolute Adds the content of the data memory to the A Dst: Register direct register. The data memory address has been Example Set Value Result specified by the content of the BR register SC (upper byte specification) and the 8-bit A [BR:ll]A absolute address ll (lower byte specification). NVCZ The content of the EP register becomes the • D=0, U=0 18H25H3DH0000 page address of the data memory (MODEL2/3). 30HD0H00H0011 30HF0H20H0010 Code MSB LSB 0000010004H 30H50H80H1100 • D=1, U=0 1824420000 ll ll • D=1, U=1 1824020010 Flag I1 I0 U D N V C Z ––★★↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 67 4 INSTRUCTION SETS

ADD A, [hhll] ||||||||||||| Add location [hhll] to A reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function A ← A + [hhll] Mode Src: 16-bit absolute Adds the content of the data memory that has Dst: Register direct been address specified by the 16-bit absolute address hhll to the A register. Example Set Value Result SC The content of the EP register becomes the A [hhll]A page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 18H25H3DH0000 Code MSB LSB 30HD0H00H0011 0000010105H 30HF0H20H0010 ll ll 30H50H80H1100 hh hh • D=1, U=0 1824420000 • D=1, U=1 1824020010 Flag I1 I0 U D N V C Z ––★★↕↕↕↕

ADD A, [HL] ||||||||||||||| Add location [HL] to A reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A + [HL] Mode Src: Register indirect Adds the content of the data memory that has Dst: Register direct been address specified by the HL register to the A register. Example Set Value Result SC The content of the EP register becomes the A [HL] A page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 18H25H3DH0000 Code MSB LSB 30HD0H00H0011 0000001103H 30HF0H20H0010 Flag I1 I0 U D N V C Z 30H50H80H1100 ––★★↕↕↕↕ • D=1, U=0 1824420000 • D=1, U=1 1824020010

ADD A, [ir] ||||||||||||||||||| Add location [ir reg.] to A reg. ||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A + [ir] Mode Src: Register indirect Adds the content of the data memory that has Dst: Register direct been address specified by the ir register (IX/ IY) to the A register. Example Set Value Result SC The content of the XP register (at time of IX A [ir] A specification) or the YP register (at time of NVCZ IY specification) becomes the page address • D=0, U=0 18H25H3DH0000 of the data memory (MODEL2/3). 30HD0H00H0011

Code MSB LSB 30HF0H20H0010 0000011ir06H/07H✽ 30H50H80H1100 • D=1, U=0 1824420000 ✽ ir Mnemonic Code • D=1, U=1 1824020010 IX 0 ADD A, [IX] 06H IY 1 ADD A, [IY] 07H

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

68 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

ADD A, [ir+dd] ||||||||| Add location [ir reg. + dd] to A reg. |||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function A ← A + [ir+dd] Mode Src: Register indirect with displacement Adds the content of the data memory to the A Dst: Register direct register. The data memory address has been specified by the sum of the content of the ir Example Set Value Result SC register (IX/IY) and the displacement dd. A [ir+dd] A The displacement dd is handled as signed NVCZ data and the range is -128 to 127. • D=0, U=0 18H25H3DH0000 The content of the XP register (at time of IX 30HD0H00H0011 specification) or the YP register (at time of 30HF0H20H0010 IY specification) becomes the page address 30H50H80H1100 of the data memory (MODEL2/3). • D=1, U=0 1824420000 Code MSB LSB • D=1, U=1 1824020010 11001110CEH

0000000ir00H/01H✽

dd dd

✽ ir Mnemonic Code IX 0 ADD A, [IX+dd] 00H IY 1 ADD A, [IY+dd] 01H

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

ADD A, [ir+L] |||||||||||| Add location [ir reg. + L] to A reg. |||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function A ← A + [ir+L] Mode Src: Register indirect with index register Adds the content of the data memory to the A Dst: Register direct register. The data memory address has been specified by the sum of the content of the ir Example Set Value Result SC register (IX/IY) and the content of the L A [ir+L] A register. NVCZ The content of the L register is handled as • D=0, U=0 18H25H3DH0000 signed data and the range is -128 to 127. 30HD0H00H0011 The content of the XP register (at time of IX 30HF0H20H0010 specification) or the YP register (at time of 30H50H80H1100 IY specification) becomes the page address • D=1, U=0 1824420000 of the data memory (MODEL2/3). • D=1, U=1 1824020010 Code MSB LSB 11001110CEH

0000001ir02H/03H✽

✽ ir Mnemonic Code IX 0 ADD A, [IX+L] 02H IY 1 ADD A, [IY+L] 03H

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 69 4 INSTRUCTION SETS

ADD [HL], A ||||||||||||||| Add A reg. to location [HL] |||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [HL] ← [HL] + A Mode Src: Register direct Adds the content of the A register to the data Dst: Register indirect memory that has been address specified by the HL register. Example Set Value Result SC The content of the EP register becomes the [HL] A [HL] page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 18H25H3DH0000 Code MSB LSB 30HD0H00H0011 11001110CEH 30HF0H20H0010 0000010004H 30H50H80H1100 • D=1, U=0 1824420000 Flag I1 I0 U D N V C Z • D=1, U=1 1824020010 ––★★↕↕↕↕

ADD [HL], #nn ||||||||| Add immediate data nn to location [HL] |||||||||||||||||||||||||||||||||||| 5 cycles ||| Function [HL] ← [HL] + nn Mode Src: Immediate data Adds the 8-bit immediate data nn to the data Dst: Register indirect memory that has been address specified by the HL register. Example Set Value Result SC The content of the EP register becomes the [HL] nn [HL] page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 18H25H3DH0000 Code MSB LSB 30HD0H00H0011 11001110CEH 30HF0H20H0010 0000010105H 30H50H80H1100 • D=1, U=0 1824420000 nn nn • D=1, U=1 1824020010 Flag I1 I0 U D N V C Z ––★★↕↕↕↕

70 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

ADD [HL], [ir] ||||||||||| Add location [ir reg.] to location [HL] ||||||||||||||||||||||||||||||||||||||| 5 cycles ||| Function [HL] ← [HL] + [ir] Mode Src: Register indirect Adds the content of the data memory that has Dst: Register indirect been address specified by the ir register (IX/ IY) to the data memory that has been address Example Set Value Result SC specified by the HL register. [HL] [ir] [HL] The content of the EP register becomes the NVCZ page address of the data memory [HL] and • D=0, U=0 18H25H3DH0000 the content of the XP register (at time of IX 30HD0H00H0011 specification) or the YP register (at time of 30HF0H20H0010 IY specification) becomes the page address 30H50H80H1100 of the data memory [ir] (MODEL2/3). • D=1, U=0 1824420000 Code MSB LSB • D=1, U=1 1824020010 11001110CEH

0000011ir06H/07H✽

✽ ir Mnemonic Code IX 0 ADD [HL], [IX] 06H IY 1 ADD [HL], [IY] 07H

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

ADD BA, rp ||||||||||||||||| Add rp reg. to BA reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function BA ← BA + rp Mode Src: Register direct Adds the content of the rp register (BA/HL/ Dst: Register direct IX/IY) to the BA register. Example Set Value Result Code MSB LSB SC BA rp BA 11001111CFH NVCZ 000000 rp 00H–03H✽ 1380H 3546H 48C6H 0000 1380H EC80H 0000H 0011 ✽ rp Mnemonic Code 5218H 4174H 938CH 1100 BA 00 ADD BA, BA 00H 5342H C32AH 166CH 0010 HL 01 ADD BA, HL 01H (rp≠BA) IX 10 ADD BA, IX 02H IY 11 ADD BA, IY 03H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 71 4 INSTRUCTION SETS

ADD BA, #mmnn ||| Add immediate data mmnn to BA reg. |||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function BA ← BA + mmnn Mode Src: Immediate data Adds the 16-bit immediate data mmnn to the Dst: Register direct BA register. Example Set Value Result Code MSB LSB SC BA mmnn BA 11000000C0H NVCZ nn nn 1380H 3546H 48C6H 0000 1380H EC80H 0000H 0011 mm mm 5218H 4174H 938CH 1100 Flag I1 I0 U D N V C Z 5342H C32AH 166CH 0010 ––––↕↕↕↕

ADD HL, rp |||||||||||||||||| Add rp reg. to HL reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function HL ← HL + rp Mode Src: Register direct Adds the content of the rp register (BA/HL/ Dst: Register direct IX/IY) to the HL register. Example Set Value Result Code MSB LSB SC HL rp HL 11001111CFH NVCZ 001000 rp 20H–23H✽ 1380H 3546H 48C6H 0000 1380H EC80H 0000H 0011 ✽ rp Mnemonic Code 5218H 4174H 938CH 1100 BA 00 ADD HL, BA 20H 5342H C32AH 166CH 0010 HL 01 ADD HL, HL 21H (rp≠HL) IX 10 ADD HL, IX 22H IY 11 ADD HL, IY 23H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

ADD HL, #mmnn ||| Add immediate data mmnn to HL reg. |||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function HL ← HL + mmnn Mode Src: Immediate data Adds the 16-bit immediate data mmnn to the Dst: Register direct HL register. Example Set Value Result Code MSB LSB SC HL mmnn HL 11000001C1H NVCZ nn nn 1380H 3546H 48C6H 0000 1380H EC80H 0000H 0011 mm mm 5218H 4174H 938CH 1100 Flag I1 I0 U D N V C Z 5342H C32AH 166CH 0010 ––––↕↕↕↕

72 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

ADD IX, rp ||||||||||||||||||| Add rp reg. to IX reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function IX ← IX + rp Mode Src: Register direct Adds the content of the rp register (BA/HL) Dst: Register direct to the IX register. Example Set Value Result Code MSB LSB SC IX rp IX 11001111CFH NVCZ 0100000rp40H/41H✽ 1380H 3546H 48C6H 0000 1380H EC80H 0000H 0011 ✽ rp Mnemonic Code 5218H 4174H 938CH 1100 BA 0 ADD IX, BA 40H 5342H C32AH 166CH 0010 HL 1 ADD IX, HL 41H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

ADD IX, #mmnn ||||| Add immediate data mmnn to IX reg. |||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function IX ← IX + mmnn Mode Src: Immediate data Adds the 16-bit immediate data mmnn to the Dst: Register direct IX register. Example Set Value Result Code MSB LSB SC IX mmnn IX 11000010C2H NVCZ nn nn 1380H 3546H 48C6H 0000 1380H EC80H 0000H 0011 mm mm 5218H 4174H 938CH 1100 Flag I1 I0 U D N V C Z 5342H C32AH 166CH 0010 ––––↕↕↕↕

ADD IY, rp |||||||||||||||||||| Add rp reg. to IY reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function IY ← IY + rp Mode Src: Register direct Adds the content of the rp register (BA/HL) Dst: Register direct to the IY register. Example Set Value Result Code MSB LSB SC IY rp IY 11001111CFH NVCZ 0100001rp42H/43H✽ 1380H 3546H 48C6H 0000 1380H EC80H 0000H 0011 ✽ rp Mnemonic Code 5218H 4174H 938CH 1100 BA 0 ADD IY, BA 42H 5342H C32AH 166CH 0010 HL 1 ADD IY, HL 43H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 73 4 INSTRUCTION SETS

ADD IY, #mmnn |||||| Add immediate data mmnn to IY reg. ||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function IY ← IY + mmnn Mode Src: Immediate data Adds the 16-bit immediate data mmnn to the Dst: Register direct IY register. Example Set Value Result Code MSB LSB SC IY mmnn IY 11000011C3H NVCZ nn nn 1380H 3546H 48C6H 0000 1380H EC80H 0000H 0011 mm mm 5218H 4174H 938CH 1100 Flag I1 I0 U D N V C Z 5342H C32AH 166CH 0010 ––––↕↕↕↕

ADD SP, rp |||||||||||||||||| Add rp reg. to SP ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function SP ← SP + rp Mode Src: Register direct Adds the content of the rp register (BA/HL) Dst: Register direct to the stack pointer (SP). Example Set Value Result Code MSB LSB SC SP rp SP 11001111CFH NVCZ 0100010rp44H/45H✽ 1380H 3546H 48C6H 0000 1380H EC80H 0000H 0011 ✽ rp Mnemonic Code 5218H 4174H 938CH 1100 BA 0 ADD SP, BA 44H 5342H C32AH 166CH 0010 HL 1 ADD SP, HL 45H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

ADD SP, #mmnn |||| Add immediate data mmnn to SP |||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function SP ← SP + mmnn Mode Src: Immediate data Adds the 16-bit immediate data mmnn to the Dst: Register direct stack pointer (SP). Example Set Value Result Code MSB LSB SC SP mmnn SP 11001111CFH NVCZ 0110100068H 1380H 3546H 48C6H 0000 1380H EC80H 0000H 0011 nn nn 5218H 4174H 938CH 1100 mm mm 5342H C32AH 166CH 0010

Flag I1 I0 U D N V C Z ––––↕↕↕↕

74 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

AND A, r |||||||||||||||||||||||| Logical AND of r reg. and A reg. |||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A ∧ r Mode Src: Register direct Takes a logical product of the content of the r Dst: Register direct register (A/B) and the content of the A Example Set Value Result register and stores the result in the A register. SC ABA Code MSB LSB NVCZ 0010000r20H/21H✽ 3BH61H21H0––0 ✽ r Mnemonic Code 5AHA5H00H0––1 A 0 AND A, A 20H D6H93H92H1––0 B 1 AND A, B 21H

Flag I1 I0 U D N V C Z ––––↕ ––↕

AND A, #nn |||||||||||||||| Logical AND of immediate data nn and A reg. ||||||||||||||||||||||||||| 2 cycles ||| Function A ← A ∧ nn Mode Src: Immediate data Takes a logical product of the 8-bit immedi- Dst: Register direct ate data nn and the content of the A register Example Set Value Result and stores the result in the A register. SC AnnA Code MSB LSB NVCZ 0010001022H 3BH61H21H0––0 nn nn 5AHA5H00H0––1 D6H93H92H1––0 Flag I1 I0 U D N V C Z ––––↕ ––↕

AND A, [BR:ll] ||||||||| Logical AND of location [BR:ll] and A reg. |||||||||||||||||||||||||||||||| 3 cycles ||| Function A ← A ∧ [BR:ll] Mode Src: 8-bit absolute Takes a logical product of the content of the Dst: Register direct data memory and the content of the A register Example Set Value Result and stores the result in the A register. The SC data memory address has been specified by A [BR:ll]A the content of the BR register (upper byte NVCZ specification) and the 8-bit absolute address ll 3BH61H21H0––0 (lower byte specification). 5AHA5H00H0––1 The content of the EP register becomes the D6H93H92H1––0 page address of the data memory (MODEL2/3).

Code MSB LSB 0010010024H

ll ll

Flag I1 I0 U D N V C Z ––––↕ ––↕

E0C88 CORE CPU MANUAL EPSON 75 4 INSTRUCTION SETS

AND A, [hhll] |||||||||||| Logical AND of location [hhll] and A reg. |||||||||||||||||||||||||||||||||| 4 cycles ||| Function A ← A ∧ [hhll] Flag I1 I0 U D N V C Z Takes a logical product of the content of the ––––↕ ––↕ data memory that has been address specified by the 16-bit absolute address hhll and the Mode Src: 16-bit absolute content of the A register and stores the result Dst: Register direct in the A register. Example Set Value Result The content of the EP register becomes the SC page address of the data memory (MODEL2/3). A [hhll]A NVCZ Code MSB LSB 3BH61H21H0––0 0010010125H 5AHA5H00H0––1 ll ll D6H93H92H1––0

hh hh

AND A, [HL] ||||||||||||||| Logical AND of location [HL] and A reg. ||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A ∧ [HL] Mode Src: Register indirect Takes a logical product of the content of the Dst: Register direct data memory that has been address specified by the HL register and the content of the A Example Set Value Result SC register and stores the result in the A register. A [HL] A The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 3BH61H21H0––0 5AHA5H00H0––1 Code MSB LSB 0010001123H D6H93H92H1––0

Flag I1 I0 U D N V C Z ––––↕ ––↕

AND A, [ir] ||||||||||||||||||| Logical AND of location [ir reg.] and A reg. ||||||||||||||||||||||||||||| 2 cycles |||

Function A ← A ∧ [ir] Flag I1 I0 U D N V C Z Takes a logical product of the content of the ––––↕ ––↕ data memory that has been address specified by the ir register (IX/IY) and the content of Mode Src: Register indirect the A register and stores the result in the A Dst: Register direct register. The content of the XP register (at time of IX Example Set Value Result SC specification) or the YP register (at time of A [ir] A IY specification) becomes the page address NVCZ of the data memory (MODEL2/3). 3BH61H21H0––0 5AHA5H00H0––1 Code MSB LSB 0010011ir26H/27H✽ D6H93H92H1––0

✽ ir Mnemonic Code IX 0 AND A, [IX] 26H IY 1 AND A, [IY] 27H

76 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

AND A, [ir+dd] ||||||||| Logical AND of location [ir reg. + dd] and A reg. ||||||||||||||||||||| 4 cycles |||

Function A ← A ∧ [ir+dd] Code MSB LSB Takes a logical product of the content of the 11001110CEH data memory and the content of the A register ✽ and stores the result in the A register. The 0010000ir20H/21H data memory address has been specified by dd dd the sum of the content of the ir register (IX/ IY) and the displacement dd. ✽ ir Mnemonic Code The displacement dd is handled as signed IX 0 AND A, [IX+dd] 20H data and the range is -128 to 127. IY 1 AND A, [IY+dd] 21H The content of the XP register (at time of IX specification) or the YP register (at time of Flag I1 I0 U D N V C Z IY specification) becomes the page address ––––↕ ––↕ of the data memory (MODEL2/3). Mode Src: Register indirect with displacement Dst: Register direct

Example Set Value Result SC A [ir+dd] A NVCZ 3BH61H21H0––0 5AHA5H00H0––1 D6H93H92H1––0

AND A, [ir+L] |||||||||||| Logical AND location [ir reg. + L] and A reg. ||||||||||||||||||||||||||| 4 cycles |||

Function A ← A ∧ [ir+L] Code MSB LSB Takes a logical product of the content of the 11001110CEH data memory and the content of the A register and stores the result in the A register. The 0010001ir22H/23H✽ data memory address has been specified by ✽ ir Mnemonic Code the sum of the content of the ir register (IX/ IX 0 AND A, [IX+L] 22H IY) and the content of the L register. The content of the L register is handled as IY 1 AND A, [IY+L] 23H signed data and the range is -128 to 127. Flag I1 I0 U D N V C Z The content of the XP register (at time of IX ––––↕ ––↕ specification) or the YP register (at time of IY specification) becomes the page address Mode Src: Register indirect with index register of the data memory (MODEL2/3). Dst: Register direct

Example Set Value Result SC A [ir+L] A NVCZ 3BH61H21H0––0 5AHA5H00H0––1 D6H93H92H1––0

E0C88 CORE CPU MANUAL EPSON 77 4 INSTRUCTION SETS

AND B, #nn |||||||||||||||| Logical AND of immediate data nn and B reg. ||||||||||||||||||||||||||| 3 cycles ||| Function B ← B ∧ nn Mode Src: Immediate data Takes a logical product of the 8-bit immedi- Dst: Register direct ate data nn and the content of the B register Example Set Value Result and stores the result in the B register. SC BnnB Code MSB LSB NVCZ 11001110CEH 3BH61H21H0––0 10110000B0H 5AHA5H00H0––1 D6H93H92H1––0 nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

AND L, #nn ||||||||||||||||| Logical AND of immediate data nn and L reg. ||||||||||||||||||||||||||| 3 cycles ||| Function L ← L ∧ nn Mode Src: Immediate data Takes a logical product of the 8-bit immedi- Dst: Register direct ate data nn and the content of the L register Example Set Value Result and stores the result in the L register. SC LnnL Code MSB LSB NVCZ 11001110CEH 3BH61H21H0––0 10110001B1H 5AHA5H00H0––1 D6H93H92H1––0 nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

AND H, #nn |||||||||||||||| Logical AND of immediate data nn and H reg. ||||||||||||||||||||||||||| 3 cycles ||| Function H ← H ∧ nn Mode Src: Immediate data Takes a logical product of the 8-bit immedi- Dst: Register direct ate data nn and the content of the H register Example Set Value Result and stores the result in the H register. SC HnnH Code MSB LSB NVCZ 11001110CEH 3BH61H21H0––0 10110010B2H 5AHA5H00H0––1 D6H93H92H1––0 nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

78 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

AND SC, #nn |||||||||||| Logical AND of immediate data nn and SC |||||||||||||||||||||||||||||||| 3 cycless ||| Function SC ← SC ∧ nn Mode Src: Immediate data Takes a logical product of the 8-bit immedi- Dst: Register direct ate data nn and the content of the system Example Set Value Result condition flag (SC) and sets the result in the SC system condition flag (SC). SC nn I1 I0 U D N V C Z Code MSB LSB 3BH61H00100001 100111009CH 5AHA5H00000000 nn nn D6H93H10010010

Flag I1 I0 U D N V C Z ↓↓↓↓↓↓↓↓

AND [BR:ll], #nn ||| Logical AND of immediate data nn and location [BR:ll] |||||||||||| 5 cycles |||

Function [BR:ll] ← [BR:ll] ∧ nn Flag I1 I0 U D N V C Z Takes a logical product of the 8-bit immedi- ––––↕ ––↕ ate data and the content of the data memory and stores the result in that address. The data Mode Src: Immediate data memory address has been specified by the Dst: 8-bit absolute content of the BR register (upper byte Example Set Value Result specification) and the 8-bit absolute address ll SC (lower byte specification). [BR:ll] nn [BR:ll] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 3BH61H21H0––0 5AHA5H00H0––1 Code MSB LSB D6H93H92H1––0 11011000D8H

ll ll

nn nn

AND [HL], A ||||||||||||||| Logical AND of A reg. and location [HL] ||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [HL] ← [HL] ∧ A Mode Src: Register direct Takes a logical product of the content of the Dst: Register indirect A register and the data memory that has been address specified by the HL register and Example Set Value Result SC stores the result in that address. [HL] A [HL] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 3BH61H21H0––0 5AHA5H00H0––1 Code MSB LSB D6H93H92H1––0 11001110CEH

0010010024H

Flag I1 I0 U D N V C Z ––––↕ ––↕

E0C88 CORE CPU MANUAL EPSON 79 4 INSTRUCTION SETS

AND [HL], #nn ||||||||| Logical AND of immediate data nn and location [HL] ||||||||||||||| 5 cycles ||| Function [HL] ← [HL] ∧ nn Mode Src: Immediate data Takes a logical product of the 8-bit immedi- Dst: Register indirect ate data nn and the data memory that has been address specified by the HL register and Example Set Value Result SC stores the result in that address. [HL] nn [HL] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 3BH61H21H0––0 5AHA5H00H0––1 Code MSB LSB 11001110CEH D6H93H92H1––0

0010010125H

nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

AND [HL], [ir] ||||||||||| Logical AND of location [ir reg.] to location [HL] ||||||||||||||||||||| 5 cycles ||| Function [HL] ← [HL] ∧ [ir] Mode Src: Register indirect Takes a logical product of the content of the Dst: Register indirect data memory that has been address specified by the ir register (IX/IY) and the data Example Set Value Result SC memory that has been address specified by [HL] [ir] [HL] the HL register and stores the result in data NVCZ memory [HL]. 3BH61H21H0––0 The content of the EP register becomes the 5AHA5H00H0––1 page address of the data memory [HL] and D6H93H92H1––0 the content of the XP register (at time of IX specification) or the YP register (at time of IY specification) becomes the page address of the data memory [ir] (MODEL2/3).

Code MSB LSB 11001110CEH

0010011ir26H/27H✽

✽ ir Mnemonic Code IX 0 AND [HL], [IX] 26H IY 1 AND [HL], [IY] 27H

Flag I1 I0 U D N V C Z ––––↕ ––↕

80 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

BIT A, B ||||||||||||||||||||||||| Test bit of A reg. with B reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ∧ B Mode Src: Register direct Takes a logical product of the content of the Dst: Register direct B register and the content of the A register Example Set Value Result and checks the bits of the A register. SC The flags (N/Z) change depending on the said ABA result, but the content of the register is not NVCZ changed. 3BH61H3BH0––0 5AHA5H5AH0––1 Code MSB LSB D6H93HD6H1––0 1001010094H

Flag I1 I0 U D N V C Z ––––↕ ––↕

BIT A, #nn ||||||||||||||||||| Test bit of A reg. with immediate data nn |||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ∧ nn Mode Src: Immediate data Takes a logical product of the 8-bit immedi- Dst: Register direct ate data nn and the content of the A register Example Set Value Result and checks the bits of the A register. SC The flags (N/Z) change depending on the said AnnA result, but the content of the register is not NVCZ changed. 3BH61H3BH0––0 5AHA5H5AH0––1 Code MSB LSB D6H93HD6H1––0 1001011096H

nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

BIT B, #nn ||||||||||||||||||| Test bit of B reg. with immediate data nn |||||||||||||||||||||||||||||||||||| 2 cycles ||| Function B ∧ nn Mode Src: Immediate data Takes a logical product of the 8-bit immedi- Dst: Register direct ate data nn and the content of the B register Example Set Value Result and checks the bits of the B register. SC The flags (N/Z) change depending on the said BnnB result, but the content of the register is not NVCZ changed. 3BH61H3BH0––0 5AHA5H5AH0––1 Code MSB LSB D6H93HD6H1––0 1001011197H

nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

E0C88 CORE CPU MANUAL EPSON 81 4 INSTRUCTION SETS

BIT [BR:ll], #nn ||||||| Test bit of location [BR:ll] with immediate data nn ||||||||||||||||||| 4 cycles ||| Function [BR:ll] ∧ nn Mode Src: Immediate data Takes a logical product of the 8-bit immedi- Dst: 8-bit absolute ate data nn and the content of the data Example Set Value Result memory and checks the bits of the data SC memory. The data memory address has been [BR:ll] nn [BR:ll] specified by the content of the BR register NVCZ (upper byte specification) and the 8-bit 3BH61H3BH0––0 absolute address ll (lower byte specification). 5AHA5H5AH0––1 The flags (N/Z) change depending on the said D6H93HD6H1––0 result, but the content of the data memory is not changed. The content of the EP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 11011100DCH

ll ll

nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

BIT [HL], #nn |||||||||||| Test bit of location [HL] with immediate data nn ||||||||||||||||||||||| 3 cycles ||| Function [HL] ∧ nn Mode Src: Register direct Takes a logical product of the 8-bit immedi- Dst: Register indirect ate data nn and the data memory that has been address specified by the HL register and Example Set Value Result SC checks the bits of the data memory. The flags [HL] nn [HL] (N/Z) change depending on the said result, NVCZ but the content of the data memory is not 3BH61H3BH0––0 changed. 5AHA5H5AH0––1 The content of the EP register becomes the D6H93HD6H1––0 page address of the data memory (MODEL2/3).

Code MSB LSB 1001010195H

nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

82 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

CALL [hhll] |||||||||||||||| Call subroutine at location [hhll] ||||||||||||||||||||||||||||| 7(MIN)/8(MAX) cycles ||| Function Code MSB LSB [SP-1]←PC(H), [SP-2]←PC(L), 11111011FBH SP←SP-2, ll ll PC(L)←[hhll], PC(H)←[hhll+1] hh hh [SP-1]←PC(H), [SP-2]←PC(L), Flag I1 I0 U D N V C Z SP←SP-2, PC(L)←[hhll], –––––––– PC(H)←[hhll+1], CB←NB Mode 16-bit indirect ← ← [SP-1] CB, [SP-2] PC(H), Example When NB = 02H in the MODEL2/3, it ← ← [SP-3] PC(L), SP SP-3, executes the "CALL [2000H]" instruction in ← ← PC(L) [hhll], PC(H) [hhll+1], the physical address 9000H. CB←NB NB CBPC(logical addr.) EP M(032000H) SP After evacuation of the top address +3 value Before execution 02H 01H 9000H 03H ABCDH 0000H of this instruction to the stack as a return address, it unconditionally calls the subrou- tine. As the branch destination address (top After execution 02H 02H ABCDH 03H ABCDH FFFDH address of the subroutine), the content of the In the above example it branches to the data memory specified by the 16-bit absolute physical address 012BCDH. address hhll becomes the lower byte and the Since there is no EP in the MODEL0/1, the content of the following address becomes the content of M(2000H) is transferred to the PC upper byte. and if the content of M(2000H) is ABCDH, since there are also no NB and CB, it In the maximum mode of the MODEL2/3, branches to the physical address ABCDH. the currently selected bank address (content of the CB) is also evacuated upon evacuation Stack content after execution of the return address. (1) MODEL2/3 (maximum mode) Upon branching in the MODEL2/3, the bank 00FFFDH 03H (PC (L) ) address set in the NB is loaded into the CB and the bank is also changed. 00FFFEH 90H (PC (H) ) The content of the EP register becomes the 00FFFFH 01H (CB) page address of the data memory. (2) MODEL2/3 (minimum mode), MODEL0/1

00FFFEH 03H (PC (L) )

00FFFFH 90H (PC (H) )

E0C88 CORE CPU MANUAL EPSON 83 4 INSTRUCTION SETS

CARL qqrr |||||||||||||||||| Call subroutine at relative location qqrr |||||||||||||||||| 5(MIN)/6(MAX) cycles ||| Function Code MSB LSB [SP-1]←PC(H), [SP-2]←PC(L), 11110010F2H SP←SP-2, PC←PC+qqrr+2 rr rr [SP-1]←PC(H), [SP-2]←PC(L), qq qq SP←SP-2, PC←PC+qqrr+2, CB←NB Flag I1 I0 U D N V C Z –––––––– [SP-1]←CB, [SP-2]←PC(H), [SP-3]←PC(L), SP←SP-3, Mode Signed 16-bit PC relative ← ← PC PC+qqrr+2, CB NB Example When NB = 02H in the MODEL2/3, it After evacuation of the top address +3 value executes the "CARL $+2000H" instruction of this instruction to the stack as a return in the physical address 9000H. address, it unconditionally calls the subrou- NB CB PC(logical addr.) SP tine. The branch destination address (top Before execution 02H 01H 9000H 0000H address of the subroutine) becomes the address resulting from the addition of a 9002H+(2000H-2) signed 16-bit relative address qqrr (-32768 to After execution 02H 02H B000H FFFDH 32767) to the top address +2 of this instruc- In the above example it branches to the tion. physical address 013000H. In the maximum mode of the MODEL2/3, In the MODEL0/1, since there are no NB and the currently selected bank address (content CB, it branches to the physical address of the CB) is also evacuated upon evacuation B000H. of the return address. Stack content after execution Upon branching in the MODEL2/3, the bank (1) MODEL2/3 (maximum mode) address set in the NB is loaded into the CB and the bank is also changed. 00FFFDH 03H (PC (L) )

00FFFEH 90H (PC (H) ) 00FFFFH 01H (CB)

(2) MODEL2/3 (minimum mode), MODEL0/1

00FFFEH 03H (PC (L) )

00FFFFH 90H (PC (H) )

84 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

CARL cc1, qqrr |||||| Call subroutine at relative location qqrr if condition cc1 is true |||||||||||||||||| Function Code MSB LSB If cc1 is true 111000 cc1 E8H–EBH✽ then CARL qqrr else PC←PC+3 rr rr qq qq If cc1 is true ✽ cc1 Mnemonic Code then CARL qqrr C 00 CARL C,qqrr E8H else PC←PC+3, NB←CB NC 01 CARL NC,qqrr E9H When the condition cc1 has been established, Z 10 CARL Z,qqrr EAH the CPU executes the "CARL qqrr" instruc- NZ 11 CARL NZ,qqrr EBH tion and when a condition has not been established, it executes the following Flag I1 I0 U D N V C Z instruction. –––––––– See "CARL qqrr" instruction. Mode Signed 16-bit PC relative In the MODEL2/3, when a condition has not been established, the content of the NB Example At the time of condition establishment, specifying the branch destination bank operates the same as the "CARL qqrr" returns to the current bank address (content of instruction. When a condition has not been the CB). established, the operation of the "CARL cc1,qqrr" in the physical address 9000H is as Condition cc1 is of the below 4 types. indicated below. The stack operation is not cc1 Condition done. C Carry (Carry flag C = 1) NB CB PC(logical addr.) SP NC Non Carry (Carry flag C = 0) Before execution 02H 01H 9000H 0000H Z Zero (Zero flag Z = 1) NZ Non Zero (Zero flag Z = 0) After execution 01H 01H 9003H 0000H The bus cycle becomes as follows, depending There are no NB and CB in the MODEL0/1. on whether it is minimum mode or maximum mode and whether a condition is established or not. Mode Condition Bus cycle Minimum True 5 cycles Minimum False 3 cycles Maximum True 6 cycles Maximum False 3 cycles

E0C88 CORE CPU MANUAL EPSON 85 4 INSTRUCTION SETS

CARS rr ||||||||||||||||||||||||| Call subroutine at relative location rr ||||||||||||||||||||| 4(MIN)/5(MAX) cycles ||| Function Code MSB LSB [SP-1]←PC(H), [SP-2]←PC(L), 11110000F0H SP←SP-2, PC←PC+rr+1 rr rr [SP-1]←PC(H), [SP-2]←PC(L), Flag I1 I0 U D N V C Z SP←SP-2, PC←PC+rr+1, CB←NB ––––––––

Mode Signed 8-bit PC relative [SP-1]←CB, [SP-2]←PC(H), Example When NB = 02H in the MODEL2/3, it [SP-3]←PC(L), SP←SP-3, PC←PC+rr+1, CB←NB executes the "CARS $+20H" instruction in the physical address 9000H. After evacuation of the top address +2 value NB CB PC(logical addr.) SP of this instruction to the stack as a return address, it unconditionally calls the subrou- Before execution 02H 01H 9000H 0000H tine. The branch destination address (top 9001H + (20H - 1) address of the subroutine) becomes the After execution 02H 02H 9020H FFFDH address resulting from the addition of a signed 8-bit relative address rr (-128 to 127) In the above example it branches to the to the top address +1 of this instruction. physical address 011020H. In the MODEL0/1, since there are no NB and In the maximum mode of the MODEL2/3, CB, it branches to the physical address the currently selected bank address (content 9020H. of the CB) is also evacuated upon evacuation of the return address. Stack content after execution Upon branching in the MODEL2/3, the bank (1) MODEL2/3 (maximum mode) address set in the NB is loaded into the CB 00FFFDH 02H (PC (L) ) and the bank is also changed. 00FFFEH 90H (PC (H) ) 00FFFFH 01H (CB)

(2) MODEL2/3 (minimum mode), MODEL0/1

00FFFEH 02H (PC (L) )

00FFFFH 90H (PC (H) )

86 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

CARS cc1, rr |||||||||||| Call subroutine at relative location rr if condition cc1 is true ||||||||||||||||||||||| Function Code MSB LSB If cc1 is true 111000 cc1 E0H–E3H✽ then CARS rr else PC←PC+2 rr rr ✽ cc1 Mnemonic Code If cc1 is true C 00 CARS C, rr E0H then CARS rr NC 01 CARS NC, rr E1H else PC←PC+2, NB←CB Z 10 CARS Z, rr E2H When the condition cc1 has been established, NZ 11 CARS NZ, rr E3H the CPU executes the "CARS rr" instruction Flag I1 I0 U D N V C Z and when a condition has not been estab- –––––––– lished, it executes the following instruction. See "CARS rr" instruction. Mode Signed 8-bit PC relative In the MODEL2/3, when a condition has not Example At the time of condition establishment, been established, the content of the NB operates the same as the "CARS rr" instruc- specifying the branch destination bank tion. When a condition has not been returns to the current bank address (content of established, the operation of the "CARS the CB). cc1,rr" in the physical address 9000H is as Condition cc1 is of the below 4 types. indicated below. The stack operation is not cc1 Condition done. C Carry (Carry flag C = 1) NB CB PC(logical addr.) SP NC Non Carry (Carry flag C = 0) Before execution 02H 01H 9000H 0000H Z Zero (Zero flag Z = 1) NZ Non Zero (Zero flag Z = 0) After execution 01H 01H 9002H 0000H The bus cycle becomes as follows, depending There are no NB and CB in the MODEL0/1. on whether it is minimum mode or maximum mode and whether a condition is established or not. Mode Condition Bus cycle Minimum True 4 cycles Minimum False 2 cycles Maximum True 5 cycles Maximum False 2 cycles

E0C88 CORE CPU MANUAL EPSON 87 4 INSTRUCTION SETS

CARS cc2, rr ||||||||||||| Call subroutine at relative location rr if condition cc2 is true |||||||||||||||||||||| Function Condition cc2 is of the below 16 types. If cc2 is true cc2 Condition then [SP-1]←PC(H), LT Less Than ([N ∀ V] = 1) ← ← [SP-2] PC(L), SP SP-2, LE Less or Equal (Z ∨ [N ∀ N] = 1) PC←PC+rr+2 GT Greater Than (Z ∨ [N ∀ N] = 0) else PC←PC+3 GE Greater or Equal ([N ∀ N] = 0) V Overflow (V = 1) If cc2 is true NV Non Overflow (V = 0) then [SP-1]←PC(H), P Plus (N = 0) [SP-2]←PC(L), M Minus (N = 1) SP←SP-2, PC←PC+rr+2 CB←NB F0 F0 is set (F0 = 1) else PC←PC+3, NB←CB F1 F1 is set (F1 = 1) F2 F2 is set (F2 = 1) F3 F3 is set (F3 = 1) If cc2 is true NF0 F0 is reset (F0 = 0) then [SP-1]←CB, [SP-2]←PC(H), [SP-3]←PC(L), SP←SP-3, NF1 F1 is reset (F1 = 0) PC←PC+rr+2, CB←NB NF2 F2 is reset (F2 = 0) else PC←PC+3, NB←CB NF3 F3 is reset (F3 = 0)

When the condition cc2 has been established, The bus cycle becomes as follows, depending after evacuation of the top address +3 value on whether it is minimum mode or maximum of this instruction to the stack as a return mode and whether a condition is established address, it calls the subroutine. The branch or not. destination address (top address of the Mode Condition Bus cycle subroutine) becomes the address resulting Minimum True 5 cycles from the addition of a signed 8-bit relative Minimum False 3 cycles address rr (-128 to 127) to the top address +2 of this instruction. Maximum True 6 cycles Maximum False 3 cycles When a condition has not been established, it executes the following instruction. In the maximum mode of the MODEL2/3, the currently selected bank address (content of the CB) is also evacuated upon evacuation of the return address. Upon branching in the MODEL2/3, the bank address set in the NB is loaded into the CB and the bank is also changed. When a condition has not been established, the content of the NB specifying the branch destination bank returns to the current bank address (content of the CB).

88 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

CARS cc2, rr

Code MSB LSB Mode Signed 8-bit PC relative 11001110CEH Example At the time of condition establishment when 1111 cc2 F0H–FFH✽ NB = 02H in the MODEL2/3, operation of the "CARS cc2,$+20" in the physical rr rr address 9000H is as indicated below. ✽ cc2 Mnemonic Code NB CB PC(logical addr.) SP LT 0000 CARS LT, rr F0H Before execution 02H 01H 9000H 0000H LE 0001 CARS LE, rr F1H 9002H + (20H - 2) GT 0010 CARS GT, rr F2H After execution 02H 02H 9020H FFFDH GE 0011 CARS GE, rr F3H In the above example it branches to the V 0100 CARS V, rr F4H physical address 011020H. NV 0101 CARS NV, rr F5H In the MODEL0/1, since there are no NB and P 0110 CARS P, rr F6H CB, it branches to the physical address M 0111 CARS M, rr F7H 9020H. F0 1000 CARS F0, rr F8H Stack content after execution F1 1001 CARS F1, rr F9H (1) MODEL2/3 (maximum mode) F2 1010 CARS F2, rr FAH F3 1011 CARS F3, rr FBH 00FFFDH 03H (PC (L) ) NF0 1100 CARS NF0, rr FCH 00FFFEH 90H (PC (H) ) NF1 1101 CARS NF1, rr FDH 00FFFFH 01H (CB) NF2 1110 CARS NF2, rr FEH NF3 1111 CARS NF3, rr FFH (2) MODEL2/3 (minimum mode), MODEL0/1

Flag I1 I0 U D N V C Z 00FFFEH 03H (PC (L) ) –––––––– 00FFFFH 90H (PC (H) )

When a condition has not been established, the operation of the "CARS cc2,$+20H" in the physical address 9000H is as indicated below. The stack operation is not done. NB CB PC(logical addr.) SP Before execution 02H 01H 9000H 0000H

After execution 01H 01H 9003H 0000H There are no NB and CB in the MODEL0/1.

E0C88 CORE CPU MANUAL EPSON 89 4 INSTRUCTION SETS

CP A, r |||||||||||||||||||||||||||| Compare r reg. with A reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles |||

Function A - r Flag I1 I0 U D N V C Z This function subtracts the content of r ––––↕↕↕↕ register (A/B) from the content of the A register and changes the content of the flag Mode Src: Register direct (N/V/C/Z) according the result thereof. The Dst: Register direct content of the A register is not changed. Example Set Value Result Code MSB LSB SC ABA 0011000r30H/31H✽ NVCZ ✽ r Mnemonic Code 74H2AH74H0000 A 0 CP A, A 30H 1DH1DH1DH0001 B 1 CP A, B 31H 3CH59H3CH1010 C3H62HC3H0100

CP A, #nn |||||||||||||||||||| Compare immediate data nn with A reg. ||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A - nn Mode Src: Immediate data This function subtracts the 8-bit immediate Dst: Register direct data nn from the content of the A register and changes the content of the flag (N/V/C/Z) Example Set Value Result SC according the result thereof. The content of AnnA the A register is not changed. NVCZ 74H2AH74H0000 Code MSB LSB 1DH1DH1DH0001 0011001032H 3CH59H3CH1010 nn nn C3H62HC3H0100 Flag I1 I0 U D N V C Z ––––↕↕↕↕

CP A, [BR:ll] ||||||||||||| Compare location [BR:ll] with A reg. |||||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function A - [BR:ll] Flag I1 I0 U D N V C Z This function subtracts the content of the data ––––↕↕↕↕ memory from the content of the A register and changes the content of the flag (N/V/C/Z) Mode Src: 8-bit absolute according the result thereof. The data Dst: Register direct memory address has been specified by the Example Set Value Result content of the BR register (upper byte SC specification) and the 8-bit absolute address ll A [BR:ll]A (lower byte specification). The content of the NVCZ A register is not changed. 74H2AH74H0000 The content of the EP register becomes the 1DH1DH1DH0001 page address of the data memory (MODEL2/3). 3CH59H3CH1010

Code MSB LSB C3H62HC3H0100 0011010034H

ll ll

90 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

CP A, [hhll] |||||||||||||||| Compare location [hhll] with A reg. |||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function A - [hhll] Mode Src: 16-bit absolute This function subtracts the content of the data Dst: Register direct memory that has been address specified by the 16-bit absolute address hhll from the Example Set Value Result SC content of the A register and changes the A [hhll]A content of the flag (N/V/C/Z) according the NVCZ result thereof. The content of the A register is 74H2AH74H0000 not changed. 1DH1DH1DH0001 The content of the EP register becomes the 3CH59H3CH1010 page address of the data memory (MODEL2/3). C3H62HC3H0100 Code MSB LSB 0011010135H

ll ll

hh hh

Flag I1 I0 U D N V C Z ––––↕↕↕↕

CP A, [HL] ||||||||||||||||||| Compare location [HL] with A reg. ||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A - [HL] Mode Src: Register indirect This function subtracts the content of the data Dst: Register direct memory that has been address specified by Example Set Value Result the HL register from the content of the A SC register and changes the content of the flag A [HL] A (N/V/C/Z) according the result thereof. The NVCZ content of the A register is not changed. 74H2AH74H0000 The content of the EP register becomes the 1DH1DH1DH0001 page address of the data memory (MODEL2/3). 3CH59H3CH1010 Code MSB LSB C3H62HC3H0100 0011001133H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 91 4 INSTRUCTION SETS

CP A, [ir] ||||||||||||||||||||||| Compare location [ir reg.] with A reg. ||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A - [ir] Mode Src: Register indirect This function subtracts the content of the data Dst: Register direct memory that has been address specified by the ir register (IX/IY) from the content of the Example Set Value Result SC A register and changes the content of the flag A [ir] A (N/V/C/Z) according the result thereof. The NVCZ content of the A register is not changed. 74H2AH74H0000 The content of the XP register (at time of IX 1DH1DH1DH0001 specification) or the YP register (at time of 3CH59H3CH1010 IY specification) becomes the page address C3H62HC3H0100 of the data memory (MODEL2/3). Code MSB LSB 0011011ir36H/37H✽

✽ ir Mnemonic Code IX 0 CP A, [IX] 36H IY 1 CP A, [IY] 37H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

CP A, [ir+dd] ||||||||||||| Compare location [ir reg. + dd] with A reg. |||||||||||||||||||||||||||||| 4 cycles ||| Function A - [ir+dd] Flag I1 I0 U D N V C Z This function subtracts the content of the data ––––↕↕↕↕ memory from the content of the A register and changes the content of the flag (N/V/C/Z) Mode Src: Register indirect with displacement according the result thereof. The data Dst: Register direct memory address has been specified by the sum of the content of the ir register (IX/IY) Example Set Value Result SC and the displacement dd. A [ir+dd] A The content of the A register is not changed. NVCZ The displacement dd is handled as signed 74H2AH74H0000 data and the range is -128 to 127. 1DH1DH1DH0001 The content of the XP register (at time of IX 3CH59H3CH1010 specification) or the YP register (at time of C3H62HC3H0100 IY specification) becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 11001110CEH

0011000ir30H/31H✽

dd dd

✽ ir Mnemonic Code IX 0 CP A, [IX+dd] 30H IY 1 CP A, [IY+dd] 31H

92 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

CP A, [ir+L] |||||||||||||||| Compare location [ir reg. + L] with A reg. ||||||||||||||||||||||||||||||||| 4 cycles ||| Function A - [ir+L] Flag I1 I0 U D N V C Z This function subtracts the content of the data ––––↕↕↕↕ memory from the content of the A register and changes the content of the flag (N/V/C/Z) Mode Src: Register indirect with index register according the result thereof. The data Dst: Register direct memory address has been specified by the sum of the content of the ir register (IX/IY) Example Set Value Result SC and the content of the L register. A [ir+L] A The content of the A register is not changed. NVCZ The content of the L register is handled as 74H2AH74H0000 signed data and the range is -128 to 127. 1DH1DH1DH0001 The content of the XP register (at time of IX 3CH59H3CH1010 specification) or the YP register (at time of C3H62HC3H0100 IY specification) becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 11001110CEH

0011001ir32H/33H✽

✽ ir Mnemonic Code IX 0 CP A, [IX+L] 32H IY 1 CP A, [IY+L] 33H

CP B, #nn ||||||||||||||||||||| Compare immediate data nn with B reg. |||||||||||||||||||||||||||||||||||| 3 cycles ||| Function B - nn Mode Src: Immediate data This function subtracts the 8-bit immediate Dst: Register direct data nn from the content of the B register and changes the content of the flag (N/V/C/Z) Example Set Value Result SC according the result thereof. The content of BnnB the B register is not changed. NVCZ 74H2AH74H0000 Code MSB LSB 1DH1DH1DH0001 11001110CEH 3CH59H3CH1010 10111100BCH C3H62HC3H0100

nn nn

Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 93 4 INSTRUCTION SETS

CP L, #nn ||||||||||||||||||||| Compare immediate data nn with L reg. ||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function L - nn Mode Src: Immediate data This function subtracts the 8-bit immediate Dst: Register direct data nn from the content of the L register and changes the content of the flag (N/V/C/Z) Example Set Value Result SC according the result thereof. The content of LnnL the L register is not changed. NVCZ 74H2AH74H0000 Code MSB LSB 1DH1DH1DH0001 11001110CEH 3CH59H3CH1010 10111101BDH C3H62HC3H0100

nn nn

Flag I1 I0 U D N V C Z ––––↕↕↕↕

CP H, #nn |||||||||||||||||||| Compare immediate data nn with H reg. ||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function H - nn Mode Src: Immediate data This function subtracts the 8-bit immediate Dst: Register direct data nn from the content of the H register and changes the content of the flag (N/V/C/Z) Example Set Value Result SC according the result thereof. The content of HnnH the H register is not changed. NVCZ 74H2AH74H0000 Code MSB LSB 1DH1DH1DH0001 11001110CEH 3CH59H3CH1010 10111110BEH C3H62HC3H0100

nn nn

Flag I1 I0 U D N V C Z ––––↕↕↕↕

CP BR, #hh |||||||||||||||| Compare immediate data hh with BR reg. |||||||||||||||||||||||||||||||||| 3 cycles ||| Function BR - hh Mode Src: Immediate data This function subtracts the 8-bit immediate Dst: Register direct data nn from the content of the BR register and changes the content of the flag (N/V/C/Z) Example Set Value Result SC according the result thereof. The content of BR hh BR the BR register is not changed. NVCZ 74H2AH74H0000 Code MSB LSB 1DH1DH1DH0001 11001110CEH 3CH59H3CH1010 10111111BFH C3H62HC3H0100

hh hh

Flag I1 I0 U D N V C Z ––––↕↕↕↕

94 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

CP [BR:ll], #nn ||||||| Compare immediate data nn with location [BR:ll] |||||||||||||||||||||| 4 cycles ||| Function [BR:ll] - nn Mode Src: Immediate data This function subtracts the 8-bit immediate Dst: 8-bit absolute data nn from the content of the data memory and changes the content of the flag (N/V/C/Z) Example Set Value Result SC according the result thereof. The data [BR:ll] nn [BR:ll] memory address has been specified by the NVCZ content of the BR register (upper byte 74H2AH74H0000 specification) and the 8-bit absolute address ll 1DH1DH1DH0001 (lower byte specification). The content of the 3CH59H3CH1010 data memory is not changed. C3H62HC3H0100 The content of the EP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 11011011DBH

ll ll

nn nn

Flag I1 I0 U D N V C Z ––––↕↕↕↕

CP [HL], A ||||||||||||||||||| Compare A reg. with location [HL] ||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function [HL] - A Mode Src: Register direct This function subtracts the content of the A Dst: Register indirect register from the content of the data memory that has been address specified by the HL Example Set Value Result SC register and changes the content of the flag [HL] A [HL] (N/V/C/Z) according the result thereof. The NVCZ content of the data memory is not changed. 74H2AH74H0000 The content of the EP register becomes the 1DH1DH1DH0001 page address of the data memory (MODEL2/3). 3CH59H3CH1010 Code MSB LSB C3H62HC3H0100 11001110CEH

0011010034H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 95 4 INSTRUCTION SETS

CP [HL], #nn ||||||||||||| Compare immediate data nn with location [HL] ||||||||||||||||||||||||| 4 cycles ||| Function [HL] - nn Mode Src: Immediate data This function subtracts the 8-bit immediate Dst: Register indirect data nn from the content of the data memory that has been address specified by the HL Example Set Value Result SC register and changes the content of the flag [HL] n n [HL] (N/V/C/Z) according the result thereof. The NVCZ content of the data memory is not changed. 74H2AH74H0000 The content of the EP register becomes the 1DH1DH1DH0001 page address of the data memory (MODEL2/3). 3CH59H3CH1010 Code MSB LSB C3H62HC3H0100 11001110CEH

0011010135H

nn nn

Flag I1 I0 U D N V C Z ––––↕↕↕↕

CP [HL], [ir] ||||||||||||||| Compare location [ir reg.] with location [HL] |||||||||||||||||||||||||||| 4 cycles ||| Function [HL] - [ir] Mode Src: Register indirect This function subtracts the content of the data Dst: Register indirect memory that has been address specified by the ir register (IX/IY) from the content of the Example Set Value Result SC data memory that has been address specified [HL] [ir] [HL] by the HL register and changes the content of NVCZ the flag (N/V/C/Z) according the result 74H2AH74H0000 thereof. The content of the data memory is 1DH1DH1DH0001 not changed. 3CH59H3CH1010 The content of the EP register becomes the C3H62HC3H0100 page address of the data memory [HL] and the content of the XP register (at time of IX specification) or the YP register (at time of IY specification) becomes the page address of the data memory [ir] (MODEL2/3).

Code MSB LSB 11001110CEH

0011011ir36H/37H✽

✽ ir Mnemonic Code IX 0 CP [HL], [IX] 36H IY 1 CP [HL], [IY] 37H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

96 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

CP BA, rp |||||||||||||||||||| Comparerp reg. with BA reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function BA - rp Mode Src: Register direct This function subtracts the content of rp Dst: Register direct register (BA/HL/IX/IY) from the content of the BA register and changes the content of Example Set Value Result SC the flag (N/V/C/Z) according the result BA rp BA thereof. The content of the BA register is not NVCZ changed. 3F71H 145AH 3F71H 0000 53D1H 53D1H 53D1H 0001 Code MSB LSB 11001111CFH A291H 632EH A291H 0100 2862H 4C25H 2862H 1010 000110 rp 18H–1BH✽ (rp≠BA) ✽ rp Mnemonic Code BA 00 CP BA, BA 18H HL 01 CP BA, HL 19H IX 10 CP BA, IX 1AH IY 11 CP BA, IY 1BH

Flag I1 I0 U D N V C Z ––––↕↕↕↕

CP BA, #mmnn |||||| Compare immediate data mmnn with BA reg. ||||||||||||||||||||||||||||| 3 cycles ||| Function BA - mmnn Mode Src: Immediate data This function subtracts the 16-bit immediate Dst: Register direct data mmnn from the content of the BA register and changes the content of the flag Example Set Value Result SC (N/V/C/Z) according the result thereof. The BA mmnn BA content of the BA register is not changed. NVCZ 3F71H 145AH 3F71H 0000 Code MSB LSB 53D1H 53D1H 53D1H 0001 11010100D4H A291H 632EH A291H 0100 nn nn 2862H 4C25H 2862H 1010

mm mm

Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 97 4 INSTRUCTION SETS

CP HL, rp ||||||||||||||||||||| Comparerp reg. with HL reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function HL - rp Mode Src: Register direct This function subtracts the content of rp Dst: Register direct register (BA/HL/IX/IY) from the content of the HL register and changes the content of Example Set Value Result SC the flag (N/V/C/Z) according the result HL rp HL thereof. The content of the HL register is not NVCZ changed. 3F71H 145AH 3F71H 0000 53D1H 53D1H 53D1H 0001 Code MSB LSB 11001111CFH A291H 632EH A291H 0100 2862H 4C25H 2862H 1010 001110 rp 38H–3BH✽ (rp≠HL) ✽ rp Mnemonic Code BA 00 CP HL, BA 38H HL 01 CP HL, HL 39H IX 10 CP HL, IX 3AH IY 11 CP HL, IY 3BH

Flag I1 I0 U D N V C Z ––––↕↕↕↕

CP HL, #mmnn ||||||| Compare immediate data mmnn with HL reg. |||||||||||||||||||||||||||| 3 cycles ||| Function HL - mmnn Mode Src: Immediate data This function subtracts the 16-bit immediate Dst: Register direct data mmnn from the content of the HL register and changes the content of the flag Example Set Value Result SC (N/V/C/Z) according the result thereof. The HL mmnn HL content of the HL register is not changed. NVCZ 3F71H 145AH 3F71H 0000 Code MSB LSB 53D1H 53D1H 53D1H 0001 11010101D5H A291H 632EH A291H 0100 nn nn 2862H 4C25H 2862H 1010

mm mm

Flag I1 I0 U D N V C Z ––––↕↕↕↕

98 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

CP IX, #mmnn ||||||||| Compare immediate data mmnn with IX reg. |||||||||||||||||||||||||||||| 3 cycles ||| Function IX - mmnn Mode Src: Immediate data This function subtracts the 16-bit immediate Dst: Register direct data mmnn from the content of the IX register and changes the content of the flag Example Set Value Result SC (N/V/C/Z) according the result thereof. The IX mmnn IX content of the IX register is not changed. NVCZ 3F71H 145AH 3F71H 0000 Code MSB LSB 53D1H 53D1H 53D1H 0001 11010110D6H A291H 632EH A291H 0100 nn nn 2862H 4C25H 2862H 1010

mm mm

Flag I1 I0 U D N V C Z ––––↕↕↕↕

CP IY, #mmnn |||||||||| Compare immediate data mmnn with IY reg. |||||||||||||||||||||||||||||| 3 cycles ||| Function IY - mmnn Mode Src: Immediate data This function subtracts the 16-bit immediate Dst: Register direct data mmnn from the content of the IY register and changes the content of the flag Example Set Value Result SC (N/V/C/Z) according the result thereof. The IY mmnn IY content of the IY register is not changed. NVCZ 3F71H 145AH 3F71H 0000 Code MSB LSB 53D1H 53D1H 53D1H 0001 11010111D7H A291H 632EH A291H 0100 nn nn 2862H 4C25H 2862H 1010

mm mm

Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 99 4 INSTRUCTION SETS

CP SP, rp |||||||||||||||||||||| Comparerp reg. with SP |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function SP - rp Mode Src: Register direct This function subtracts the content of rp Dst: Register direct register (BA/HL) from the content of the stack pointer (SP) and changes the content of Example Set Value Result SC the flag (N/V/C/Z) according the result SP rp SP thereof. The content of the SP is not changed. NVCZ 3F71H 145AH 3F71H 0000 Code MSB LSB 53D1H 53D1H 53D1H 0001 11001111CFH A291H 632EH A291H 0100 0101110rp5CH/5DH✽ 2862H 4C25H 2862H 1010

✽ rp Mnemonic Code BA 0 CP SP, BA 5CH HL 1 CP SP, HL 5DH

Flag I1 I0 U D N V C Z ––––↕↕↕↕

CP SP, #mmnn |||||||| Compare immediate data mmnn with SP |||||||||||||||||||||||||||||||||||| 4 cycles ||| Function SP - mmnn Mode Src: Immediate data This function subtracts the 16-bit immediate Dst: Register direct data mmnn from the content of the stack pointer (SP) and changes the content of the Example Set Value Result SC flag (N/V/C/Z) according the result thereof. S P mmnn S P The content of the SP is not changed. NVCZ 3F71H 145AH 3F71H 0000 Code MSB LSB 53D1H 53D1H 53D1H 0001 11001111CFH A291H 632EH A291H 0100 011011006CH 2862H 4C25H 2862H 1010 nn nn

mm mm

Flag I1 I0 U D N V C Z ––––↕↕↕↕

100 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

CPL r |||||||||||||||||||||||||||||||| Complement r reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function r ← r Flag I1 I0 U D N V C Z Inverts the each bit of the r register (A/B) and ––––↕ ––↕ creates one compliment. Mode Register direct Code MSB LSB 11001110CEH Example Set Value Result SC 1010000rA0H/A1H✽ rr NVCZ ✽ r Mnemonic Code 11111111 00000000 0––1 A 0 CPL A A0H 10100101 01011010 1––0 B 1 CPL A A1H

CPL [BR:ll] ||||||||||||||||| Complement location [BR:ll] ||||||||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles |||

Function [BR:ll] ← [BR:ll] Flag I1 I0 U D N V C Z Inverts the each bit of the data memory and ––––↕ ––↕ creates one compliment. The data memory address has been specified by the content of Mode 8-bit absolute the BR register (upper byte specification) and Example Set Value Result the 8-bit absolute address ll (lower byte SC specification). [BR:ll] [BR:ll] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 11111111 00000000 0––1 10100101 01011010 1––0 Code MSB LSB 11001110CEH

10100010A2H

ll ll

CPL [HL] ||||||||||||||||||||||| Complement location [HL] |||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function [HL] ← [HL] Flag I1 I0 U D N V C Z Inverts the each bit of the data memory that ––––↕ ––↕ has been address specified by the HL register and creates one compliment. Mode Register indirect The content of the EP register becomes the Example Set Value Result page address of the data memory (MODEL2/3). SC [HL] [HL] Code MSB LSB NVCZ 11001110CEH 11111111 00000000 0––1 10100011A3H 10100101 01011010 1––0

E0C88 CORE CPU MANUAL EPSON 101 4 INSTRUCTION SETS

DEC r |||||||||||||||||||||||||||||||| Decrement r reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function r ← r - 1 Mode Register direct Decrements (-1) the content of the r register Example Set Value Result (A/B/L/H). SC Code MSB LSB rr NVCZ 100010 r 88H–8BH✽ 63H 62H–––0 ✽ r Mnemonic Code 01H 00H–––1 A 00 DEC A 88H B 01 DEC B 89H L 10 DEC L 8AH H 11 DEC H 8BH

Flag I1 I0 U D N V C Z –––––––↕

DEC BR |||||||||||||||||||||||||| Decrement BR reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function BR ← BR - 1 Mode Register direct Decrements (-1) the content of the BR Example Set Value Result register. SC BR BR Code MSB LSB NVCZ 100011008CH 63H 62H–––0 Flag I1 I0 U D N V C Z 01H 00H–––1 –––––––↕

DEC [BR:ll] ||||||||||||||||| Decrement location [BR:ll] ||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [BR:ll] ← [BR:ll] - 1 Mode 8-bit absolute Decrements (-1) the content of the data Example Set Value Result memory. The data memory address has been SC specified by the content of the BR register [BR:ll] [BR:ll] (upper byte specification) and the 8-bit NVCZ absolute address ll (lower byte specification). 63H 62H–––0 The content of the EP register becomes the 01H 00H–––1 page address of the data memory (MODEL2/3).

Code MSB LSB 100011018DH

ll ll

Flag I1 I0 U D N V C Z –––––––↕

102 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

DEC [HL] ||||||||||||||||||||||| Decrement location [HL] |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function [HL] ← [HL] - 1 Mode Register indirect Decrements (-1) the content of the data Example Set Value Result memory that has been address specified by SC the HL register. [HL] [HL] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 63H 62H–––0 01H 00H–––1 Code MSB LSB 100011108EH

Flag I1 I0 U D N V C Z –––––––↕

DEC rp |||||||||||||||||||||||||||| Decrement rp reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function rp ← rp - 1 Mode Register direct Decrements (-1) the content of the rp register Example Set Value Result (BA/HL/IX/IY). SC Code MSB LSB rp rp NVCZ 100110 rp 98H–9BH✽ 4285H 4284H –––0 ✽ r Mnemonic Code 0001H 0000H –––1 BA 00 DEC BA 98H HL 01 DEC HL 99H IX 10 DEC IX 9AH IY 11 DEC IY 9BH

Flag I1 I0 U D N V C Z –––––––↕

DEC SP |||||||||||||||||||||||||| Decrement SP reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function SP ← SP - 1 Mode Register direct Decrements (-1) the content of the stack Example Set Value Result pointer (SP). SC SP SP Code MSB LSB NVCZ 100011118FH 4285H 4284H –––0 Flag I1 I0 U D N V C Z 0001H 0000H –––1 –––––––↕

E0C88 CORE CPU MANUAL EPSON 103 4 INSTRUCTION SETS

DIV ||||||||||||||||||||||||||||||||||||||| Divide HL reg. by A reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 13 cycles |||

Function L ← HL/A, H ← remainder Flag I1 I0 U D N V C Z Divides the content of the HL register by the ––––↕↕0 ↕ content of the A register it stores the quotient in the L register and the remainder in the H Mode Implied (Register direct) register. Example Set Value Result When it divides by the divisor '0', a zero SC division exception processing is generated. HL A L H When it divides by a divisor other than '0' and NVCZ the quotient exceeds 8 bits, the V flag is set to 1A16H 64H 42H 4EH 0000 '1' and the dividend (content of the HL 332CH 64H 83H 00H 1000 register) is saved. 0000H 58H 00H 00H 0001 Code MSB LSB 0301H 02H 01H 03H 1100 11001110CEH Note This instruction cannot be used in the 11011001D9H MODEL0/2.

DJR NZ, rr ||||||||||||||||||| Decrement B reg. & Jump relative if B reg. is not zero ||||||||||||||| 4 cycles ||| Function Mode Signed 8-bit PC relative B ← B - 1, Example At the time of condition establishment when If B ≠ 0 then JRS rr NB = 02H and B = 05H in the MODEL2/3, else PC ← PC + 2 operation of the "DJR NZ,$-05H" in the physical address 9000H is as indicated below. ← B B - 1, NB CB PC(logical addr.) B If B ≠ 0 then JRS rr else PC ← PC + 2, NB ← CB Before execution 02H 01H 9000H 05H 9001H+(FFFBH-1) Decrements (-1) the B register and as a result thereof, the B register is other than '0', it After execution 02H 02H 8FFBH 04H executes the branch instruction "JRS rr". In the above example it branches to the When the B register has become '0', it physical address 010FFBH. executes the following instruction. In the MODEL0/1, since there are no NB and See the "JRS rr" instruction. CB, it branches to the physical address 8FFBH. In the MODEL2/3, the bank address set in the NB upon branching is loaded into the CB, When a condition has not been established, and the bank is also changed. When it shifts the operation of the "DJR NZ,$-05H" in the to the following instruction instead of physical address 9000H is as indicated below. branching, this function returns the content of NB CB PC(logical addr.) B the NB to the current bank address (content of the CB). Before execution 01H 02H 9000H 01H

Code MSB LSB 11110101F5H After execution 02H 02H 9002H 00H

rr rr There are no NB and CB in the MODEL0/1.

Flag I1 I0 U D N V C Z –––––––↕

104 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

EX A, B ||||||||||||||||||||||||||| Exchange A reg. and B reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ↔ B Mode Src: Register direct Exchanges the content of the B register with Dst: Register direct the A register. Example Set Value Result Code MSB LSB SC ABAB 11001100CCH NVCZ Flag I1 I0 U D N V C Z 82H49H49H82H–––– ––––––––

EX A, [HL] |||||||||||||||||||| Exchange A reg. and location [HL] |||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function A ↔ [HL] Mode Src: Register indirect Exchanges the content of the data memory Dst: Register direct that has been address specified by HL register Example Set Value Result with the A register. SC The content of the EP register becomes the A [HL] A [HL] page address of the data memory (MODEL2/3). NVCZ 82H49H49H82H–––– Code MSB LSB 11001101CDH

Flag I1 I0 U D N V C Z ––––––––

EX BA, rp |||||||||||||||||||||| Exchange BA reg. and rp reg. |||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function BA ↔ rp Mode Src: Register direct Exchanges the content of the rp register (HL/ Dst: Register direct IX/IY/SP) with the BA register. Example Set Value Result Code MSB LSB SC ✽ BA rp BA rp 110010 rp C8H–CBH NVCZ ✽ rp Mnemonic Code 35D6H C284H C284H 35D6H –––– HL 00 EX BA, HL C8H IX 01 EX BA, IX C9H IY 10 EX BA, IY CAH S P 11 EX BA,SP CBH

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 105 4 INSTRUCTION SETS

HALT |||||||||||||||||||||||||||||||||| Set CPU to HALT mode |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function HALT Code MSB LSB Sets the CPU in the HALT status. 11001110CEH In the HALT status, the CPU stops operation, thus reducing power consumption. Peripheral 10101110AEH circuits such as the oscillation circuit still Flag I1 I0 U D N V C Z operate. –––––––– An interrupt causes it to return from the HALT status to the normal program execu- tion status. See Section 3.7.1, "Halt status".

INC r |||||||||||||||||||||||||||||||||| Increment r reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function r ← r + 1 Mode Register direct Increments (+1) the content of the r register Example Set Value Result (A/B/L/H). SC Code MSB LSB rr NVCZ 100000 r 80H–83H✽ 52H 53H–––0 ✽ r Mnemonic Code FFH 00H–––1 A 00 INC A 80H B 01 INC B 81H L 10 INC L 82H H 11 INC H 83H

Flag I1 I0 U D N V C Z –––––––↕

INC BR |||||||||||||||||||||||||||| Increment BR reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function BR ← BR + 1 Mode Register direct Increments (+1) the content of the BR Example Set Value Result register. SC BR BR Code MSB LSB NVCZ 1000010084H 52H 53H–––0 Flag I1 I0 U D N V C Z FFH 00H–––1 –––––––↕

106 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

INC [BR:ll] ||||||||||||||||||| Increment location [BR:ll] |||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [BR:ll] ← [BR:ll] +1 Mode 8-bit absolute Increments (+1) the content of the data Example Set Value Result memory. The data memory address has been SC specified by the content of the BR register [BR:ll] [BR:ll] (upper byte specification) and the 8-bit NVCZ absolute address ll (lower byte specification). 52H 53H–––0 The content of the EP register becomes the FFH 00H–––1 page address of the data memory (MODEL2/3).

Code MSB LSB 1000010185H

ll ll

Flag I1 I0 U D N V C Z –––––––↕

INC [HL] ||||||||||||||||||||||||| Increment location [HL] ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function [HL] ← [HL] + 1 Mode Register indirect Increments (+1) the content of the data Example Set Value Result memory that has been address specified by SC the HL register. [HL] [HL] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 52H 53H–––0 FFH 00H–––1 Code MSB LSB 1000011086H

Flag I1 I0 U D N V C Z –––––––↕

INC rp ||||||||||||||||||||||||||||||| Increment rp reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function rp ← rp + 1 Mode Register direct Increments (+1) the content of the rp register Example Set Value Result (BA/HL/IX/IY). SC Code MSB LSB rp rp NVCZ 100100 rp 90H–93H✽ 3259H 325AH –––0 ✽ r Mnemonic Code FFFFH 0000H –––1 BA 00 INC BA 90H HL 01 INC HL 91H IX 10 INC IX 92H IY 11 INC IY 93H

Flag I1 I0 U D N V C Z –––––––↕

E0C88 CORE CPU MANUAL EPSON 107 4 INSTRUCTION SETS

INC SP ||||||||||||||||||||||||||||| Increment SP reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function SP ← SP +1 Mode Register direct Increments (+1) the content of the stack Example Set Value Result pointer (SP). SC SP SP Code MSB LSB NVCZ 1000011187H 3259H 325AH –––0 Flag I1 I0 U D N V C Z FFFFH 0000H –––1 –––––––↕

INT [kk] ||||||||||||||||||||||||||| Software Interrupt ||||||||||||||||||||||||||||||||||||||||||||||||||| 7(MIN)/8(MAX) cycles ||| Function Code MSB LSB [SP-1]←PC(H), [SP-2]←PC(L), 11111100FCH [SP-3]←SC, SP←SP-3, PC(L)←[00kk], PC(H)←[00kk+1] kk kk Flag I1 I0 U D N V C Z [SP-1]←PC(H), [SP-2]←PC(L), –––––––– [SP-3]←SC, SP←SP-3, PC(L)←[00kk], PC(H)←[00kk+1], CB←NB Mode 8-bit indirect Example When NB = 02H in the MODEL2/3, it [SP-1]←CB, [SP-2]←PC(H), executes the "INT [20H]" instruction in the [SP-3]←PC(L), [SP-4]←SC, physical address 9000H. SP←SP-4, PC(L)←[00kk], NB CBPC(logical addr.) EP M(000020H) SP ← ← PC(H) [00kk+1], CB NB Before execution 02H 01H 9000H 03H ABCDH 0000H Executes the software interrupt routine that makes the 00kk address of the program After execution 02H 02H ABCDH 03H ABCDH FFFCH memory the vector address, following evacuation of the top address +2 value of this EP is disregarded and the vector area instruction and system condition flag (SC) to (000000H–0000FFH) is specified. the stack. In the above example it branches to the physical address 012BCDH. In the maximum mode of the MODEL2/3, Since there are no NB and CB in the the currently selected bank address (content MODEL0/1, it branches to the physical of the CB) is also evacuated upon evacuation address ABCDH. of the return address. Upon branching in the MODEL2/3, the bank Stack content after execution address set in the NB is loaded into the CB (1) MODEL2/3 (maximum mode) and the bank is also changed. 00FFFCH Content of SC

The content of the EP register becomes the 00FFFDH 02H (PC (L) )

page address of the data memory. 00FFFEH 90H (PC (H) ) 00FFFFH The vector field is fixed at page 0. 01H (CB) Note You should use the "RETE" instruction that (2) MODEL2/3 (minimum mode), MODEL0/1 also returns the content of the SC for return 00FFFDH Content of SC from an interrupt routine executed by an "INT 00FFFEH 02H (PC (L) ) [kk]" instruction. 00FFFFH 90H (PC (H) )

108 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

JP HL ||||||||||||||||||||||||||||||| Indirect Jump using HL reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function Mode Register direct PC ← HL Example When NB = 02H and HL = 8765H in the MODEL2/3, it executes the "JP HL" PC ← HL, CB ← NB instruction in the physical address 9000H. Loads the content of the HL register into the NB CB PC(logical addr.) HL program counter (PC) then unconditionally Before execution 02H 01H 9000H 8765H branches.

Upon branching in the MODEL2/3, the bank After execution 02H 02H 8765H 8765H address set in the NB is loaded into the CB and the bank is also changed. In the above example it branches to the physical address 010765H. Code MSB LSB Since there are no NB and CB in the 11110100F4H MODEL0/1, it branches to the physical address 8765H. Flag I1 I0 U D N V C Z ––––––––

JP [kk] ||||||||||||||||||||||||||||| Indirect Jump using vector |||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function Mode 8-bit indirect ← ← PC(L) [00kk], PC(H) [00kk+1] Example When NB = 02H in the MODEL2/3, it executes the "JP [20H]" instruction in the CB ← NB, PC(L) ← [00kk], physical address 9000H. ← PC(H) [00kk+1] NB CBPC(logical addr.) EP M(000020H) It makes the kk the 8-bit indirect address, Before execution 02H 01H 9000H 03H ABCDH then load the vector written into the 00kk and 00kk+1 address of the program memory into After execution 02H 02H ABCDH 03H ABCDH the program counter (PC), and then uncondi- tionally branches. EP is disregarded and the vector area (000000H–0000FFH) is specified. Upon branching in the MODEL2/3, the bank In the above example it branches to the address set in the NB is loaded into the CB physical address 012BCDH. and the bank is also changed. Since there are no NB and CB in the The vector field is fixed at page 0. MODEL0/1, it branches to the physical Code MSB LSB address ABCDH. 11111101FDH

kk kk

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 109 4 INSTRUCTION SETS

JRL qqrr |||||||||||||||||||||||| Jump to relative location qqrr ||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function Mode Signed 16-bit PC relative PC ← PC + qqrr + 2 Example When NB = 02H in the MODEL2/3, it executes the "JRL $+2000H" instruction in PC ← PC + qqrr + 2, CB ← NB the physical address 9000H. Adds the 16-bit relative address qqrr (-32768 NB CB PC(logical addr.) to 32767) to the program counter (PC) as an Before execution 02H 01H 9000H offset from the top address +2 of this 9002H + (2000H - 2) instruction and unconditionally branches to this address. After execution 02H 02H B000H Upon branching in the MODEL2/3, the bank In the above example it branches to the address set in the NB is loaded into the CB physical address 013000H. and the bank is also changed. Since there are no NB and CB in the MODEL0/1, it branches to the physical Code MSB LSB address B000H. 11110011F3H

rr rr

qq qq

Flag I1 I0 U D N V C Z ––––––––

110 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

JRL cc1, qqrr ||||||||||| Jump to relative location qqrr if condition cc1 is true |||||||||||||||| 3 cycles ||| Function Code MSB LSB If cc1 is true 111011 cc1ECH–EFH✽ then JRL qqrr else PC ←PC + 3 rr rr qq qq If cc1 is true ✽ cc1 Mnemonic Code then JRL qqrr C 00 JRL C,qqrr ECH else PC ← PC + 3, NB ← CB NC 01 JRL NC,qqrr EDH When the condition cc1 has been established, Z 10 JRL Z,qqrr EEH the CPU executes the "JRL qqrr" instruction NZ 11 JRL NZ,qqrr EFH and when a condition has not been estab- lished, it executes the following instruction. Flag I1 I0 U D N V C Z See "JRL qqrr" instruction. –––––––– In the MODEL2/3, when a condition has not Mode Signed 16-bit PC relative been established, the content of the NB specifying the branch destination bank Example At the time of condition establishment, returns to the current bank address (content of operates the same as the "JRL qqrr" instruc- the CB). tion. When a condition has not been established, the operation of the "JRL Condition cc1 is of the below 4 types. cc1,qqrr" in the physical address 9000H is as cc1 Condition indicated below. C Carry (Carry flag C = 1) NB CB PC(logical addr.) NC Non Carry (Carry flag C = 0) Z Zero (Zero flag Z = 1) Before execution 02H 01H 9000H NZ Non Zero (Zero flag Z = 0) After execution 01H 01H 9003H There are no NB and CB in the MODEL0/1.

E0C88 CORE CPU MANUAL EPSON 111 4 INSTRUCTION SETS

JRS rr |||||||||||||||||||||||||||||| Jump to relative location rr ||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function Mode Signed 8-bit PC relative PC ← PC + rr + 1 Example When NB = 02H in the MODEL2/3, it executes the "JRL $+20H" instruction in the PC ← PC + rr + 1, CB ← NB physical address 9000H. Adds the 8-bit relative address rr (-128 to NB CB PC(logical addr.) 127) to the program counter (PC) as an Before execution 02H 01H 9000H displacement from the top address +1 of this 9001H + (20H - 1) instruction and unconditionally branches to this address. After execution 02H 02H 9020H Upon branching in the MODEL2/3, the bank In the above example it branches to the address set in the NB is loaded into the CB physical address 011020H. and the bank is also changed. Since there are no NB and CB in the MODEL0/1, it branches to the physical Code MSB LSB address 9020H. 11110001F1H

rr rr

Flag I1 I0 U D N V C Z ––––––––

112 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

JRS cc1, rr |||||||||||||||||| Jump to relative location rr if condition cc1 is true |||||||||||||||||||| 2 cycles ||| Function Code MSB LSB If cc1 is true 111001 cc1 E4H–E7H✽ then JRS rr else PC ← PC + 2 rr rr ✽ cc1 Mnemonic Code If cc1 is true C 00 JRS C,qqrr E4H then JRS rr NC 01 JRS NC,qqrr E5H else PC ← PC + 2, NB ← CB Z 10 JRS Z,qqrr E6H When the condition cc1 has been established, NZ 11 JRS NZ,qqrr E7H the CPU executes the "JRS rr" instruction and Flag I1 I0 U D N V C Z when a condition has not been established, it –––––––– executes the following instruction. See "JRS rr" instruction. Mode Signed 8-bit PC relative In the MODEL2/3, when a condition has not Example At the time of condition establishment, been established, the content of the NB operates the same as the "JRS rr" instruction. specifying the branch destination bank When a condition has not been established, returns to the current bank address (content of the operation of the "JRS cc1,rr" in the the CB). physical address 9000H is as indicated below. Condition cc1 is of the below 4 types. NB CB PC(logical addr.) cc1 Condition Before execution 02H 01H 9000H C Carry (Carry flag C = 1) NC Non Carry (Carry flag C = 0) After execution 01H 01H 9002H Z Zero (Zero flag Z = 1) NZ Non Zero (Zero flag Z = 0) There are no NB and CB in the MODEL0/1.

JRS cc2, rr |||||||||||||||||| Jump to relative location rr if condition cc2 is true |||||||||||||||||||| 3 cycles ||| Function When the condition cc2 has been established, If cc2 is true it adds the 8-bit relative address rr (-128 to then PC ← PC + rr + 2 127) to the program counter (PC) as an offset else PC ← PC + 3 from the top address +2 of this instruction and branches to that address. When a condition has not been established, it If cc2 is true executes the following instruction. then PC ← PC + rr + 2, CB ← NB else PC ← PC + 3, NB ← CB Upon branching in the MODEL2/3, the bank address set in the NB is loaded into the CB and the bank is also changed. When a condition has not been established, the content of the NB specifying the branch destination bank returns to the current bank address (content of the CB).

E0C88 CORE CPU MANUAL EPSON 113 4 INSTRUCTION SETS

JRS cc2, rr

Mode Signed 8-bit PC relative Condition cc2 is of the below 16 types. cc2 Condition Example At the time of condition establishment when LT Less Than ([N ∀ V] = 1) NB = 02H in the MODEL2/3, operation of the "JRS cc2,$+20" in the physical address LE Less or Equal (Z ∨ [N ∀ N] = 1) 9000H is as indicated below. GT Greater Than (Z ∨ [N ∀ N] = 0) GE Greater or Equal ([N ∀ N] = 0) NB CB PC(logical addr.) V Overflow (V = 1) Before execution 02H 01H 9000H NV Non Overflow (V = 0) 9002H + (20H - 2) P Plus (N = 0) After execution 02H 02H 9020H M Minus (N = 1) In the above example it branches to the F0 F0 is set (F0 = 1) physical address 011020H. In the MODEL0/ F1 F1 is set (F1 = 1) 1, since there are no NB and CB, it branches F2 F2 is set (F2 = 1) to the physical address 9020H. F3 F3 is set (F3 = 1) NF0 F0 is reset (F0 = 0) When a condition has not been established, the operation of the "JRS cc2,rr" in the NF1 F1 is reset (F1 = 0) physical address 9000H is as indicated below. NF2 F2 is reset (F2 = 0) NF3 F3 is reset (F3 = 0) NB CB PC(logical addr.) Before execution 02H 01H 9000H Code MSB LSB 11001110CEH After execution 01H 01H 9003H 1110 cc2 E0H–EFH✽ There are no NB and CB in the MODEL0/1. rr rr

✽ cc2 Mnemonic Code LT 0000 JRS LT, rr E0H LE 0001 JRS LE, rr E1H GT 0010 JRS GT, rr E2H GE 0011 JRS GE, rr E3H V 0100 JRS V, rr E4H NV 0101 JRS NV, rr E5H P 0110 JRS P, rr E6H M 0111 JRS M, rr E7H F0 1000 JRS F0, rr E8H F1 1001 JRS F1, rr E9H F2 1010 JRS F2, rr EAH F3 1011 JRS F3, rr EBH NF0 1100 JRS NF0, rr ECH NF1 1101 JRS NF1, rr EDH NF2 1110 JRS NF2, rr EEH NF3 1111 JRS NF3, rr EFH

Flag I1 I0 U D N V C Z ––––––––

114 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD r, r' |||||||||||||||||||||||||||||| Load r' reg. into r reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 1 cycle |||

Function r ← r' Flag I1 I0 U D N V C Z Loads the content of the r' register (A/B/L/H) –––––––– into the r register (A/B/L/H). Mode Src: Register direct Code MSB LSB Dst: Register direct 010 r 0 r' ✽ Example Set Value Result ✽ r' A B L H SC r (0,0) (0,1) (1,0) (1,1) rr'rr' NVCZ A(0,0) 40H 41H 42H 43H 5AH42H42H42H–––– B(0,1) 48H 49H 4AH 4BH (r≠r') L(1,0) 50H 51H 52H 53H H(1,1) 58H 59H 5AH 5BH

LD A, BR ||||||||||||||||||||||| Load BR reg. into A reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← BR Mode Src: Register direct Loads the content of the BR register into the Dst: Register direct A register. Example Set Value Result Code MSB LSB SC ABRABR 11001110CEH NVCZ 11000000C0H 5AH42H42H42H––––

Flag I1 I0 U D N V C Z ––––––––

LD A, SC ||||||||||||||||||||||| Load SC. into A reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← SC Mode Src: Register direct Loads the content of the system condition Dst: Register direct flag (SC) into the A register. Example Set Value Result Code MSB LSB SC ASCASC 11001110CEH NVCZ 11000001C1H 5AH42H42H42H––––

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 115 4 INSTRUCTION SETS

LD A, er |||||||||||||||||||||||||| Load er reg. into A reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← er Mode Src: Register direct Loads the content of the er register (NB/EP/ Dst: Register direct XP/YP) into the A register. Example Set Value Result Code MSB LSB SC AerAer 11001110CEH NVCZ 110010 er C8H–CBH✽ 5AH42H42H42H––––

✽ er Mnemonic Code Note This instruction cannot be used in the NB 00 LD A, NB C8H MODEL0/1. E P 01 LD A, EP C9H XP 10 LD A, XP CAH YP 11 LD A, YP CBH

Flag I1 I0 U D N V C Z ––––––––

LD BR, A ||||||||||||||||||||||| Load A reg. into BR reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function BR ← A Mode Src: Register direct Loads the content of the A register into the Dst: Register direct BR register. Example Set Value Result Code MSB LSB SC BR A BR A 11001110CEH NVCZ 11000010C2H 5AH42H42H42H––––

Flag I1 I0 U D N V C Z ––––––––

LD SC, A ||||||||||||||||||||||| Load A reg. into SC ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function SC ← A Mode Src: Register direct Sets the content of the A register into the Dst: Register direct system condition flag (SC). Example Code MSB LSB Set Value Result 11001110CEH SC SC A SC A 11000011C3H I1 I0 U D N V C Z 5AH42H42H42H01000010 Flag I1 I0 U D N V C Z ↕↕↕↕↕↕↕↕

116 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD er, A |||||||||||||||||||||||||| Load A reg. into er reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 or 3 cycles ||| Function er ← A Mode Src: Register direct Loads the content of the A register into the er Dst: Register direct (NB/EP/XP/YP) register. Example Set Value Result Code MSB LSB SC er A er A 11001110CEH NVCZ 110011 er CCH–CFH✽ 5AH42H42H42H––––

✽ er Mnemonic Code Note This instruction cannot be used in the NB 00 LD NB, A CCH (3 cycles) MODEL0/1. E P 01 LD EP, A CDH (2 cycles) XP 10 LD XP, A CEH (2 cycles) YP 11 LD YP, A CFH (2 cycles)

Flag I1 I0 U D N V C Z ––––––––

LD [BR:ll], r |||||||||||||||| Load r reg. into location [BR:ll] ||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function [BR:ll] ← r Mode Src: Register direct Loads the content of the r register (A/B/L/H) Dst: 8-bit absolute into the data memory. The data memory address has been specified by the content of Example Set Value Result SC the BR register (upper byte specification) and [BR:ll] r [BR:ll]r the 8-bit absolute address ll (lower byte NVCZ specification). 5AH42H42H42H–––– The content of the EP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 011110 r 78H–7BH✽

ll ll

✽ r Mnemonic Code A 00 LD [BR:ll], A 78H B 01 LD [BR:ll], B 79H L 10 LD [BR:ll], L 7AH H 11 LD [BR:ll], H 7BH

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 117 4 INSTRUCTION SETS

LD [hhll], r ||||||||||||||||||| Load r reg. into location [hhll] ||||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles ||| Function [hhll] ← r Mode Src: Register direct Loads the content of the r register (A/B/L/H) Dst: 16-bit absolute into the data memory that has been address specified by the 16-bit absolute address hhll. Example Set Value Result SC The content of the EP register becomes the [hhll] r [hhll]r page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 11001110CEH

110101 r D4H–D7H✽

ll ll

hh hh

✽ r Mnemonic Code A 00 LD [hhll], A D4H B 01 LD [hhll], B D5H L 10 LD [hhll], L D6H H 11 LD [hhll], H D7H

Flag I1 I0 U D N V C Z ––––––––

LD [HL], r |||||||||||||||||||||| Load r reg. into location [HL] |||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function [HL] ← r Mode Src: Register direct Loads the content of the r register (A/B/L/H) Dst: Register indirect into the data memory that has been address specified by the HL register. Example Set Value Result SC The content of the EP register becomes the [HL] r [HL] r page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 011010 r 68H–6BH✽

✽ r Mnemonic Code A 00 LD [HL], A 68H B 01 LD [HL], B 69H L 10 LD [HL], L 6AH H 11 LD [HL], H 6BH

Flag I1 I0 U D N V C Z ––––––––

118 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD [IX], r |||||||||||||||||||||||| Load r reg. into location [IX] ||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function [IX] ← r Mode Src: Register direct Loads the content of the r register (A/B/L/H) Dst: Register indirect into the data memory that has been address specified by the IX register. Example Set Value Result SC The content of the XP register becomes the [IX] r [IX] r page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 011000 r 60H–63H✽

✽ r Mnemonic Code A 00 LD [IX], A 60H B 01 LD [IX], B 61H L 10 LD [IX], L 62H H 11 LD [IX], H 63H

Flag I1 I0 U D N V C Z ––––––––

LD [IY], r |||||||||||||||||||||||| Load r reg. into location [IY] |||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function [IY] ← r Mode Src: Register direct Loads the content of the r register (A/B/L/H) Dst: Register indirect into the data memory that has been address specified by the IY register. Example Set Value Result SC The content of the YP register becomes the [IY] r [IY] r page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 011100 r 70H–73H✽

✽ r Mnemonic Code A 00 LD [IY], A 70H B 01 LD [IY], B 71H L 10 LD [IY], L 72H H 11 LD [IY], H 73H

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 119 4 INSTRUCTION SETS

LD [IX+dd], r |||||||||||||| Load r reg. into location [IX + dd] ||||||||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function [IX+dd] ← r Flag I1 I0 U D N V C Z Loads the content of the r register (A/B/L/H) –––––––– into the data memory that has been address specified by the sum of the content of the IX Mode Src: Register direct register and the displacement dd. Dst: Register indirect with displacement The displacement dd is handled as signed Example Set Value Result data and the range is -128 to 127. SC The content of the XP register becomes the [IX+dd] r [IX+dd] r page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 11001110CEH

010 r 10044H/4CH/54H/5CH✽

dd dd

✽ r Mnemonic Code A 00 LD [IX+dd], A 44H B 01 LD [IX+dd], B 4CH L 10 LD [IX+dd], L 54H H 11 LD [IX+dd], H 5CH

LD [IY+dd], r |||||||||||||| Load r reg. into location [IY + dd] ||||||||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function [IY+dd] ← r Flag I1 I0 U D N V C Z Loads the content of the r register (A/B/L/H) –––––––– into the data memory that has been address specified by the sum of the content of the IY Mode Src: Register direct register and the displacement dd. Dst: Register indirect with displacement The displacement dd is handled as signed Example Set Value Result data and the range is -128 to 127. SC The content of the YP register becomes the [IY+dd] r [IY+dd] r page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 11001110CEH

010 r 10145H/4DH/55H/5DH✽

dd dd

✽ r Mnemonic Code A 00 LD [IY+dd], A 45H B 01 LD [IY+dd], B 4DH L 10 LD [IY+dd], L 55H H 11 LD [IY+dd], H 5DH

120 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD [IX+L], r ||||||||||||||||| Load r reg. into location [IX + L] ||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [IX+L] ← r Mode Src: Register direct Loads the content of the r register (A/B/L/H) Dst: Register indirect with index register into the data memory that has been address specified by the sum of the content of the IX Example Set Value Result SC register and the content of the L register. [IX+L] r [IX+L] r The content of the L register is handled as NVCZ signed data and the range is -128 to 127. 5AH42H42H42H–––– The content of the XP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 11001110CEH

010 r 11046H/4EH/56H/5EH✽

✽ r Mnemonic Code A 00 LD [IX+L], A 46H B 01 LD [IX+L], B 4EH L 10 LD [IX+L], L 56H H 11 LD [IX+L], H 5EH

Flag I1 I0 U D N V C Z ––––––––

LD [IY+L], r ||||||||||||||||| Load r reg. into location [IY + L] ||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [IY+L] ← r Mode Src: Register direct Loads the content of the r register (A/B/L/H) Dst: Register indirect with index register into the data memory that has been address specified by the sum of the content of the IY Example Set Value Result SC register and the content of the L register. [IY+L] r [IY+L] r The content of the L register is handled as NVCZ signed data and the range is -128 to 127. 5AH42H42H42H–––– The content of the YP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 11001110CEH

010 r 11147H/4FH/57H/5FH✽

✽ r Mnemonic Code A 00 LD [IY+L], A 47H B 01 LD [IY+L], B 4FH L 10 LD [IY+L], L 57H H 11 LD [IY+L], H 5FH

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 121 4 INSTRUCTION SETS

LD r, #nn ||||||||||||||||||||||| Load immediate data nn into r reg. ||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function r ← nn Mode Src: Immediate data Loads the 8-bit immediate data nn into the r Dst: Register direct register (A/B/L/H). Example Set Value Result Code MSB LSB SC ✽ rnnrnn 101100 r B0H–B3H NVCZ nn nn 5AH42H42H42H––––

✽ r Mnemonic Code A 00 LD A, #nn B0H B 01 LD B, #nn B1H L 10 LD L, #nn B2H H 11 LD H, #nn B3H

Flag I1 I0 U D N V C Z ––––––––

LD BR, #hh ||||||||||||||||| Load immediate data hh into BR reg. ||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function BR ← hh Mode Src: Immediate data Loads the 8-bit immediate data hh into the Dst: Register direct BR register. Example Set Value Result Code MSB LSB SC BR hh BR hh 10110100B4H NVCZ hh hh 5AH42H42H42H––––

Flag I1 I0 U D N V C Z ––––––––

LD SC, #nn ||||||||||||||||| Load immediate data nn into SC ||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function SC ← nn Mode Src: Immediate data Sets the 8-bit immediate data nn into the Dst: Register direct system condition flag (SC). Example Code MSB LSB Set Value Result 100111119FH SC SC nn SC nn nn nn I1 I0 U D N V C Z 5AH42H42H42H01000010 Flag I1 I0 U D N V C Z ↕↕↕↕↕↕↕↕

122 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD NB, #bb ||||||||||||||||| Load immediate data bb into NB reg. ||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function NB ← bb Mode Src: Immediate data Loads the 8-bit immediate data bb into the Dst: Register direct new code bank register NB. Example Set Value Result Code MSB LSB SC NB bb NB bb 11001110CEH NVCZ 11000100C4H 5AH42H42H42H––––

bb bb Note This instruction cannot be used in the MODEL0/1. Flag I1 I0 U D N V C Z ––––––––

LD EP, #pp |||||||||||||||||| Load immediate data pp into EP reg. |||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function EP ← pp Mode Src: Immediate data Loads the 8-bit immediate data pp into the Dst: Register direct expand page register EP. Example Set Value Result Code MSB LSB SC EP pp EP pp 11001110CEH NVCZ 11000101C5H 5AH42H42H42H––––

pp pp Note This instruction cannot be used in the MODEL0/1. Flag I1 I0 U D N V C Z ––––––––

LD XP, #pp |||||||||||||||||| Load immediate data pp into XP reg. |||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function XP ← pp Mode Src: Immediate data Loads the 8-bit immediate data pp into the Dst: Register direct expand page register XP. Example Set Value Result Code MSB LSB SC XP pp XP pp 11001110CEH NVCZ 11000110C5H 5AH42H42H42H––––

pp pp Note This instruction cannot be used in the MODEL0/1. Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 123 4 INSTRUCTION SETS

LD YP, #pp |||||||||||||||||| Load immediate data pp into YP reg. |||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function YP ← pp Mode Src: Immediate data Loads the 8-bit immediate data pp into the Dst: Register direct expand page register YP. Example Set Value Result Code MSB LSB SC YP pp YP pp 11001110CEH NVCZ 11000111C7H 5AH42H42H42H––––

pp pp Note This instruction cannot be used in the MODEL0/1. Flag I1 I0 U D N V C Z ––––––––

LD [BR:ll], #nn |||||||| Load immediate data nn into location [BR:ll] |||||||||||||||||||||||||||| 4 cycles ||| Function [BR:ll] ← nn Mode Src: Immediate data Loads the 8-bit immediate data nn into the Dst: 8-bit absolute data memory. The data memory address has been specified by the content of the BR Example Set Value Result SC register (upper byte specification) and the 8- [BR:ll] nn [BR:ll]nn bit absolute address ll (lower byte specifica- NVCZ tion). 5AH42H42H42H–––– The content of the EP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 11011101DDH

ll ll

nn nn

Flag I1 I0 U D N V C Z ––––––––

LD [HL], #nn |||||||||||||| Load immediate data nn into location [HL] ||||||||||||||||||||||||||||||| 3 cycles ||| Function [HL] ← nn Mode Src: Immediate data Loads the 8-bit immediate data nn into the Dst: Register indirect data memory that has been address specified by the HL register. Example Set Value Result SC The content of the EP register becomes the [HL] n n [HL] n n page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 10110101B5H

nn nn

Flag I1 I0 U D N V C Z ––––––––

124 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD [ir], #nn ||||||||||||||||| Load immediate data nn into location [ir reg.] ||||||||||||||||||||||||||| 3 cycles ||| Function [ir] ← nn Mode Src: Immediate data Loads the 8-bit immediate data nn into the Dst: Register indirect data memory that has been address specified by the ir register (IX/IY). Example Set Value Result SC The content of the XP register (at time of IX [ir] n n [ir] n n specification) or the YP register (at time of NVCZ IY specification) becomes the page address 5AH42H42H42H–––– of the data memory (MODEL2/3).

Code MSB LSB 1011011irB6H/B7H✽

nn nn

✽ ir Mnemonic Code IX 0 LD [IX], #nn B6H IY 1 LD [IY], #nn B7H

Flag I1 I0 U D N V C Z ––––––––

LD r, [BR:ll] |||||||||||||||| Load location [BR:ll] into r reg. ||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function r ← [BR:ll] Mode Src: 8-bit absolute Loads the content of the data memory into Dst: Register direct the r register (A/B/L/H). The data memory address has been specified by the content of Example Set Value Result SC the BR register (upper byte specification) and r [BR:ll] r [BR:ll] the 8-bit absolute address ll (lower byte NVCZ specification). 5AH42H42H42H–––– The content of the EP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 010 r 10044H/4CH/54H/5CH✽

ll ll

✽ r Mnemonic Code A 00 LD A, [BR:ll] 44H B 01 LD B, [BR:ll] 4CH L 10 LD L, [BR:ll] 54H H 11 LD H, [BR:ll] 5CH

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 125 4 INSTRUCTION SETS

LD [HL], [BR:ll] ||||||| Load location [BR:ll] into location [HL] |||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [HL] ← [BR:ll] Mode Src: 8-bit absolute Loads the content of the data memory [BR:ll] Dst: Register indirect into the data memory [HL]. The data memory [BR:ll] address has been specified by the Example Set Value Result SC content of the BR register (upper byte [HL] [BR:ll] [HL] [BR:ll] specification) and the 8-bit absolute address ll NVCZ (lower byte specification). The data memory 5AH42H42H42H–––– [HL] address has been specified by the HL register. The content of the EP register becomes the page address of the data memory (MODEL2/3). Code MSB LSB 011011006CH

ll ll

Flag I1 I0 U D N V C Z ––––––––

LD [ir], [BR:ll] ||||||||||| Load location [BR:ll] into location [ir reg.] ||||||||||||||||||||||||||||||| 4 cycles ||| Function [ir] ← [BR:ll] Mode Src: 8-bit absolute Loads the content of the data memory [BR:ll] Dst: Register indirect into the data memory [ir]. The data memory [BR:ll] address has been specified by the Example Set Value Result SC content of the BR register (upper byte [ir] [BR:ll] [ir] [BR:ll] specification) and the 8-bit absolute address ll NVCZ (lower byte specification). The data memory 5AH42H42H42H–––– [ir] address has been specified by the ir register (IX/IY). The content of the EP register becomes the page address of the data memory [BR:ll] and the content of the XP register (at time of IX specification) or the YP register (at time of IY specification) becomes the page address of the data memory [ir] (MODEL2/3).

Code MSB LSB 011ir010064H/74H✽

ll ll

✽ ir Mnemonic Code IX 0 LD [IX], [BR:ll] 64H IY 1 LD [IY], [BR:ll] 74H

Flag I1 I0 U D N V C Z ––––––––

126 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD r, [hhll] ||||||||||||||||||| Load location [hhll] into r reg. |||||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles ||| Function r ← [hhll] Mode Src: 16-bit absolute Loads the content of the data memory that Dst: Register direct has been address specified by the 16-bit absolute address hhll into the r register (A/B/ Example Set Value Result SC L/H). r[hhll] r [hhll] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 5AH42H42H42H––––

Code MSB LSB 11001110CEH

110100 r D0H–D3H✽

ll ll

hh hh

✽ r Mnemonic Code A 00 LD A, [hhll] D0H B 01 LD B, [hhll] D1H L 10 LD L, [hhll] D2H H 11 LD H, [hhll] D3H

Flag I1 I0 U D N V C Z ––––––––

LD r, [HL] |||||||||||||||||||||| Load location [HL] into r reg. |||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function r ← [HL] Mode Src: Register indirect Loads the content of the data memory that Dst: Register direct has been address specified by the HL register into the r register (A/B/L/H). Example Set Value Result SC The content of the EP register becomes the r [HL] r [HL] page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 010 r 10145H/4DH/55H/5DH✽

✽ r Mnemonic Code A 00 LD A, [HL] 45H B 01 LD B, [HL] 4DH L 10 LD L, [HL] 55H H 11 LD H, [HL] 5DH

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 127 4 INSTRUCTION SETS

LD [BR:ll], [HL] ||||||| Load location [HL] into location [BR:ll] |||||||||||||||||||||||||||||||||||| 4 cycles |||

Function [BR:ll] ← [HL] Code MSB LSB Loads the content of the data memory [HL] 011111017DH into the data memory [BR:ll]. The data memory [BR:ll] address has been specified ll ll by the content of the BR register (upper byte Flag I1 I0 U D N V C Z specification) and the 8-bit absolute address ll –––––––– (lower byte specification). The data memory [HL] address has been specified by the HL Mode Src: Register indirect register. Dst: 8-bit absolute The content of the EP register becomes the page address of the data memory (MODEL2/3). Example Set Value Result SC [BR:ll] [HL] [BR:ll] [HL] NVCZ 5AH42H42H42H––––

LD [HL], [HL] ||||||||||||| Load location [HL] into location [HL] ||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function [HL] ← [HL] Mode Src: Register indirect Loads the content of the data memory that Dst: Register indirect has been address specified by the HL register into the same address. As a result, only three Example Set Value Result SC cycles are consumed. [HL] [HL] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 42H 42H ––––

Code MSB LSB 011011016DH

Flag I1 I0 U D N V C Z ––––––––

LD [ir], [HL] ||||||||||||||||| Load location [HL] into location [ir reg.] |||||||||||||||||||||||||||||||||| 3 cycles |||

Function [ir] ← [HL] Code MSB LSB Loads the content of the data memory [HL] 011ir010165H/75H✽ into the data memory [ir]. The data memory ✽ [HL] address has been specified by the HL ir Mnemonic Code register. The data memory [ir] address has IX 0 LD [IX], [HL] 65H been specified by the ir register (IX/IY). IY 1 LD [IY], [HL] 75H The content of the EP register becomes the Flag I1 I0 U D N V C Z page address of the data memory [HL] and the content of the XP register (at time of IX –––––––– specification) or the YP register (at time of Mode Src: Register indirect IY specification) becomes the page address Dst: Register indirect of the data memory [ir] (MODEL2/3). Example Set Value Result SC [ir] [HL] [ir] [HL] NVCZ 5AH42H42H42H––––

128 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD r, [IX] |||||||||||||||||||||||| Load location [IX] into r reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles |||

Function r ← [IX] Flag I1 I0 U D N V C Z Loads the content of the data memory that –––––––– has been address specified by the IX register into the r register (A/B/L/H). Mode Src: Register indirect The content of the XP register becomes the Dst: Register direct page address of the data memory (MODEL2/3). Example Set Value Result Code MSB LSB SC ✽ r [IX] r [IX] 010 r 11046H/4EH/56H/5EH NVCZ ✽ r Mnemonic Code 5AH42H42H42H–––– A 00 LD A, [IX] 46H B 01 LD B, [IX] 4EH L 10 LD L, [IX] 56H H 11 LD H, [IX] 5EH

LD [BR:ll], [IX] ||||||||| Load location [IX] into location [BR:ll] ||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function [BR:ll] ← [IX] Code MSB LSB Loads the content of the data memory [IX] 011111107EH into the data memory [BR:ll]. The data memory [BR:ll] address has been specified ll ll by the content of the BR register (upper byte Flag I1 I0 U D N V C Z specification) and the 8-bit absolute address ll –––––––– (lower byte specification). The data memory [IX] address has been specified by the IX Mode Src: Register indirect register. Dst: 8-bit absolute The content of the EP register becomes the page address of the data memory [BR:ll] and Example Set Value Result the content of the XP register becomes the page SC [BR:ll] [IX] [BR:ll] [IX] address of the data memory [IX] (MODEL2/3). NVCZ 5AH42H42H42H––––

LD [HL], [IX] ||||||||||||||| Load location [IX] into location [HL] |||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function [HL] ← [IX] Code MSB LSB Loads the content of the data memory [IX] 011011106EH into the data memory [HL]. The data memory [HL] address has been specified by the HL Flag I1 I0 U D N V C Z register. The data memory [IX] address has –––––––– been specified by the IX register. Mode Src: Register indirect The content of the EP register becomes the Dst: Register indirect page address of the data memory [HL] and the content of the XP register becomes the page Example Set Value Result address of the data memory [IX] (MODEL2/3). SC [HL] [IX] [HL] [IX] NVCZ 5AH42H42H42H––––

E0C88 CORE CPU MANUAL EPSON 129 4 INSTRUCTION SETS

LD [ir], [IX] ||||||||||||||||||| Load location [IX] into location [ir reg.] ||||||||||||||||||||||||||||||||||| 3 cycles ||| Function [ir] ← [IX] Mode Src: Register indirect Loads the content of the data memory [IX] Dst: Register indirect into the data memory [ir]. The data memory Example Set Value Result [IX] address has been specified by the IX SC register. The data memory [ir] address has [IY] [IX] [IY] [IX] been specified by the ir register (IX/IY). NVCZ The content of the XP register (at time of IX 5AH42H42H42H–––– specification) or the YP register (at time of IY specification) becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 011ir011066H/76H✽

✽ ir Mnemonic Code IX 0 LD [IX], [IX] 66H IY 1 LD [IY], [IX] 76H

Flag I1 I0 U D N V C Z ––––––––

LD r, [IY] |||||||||||||||||||||||| Load location [IY] into r reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function r ← [IY] Mode Src: Register indirect Loads the content of the data memory that Dst: Register direct has been address specified by the IY register Example Set Value Result into the r register (A/B/L/H). SC The content of the YP register becomes the r [IY] r [IY] page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 010 r 11147H/4FH/57H/5FH✽

✽ r Mnemonic Code A 00 LD A, [IY] 47H B 01 LD B, [IY] 4FH L 10 LD L, [IY] 57H H 11 LD H, [IY] 5FH

Flag I1 I0 U D N V C Z ––––––––

130 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD [BR:ll], [IY] ||||||||| Load location [IY] into location [BR:ll] ||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function [BR:ll] ← [IY] Code MSB LSB Loads the content of the data memory [IY] 011111117FH into the data memory [BR:ll]. The data memory [BR:ll] address has been specified ll ll by the content of the BR register (upper byte Flag I1 I0 U D N V C Z specification) and the 8-bit absolute address ll –––––––– (lower byte specification). The data memory [IY] address has been specified by the IY Mode Src: Register indirect register. Dst: 8-bit absolute The content of the EP register becomes the page address of the data memory [BR:ll] and Example Set Value Result the content of the YP register becomes the page SC [BR:ll] [IY] [BR:ll] [IY] address of the data memory [IY] (MODEL2/3). NVCZ 5AH42H42H42H––––

LD [HL], [IY] ||||||||||||||| Load location [IY] into location [HL] |||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function [HL] ← [IY] Code MSB LSB Loads the content of the data memory [IY] 011011116FH into the data memory [HL]. The data memory [HL] address has been specified by the HL Flag I1 I0 U D N V C Z register. The data memory [IY] address has –––––––– been specified by the IY register. Mode Src: Register indirect The content of the EP register becomes the Dst: Register indirect page address of the data memory [HL] and the content of the YP register becomes the page Example Set Value Result address of the data memory [IY] (MODEL2/3). SC [HL] [IY] [HL] [IY] NVCZ 5AH42H42H42H––––

LD [ir], [IY] ||||||||||||||||||| Load location [IY] into location [ir reg.] ||||||||||||||||||||||||||||||||||| 3 cycles |||

Function [ir] ← [IY] Flag I1 I0 U D N V C Z Loads the content of the data memory [IY] –––––––– into the data memory [ir]. The data memory [IY] address has been specified by the IY Mode Src: Register indirect register. The data memory [ir] address has Dst: Register indirect been specified by the ir register (IX/IY). The content of the XP register (at time of IX Example Set Value Result SC specification) or the YP register (at time of IY [IX] [IY] [IX] [IY] specification) becomes the page address of the NVCZ data memory (MODEL2/3). 5AH42H42H42H––––

Code MSB LSB 011ir011167H/77H✽

✽ ir Mnemonic Code IX 0 LD [IX], [IY] 67H IY 1 LD [IY], [IY] 77H

E0C88 CORE CPU MANUAL EPSON 131 4 INSTRUCTION SETS

LD r, [IX+dd] |||||||||||||| Load location [IX + dd] into r reg. ||||||||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function r ← [IX+dd] Flag I1 I0 U D N V C Z Loads the content of the data memory that –––––––– has been address specified by the sum of the content of the IX register and the displace- Mode Src: Register indirect with displacement ment dd into the r register (A/B/L/H). Dst: Register direct The displacement dd is handled as signed data and the range is -128 to 127. Example Set Value Result SC The content of the XP register becomes the r [IX+dd] r [IX+dd] page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 11001110CEH

010 r 00040H/48H/50H/58H✽

dd dd

✽ r Mnemonic Code A 00 LD A, [IX+dd] 40H B 01 LD B, [IX+dd] 48H L 10 LD L, [IX+dd] 50H H 11 LD H, [IX+dd] 58H

LD [HL], [IX+dd] ||||| Load location [IX + dd] into location [HL] ||||||||||||||||||||||||||||||| 5 cycles |||

Function [HL] ← [IX+dd] Mode Src: Register indirect with displacement Loads the content of the data memory Dst: Register indirect [IX+dd] into the data memory [HL]. The data memory [HL] address has been specified by Example Set Value Result the HL register. The data memory [IX+dd] SC [HL] [IX+dd] [HL] [IX+dd] address has been specified by the sum of the NVCZ content of the IX register and the displace- 5AH42H42H42H–––– ment dd. The displacement dd is handled as signed data and the range is -128 to 127. The content of the EP register becomes the page address of the data memory [HL] and the content of the XP register becomes the page address of the data memory [IX+dd] (MODEL2/3).

Code MSB LSB 11001110CEH

0110000060H

dd dd

Flag I1 I0 U D N V C Z ––––––––

132 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD [ir], [IX+dd] |||||||| Load location [IX + dd] into location [ir reg.] ||||||||||||||||||||||||||| 5 cycles |||

Function [ir] ← [IX+dd] Code MSB LSB Loads the content of the data memory 11001110CEH [IX+dd] into the data memory [ir]. The data ✽ memory [ir] address has been specified by the 011ir100068H/78H ir register (IX/IY). The data memory [IX+dd] dd dd address has been specified by the sum of the content of the IX register and the displace- ✽ ir Mnemonic Code ment dd. IX 0 LD [IX], [IX+dd] 68H The displacement dd is handled as signed IY 1 LD [IY], [IX+dd] 78H data and the range is -128 to 127. The content of the XP register (at time of IX Flag I1 I0 U D N V C Z specification) or the YP register (at time of –––––––– IY specification) becomes the page address Mode Src: Register indirect with displacement of the data memory (MODEL2/3). Dst: Register indirect

Example Set Value Result SC [ir] [IX+dd] [ir] [IX+dd] NVCZ 5AH42H42H42H––––

LD r, [IY+dd] |||||||||||||| Load location [IY + dd] into r reg. ||||||||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function r ← [IY+dd] Flag I1 I0 U D N V C Z Loads the content of the data memory that –––––––– has been address specified by the sum of the content of the IY register and the displace- Mode Src: Register indirect with displacement ment dd into the r register (A/B/L/H). Dst: Register direct The displacement dd is handled as signed data and the range is -128 to 127. Example Set Value Result SC The content of the YP register becomes the r [IY+dd] r [IY+dd] page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 11001110CEH

010 r 00141H/49H/51H/59H✽

dd dd

✽ r Mnemonic Code A 00 LD A, [IY+dd] 41H B 01 LD B, [IY+dd] 49H L 10 LD L, [IY+dd] 51H H 11 LD H, [IY+dd] 59H

E0C88 CORE CPU MANUAL EPSON 133 4 INSTRUCTION SETS

LD [HL], [IY+dd] ||||| Load location [IY + dd] into location [HL] ||||||||||||||||||||||||||||||| 5 cycles |||

Function [HL] ← [IY+dd] Code MSB LSB Loads the content of the data memory 11001110CEH [IY+dd] into the data memory [HL]. The data memory [HL] address has been specified by 0110000161H the HL register. The data memory [IY+dd] dd dd address has been specified by the sum of the content of the IY register and the displace- Flag I1 I0 U D N V C Z ment dd. –––––––– The displacement dd is handled as signed data and the range is -128 to 127. Mode Src: Register indirect with displacement The content of the EP register becomes the Dst: Register indirect page address of the data memory [HL] and Example Set Value Result the content of the YP register becomes the SC page address of the data memory [IY+dd] [HL] [IY+dd] [HL] [IY+dd] (MODEL2/3). NVCZ 5AH42H42H42H––––

LD [ir], [IY+dd] |||||||| Load location [IY + dd] into location [ir reg.] ||||||||||||||||||||||||||| 5 cycles |||

Function [ir] ← [IX+dd] Code MSB LSB Loads the content of the data memory 11001110CEH [IY+dd] into the data memory [ir]. The data ✽ memory [ir] address has been specified by the 011ir100169H/79H ir register (IX/IY). The data memory [IY+dd] dd dd address has been specified by the sum of the content of the IY register and the displace- ✽ ir Mnemonic Code ment dd. IX 0 LD [IX], [IY+dd] 69H The displacement dd is handled as signed IY 1 LD [IY], [IY+dd] 79H data and the range is -128 to 127. The content of the XP register (at time of IX Flag I1 I0 U D N V C Z specification) or the YP register (at time of –––––––– IY specification) becomes the page address Mode Src: Register indirect with displacement of the data memory (MODEL2/3). Dst: Register indirect

Example Set Value Result SC [ir] [IY+dd] [ir] [IY+dd] NVCZ 5AH42H42H42H––––

134 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD r, [IX+L] ||||||||||||||||| Load location [IX +L] into r reg. |||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function r ← [IX+L] Flag I1 I0 U D N V C Z Loads the content of the data memory that –––––––– has been address specified by the sum of the content of the IX register and the content of Mode Src: Register indirect with index register the L register into the r register (A/B/L/H). Dst: Register direct The content of the L register is handled as signed data and the range is -128 to 127. Example Set Value Result SC The content of the XP register becomes the r [IX+L] r [IX+L] page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 11001110CEH

010 r 01042H/4AH/52H/5AH✽

✽ r Mnemonic Code A 00 LD A, [IX+L] 42H B 01 LD B, [IX+L] 4AH L 10 LD L, [IX+L] 52H H 11 LD H, [IX+L] 5AH

LD [HL], [IX+L] |||||||| Load location [IX + L] into location [HL] ||||||||||||||||||||||||||||||||| 5 cycles |||

Function [HL] ← [IX+L] Mode Src: Register indirect with index register Loads the content of the data memory [IX+L] Dst: Register indirect into the data memory [HL]. The data memory [HL] address has been specified by the HL Example Set Value Result register. The data memory [IX+L] address SC [HL] [IX+L] [HL] [IX+L] has been specified by the sum of the content NVCZ of the IX register and the content of the L 5AH42H42H42H–––– register. The content of the L register is handled as signed data and the range is -128 to 127. The content of the EP register becomes the page address of the data memory [HL] and the content of the XP register becomes the page address of the data memory [IX+L] (MODEL2/3).

Code MSB LSB 11001110CEH

0110001062H

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 135 4 INSTRUCTION SETS

LD [ir], [IX+L] |||||||||||| Load location [IX + L] into location [ir reg.] |||||||||||||||||||||||||||| 5 cycles |||

Function [ir] ← [IX+L] Code MSB LSB Loads the content of the data memory [IX+L] 11001110CEH into the data memory [ir]. The data memory ✽ [ir] address has been specified by the ir 011ir10106AH/7AH register (IX/IY). The data memory [IX+L] ✽ ir Mnemonic Code address has been specified by the sum of the IX 0 LD [IX], [IX+L] 6AH content of the IX register and the content of the L register. IY 1 LD [IY], [IX+L] 7AH The content of the L register is handled as Flag I1 I0 U D N V C Z signed data and the range is -128 to 127. –––––––– The content of the XP register (at time of IX specification) or the YP register (at time of Mode Src: Register indirect with index register IY specification) becomes the page address Dst: Register indirect of the data memory (MODEL2/3). Example Set Value Result SC [ir] [IX+L] [ir] [IX+L] NVCZ 5AH42H42H42H––––

LD r, [IY+L] ||||||||||||||||| Load location [IY +L] into r reg. |||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function r ← [IY+L] Flag I1 I0 U D N V C Z Loads the content of the data memory that –––––––– has been address specified by the sum of the content of the IY register and the content of Mode Src: Register indirect with index register the L register into the r register (A/B/L/H). Dst: Register direct The content of the L register is handled as signed data and the range is -128 to 127. Example Set Value Result SC The content of the YP register becomes the r [IY+L] r [IY+L] page address of the data memory (MODEL2/3). NVCZ 5AH42H42H42H–––– Code MSB LSB 11001110CEH

010 r 01143H/4BH/53H/5BH✽

✽ r Mnemonic Code A 00 LD A, [IY+L] 43H B 01 LD B, [IY+L] 4BH L 10 LD L, [IY+L] 53H H 11 LD H, [IY+L] 5BH

136 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD [HL], [IY+L] |||||||| Load location [IY + L] into location [HL] ||||||||||||||||||||||||||||||||| 5 cycles |||

Function [HL] ← [IY+L] Code MSB LSB Loads the content of the data memory [IY+L] 11001110CEH into the data memory [HL]. The data memory [HL] address has been specified by the HL 0110001163H register. The data memory [IY+L] address Flag I1 I0 U D N V C Z has been specified by the sum of the content –––––––– of the IY register and the content of the L register. Mode Src: Register indirect with index register The content of the L register is handled as Dst: Register indirect signed data and the range is -128 to 127. The content of the EP register becomes the Example Set Value Result page address of the data memory [HL] and SC [HL] [IY+L] [HL] [IY+L] the content of the YP register becomes the NVCZ page address of the data memory [IY+L] 5AH42H42H42H–––– (MODEL2/3).

LD [ir], [IY+L] |||||||||||| Load location [IY + L] into location [ir reg.] |||||||||||||||||||||||||||| 5 cycles |||

Function [ir] ← [IY+L] Code MSB LSB Loads the content of the data memory [IY+L] 11001110CEH into the data memory [ir]. The data memory ✽ [ir] address has been specified by the ir 011ir10116BH/7BH register (IX/IY). The data memory [IY+L] ✽ ir Mnemonic Code address has been specified by the sum of the IX 0 LD [IX], [IY+L] 6BH content of the IY register and the content of the L register. IY 1 LD [IY], [IY+L] 7BH The content of the L register is handled as Flag I1 I0 U D N V C Z signed data and the range is -128 to 127. –––––––– The content of the XP register (at time of IX specification) or the YP register (at time of Mode Src: Register indirect with index register IY specification) becomes the page address Dst: Register indirect of the data memory (MODEL2/3). Example Set Value Result SC [ir] [IY+L] [ir] [IY+L] NVCZ 5AH42H42H42H––––

E0C88 CORE CPU MANUAL EPSON 137 4 INSTRUCTION SETS

LD rp, rp' |||||||||||||||||||||| Load rp' reg. into rp reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles |||

Function rp ← rp' Flag I1 I0 U D N V C Z Loads the content of the rp' register (BA/HL/ –––––––– IX/IY) into the rp register (BA/HL/IX/IY). Mode Src: Register direct Code MSB LSB Dst: Register direct 11001111CFH Example Set Value Result 1110 rp rp' ✽ SC rp rp' rp rp' ✽ r p ' BA HL IX IY NVCZ rp (0,0) (0,1) (1,0) (1,1) 3521H E964H E964H E964H –––– BA(0,0) E0H E1H E2H E3H (rp≠rp') HL(0,1) E4H E5H E6H E7H IX(1,0) E8H E9H EAH EBH IY(1,1) ECH EDH EEH EFH

LD BA, PC ||||||||||||||||||| Load PC into BA reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function BA ← PC + 2 Mode Src: Register direct Loads the content of the program counter (PC) Dst: Register direct into the BA register. The value that has been loaded is top address of this instruction + 2. Example Set Value Result SC BA P C BA P C Code MSB LSB NVCZ 11001111CFH 3521H E964H E964H E964H –––– 11111001F9H

Flag I1 I0 U D N V C Z ––––––––

LD BA, SP ||||||||||||||||||| Load SP into BA reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function BA ← SP Mode Src: Register direct Loads the content of the stack pointer (SP) Dst: Register direct into the BA register. Example Set Value Result Code MSB LSB SC BA S P BA S P 11001111CFH NVCZ 11111000F8H 3521H E964H E964H E964H ––––

Flag I1 I0 U D N V C Z ––––––––

138 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD HL, PC ||||||||||||||||||| Load PC into HL reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function HL ← PC + 2 Mode Src: Register direct Loads the content of the program counter (PC) Dst: Register direct into the HL register. The value that has been loaded is top address of this instruction + 2. Example Set Value Result SC HL P C HL P C Code MSB LSB NVCZ 11001111CFH 3521H E964H E964H E964H –––– 11110101F5H

Flag I1 I0 U D N V C Z ––––––––

LD HL, SP |||||||||||||||||||| Load SP into HL reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function HL ← SP Mode Src: Register direct Loads the content of the stack pointer (SP) Dst: Register direct into the HL register. Example Set Value Result Code MSB LSB SC HL S P HL S P 11001111CFH NVCZ 11110100F4H 3521H E964H E964H E964H ––––

Flag I1 I0 U D N V C Z ––––––––

LD IX, SP |||||||||||||||||||||| Load SP into IX reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function IX ← SP Mode Src: Register direct Loads the content of the stack pointer (SP) Dst: Register direct into the IX register. Example Set Value Result Code MSB LSB SC IX S P IX S P 11001111CFH NVCZ 11111010FAH 3521H E964H E964H E964H ––––

Flag I1 I0 U D N V C Z ––––––––

LD IY, SP |||||||||||||||||||||| Load SP into IY reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function IY ← SP Mode Src: Register direct Loads the content of the stack pointer (SP) Dst: Register direct into the IY register. Example Set Value Result Code MSB LSB SC IY S P IY S P 11001111CFH NVCZ 11111110FEH 3521H E964H E964H E964H ––––

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 139 4 INSTRUCTION SETS

LD SP, rp |||||||||||||||||||||| Load rp reg. into SP ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function SP ← rp Mode Src: Register direct Loads the content of the rp register (BA/HL/ Dst: Register direct IX/IY) into the stack pointer (SP). Example Set Value Result Code MSB LSB SC SP rp SP rp 11001111CFH NVCZ 111100 rp F0H–F3H✽ 3521H E964H E964H E964H ––––

✽ rp Mnemonic Code BA 00 LD SP, BA F0H HL 01 LD SP, HL F1H IX 10 LD SP, IX F2H IY 11 LD SP, IY F3H

Flag I1 I0 U D N V C Z ––––––––

LD [hhll], rp ||||||||||||||| Load rp reg. into location [hhll] |||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles ||| Function [hhll] ← rp(L), [hhll+1] ← rp(H) Mode Src: Register direct Stores the lower byte of the rp register (BA/ Dst: 16-bit absolute HL/IX/IY) in the address hhll of the data Example memory and stores the upper byte in the following address hhll+1. Set Value Result SC The content of the EP register becomes the rp [hhll] [hhll+1] rp page address of the data memory (MODEL2/3). NVCZ E964H 64H E9H E964H – – – – Code MSB LSB 101111 rp BCH–BFH✽

ll ll

hh hh

✽ rp Mnemonic Code BA 00 LD [hhll], BA BCH HL 01 LD [hhll], HL BDH IX 10 LD [hhll], IX BEH IY 11 LD [hhll], IY BFH

Flag I1 I0 U D N V C Z ––––––––

140 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD [hhll], SP |||||||||||||| Load SP into location [hhll] |||||||||||||||||||||||||||||||||||||||||||||||||||||||| 6 cycles ||| Function [hhll] ← SP(L), [hhll+1] ← SP(H) Mode Src: Register direct Stores the lower byte of the stack pointer Dst: 16-bit absolute (SP) in the address hhll of the data memory Example and stores the upper byte in the following address hhll+1. Set Value Result SC The content of the EP register becomes the S P [hhll] [hhll+1] S P page address of the data memory (MODEL2/3). NVCZ E964H 64H E9H E964H –––– Code MSB LSB 11001111CFH

011111007CH

ll ll

hh hh

Flag I1 I0 U D N V C Z ––––––––

LD [HL], rp |||||||||||||||||| Load rp reg. into location [HL] ||||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles |||

Function [HL] ← rp(L), [HL+1] ← rp(H) Mode Src: Register direct Stores the lower byte of the rp register (BA/ Dst: Register indirect HL/IX/IY) in the address of the data memory Example that has been specified by the content of the HL register and stores the upper byte in the Set Value Result SC following address. rp [HL] [HL+1] rp The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). E964H 64H E9H E964H ––––

Code MSB LSB 11001111CFH

110001 rp C4H–C7H✽

✽ rp Mnemonic Code BA 00 LD [HL], BA C4H HL 01 LD [HL], HL C5H IX 10 LD [HL], IX C6H IY 11 LD [HL], IY C7H

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 141 4 INSTRUCTION SETS

LD [IX], rp |||||||||||||||||||| Load rp reg. into location [IX] ||||||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles ||| Function [IX] ← rp(L), [IX+1] ← rp(H) Mode Src: Register direct Stores the lower byte of the rp register (BA/ Dst: Register indirect HL/IX/IY) in the address of the data memory Example that has been specified by the content of the IX register and stores the upper byte in the Set Value Result SC following address. rp [IX] [IX+1] rp The content of the XP register becomes the NVCZ page address of the data memory (MODEL2/3). E964H 64H E9H E964H – – – –

Code MSB LSB 11001111CFH

110101 rp D4H–D7H✽

✽ rp Mnemonic Code BA 00 LD [IX], BA D4H HL 01 LD [IX], HL D5H IX 10 LD [IX], IX D6H IY 11 LD [IX], IY D7H

Flag I1 I0 U D N V C Z ––––––––

LD [IY], rp |||||||||||||||||||| Load rp reg. into location [IY] ||||||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles |||

Function [IY] ← rp(L), [IY+1] ← rp(H) Mode Src: Register direct Stores the lower byte of the rp register (BA/ Dst: Register indirect HL/IX/IY) in the address of the data memory Example that has been specified by the content of the IY register and stores the upper byte in the Set Value Result SC following address. rp [IY] [IY+1] rp The content of the YP register becomes the NVCZ page address of the data memory (MODEL2/3). E964H 64H E9H E964H – – – –

Code MSB LSB 11001111CFH

110111 rp DCH–DFH✽

✽ rp Mnemonic Code BA 00 LD [IY], BA DCH HL 01 LD [IY], HL DDH IX 10 LD [IY], IX DEH IY 11 LD [IY], IY DFH

Flag I1 I0 U D N V C Z ––––––––

142 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD [SP+dd], rp |||||||| Load rp reg. into location [SP + dd] ||||||||||||||||||||||||||||||||||||||||||| 6 cycles |||

Function [SP+dd] ← rp(L), [SP+dd+1] ← rp(H) Flag I1 I0 U D N V C Z Stores the lower byte of the rp register (BA/ –––––––– HL/IX/IY) in the address of the data memory that has been specified by the sum of the Mode Src: Register direct content of the SP and the displacement dd, Dst: Register indirect with displacement and stores the upper byte in the following address. Example The displacement dd is handled as signed Set Value Result SC data and the range is -128 to 127. rp [SP+dd] [SP+dd+1] rp NVCZ Code MSB LSB E964H 64H E9H E964H –––– 11001111CFH

011101 rp 74H–77H✽

dd dd

✽ rp Mnemonic Code BA 00 LD [SP], BA 74H HL 01 LD [SP], HL 75H IX 10 LD [SP], IX 76H IY 11 LD [SP], IY 77H

LD rp, #mmnn ||||||||| Load immediate data mmnn into rp reg. |||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function rp ← mmnn Mode Src: Immediate data Loads the 16-bit immediate data mmnn into Dst: Register direct the rp register (BA/HL/IX/IY). Example Set Value Result Code MSB LSB SC ✽ rp mmnn rp mmnn 110001 rp C4H–C7H NVCZ nn nn 3521H E964H E964H E964H ––––

mm mm

✽ rp Mnemonic Code BA 00 LD BA, #mmnn C4H HL 01 LD HL, #mmnn C5H IX 10 LD IX, #mmnn C6H IY 11 LD IY, #mmnn C7H

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 143 4 INSTRUCTION SETS

LD SP, #mmnn |||||||| Load immediate data mmnn into SP |||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function SP ← mmnn Mode Src: Immediate data Loads the 16-bit immediate data mmnn into Dst: Register direct the stack pointer (SP). Example Set Value Result Code MSB LSB SC SP mmnn S P mmnn 11001111CFH NVCZ 011011106EH 3521H E964H E964H E964H ––––

nn nn

mm mm

Flag I1 I0 U D N V C Z ––––––––

LD rp, [hhll] ||||||||||||||| Load location [hhll] into rp reg. |||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles ||| Function rp(L) ← [hhll], rp(H) ← [hhll+1] Mode Src: 16-bit absolute Loads the content of the data memory that Dst: Register direct has been address specified by the 16-bit immediate data hhll into the rp register (BA/ Example Set Value Result SC HL/IX/IY) as the lower byte and loads the rp [hhll] [hhll+1] rp content of the following address as the upper NVCZ byte. 3521H 64H E9H E964H –––– The content of the EP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 101110 rp B8H–BBH✽

ll ll

hh hh

✽ rp Mnemonic Code BA 00 LD BA, [hhll] B8H HL 01 LD HL, [hhll] B9H IX 10 LD IX, [hhll] BAH IY 11 LD IY, [hhll] BBH

Flag I1 I0 U D N V C Z ––––––––

144 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD SP, [hhll] |||||||||||||| Load location [hhll] into SP |||||||||||||||||||||||||||||||||||||||||||||||||||||||| 6 cycles |||

Function SP(L) ← [hhll], SP(H) ← [hhll+1] Mode Src: 16-bit absolute Loads the content of the data memory that Dst: Register direct has been address specified by the 16-bit Example Set Value Result immediate data hhll into the stack pointer SC (SP) as the lower byte and loads the content SP [hhll] [hhll+1] SP of the following address as the upper byte. NVCZ The content of the EP register becomes the 3521H 64H E9H E964H –––– page address of the data memory (MODEL2/3).

Code MSB LSB 11001111CFH

0111100078H

ll ll

hh hh

Flag I1 I0 U D N V C Z ––––––––

LD rp, [HL] |||||||||||||||||| Load location [HL] into rp reg. |||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles |||

Function rp(L) ← [HL], rp(H) ← [HL+1] Mode Src: Register indirect Loads the content of the data memory that Dst: Register direct has been address specified by the HL register Example Set Value Result into the rp register (BA/HL/IX/IY) as the SC lower byte and loads the content of the rp [HL] [HL+1] rp following address as the upper byte. NVCZ The content of the EP register becomes the 3521H 64H E9H E964H –––– page address of the data memory (MODEL2/3).

Code MSB LSB 11001111CFH

110000 rp C0H–C3H✽

✽ rp Mnemonic Code BA 00 LD BA, [HL] C0H HL 01 LD HL, [HL] C1H IX 10 LD IX, [HL] C2H IY 11 LD IY, [HL] C3H

Flag I1 I0 U D N V C Z ––––––––

E0C88 CORE CPU MANUAL EPSON 145 4 INSTRUCTION SETS

LD rp, [IX] |||||||||||||||||||| Load location [IX] into rp reg. |||||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles |||

Function rp(L) ← [IX], rp(H) ← [IX+1] Mode Src: Register indirect Loads the content of the data memory that Dst: Register direct has been address specified by the IX register Example Set Value Result into the rp register (BA/HL/IX/IY) as the SC lower byte and loads the content of the rp [IX] [IX+1] rp following address as the upper byte. NVCZ The content of the XP register becomes the 3521H 64H E9H E964H –––– page address of the data memory (MODEL2/3).

Code MSB LSB 11001111CFH

110100 rp D0H–D3H✽

✽ rp Mnemonic Code BA 00 LD BA, [IX] D0H HL 01 LD HL, [IX] D1H IX 10 LD IX, [IX] D2H IY 11 LD IY, [IX] D3H

Flag I1 I0 U D N V C Z ––––––––

LD rp, [IY] |||||||||||||||||||| Load location [IY] into rp reg. |||||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles |||

Function rp(L) ← [IY], rp(H) ← [IY+1] Mode Src: Register indirect Loads the content of the data memory that Dst: Register direct has been address specified by the IY register Example Set Value Result into the rp register (BA/HL/IX/IY) as the SC lower byte and loads the content of the rp [IY] [IY+1] rp following address as the upper byte. NVCZ The content of the YP register becomes the 3521H 64H E9H E964H –––– page address of the data memory (MODEL2/3).

Code MSB LSB 11001111CFH

110110 rp D8H–DBH✽

✽ rp Mnemonic Code BA 00 LD BA, [IY] D8H HL 01 LD HL, [IY] D9H IX 10 LD IX, [IY] DAH IY 11 LD IY, [IY] DBH

Flag I1 I0 U D N V C Z ––––––––

146 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

LD rp, [SP+dd] |||||||| Load location [SP + dd] into rp reg. |||||||||||||||||||||||||||||||||||||||||| 6 cycles |||

Function rp(L) ← [SP+dd], rp(H) ← [SP+dd+1] Flag I1 I0 U D N V C Z Loads the content of the data memory that –––––––– has been address specified by the sum of the content of the SP and the displacement dd Mode Src: Register indirect with displacement into the rp register (BA/HL/IX/IY) as the Dst: Register direct lower byte and loads the content of the following address as the upper byte. Example The displacement dd is handled as signed Set Value Result data and the range is -128 to 127. SC rp [SP+dd] [SP+dd+1] rp NVCZ Code MSB LSB 3521H 64H E9H E964H –––– 11001111CFH

011100 rp 70H–73H✽

dd dd

✽ rp Mnemonic Code BA 0 0 LD BA, [SP+dd] 70H HL 0 1 LD HL, [SP+dd] 71H IX 1 0 LD IX, [SP+dd] 72H IY 1 1 LD IY, [SP+dd] 73H

MLT |||||||||||||||||||||||||||||||||||||| Multiply ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 12 cycles ||| Function HL ← L * A Mode Implide (Register direct) Multiplies the content of the L register by the content of the A register and stores the result Example Set Value Result SC in the HL register. LAHL NVCZ Code MSB LSB 00H 64H 0000H 0001 11001110CEH 64H 58H 2260H 0000 11011000D8H A5H 93H 5EBFH 0000 C8H A5H 80E8H 1000 Flag I1 I0 U D N V C Z ↕ ↕ –––– 00 Note This instruction cannot be used in the MODEL0/2.

E0C88 CORE CPU MANUAL EPSON 147 4 INSTRUCTION SETS

NEG r |||||||||||||||||||||||||||||||| Negate r reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function r ← 0 - r Flag I1 I0 U D N V C Z Subtracts the content of the r register (A/B) ––★★↕↕↕↕ from 0 (creates two compliment) and stores the result in the r register. Mode Register direct

Code MSB LSB Example Set Value Result 11001110CEH SC rr NVCZ 1010010rA4H/A5H✽ • D=0, U=0 57H A9H1010 ✽ r Mnemonic Code 00H 00H0001 A 0 NEG A A4H 2BH D5H1010 B 1 NEG B A5H 80H 80H1110 • D=1, U=0 57 43 0010 • D=1, U=1 57 03 0010

NEG [BR:ll] ||||||||||||||||| Negate location [BR:ll] |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles ||| Function [BR:ll] ← 0 - [BR:ll] Flag I1 I0 U D N V C Z Subtracts the content of the data memory ––★★↕↕↕↕ from 0 (creates two compliment) and stores the result in the same address. The data Mode 8-bit absolute memory address has been specified by the Example Set Value Result content of the BR register (upper byte SC specification) and the 8-bit absolute address ll [BR:ll] [BR:ll] (lower byte specification). NVCZ The content of the EP register becomes the • D=0, U=0 57H A9H1010 page address of the data memory (MODEL2/3). 00H 00H0001 2BH D5H1010 Code MSB LSB 80H 80H1110 11001110CEH • D=1, U=0 57 43 0010 10100110A6H • D=1, U=1 57 03 0010 ll ll

NEG [HL] ||||||||||||||||||||||| Negate location [HL] ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [HL] ← 0 - [HL] Mode Register indirect Subtracts the content of the data memory that has been address specified by the HL register Example Set Value Result SC from 0 (creates two compliment) and stores [HL] [HL] the result in that address. NVCZ The content of the EP register becomes the • D=0, U=0 57H A9H1010 page address of the data memory (MODEL2/3). 00H 00H0001

Code MSB LSB 2BH D5H1010 11001110CEH 80H 80H1110 • D=1, U=0 57 43 0010 10100111A7H • D=1, U=1 57 03 0010 Flag I1 I0 U D N V C Z ––★★↕↕↕↕

148 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

NOP ||||||||||||||||||||||||||||||||||||| No Operation |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function No Operation Code MSB LSB Expends 2 cycles without doing an operation 11111111FFH that otherwise exerts an affect. The program counter (PC) is incremented (+1). Flag I1 I0 U D N V C Z ––––––––

OR A, r |||||||||||||||||||||||||||| Logical OR of r reg. and A reg. |||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A ∨ r Mode Src: Register direct Takes a logical sum of the content of the r Dst: Register direct register (A/B) and the content of the A Example Set Value Result register and stores the result in the A register. SC ABA Code MSB LSB NVCZ 0010100r28H/29H✽ 32H6CH7EH0––0 ✽ r Mnemonic Code 86H41HC7H1––0 A 0 OR A, A 28H B 1 OR A, B 29H

Flag I1 I0 U D N V C Z ––––↕ ––↕

OR A, #nn |||||||||||||||||||| Logical OR of immediate data nn and A reg. |||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A ∨ nn Mode Src: Immediate data Takes a logical sum of the 8-bit immediate Dst: Register direct data nn and the content of the A register and Example Set Value Result stores the result in the A register. SC AnnA Code MSB LSB NVCZ 001010102AH 32H6CH7EH0––0 nn nn 86H41HC7H1––0

Flag I1 I0 U D N V C Z ––––↕ ––↕

E0C88 CORE CPU MANUAL EPSON 149 4 INSTRUCTION SETS

OR A, [BR:ll] ||||||||||||| Logical OR of location [BR:ll] and A reg. |||||||||||||||||||||||||||||||||| 3 cycles ||| Function A ← A ∨ [BR:ll] Flag I1 I0 U D N V C Z Takes a logical sum of the content of the data ––––↕ ––↕ memory and the content of the A register and stores the result in the A register. The data Mode Src: 8-bit absolute memory address has been specified by the Dst: Register direct content of the BR register (upper byte specification) and the 8-bit absolute address ll Example Set Value Result (lower byte specification). SC A [BR:ll]A The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 32H6CH7EH0––0

Code MSB LSB 86H41HC7H1––0 001011002CH

ll ll

OR A, [hhll] |||||||||||||||| Logical OR of location [hhll] and A reg. ||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function A ← A ∨ [hhll] Flag I1 I0 U D N V C Z Takes a logical sum of the content of the data ––––↕ ––↕ memory that has been address specified by the 16-bit absolute address hhll and the Mode Src: 16-bit absolute content of the A register and stores the result Dst: Register direct in the A register. Example Set Value Result The content of the EP register becomes the SC page address of the data memory (MODEL2/3). A [hhll]A NVCZ Code MSB LSB 32H6CH7EH0––0 001011012DH 86H41HC7H1––0 ll ll

hh hh

OR A, [HL] ||||||||||||||||||| Logical OR of location [HL] and A reg. ||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A ∨ [HL] Mode Src: Register indirect Takes a logical sum of the content of the data Dst: Register direct memory that has been address specified by the HL register and the content of the A Example Set Value Result SC register and stores the result in the A register. A [HL] A The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 32H6CH7EH0––0 86H41HC7H1––0 Code MSB LSB 001010112BH

Flag I1 I0 U D N V C Z ––––↕ ––↕

150 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

OR A, [ir] |||||||||||||||||||||| Logical OR of location [ir reg.] and A reg. ||||||||||||||||||||||||||||||||| 2 cycles |||

Function A ← A ∨ [ir] Flag I1 I0 U D N V C Z Takes a logical sum of the content of the data ––––↕ ––↕ memory that has been address specified by the ir register (IX/IY) and the content of the Mode Src: Register indirect A register and stores the result in the A Dst: Register direct register. The content of the XP register (at time of IX Example Set Value Result SC specification) or the YP register (at time of A [Ir] A IY specification) becomes the page address NVCZ of the data memory (MODEL2/3). 32H6CH7EH0––0 86H41HC7H1––0 Code MSB LSB 0010111ir2EH/2FH✽

✽ ir Mnemonic Code IX 0 OR A, [IX] 2EH IY 1 OR A, [IY] 2FH

OR A, [ir+dd] |||||||||||| Logical OR of location [ir reg. + dd] and A reg. |||||||||||||||||||||||| 4 cycles |||

Function A ← A ∨ [ir+dd] Flag I1 I0 U D N V C Z Takes a logical sum of the content of the data ––––↕ ––↕ memory and the content of the A register and stores the result in the A register. The data Mode Src: Register indirect with displacement memory address has been specified by the Dst: Register direct sum of the content of the ir register (IX/IY) and the displacement dd. Example Set Value Result The displacement dd is handled as signed SC A [Ir+dd] A data and the range is -128 to 127. NVCZ The content of the XP register (at time of IX 32H6CH7EH0––0 specification) or the YP register (at time of 86H41HC7H1––0 IY specification) becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 11001110CEH

0010100ir28H/29H✽

dd dd

✽ ir Mnemonic Code IX 0 OR A, [IX+dd] 28H IY 1 OR A, [IY+dd] 29H

E0C88 CORE CPU MANUAL EPSON 151 4 INSTRUCTION SETS

OR A, [ir+L] |||||||||||||||| Logical OR location [ir reg. + L] and A reg. ||||||||||||||||||||||||||||| 4 cycles ||| Function A ← A ∨ [ir+L] Code MSB LSB Takes a logical sum of the content of the data 11001110CEH memory and the content of the A register and ✽ stores the result in the A register. The data 0010101ir2AH/2BH memory address has been specified by the ✽ ir Mnemonic Code sum of the content of the ir register (IX/IY) IX 0 OR A, [IX+L] 2AH and the content of the L register. IY 1 OR A, [IY+L] 2BH The content of the L register is handled as signed data and the range is -128 to 127. Flag I1 I0 U D N V C Z The content of the XP register (at time of IX ––––↕ ––↕ specification) or the YP register (at time of IY specification) becomes the page address Mode Src: Register indirect with index register of the data memory (MODEL2/3). Dst: Register direct

Example Set Value Result SC A [Ir+L] A NVCZ 32H6CH7EH0––0 86H41HC7H1––0

OR B, #nn |||||||||||||||||||| Logical OR of immediate data nn and B reg. |||||||||||||||||||||||||||||| 3 cycles |||

Function B ← B ∨ nn Flag I1 I0 U D N V C Z Takes a logical sum of the 8-bit immediate ––––↕ ––↕ data nn and the content of the B register and stores the result in the B register. Mode Src: Immediate data Dst: Register direct Code MSB LSB 11001110CEH Example Set Value Result SC 10110100B4H BnnB NVCZ nn nn 32H6CH7EH0––0 86H41HC7H1––0

OR L, #nn |||||||||||||||||||| Logical OR of immediate data nn and L reg. ||||||||||||||||||||||||||||||| 3 cycles |||

Function L ← L ∨ nn Flag I1 I0 U D N V C Z Takes a logical sum of the 8-bit immediate ––––↕ ––↕ data nn and the content of the L register and stores the result in the L register. Mode Src: Immediate data Dst: Register direct Code MSB LSB 11001110CEH Example Set Value Result SC 10110101B5H LnnL NVCZ nn nn 32H6CH7EH0––0 86H41HC7H1––0

152 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

OR H, #nn |||||||||||||||||||| Logical OR of immediate data nn and H reg. ||||||||||||||||||||||||||||| 3 cycles |||

Function H ← H ∨ nn Flag I1 I0 U D N V C Z Takes a logical sum of the 8-bit immediate ––––↕ ––↕ data nn and the content of the H register and stores the result in the H register. Mode Src: Immediate data Dst: Register direct Code MSB LSB 11001110CEH Example Set Value Result SC 10110110B6H HnnH NVCZ nn nn 32H6CH7EH0––0 86H41HC7H1––0

OR SC, #nn |||||||||||||||| Logical OR of immediate data nn and SC ||||||||||||||||||||||||||||||||||| 3 cycles ||| Function SC ← SC ∨ nn Mode Src: Immediate data Takes a logical sum of the 8-bit immediate Dst: Register direct data nn and the content of the system Example Set Value Result condition flag (SC) and sets the result in the SC system condition flag (SC). SC nn I1 I0 U D N V C Z Code MSB LSB 32H6CH01111110 100111019DH 86H41H11000111 nn nn

Flag I1 I0 U D N V C Z ↑↑↑↑↑↑↑↑

OR [BR:ll], #nn ||||||| Logical OR of immediate data nn and location [BR:ll] |||||||||||||| 5 cycles |||

Function [BR:ll] ← [BR:ll] ∨ nn Flag I1 I0 U D N V C Z Takes a logical sum of the 8-bit immediate ––––↕ ––↕ data and the content of the data memory and stores the result in that address. The data Mode Src: Immediate data memory address has been specified by the Dst: 8-bit absolute content of the BR register (upper byte Example Set Value Result specification) and the 8-bit absolute address ll SC (lower byte specification). [BR:ll] nn [BR:ll] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 32H6CH7EH0––0 86H41HC7H1––0 Code MSB LSB 11011001D9H

ll ll

nn nn

E0C88 CORE CPU MANUAL EPSON 153 4 INSTRUCTION SETS

OR [HL], A ||||||||||||||||||| Logical OR of A reg. and location [HL] ||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function [HL] ← [HL] ∨ A Flag I1 I0 U D N V C Z Takes a logical sum of the content of the A ––––↕ ––↕ register and the data memory that has been address specified by the HL register and Mode Src: Register direct stores the result in that address. Dst: Register indirect The content of the EP register becomes the page address of the data memory (MODEL2/3). Example Set Value Result SC Code MSB LSB [HL] A [HL] NVCZ 11001110CEH 32H6CH7EH0––0 001011002CH 86H41HC7H1––0

OR [HL], #nn ||||||||||||| Logical OR of immediate data nn and location [HL] ||||||||||||||||| 5 cycles |||

Function [HL] ← [HL] ∨ nn Flag I1 I0 U D N V C Z Takes a logical sum of the 8-bit immediate ––––↕ ––↕ data nn and the data memory that has been address specified by the HL register and Mode Src: Immediate data stores the result in that address. Dst: Register indirect The content of the EP register becomes the page address of the data memory (MODEL2/3). Example Set Value Result SC [HL] n n [HL] Code MSB LSB NVCZ 11001110CEH 32H6CH7EH0––0 001011012DH 86H41HC7H1––0

nn nn

OR [HL], [ir] |||||||||||||||| Logical OR of location [ir reg.] to location [HL] |||||||||||||||||||||| 5 cycles |||

Function [HL] ← [HL] ∨ [ir] Code MSB LSB Takes a logical sum of the content of the data 11001110CEH memory that has been address specified by ✽ the ir register (IX/IY) and the data memory 0010111ir2EH/2FH that has been address specified by the HL ✽ ir Mnemonic Code register and stores the result in data memory IX 0 OR [HL], [IX] 2EH [HL]. IY 1 OR [HL], [IY] 2FH The content of the EP register becomes the page address of the data memory [HL] and Flag I1 I0 U D N V C Z the content of the XP register (at time of IX ––––↕ ––↕ specification) or the YP register (at time of IY specification) becomes the page address Mode Src: Register indirect of the data memory [ir] (MODEL2/3). Dst: Register indirect

Example Set Value Result SC [HL] [ir] [HL] NVCZ 32H6CH7EH0––0 86H41HC7H1––0

154 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

PACK ||||||||||||||||||||||||||||||||| Pack BA reg. to A reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function BA A Mode Implide (Register direct ) * m * nmn Example Set Value Result Packs the content of the BA register and SC stores it in the A register. The upper 4 bits of BA A B the A register are substituted for the content NVCZ of the lower 4 bits of the B register. 38C4H 84H 38H – – – –

Code MSB LSB 11011110DEH

Flag I1 I0 U D N V C Z ––––––––

POP r ||||||||||||||||||||||||||||||| Pop top of stack into r reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function r ← [SP], SP ← SP + 1 Flag I1 I0 U D N V C Z Loads the content of the address indicated by –––––––– the stack pointer (SP) into the r register (A/B/ L/H) and increments (+1) the SP. Mode Register direct Code MSB LSB Example Executes "POP A" 11001111CFH A SP 101101 r B4H–B7H✽ Stack Before execution 82H FFFFH 5AH 00FFFFH ✽ r Mnemonic Code A 00 POP A B4H After execution 5AH 0000H B 01 POP B B5H L 10 POP L B6H H 11 POP H B7H

POP rp |||||||||||||||||||||||||||| Pop top of stack into rp reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function rp(L) ← [SP], rp(H) ← [SP+1], Flag I1 I0 U D N V C Z SP ← SP + 2 –––––––– Loads the content of the 2 bytes from the address indicated by the stack pointer (SP) in Mode Register direct the sequence of the lower byte, then the upper Example Executes "POP BA" byte of the rp register (BA/HL/IX/IY) and adds 2 to the SP. B A SP Stack Code MSB LSB Before execution 67H 05H FFFEH 5AH 00FFFEH 101010 rp A8H–ABH✽ 23H 00FFFFH ✽ rp Mnemonic Code After execution 23H 5AH 0000H BA 00 POP BA A8H HL 01 POP HL A9H IX 10 POP IX AAH IY 11 POP IY ABH

E0C88 CORE CPU MANUAL EPSON 155 4 INSTRUCTION SETS

POP BR |||||||||||||||||||||||||| Pop top of stack into BR reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function BR ← [SP], SP ← SP + 1 Mode Register direct Loads the content of the address indicated by Example the stack pointer (SP) into the BR register and increments (+1) the SP. BR SP Stack Code MSB LSB Before execution 82H FFFFH 5AH 00FFFFH 10101100ACH After execution 5AH 0000H Flag I1 I0 U D N V C Z ––––––––

POP EP |||||||||||||||||||||||||| Pop top of stack into EP reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function EP ← [SP], SP ← SP + 1 Mode Register direct Loads the content of the address indicated by Example the stack pointer (SP) into the EP register and increments (+1) the SP. EP SP Stack Code MSB LSB Before execution 82H FFFFH 5AH 00FFFFH 10101101ADH After execution 5AH 0000H Flag I1 I0 U D N V C Z –––––––– Note This instruction cannot be used in the MODEL0/1.

POP IP |||||||||||||||||||||||||||| Pop top of stack into IP reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function YP ← [SP], XP ← [SP+1], SP ← SP + 2 Mode Register direct Loads the content of the 2 bytes from the Example Executes "POP IP" address indicated by the stack pointer (SP) sequentially into the YP register and XP XP YP SP register and adds 2 to the SP. Stack Before execution 67H 05H FFFEH 5AH 00FFFEH Code MSB LSB 23H 00FFFFH 10101110AEH After execution 23H 5AH 0000H Flag I1 I0 U D N V C Z –––––––– Note This instruction cannot be used in the MODEL0/1.

POP SC |||||||||||||||||||||||||| Pop top of stack into SC ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function SC ← [SP], SP ← SP + 1 Mode Register direct Sets the content of the address indicated by Example the stack pointer (SP) to the system condition flag (SC) and increments (+1) the SP. SC SP Stack Code MSB LSB Before execution 82H FFFFH 5AH 00FFFFH 10101111AFH

Flag I1 I0 U D N V C Z After execution 5AH 0000H ↕↕↕↕↕↕↕↕

156 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

POP ALE ||||||||||||||||||||||| Pop all registers including expand registers ||||||||||||||||||||||||||||| 14 cycles ||| Function POP IP, EP, BR, IY, IX, HL, BA Mode Implide (Register direct) Pops the content of the address indicated by Example In case of SP = FFF4H, when "POP ALE" is the stack pointer (SP) in the sequence of IP executed, the content of the stack as shown in (XP/YP), EP, BR, IY, IX, HL and BA the below figure returns to the respective register. It can once return the content of the register and becomes SP = 0000H. register that has been batch evacuated by the

"PUSH ALE" instruction. 12, which 00FFFAH IX (L) 00FFF4H YP corresponds to the number of bytes that have 00FFFBH IX (H) 00FFF5H XP been popped, is added to the SP. 00FFFCH L 00FFF6H EP Code MSB LSB 00FFFDH H 00FFF7H BR 11001111CFH 00FFFEH A 00FFF8H IY (L)

10111101BDH 00FFFFH B 00FFF9H IY (H)

Flag I1 I0 U D N V C Z ↕↕↕↕↕↕↕↕ Note This instruction cannot be used in the MODEL0/1.

POP ALL ||||||||||||||||||||||| Pop all registers ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 11 cycles ||| Function POP BR, IY, IX, HL, BA Mode Implide (Register direct) Pops the content of the address indicated by Example In case of SP = FFF7H, when "POP ALL" is the stack pointer (SP) in the sequence of BR, executed, the content of the stack as shown in IY, IX, HL and BA register. It can once the below figure returns to the respective return the content of the register that has been register and becomes SP = 0000H. batch evacuated by the "PUSH ALL" instruction. 9, which corresponds to the 00FFFCH L 00FFF7H BR number of bytes that have been popped, is 00FFFDH 00FFF8H (L) added to the SP. H IY 00FFFEH A 00FFF9H IY (H) Code MSB LSB 00FFFFH B 00FFFAH IX (L) 11001111CFH 00FFFBH IX (H) 10111100BCH

Flag I1 I0 U D N V C Z ↕↕↕↕↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 157 4 INSTRUCTION SETS

PUSH r |||||||||||||||||||||||||||| Push r reg. onto stack |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function [SP-1] ← r, SP ← SP - 1 Mode Register direct Stores the content of the r register (A/B/L/H) Example Executes "PUSH A" in the address indicated by the content resulting from the subtraction of 1 from the A SP stack pointer (SP). Before execution 5AH 0000H The SP is decremented (-1). Stack Code MSB LSB After execution 5AH FFFFH 5AH (A) 00FFFFH 11001111CFH

101100 r B0H–B3H✽

✽ r Mnemonic Code A 00 PUSH A B0H B 01 PUSH B B1H L 10 PUSH L B2H H 11 PUSH H B3H

Flag I1 I0 U D N V C Z ––––––––

PUSH rp |||||||||||||||||||||||| Push rp reg. onto stack ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function [SP-1] ← rp(L), [SP-2] ← rp(H), Mode Register direct SP ← SP - 2 Example Executes "PUSH BA" Stores the content of the rp register (BA/HL/ IX/IY) in the address indicated by the content BA SP resulting from the subtraction of 1 from the Before execution 235AH 0000H Stack stack pointer (SP) and in the one preceding 00FFFEH address in the sequence of the upper byte, 5AH (A) then the lower byte. After execution 235AH FFFEH 23H (B) 00FFFFH 2 is subtracted from the SP.

Code MSB LSB 101000 rp A0H–A3H✽

✽ rp Mnemonic Code BA 00 PUSH BA A0H HL 01 PUSH HL A1H IX 10 PUSH IX A2H IY 11 PUSH IY A3H

Flag I1 I0 U D N V C Z ––––––––

158 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

PUSH BR |||||||||||||||||||||| Push BR reg. onto stack ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function [SP-1] ← BR, SP ← SP - 1 Mode Register direct Stores the content of the BR register in the Example address indicated by the content resulting from the subtraction of 1 from the stack BR SP pointer (SP). Before execution 5AH 0000H The SP is decremented (-1). Stack Code MSB LSB After execution 5AH FFFFH 5AH (BR) 00FFFFH 10100100A4H

Flag I1 I0 U D N V C Z ––––––––

PUSH EP |||||||||||||||||||||| Push EP reg. onto stack |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function [SP-1] ← EP, SP ← SP - 1 Mode Register direct Stores the content of the EP register in the Example address indicated by the content resulting from the subtraction of 1 from the stack EP SP pointer (SP). Before execution 5AH 0000H The SP is decremented (-1). Stack Code MSB LSB After execution 5AH FFFFH 5AH (EP) 00FFFFH 10100101A5H

Flag I1 I0 U D N V C Z –––––––– Note This instruction cannot be used in the MODEL0/1.

PUSH IP ||||||||||||||||||||||||| Push IP reg. onto stack |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [SP-1] ← XP, [SP-2] ← YP, SP ← SP - 2 Mode Register direct Stores the content of the XP register and the Example Executes "PUSH IP" YP register in the address indicated by the content resulting from the subtraction of 1 XP YP SP from the stack pointer (SP), and the one Before execution 23H 5AH 0000H Stack preceding address. 00FFFEH 2 is subtracted from the SP. 5AH (YP) After execution 23H 5AH FFFEH 23H (XP) 00FFFFH Code MSB LSB 10100110A6H

Flag I1 I0 U D N V C Z –––––––– Note This instruction cannot be used in the MODEL0/1.

E0C88 CORE CPU MANUAL EPSON 159 4 INSTRUCTION SETS

PUSH SC |||||||||||||||||||||| Push SC onto stack ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function [SP-1] ← SC, SP ← SP - 1 Mode Register direct Stores the content of the system condition Example flag (SC) in the address indicated by the content resulting from the subtraction of 1 SC SP from the stack pointer (SP). Before execution 5AH 0000H The SP is decremented (-1). Stack Code MSB LSB After execution 5AH FFFFH 5AH (SC) 00FFFFH 10100111A7H

Flag I1 I0 U D N V C Z ––––––––

PUSH ALE ||||||||||||||||||| Push all registers including expand registers ||||||||||||||||||||||||||| 15 cycles ||| Function PUSH BA, HL, IX, IY, BR, EP, IP Mode Implide (Register direct) Pushes the content of the registers in the Example In case of SP = 0000H, when "PUSH ALE" sequence of BA, HL, IX, IY, BR, EP and IP is executed, the registers are stacked as (XP/YP) from the address indicated by the shown in the below figure and becomes SP = stack pointer (SP) toward the lower address. FFF4H. 12, which corresponds to the number of bytes pushed, is subtracted from the SP. 00FFFAH IX (L) 00FFF4H YP Evacuates the registers for MODEL2/3 use. 00FFFBH IX (H) 00FFF5H XP

Code MSB LSB 00FFFCH L 00FFF6H EP 11001111CFH 00FFFDH H 00FFF7H BR 00FFFEH A 00FFF8H IY (L) 10111001B9H 00FFFFH B 00FFF9H IY (H) Flag I1 I0 U D N V C Z –––––––– Note This instruction cannot be used in the MODEL0/1.

PUSH ALL ||||||||||||||||||| Push all registers ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 12 cycles ||| Function PUSH BA, HL, IX, IY, BR Mode Implide (Register direct) Pushes the content of the registers in the Example In case of SP = 0000H, when "PUSH ALL" sequence of BA, HL, IX, IY and BR from the is executed, the registers are stacked as address indicated by the stack pointer (SP) shown in the below figure and becomes SP = toward the lower address. 9, which corre- FFF7H. sponds to the number of bytes pushed, is subtracted from the SP. 00FFFCH L 00FFF7H BR

Evacuates the registers for MODEL0/1 use. 00FFFDH H 00FFF8H IY (L)

00FFFEH A 00FFF9H IY (H) Code MSB LSB 00FFFFH B 00FFFAH IX (L) 11001111CFH 00FFFBH IX (H) 10111000B8H

Flag I1 I0 U D N V C Z ––––––––

160 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

RET |||||||||||||||||||||||||||||||||||||| Return from subroutine |||||||||||||||||||||||||||||||||||||||||||| 3(MIN)/4(MAX) cycles ||| Function Code MSB LSB PC(L)←[SP], PC(H)←[SP+1], SP←SP+2 11111000F8H

Flag I1 I0 U D N V C Z ← ← PC(L) [SP], PC(H) [SP+1], –––––––– CB←[SP+2], NB←CB, SP←SP+3 Loads the 2 bytes from the address indicated Example In the maximum mode of the MODEL2/3, it by the stack pointer (SP) in the sequence of executes the "RET" instruction in the the lower byte then the upper byte of the physical address 013100H. program counter (PC), then returns from the NB CB PC(logical addr.) SP Stack subroutine. Before execution 02H 02H B100H FFFDH In the maximum mode of the MODEL2/3 it 03H(PC (L) ) 00FFFDH 90H(PC (H) ) 00FFFEH loads the following 1 byte into the CB as the After execution 01H 01H 9003H 0000H bank address and returns it to the originally 01H(CB) 00FFFFH called bank. It simultaneously also resets that In the above example it returns to the bank address to NB. physical address 009003H. The returned number of bytes (minimum Since CB is not stacked in the minimum mode: 2 bytes, maximum mode: 3 bytes) are mode of the MODEL2/3, CB and NB are not added to the SP. changed. There are no NB and CB in the MODEL0/1. Note Use the following "RETE" instruction to return from an exception processing routine.

RETE |||||||||||||||||||||||||||||||||| Return from exception processing routine ||||||||||||||| 4(MIN)/5(MAX) cycles ||| Function Code MSB LSB SC←[SP], PC(L)←[SP+1], 11111001F9H PC(H)←[SP+2], SP←SP+3 Flag I1 I0 U D N V C Z –––––––– SC←[SP], PC(L)←[SP+1], PC(H)←[SP+2], CB←[SP+3], NB←CB, Example In the maximum mode of the MODEL2/3, it SP←SP+4 executes the "RETE" instruction in the Loads the 3 bytes from the address indicated physical address 013100H. by the stack pointer (SP) in the sequence of PC (logical NB CB SP SC the system condition flag (SC) then the lower addr.) Stack 54H(SC) 00FFFCH byte and the upper byte of the program Before execution 02H 02H B100H FFFCH 91H counter (PC), then returns from the subrou- 03H(PC (L) ) 00FFFDH tine. 90H(PC (H) ) 00FFFEH After execution In the maximum mode of the MODEL2/3 it 01H 01H 9003H 0000H 54H 01H(CB) 00FFFFH loads the following 1 byte into the CB as the In the above example it returns to the bank address and returns it to the originally physical address 009003H. called bank. It simultaneously also resets that Since CB is not stacked in the minimum bank address to NB. mode of the MODEL2/3, CB and NB are not The returned number of bytes (minimum changed. mode: 3 bytes, maximum mode: 4 bytes) are There are no NB and CB in the MODEL0/1. added to the SP.

E0C88 CORE CPU MANUAL EPSON 161 4 INSTRUCTION SETS

RETS |||||||||||||||||||||||||||||||||| Return from subroutine then skip 2 bytes |||||||||||||||| 5(MIN)/6(MAX) cycles ||| Function Example In the maximum mode of the MODEL2/3, it PC(L)←[SP], PC(H)←[SP+1], SP←SP+2, executes the "RETS" instruction in the PC←PC+2 physical address 013100H. NB CB PC(logical addr.) SP Stack PC(L)←[SP], PC(H)←[SP+1], Before execution 02H 02H B100H FFFDH 03H(PC (L) ) 00FFFDH CB←[SP+2], NB←CB, SP←SP+3, +2 ← 90H(PC (H) ) 00FFFEH PC PC+2 After execution 01H 01H 9005H 0000H 01H(CB) 00FFFFH Skips the 2-byte instruction of the returned In the above example it returns to the address, following execution of the "RET" physical address 009005H. instruction. Since CB is not stacked in the minimum Code MSB LSB mode of the MODEL2/3, CB and NB are not 11111010FAH changed. There are no NB and CB in the MODEL0/1. Flag I1 I0 U D N V C Z ––––––––

RL r |||||||||||||||||||||||||||||||||||| Rotate left r reg. with carry ||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function C 76543210 r Mode Register direct Rotates the content of the r register (A/B) the Example Set Value Result equivalent of 1 bit to the left, including the SC rCr carry (C). The content of the carry (C) moves NVCZ to bit 0 of the register and bit 7 of the register 83H0 06H0–10 moves to the carry (C). 4CH0 98H1–00 Code MSB LSB A2H1 45H0–10 11001110CEH

1001000r90H/91H✽

✽ r Mnemonic Code A 0 RL A 90H B 1 RL B 91H

Flag I1 I0 U D N V C Z ––––↕ – ↕↕

162 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

RL [BR:ll] ||||||||||||||||||||| Rotate left location [BR:ll] with carry ||||||||||||||||||||||||||||||||||||||||| 5 cycles |||

Function C 76543210 [BR:ll] Code MSB LSB Rotates the content of the data memory the 11001110CEH equivalent of 1 bit to the left, including the 1001001092H carry (C). The data memory address has been specified by the content of the BR register ll ll (upper byte specification) and the 8-bit Flag I1 I0 U D N V C Z absolute address ll (lower byte specification). ↕ ↕↕ The content of the carry (C) moves to bit 0 of –––– – the data and bit 7 of the data moves to the Mode 8-bit absolute carry (C). The content of the EP register becomes the Example Set Value Result page address of the data memory (MODEL2/3). SC [BR:ll] C [BR:ll] NVCZ 83H0 06H0–10 4CH0 98H1–00 A2H1 45H0–10

RL [HL] ||||||||||||||||||||||||||| Rotate left location [HL] with carry |||||||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function C 76543210 [HL] Flag I1 I0 U D N V C Z Rotates the content of the data memory that ––––↕ – ↕↕ has been address specified by the HL register Mode Register indirect the equivalent of 1 bit to the left, including the carry (C). The content of the carry (C) Example Set Value Result moves to bit 0 of the data and bit 7 of the data SC [HL] C [HL] moves to the carry (C). NVCZ The content of the EP register becomes the 83H0 06H0–10 page address of the data memory (MODEL2/3). 4CH0 98H1–00 Code MSB LSB A2H1 45H0–10 11001110CEH

1001001193H

RLC r |||||||||||||||||||||||||||||||| Rotate left r reg. circular ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function C 76543210 r Flag I1 I0 U D N V C Z Rotates the content of the r register (A/B) the ––––↕ – ↕↕ equivalent of 1 bit to the left. Bit 7 of the Mode Register direct register moves to bit 0 and carry (C). Example Set Value Result Code MSB LSB SC 11001110CEH rCr NVCZ 1001010r94H/95H✽ E3H0 C7H1–10 ✽ r Mnemonic Code 3BH1 76H0–00 A 0 RLC A 94H B 1 RLC B 95H

E0C88 CORE CPU MANUAL EPSON 163 4 INSTRUCTION SETS

RLC [BR:ll] ||||||||||||||||| Rotate left location [BR:ll] circular |||||||||||||||||||||||||||||||||||||||||||| 5 cycles |||

Function C 76543210 [BR:ll] Code MSB LSB Rotates the content of the data memory the 11001110CEH equivalent of 1 bit to the left. The data 1001011096H memory address has been specified by the content of the BR register (upper byte ll ll specification) and the 8-bit absolute address ll Flag I1 I0 U D N V C Z (lower byte specification). ↕ ↕↕ Bit 7 of the data moves to bit 0 and carry (C). –––– – The content of the EP register becomes the Mode 8-bit absolute page address of the data memory (MODEL2/3). Example Set Value Result SC [BR:ll] C [BR:ll] NVCZ E3H0 C7H1–10 3BH1 76H0–00

RLC [HL] ||||||||||||||||||||||| Rotate left location [HL] circular ||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function C 76543210 [HL] Flag I1 I0 U D N V C Z Rotates the content of the data memory that ––––↕ – ↕↕ has been address specified by the HL register Mode Register indirect the equivalent of 1 bit to the left. Bit 7 of the data moves to bit 0 and carry (C). Example Set Value Result The content of the EP register becomes the SC [HL] C [HL] page address of the data memory (MODEL2/3). NVCZ Code MSB LSB E3H0 C7H1–10 11001110CEH 3BH1 76H0–00

1001011197H

RR r |||||||||||||||||||||||||||||||||||| Rotate right r reg. with carry |||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function 76543210 C r Flag I1 I0 U D N V C Z Rotates the content of the r register (A/B) the ––––↕ – ↕↕ equivalent of 1 bit to the right, including the Mode Register direct carry (C). The content of the carry (C) moves to bit 7 of the register and bit 0 of the register Example Set Value Result moves to the carry (C). SC rCr NVCZ Code MSB LSB 11001110CEH 7EH0 3FH0–00 51H0 28H0–10 ✽ 1001100r98H/99H D4H1 EAH1–00 ✽ r Mnemonic Code A 0 RR A 98H B 1 RR B 99H

164 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

RR [BR:ll] ||||||||||||||||||||| Rotate right location [BR:ll] with carry ||||||||||||||||||||||||||||||||||||| 5 cycles |||

Function 76543210 C [BR:ll] Code MSB LSB Rotates the content of the data memory the 11001110CEH equivalent of 1 bit to the right, including the 100110109AH carry (C). The data memory address has been specified by the content of the BR register ll ll (upper byte specification) and the 8-bit Flag I1 I0 U D N V C Z absolute address ll (lower byte specification). ↕ ↕↕ The content of the carry (C) moves to bit 7 of –––– – the data and bit 0 of the data moves to the Mode 8-bit absolute carry (C). The content of the EP register becomes the Example Set Value Result page address of the data memory (MODEL2/3). SC [BR:ll] C [BR:ll] NVCZ 7EH0 3FH0–00 51H0 28H0–10 D4H1 EAH1–00

RR [HL] ||||||||||||||||||||||||||| Rotate right location [HL] with carry |||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function 76543210 C [HL] Mode Register indirect Rotates the content of the data memory that Example Set Value Result has been address specified by the HL register SC [HL] C [HL] the equivalent of 1 bit to the right, including NVCZ the carry (C). The content of the carry (C) 7EH0 3FH0–00 moves to bit 7 of the data and bit 0 of the data 51H0 28H0–10 moves to the carry (C). The content of the EP register becomes the D4H1 EAH1–00 page address of the data memory (MODEL2/3).

Code MSB LSB 11001110CEH

100110119BH

Flag I1 I0 U D N V C Z ––––↕ – ↕↕

E0C88 CORE CPU MANUAL EPSON 165 4 INSTRUCTION SETS

RRC r |||||||||||||||||||||||||||||||| Rotate right r reg. circular ||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles |||

Function 76543210 C r Flag I1 I0 U D N V C Z Rotates the content of the r register (A/B) the ––––↕ – ↕↕ equivalent of 1 bit to the right. Bit 0 of the Mode Register direct register moves to bit 7 and carry (C). Example Set Value Result Code MSB LSB SC 11001110CEH rCr NVCZ 1001110r9CH/9DH✽ C6H1 63H0–00 ✽ r Mnemonic Code D7H0 EBH1–10 A 0 RRC A 9CH B 1 RRC B 9DH

RRC [BR:ll] ||||||||||||||||| Rotate right location [BR:ll] circular ||||||||||||||||||||||||||||||||||||||||| 5 cycles |||

Function 76543210 C [BR:ll] Code MSB LSB Rotates the content of the data memory the 11001110CEH equivalent of 1 bit to the right. The data 100111109EH memory address has been specified by the content of the BR register (upper byte ll ll specification) and the 8-bit absolute address ll Flag I1 I0 U D N V C Z (lower byte specification). ↕ ↕↕ Bit 0 of the data moves to bit 7 and carry (C). –––– – The content of the EP register becomes the Mode 8-bit absolute page address of the data memory (MODEL2/3). Example Set Value Result SC [BR:ll] C [BR:ll] NVCZ C6H1 63H0–00 D7H0 EBH1–10

RRC [HL] |||||||||||||||||||||| Rotate right location [HL] circular ||||||||||||||||||||||||||||||||||||||||||||| 4 cycles |||

Function 76543210 C [HL] Flag I1 I0 U D N V C Z Rotates the content of the data memory that ––––↕ – ↕↕ has been address specified by the HL register Mode Register indirect the equivalent of 1 bit to the right. Bit 0 of the data moves to bit 7 and carry (C). Example Set Value Result The content of the EP register becomes the SC [HL] C [HL] page address of the data memory (MODEL2/3). NVCZ Code MSB LSB C6H1 63H0–00 11001110CEH D7H0 EBH1–10

100111119FH

166 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

SBC A, r ||||||||||||||||||||||||| Subtract with carry r reg. from A reg. |||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A - r - C Mode Src: Register direct Subtracts the content of the r register (A/B) Dst: Register direct and carry (C) from the A register. Example Set Value Result Code MSB LSB SC ABCA 0001100r18H/19H✽ NVCZ ✽ r Mnemonic Code • D=0, U=0 A8H 42H 1 65H 0 1 0 0 A 0 SBC A, A 18H 36H5AH1 DBH1010 B 1 SBC A, B 19H • D=1, U=0 88 39 1 48 0 0 0 0 • D=1, U=1 88 39 1 08 0 0 1 0 Flag I1 I0 U D N V C Z ––★★↕↕↕↕

SBC A, #nn ||||||||||||||||| Subtract with carry immediate data nn from A reg. |||||||||||||||||||| 2 cycles ||| Function A ← A - nn - C Mode Src: Immediate data Subtracts 8-bit immediate data nn and carry Dst: Register direct (C) from the A register. Example Set Value Result Code MSB LSB SC AnnCA 000110101AH NVCZ nn nn • D=0, U=0 A8H 42H 1 65H 0 1 0 0 36H5AH1 DBH1010 I1 I0 U D N V C Z Flag • D=1, U=0 88 39 1 48 0 0 0 0 ––★★↕↕↕↕ • D=1, U=1 88 39 1 08 0 0 1 0

SBC A, [BR:ll] |||||||||| Subtract with carry location [BR:ll] from A reg. |||||||||||||||||||||||| 3 cycles ||| Function A ← A - [BR:ll] - C Mode Src: 8-bit absolute Subtracts the content of the data memory and Dst: Register direct the carry (C) from the A register. The data Example Set Value Result memory address has been specified by the SC content of the BR register (upper byte A [BR:ll] CA specification) and the 8-bit absolute address ll NVCZ (lower byte specification). • D=0, U=0 A8H 42H 1 65H 0 1 0 0 The content of the EP register becomes the 36H5AH1 DBH1010 page address of the data memory (MODEL2/3). • D=1, U=0 88 39 1 48 0 0 0 0 Code MSB LSB • D=1, U=1 88 39 1 08 0 0 1 0 000111001CH

ll ll

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 167 4 INSTRUCTION SETS

SBC A, [hhll] ||||||||||||| Subtract with carry location [hhll] from A reg. |||||||||||||||||||||||||| 4 cycles ||| Function A ← A - [hhll] - C Flag I1 I0 U D N V C Z Subtracts the content of the data memory and ––★★↕↕↕↕ the carry (C) from the A register. The data memory address has been specified by the Mode Src: 16-bit absolute 16-bit absolute address hhll. Dst: Register direct The content of the EP register becomes the Example Set Value Result page address of the data memory (MODEL2/3). SC A [hhll]C A Code MSB LSB NVCZ 000111011DH • D=0, U=0 A8H 42H 1 65H 0 1 0 0 ll ll 36H 5AH 1 DBH 1 0 1 0 • D=1, U=0 88 39 1 48 0 0 0 0 hh hh • D=1, U=1 88 39 1 08 0 0 1 0

SBC A, [HL] |||||||||||||||| Subtract with carry location [HL] from A reg. ||||||||||||||||||||||||||| 2 cycles ||| Function A ← A - [HL] - C Mode Src: Register indirect Subtracts the content of the data memory and Dst: Register direct the carry (C) from the A register. The data memory address has been specified by the Example Set Value Result SC HL register. A [HL] C A The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). • D=0, U=0 A8H 42H 1 65H 0 1 0 0 36H 5AH 1 DBH 1 0 1 0 Code MSB LSB 000110111BH • D=1, U=0 88 39 1 48 0 0 0 0 • D=1, U=1 88 39 1 08 0 0 1 0 Flag I1 I0 U D N V C Z ––★★↕↕↕↕

SBC A, [ir] ||||||||||||||||||| Subtract with carry location [ir reg.] from A reg. ||||||||||||||||||||||| 2 cycles |||

Function A ← A - [ir] - C Flag I1 I0 U D N V C Z Subtracts the content of the data memory and ––★★↕↕↕↕ the carry (C) from the A register. The data memory address has been specified by the ir Mode Src: Register indirect register (IX/IY). Dst: Register direct The content of the XP register (at time of IX Example Set Value Result specification) or the YP register (at time of SC IY specification) becomes the page address A [ir] C A of the data memory (MODEL2/3). NVCZ • D=0, U=0 A8H 42H 1 65H 0 1 0 0 Code MSB LSB 36H 5AH 1 DBH 1 0 1 0 0001111ir1EH/1FH✽ • D=1, U=0 88 39 1 48 0 0 0 0 ✽ ir Mnemonic Code • D=1, U=1 88 39 1 08 0 0 1 0 IX 0 SBC A, [IX] 1EH IY 1 SBC A, [IY] 1FH

168 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

SBC A, [ir+dd] ||||||||| Subtract with carry location [ir reg. + dd] from A reg. |||||||||||||| 4 cycles |||

Function A ← A - [ir+dd] - C Flag I1 I0 U D N V C Z Subtracts the content of the data memory and ––★★↕↕↕↕ the carry (C) from the A register. The data memory address has been specified by the Mode Src: Register indirect with displacement sum of the content of the ir register (IX/IY) Dst: Register direct and the displacement dd. Example Set Value Result The displacement dd is handled as signed SC data and the range is -128 to 127. A [ir+dd] CA The content of the XP register (at time of IX NVCZ specification) or the YP register (at time of • D=0, U=0 A8H 42H 1 65H 0 1 0 0 IY specification) becomes the page address 36H5AH1 DBH1010 of the data memory (MODEL2/3). • D=1, U=0 88 39 1 48 0 0 0 0

Code MSB LSB • D=1, U=1 88 39 1 08 0 0 1 0 11001110CEH

0001100ir18H/19H✽

dd dd

✽ ir Mnemonic Code IX 0 SBC A, [IX+dd] 18H IY 1 SBC A, [IY+dd] 19H

SBC A, [ir+L] ||||||||||||| Subtract with carry location [ir reg. + L] from A reg. ||||||||||||||| 4 cycles |||

Function A ← A - [ir+L] - C Flag I1 I0 U D N V C Z Subtracts the content of the data memory and ––★★↕↕↕↕ the carry (C) from the A register. The data memory address has been specified by the Mode Src: Register indirect with index register sum of the content of the ir register (IX/IY) Dst: Register direct and the content of the L register. The content of the L register is handled as Example Set Value Result SC signed data and the range is -128 to 127. A [ir+L] CA The content of the XP register (at time of IX NVCZ specification) or the YP register (at time of • D=0, U=0 A8H 42H 1 65H 0 1 0 0 IY specification) becomes the page address 36H5AH1 DBH1010 of the data memory (MODEL2/3). • D=1, U=0 88 39 1 48 0 0 0 0 Code MSB LSB • D=1, U=1 88 39 1 08 0 0 1 0 11001110CEH

0001101ir1AH/1BH✽

✽ ir Mnemonic Code IX 0 SBC A, [IX+L] 1AH IY 1 SBC A, [IY+L] 1BH

E0C88 CORE CPU MANUAL EPSON 169 4 INSTRUCTION SETS

SBC [HL], A |||||||||||||||| Subtract with carry A reg. from location [HL] ||||||||||||||||||||||||||| 4 cycles ||| Function [HL] ← [HL] - A - C Mode Src: Register direct Subtracts the content of the A register and the Dst: Register indirect carry (C) from the data memory that has been address specified by the HL register. Example Set Value Result SC The content of the EP register becomes the [HL] A C [HL] page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 A8H 42H 1 65H 0 1 0 0 Code MSB LSB 36H 5AH 1 DBH 1 0 1 0 11001110CEH • D=1, U=0 88 39 1 48 0 0 0 0 000111001CH • D=1, U=1 88 39 1 08 0 0 1 0

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

SBC [HL], #nn |||||||||| Subtract with carry immediate data nn from location [HL] ||||||| 5 cycles ||| Function [HL] ← [HL] - nn - C Mode Src: Immediate data Subtracts the 8-bit immediate data nn and the Dst: Register indirect carry (C) from the data memory that has been Example Set Value Result address specified by the HL register. SC The content of the EP register becomes the [HL] n n C [HL] page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 A8H 42H 1 65H 0 1 0 0 Code MSB LSB 36H 5AH 1 DBH 1 0 1 0 11001110CEH • D=1, U=0 88 39 1 48 0 0 0 0 000111011DH • D=1, U=1 88 39 1 08 0 0 1 0

nn nn

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

170 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

SBC [HL], [ir] |||||||||||| Subtract with carry location [ir reg.] from location [HL] |||||||||| 5 cycles ||| Function [HL] ← [HL] - [ir] - C Mode Src: Register indirect Subtracts the content of the data memory that Dst: Register indirect has been address specified by the ir register Example Set Value Result (IX/IY) and the carry (C) from the data SC memory that has been address specified by [HL] [ir] C [HL] the HL register. NVCZ The content of the EP register becomes the • D=0, U=0 A8H 42H 1 65H 0 1 0 0 page address of the data memory [HL] and 36H5AH1 DBH1010 the content of the XP register (at time of IX • D=1, U=0 88 39 1 48 0 0 0 0 specification) or the YP register (at time of • D=1, U=1 88 39 1 08 0 0 1 0 IY specification) becomes the page address of the data memory [ir] (MODEL2/3).

Code MSB LSB 11001110CEH

0001111ir1EH/1FH✽

✽ ir Mnemonic Code IX 0 SBC [HL], [IX] 1EH IY 1 SBC [HL], [IY] 1FH

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

SBC BA, rp ||||||||||||||||| Subtract with carry rp reg. from BA reg. |||||||||||||||||||||||||||||||||||| 4 cycles ||| Function BA ← BA - rp - C Mode Src: Register direct Subtracts the content of the rp register (BA/ Dst: Register direct HL/IX/IY) and the carry (C) from the BA register. Example Set Value Result SC BA rp C BA Code MSB LSB NVCZ 11001111CFH 63C2H 2125H 1 429CH 0100 000011 rp 0CH–0FH✽ 205CH 7120H 1 AF3BH 1010 (rp≠BA) ✽ rp Mnemonic Code BA 00 SBC BA, BA 0CH HL 01 SBC BA, HL 0DH IX 10 SBC BA, IX 0EH IY 11 SBC BA, IY 0FH

Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 171 4 INSTRUCTION SETS

SBC BA, #mmnn ||| Subtract with carry immediate data mmnn from BA reg. ||||||||||| 4 cycles |||

Function BA ← BA - mmnn - C Flag I1 I0 U D N V C Z Subtracts the 16-bit immediate data mmnn ––––↕↕↕↕ and the carry (C) from the BA register. Mode Src: Immediate data Code MSB LSB Dst: Register direct 11001111CFH Example Set Value Result 0110001062H SC BA mmnn C BA nn nn NVCZ 63C2H 2125H 1 429CH 0100 mm mm 205CH 7120H 1 AF3BH 1010

SBC HL, rp |||||||||||||||||| Subtract with carry rp reg. from BA reg. |||||||||||||||||||||||||||||||||||| 4 cycles |||

Function HL ← HL - rp - C Flag I1 I0 U D N V C Z Subtracts the content of the rp register (BA/ ––––↕↕↕↕ HL/IX/IY) and the carry (C) from the HL register. Mode Src: Register direct Dst: Register direct Code MSB LSB 11001111CFH Example Set Value Result SC 001011 rp 2CH–2FH✽ HL rp C HL NVCZ ✽ rp Mnemonic Code 63C2H 2125H 1 429CH 0100 BA 00 SBC HL, BA 2CH 205CH 7120H 1 AF3BH 1010 HL 01 SBC HL, HL 2DH (rp≠HL) IX 10 SBC HL, IX 2EH IY 11 SBC HL, IY 2FH

SBC HL, #mmnn |||| Subtract with carry immediate data mmnn from HL reg. ||||||||||| 4 cycles |||

Function HL ← HL - mmnn - C Flag I1 I0 U D N V C Z Subtracts the 16-bit immediate data mmnn ––––↕↕↕↕ and the carry (C) from the HL register. Mode Src: Immediate data Code MSB LSB Dst: Register direct 11001111CFH Example Set Value Result 0110001063H SC HL mmnn C HL nn nn NVCZ 63C2H 2125H 1 429CH 0100 mm mm 205CH 7120H 1 AF3BH 1010

172 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

SEP |||||||||||||||||||||||||||||||||||||| Sign expand A reg. to BA reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function B A B A Code MSB LSB ******** 0******* 00000000 0******* 11001110CEH ******** 1******* 11111111 1******* Expands the code bit (bit 7) of the 8-bit data 10101000A8H stored in the A register into the B register and Flag I1 I0 U D N V C Z makes it 16-bit data handled as the BA –––––––– register. When the value of the A register is positive Mode Implide (Register direct ) (bit 7 is '0') the B register becomes 00H and when it is negative (bit 7 is '1') it becomes Example Set Value Result FFH. SC BABA NVCZ 5CH 76H 0076H –––– 42H A5H FFA5H ––––

SLA r |||||||||||||||||||||||||||||||| Shift r reg. left arithmetic |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function C 76543210 0 r Mode Register direct

Shifts the content of the r register (A/B) 1 bit Example Set Value Result to the left. Bit 7 of the register moves to the SC rr carry (C) and '0' enters bit 0 of the register. NVCZ The same result as for the "SLL" instruction 00111100 01111000 0000 is obtained, but the "SLA" instruction also changes the overflow (V) flag due to the 10010000 00100000 0110 arithmetic shift.

Code MSB LSB 11001110CEH

1000000ir80H/81H✽

✽ r Mnemonic Code A 0 SLA A 80H B 1 SLA B 81H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 173 4 INSTRUCTION SETS

SLA [BR:ll] |||||||||||||||||| Shift location [BR:ll] left arithmetic ||||||||||||||||||||||||||||||||||||||||||| 5 cycles ||| Function C 76543210 0 [BR:ll] Code MSB LSB Shifts the content of the data memory 1 bit to 11001110CEH the left. The data memory address has been 1000001082H specified by the content of the BR register (upper byte specification) and the 8-bit ll ll absolute address ll (lower byte specification). Flag I1 I0 U D N V C Z Bit 7 of the data moves to the carry (C) and ––––↕↕↕↕ bit 0 of the data becomes '0'. The same result as for the "SLL" instruction Mode 8-bit absolute is obtained, but the "SLA" instruction also changes the overflow (V) flag due to the Example Set Value Result arithmetic shift. SC [BR:ll] [BR:ll] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 00111100 01111000 0000 10010000 00100000 0110

SLA [HL] ||||||||||||||||||||||| Shift location [HL] left arithmetic ||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function C 76543210 0 [HL] Mode Register indirect Shifts the content of the data memory that has Example Set Value Result been address specified by the HL register 1 SC [HL] [HL] bit to the left. Bit 7 of the data moves to the NVCZ carry (C) and bit 0 of the data becomes '0'. 00111100 01111000 0000 The same result as for the "SLL" instruction 10010000 00100000 0110 is obtained, but the "SLA" instruction also changes the overflow (V) flag due to the arithmetic shift. The content of the EP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 11001110CEH

1000001183H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

174 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

SLL r ||||||||||||||||||||||||||||||||| Shift r reg. left logical ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function C 76543210 0 r Mode Register direct

Shifts the content of the r register (A/B) 1 bit Example Set Value Result to the left. Bit 7 of the register moves to the SC rr carry (C) and '0' enters bit 0 of the register. NVCZ The same result as for the "SLA" instruction 00111100 01111000 1–00 is obtained, but the overflow (V) flag does not change due to the logical shift. 10010000 00100000 0–10

Code MSB LSB 11001110CEH

1000010ir84H/85H✽

✽ r Mnemonic Code A 0 SLL A 84H B 1 SLL B 85H

Flag I1 I0 U D N V C Z ––––↕ – ↕↕

SLL [BR:ll] |||||||||||||||||| Shift location [BR:ll] left logical ||||||||||||||||||||||||||||||||||||||||||||||||| 5 cycles ||| Function C 76543210 0 [BR:ll] Code MSB LSB Shifts the content of the data memory 1 bit to 11001110CEH the left. The data memory address has been 1000011086H specified by the content of the BR register (upper byte specification) and the 8-bit ll ll absolute address ll (lower byte specification). Flag I1 I0 U D N V C Z Bit 7 of the data moves to the carry (C) and ––––↕ – ↕↕ bit 0 of the data becomes '0'. The same result as for the "SLA" instruction Mode 8-bit absolute is obtained, but the overflow (V) flag does not change due to the logical shift. Example Set Value Result The content of the EP register becomes the SC [BR:ll] [BR:ll] page address of the data memory (MODEL2/3). NVCZ 00111100 01111000 1–00 10010000 00100000 0–10

E0C88 CORE CPU MANUAL EPSON 175 4 INSTRUCTION SETS

SLL [HL] |||||||||||||||||||||||| Shift location [HL] left logical |||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function C 76543210 0 [HL] Mode Register indirect Shifts the content of the data memory that has Example Set Value Result been address specified by the HL register 1 SC [HL] [HL] bit to the left. Bit 7 of the data moves to the NVCZ carry (C) and bit 0 of the data becomes '0'. 00111100 01111000 1–00 The same result as for the "SLA" instruction 10010000 00100000 0–10 is obtained, but the overflow (V) flag due to the logical shift. The content of the EP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 11001110CEH

1000011187H

Flag I1 I0 U D N V C Z ––––↕ – ↕↕

SLP |||||||||||||||||||||||||||||||||||||| Set CPU to SLEEP mode ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function SLEEP Code MSB LSB Puts the CPU in the SLEEP status. 11001110CEH In the SLEEP status, the peripheral circuits including the CPU and the oscillation circuit 10101111AFH stop operating and power consumption is Flag I1 I0 U D N V C Z substantially reduced. –––––––– From the SLEEP status, an interrupt outside the MCU will return it to the normal program execution status. See Section 3.7.2, "SLEEP status".

176 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

SRA r |||||||||||||||||||||||||||||||| Shift r reg. right arithmetic ||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function 76543210 C r Mode Register direct

Shifts the content of the r register (A/B) 1 bit Example Set Value Result SC to the right. Bit 0 of the register moves to the rr carry (C) and bit 7 of the register does not NVCZ change. 01000100 00100010 0000 The overflow (V) flag is reset to '0'. 10111001 11011100 1010

Code MSB LSB 11001110CEH

1000100r88H/89H✽

✽ r Mnemonic Code A 0 SRA A 88H B 1 SRA B 89H

Flag I1 I0 U D N V C Z ––––↕ 0 ↕↕

SRA [BR:ll] ||||||||||||||||| Shift location [BR:ll] right arithmetic |||||||||||||||||||||||||||||||||||||||| 5 cycles ||| Function 76543210 C [BR:ll] Code MSB LSB 11001110CEH Shifts the content of the data memory 1 bit to the right. The data memory address has been 100010108AH specified by the content of the BR register ll ll (upper byte specification) and the 8-bit absolute address ll (lower byte specification). Flag I1 I0 U D N V C Z Bit 0 of the data moves to the carry (C) and ––––↕ 0 ↕↕ bit 7 of the data does not change. The overflow (V) flag is reset to '0'. Mode 8-bit absolute The content of the EP register becomes the Example Set Value Result page address of the data memory (MODEL2/3). SC [BR:ll] [BR:ll] NVCZ 01000100 00100010 0000 10111001 11011100 1010

E0C88 CORE CPU MANUAL EPSON 177 4 INSTRUCTION SETS

SRA [HL] ||||||||||||||||||||||| Shift location [HL] right arithmetic ||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function 76543210 C [HL] Mode Register indirect Example Set Value Result Shifts the content of the data memory that has SC been address specified by the HL register 1 [HL] [HL] bit to the right. Bit 0 of the data moves to the NVCZ carry (C) and bit 7 of the data does not 01000100 00100010 0000 change. 10111001 11011100 1010 The overflow (V) flag is reset to '0'. The content of the EP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 11001110CEH

100010118BH

Flag I1 I0 U D N V C Z ––––↕ 0 ↕↕

SRL r |||||||||||||||||||||||||||||||| Shift r reg. right logical ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function 0 76543210 C r Mode Register direct

Shifts the content of the r register (A/B) 1 bit Example Set Value Result to the right. Bit 0 of the register moves to the SC rr carry (C) and bit 7 of the register becomes '0'. NVCZ Code MSB LSB 01000100 00100010 0–00 11001110CEH 01101101 00110110 0–10

1000110r8CH/8DH✽

✽ r Mnemonic Code A 0 SRL A 8CH B 1 SRL B 8DH

Flag I1 I0 U D N V C Z ––––0–↕↕

178 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

SRL [BR:ll] |||||||||||||||||| Shift location [BR:ll] right logical ||||||||||||||||||||||||||||||||||||||||||||| 5 cycles ||| Function 0 76543210 C [BR:ll] Code MSB LSB 11001110CEH Shifts the content of the data memory 1 bit to the right. The data memory address has been 100011108EH specified by the content of the BR register ll ll (upper byte specification) and the 8-bit absolute address ll (lower byte specification). Flag I1 I0 U D N V C Z Bit 0 of the data moves to the carry (C) and ––––0–↕↕ bit 7 of the data becomes '0'. The content of the EP register becomes the Mode 8-bit absolute page address of the data memory (MODEL2/3). Example Set Value Result SC [BR:ll] [BR:ll] NVCZ 01000100 00100010 0–00 01101101 00110110 0–10

SRL [HL] ||||||||||||||||||||||| Shift location [HL] right logical ||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function 0 76543210 C [HL] Mode Register indirect Shifts the content of the data memory that has Example Set Value Result been address specified by the HL register 1 SC [HL] [HL] bit to the right. Bit 0 of the data moves to the NVCZ carry (C) and bit 7 of the data becomes '0'. 01000100 00100010 0–00 The content of the EP register becomes the 01101101 00110110 0–10 page address of the data memory (MODEL2/3).

Code MSB LSB 11001110CEH

100011118FH

Flag I1 I0 U D N V C Z ––––0–↕↕

E0C88 CORE CPU MANUAL EPSON 179 4 INSTRUCTION SETS

SUB A, r ||||||||||||||||||||||||| Subtract r reg. from A reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A - r Mode Src: Register direct Subtracts the content of the r register (A/B) Dst: Register direct from the A register. Example Set Value Result Code MSB LSB SC ✽ ABA 0001000r10H/11H NVCZ ✽ r Mnemonic Code • D=0, U=0 A8H42H66H0100 A 0 SUB A, A 10H 36H5AHDCH1010 B 1 SUB A, B 11H • D=1, U=0 8839490000 • D=1, U=1 8839090010 Flag I1 I0 U D N V C Z ––★★↕↕↕↕

SUB A, #nn ||||||||||||||||| Subtract immediate data nn from A reg. ||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A - nn Mode Src: Immediate data Subtracts 8-bit immediate data nn from the A Dst: Register direct register. Example Set Value Result Code MSB LSB SC AnnA 0001001012H NVCZ nn nn • D=0, U=0 A8H42H66H0100 36H5AHDCH1010 I1 I0 U D N V C Z Flag • D=1, U=0 8839490000 ––★★↕↕↕↕ • D=1, U=1 8839090010

SUB A, [BR:ll] |||||||||| Subtract location [BR:ll] from A reg. |||||||||||||||||||||||||||||||||||||||||| 3 cycles ||| Function A ← A - [BR:ll] Mode Src: 8-bit absolute Subtracts the content of the data memory Dst: Register direct from the A register. The data memory Example Set Value Result address has been specified by the content of SC the BR register (upper byte specification) and A [BR:ll]A the 8-bit absolute address ll (lower byte NVCZ specification). • D=0, U=0 A8H42H66H0100 The content of the EP register becomes the 36H5AHDCH1010 page address of the data memory (MODEL2/3). • D=1, U=0 8839490000 Code MSB LSB • D=1, U=1 8839090010 0001010014H

ll ll

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

180 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

SUB A, [hhll] ||||||||||||| Subtract location [hhll] from A reg. |||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function A ← A - [hhll] Flag I1 I0 U D N V C Z Subtracts the content of the data memory that ––★★↕↕↕↕ has been address specified by the 16-bit absolute address hhll from the A register. Mode Src: 16-bit absolute The content of the EP register becomes the Dst: Register direct page address of the data memory (MODEL2/3). Example Set Value Result Code MSB LSB SC A [hhll]A 0001010115H NVCZ ll ll • D=0, U=0 A8H42H66H0100 36H5AHDCH1010 hh hh • D=1, U=0 8839490000 • D=1, U=1 8839090010

SUB A, [HL] |||||||||||||||| Subtract location [HL] from A reg. |||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A - [HL] Mode Src: Register indirect Subtracts the content of the data memory that Dst: Register direct has been address specified by the HL register from the A register. Example Set Value Result SC The content of the EP register becomes the A [HL] A page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 A8H42H66H0100 Code MSB LSB 36H5AHDCH1010 0001001113H • D=1, U=0 8839490000 Flag I1 I0 U D N V C Z • D=1, U=1 8839090010 ––★★↕↕↕↕

SUB A, [ir] ||||||||||||||||||| Subtract location [ir reg.] from A reg. |||||||||||||||||||||||||||||||||||||||| 2 cycles |||

Function A ← A - [ir] Flag I1 I0 U D N V C Z Subtracts the content of the data memory that ––★★↕↕↕↕ has been address specified by the ir register (IX/IY) from the A register. Mode Src: Register indirect The content of the XP register (at time of IX Dst: Register direct specification) or the YP register (at time of Example Set Value Result IY specification) becomes the page address SC of the data memory (MODEL2/3). A [ir] A NVCZ Code MSB LSB • D=0, U=0 A8H42H66H0100 0001011ir16H/17H✽ 36H5AHDCH1010 ✽ ir Mnemonic Code • D=1, U=0 8839490000 IX 0 SUB A, [IX] 16H • D=1, U=1 8839090010 IY 1 SUB A, [IY] 17H

E0C88 CORE CPU MANUAL EPSON 181 4 INSTRUCTION SETS

SUB A, [ir+dd] ||||||||| Subtract location [ir reg. + dd] from A reg. |||||||||||||||||||||||||||||||| 4 cycles |||

Function A ← A - [ir+dd] Flag I1 I0 U D N V C Z Subtracts the content of the data memory ––★★↕↕↕↕ from the A register. The data memory address has been specified by the sum of the Mode Src: Register indirect with displacement content of the ir register (IX/IY) and the Dst: Register direct displacement dd. Example Set Value Result The displacement dd is handled as signed SC data and the range is -128 to 127. A [ir+dd] A The content of the XP register (at time of IX NVCZ specification) or the YP register (at time of • D=0, U=0 A8H42H66H0100 IY specification) becomes the page address 36H5AHDCH1010 of the data memory (MODEL2/3). • D=1, U=0 8839490000

Code MSB LSB • D=1, U=1 8839090010 11001110CEH

0001000ir10H/11H✽

dd dd

✽ ir Mnemonic Code IX 0 SUB A, [IX+dd] 10H IY 1 SUB A, [IY+dd] 11H

SUB A, [ir+L] ||||||||||||| Subtract location [ir reg. + L] from A reg. ||||||||||||||||||||||||||||||||| 4 cycles |||

Function A ← A - [ir+L] Flag I1 I0 U D N V C Z Subtracts the content of the data memory ––★★↕↕↕↕ from the A register. The data memory address has been specified by the sum of the Mode Src: Register indirect with index register content of the ir register (IX/IY) and the Dst: Register direct content of the L register. Example Set Value Result The content of the L register is handled as SC signed data and the range is -128 to 127. A [ir+L] A The content of the XP register (at time of IX NVCZ specification) or the YP register (at time of • D=0, U=0 A8H42H66H0100 IY specification) becomes the page address 36H5AHDCH1010 of the data memory (MODEL2/3). • D=1, U=0 8839490000 • D=1, U=1 8839090010 Code MSB LSB 11001110CEH

0001001ir12H/13H✽

✽ ir Mnemonic Code IX 0 SUB A, [IX+L] 12H IY 1 SUB A, [IY+L] 13H

182 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

SUB [HL], A |||||||||||||||| Subtract A reg. from location [HL] ||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [HL] ← [HL] - A Mode Src: Register direct Subtracts the content of the A register from Dst: Register indirect the data memory that has been address specified by the HL register. Example Set Value Result SC The content of the EP register becomes the [HL] A [HL] page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 A8H42H66H0100 Code MSB LSB 36H5AHDCH1010 11001110CEH • D=1, U=0 8839490000 0001010014H • D=1, U=1 8839090010

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

SUB [HL], #nn |||||||||| Subtract immediate data nn from location [HL] ||||||||||||||||||||||||| 5 cycles ||| Function [HL] ← [HL] - nn Mode Src: Immediate data Subtracts the 8-bit immediate data nn from Dst: Register indirect the data memory that has been address specified by the HL register. Example Set Value Result SC The content of the EP register becomes the [HL] n n [HL] page address of the data memory (MODEL2/3). NVCZ • D=0, U=0 A8H42H66H0100 Code MSB LSB 36H5AHDCH1010 11001110CEH • D=1, U=0 8839490000 0001010115H • D=1, U=1 8839090010

nn nn

Flag I1 I0 U D N V C Z ––★★↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 183 4 INSTRUCTION SETS

SUB [HL], [ir] |||||||||||| Subtract location [ir reg.] from location [HL] ||||||||||||||||||||||||||| 5 cycles |||

Function [HL] ← [HL] - [ir] Flag I1 I0 U D N V C Z Subtracts the content of the data memory that ––★★↕↕↕↕ has been address specified by the ir register (IX/IY) from the data memory that has been Mode Src: Register indirect address specified by the HL register. Dst: Register indirect The content of the EP register becomes the Example Set Value Result page address of the data memory [HL] and SC the content of the XP register (at time of IX [HL] [ir] [HL] specification) or the YP register (at time of NVCZ IY specification) becomes the page address • D=0, U=0 A8H42H66H0100 of the data memory [ir] (MODEL2/3). 36H5AHDCH1010 • D=1, U=0 8839490000 Code MSB LSB 11001110CEH • D=1, U=1 8839090010

0001011ir16H/17H✽

✽ ir Mnemonic Code IX 0 SUB [HL], [IX] 16H IY 1 SUB [HL], [IY] 17H

SUB BA, rp ||||||||||||||||| Subtract rp reg. from BA reg. |||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function BA ← BA - rp Mode Src: Register direct Subtracts the content of the rp register (BA/ Dst: Register direct HL/IX/IY) from the BA register. Example Set Value Result Code MSB LSB SC BA rp BA 11001111CFH NVCZ 000010 rp 08H–0BH✽ 63C2H 2125H 429DH 0000 C261H 5A32H 682FH 0100 ✽ rp Mnemonic Code 205CH 7120H AF3CH 1010 BA 00 SUB BA, BA 08H (rp≠BA) HL 01 SUB BA, HL 09H IX 10 SUB BA, IX 0AH IY 11 SUB BA, IY 0BH

Flag I1 I0 U D N V C Z ––––↕↕↕↕

184 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

SUB BA, #mmnn ||| Subtract immediate data mmnn from BA reg. ||||||||||||||||||||||||||||| 3 cycles ||| Function BA ← BA - mmnn Mode Src: Immediate data Subtracts the 16-bit immediate data mmnn Dst: Register direct from the BA register. Example Set Value Result Code MSB LSB SC BA mmnn BA 11010000D0H NVCZ nn nn 63C2H 2125H 429DH 0000 C261H 5A32H 682FH 0100 mm mm 205CH 7120H AF3CH 1010 Flag I1 I0 U D N V C Z ––––↕↕↕↕

SUB HL, rp |||||||||||||||||| Subtract rp reg. from HL reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function HL ← HL - rp Mode Src: Register direct Subtracts the content of the rp register (BA/ Dst: Register direct HL/IX/IY) from the HL register. Example Set Value Result Code MSB LSB SC HL rp HL 11001111CFH NVCZ 001010 rp 28H–2BH✽ 63C2H 2125H 429DH 0000 C261H 5A32H 682FH 0100 ✽ rp Mnemonic Code 205CH 7120H AF3CH 1010 BA 00 SUB HL, BA 28H (rp≠HL) HL 01 SUB HL, HL 29H IX 10 SUB HL, IX 2AH IY 11 SUB HL, IY 2BH

Flag I1 I0 U D N V C Z ––––↕↕↕↕

SUB HL, #mmnn |||| Subtract immediate data mmnn from HL reg. |||||||||||||||||||||||||||| 3 cycles ||| Function HL ← HL - mmnn Mode Src: Immediate data Subtracts the 16-bit immediate data mmnn Dst: Register direct from the HL register. Example Set Value Result Code MSB LSB SC HL mmnn HL 11010001D1H NVCZ nn nn 63C2H 2125H 429DH 0000 C261H 5A32H 682FH 0100 mm mm 205CH 7120H AF3CH 1010 Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 185 4 INSTRUCTION SETS

SUB IX, rp |||||||||||||||||||| Subtract rp reg. from IX reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function IX ← IX - rp Mode Src: Register direct Subtracts the content of the rp register (BA/ Dst: Register direct HL) from the IX register. Example Set Value Result Code MSB LSB SC IX r p IX 11001111CFH NVCZ 0100100rp48H/49H✽ 63C2H 2125H 429DH 0000 C261H 5A32H 682FH 0100 ✽ rp Mnemonic Code 205CH 7120H AF3CH 1010 BA 0 SUB IX, BA 48H HL 1 SUB IX, HL 49H

Flag I1 I0 U D N V C Z ––––↕↕↕↕

SUB IX, #mmnn |||||| Subtract immediate data mmnn from IX reg. |||||||||||||||||||||||||||||| 3 cycles ||| Function IX ← IX - mmnn Mode Src: Immediate data Subtracts the 16-bit immediate data mmnn Dst: Register direct from the IX register. Example Set Value Result Code MSB LSB SC IX mmnn IX 11010010D2H NVCZ nn nn 63C2H 2125H 429DH 0000 C261H 5A32H 682FH 0100 mm mm 205CH 7120H AF3CH 1010 Flag I1 I0 U D N V C Z ––––↕↕↕↕

SUB IY, rp |||||||||||||||||||| Subtract rp reg. from IY reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function IY ← IY - rp Mode Src: Register direct Subtracts the content of the rp register (BA/ Dst: Register direct HL) from the IY register. Example Set Value Result Code MSB LSB SC IY r p IY 11001111CFH NVCZ 0100101rp4AH/4BH✽ 63C2H 2125H 429DH 0000 C261H 5A32H 682FH 0100 ✽ rp Mnemonic Code 205CH 7120H AF3CH 1010 BA 0 SUB IY, BA 4AH HL 1 SUB IY, HL 4BH

Flag I1 I0 U D N V C Z ––––↕↕↕↕

186 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

SUB IY, #mmnn |||||| Subtract immediate data mmnn from IY reg. |||||||||||||||||||||||||||||| 3 cycles ||| Function IY ← IY - mmnn Mode Src: Immediate data Subtracts the 16-bit immediate data mmnn Dst: Register direct from the IY register. Example Set Value Result Code MSB LSB SC IY mmnn IY 11010011D3H NVCZ nn nn 63C2H 2125H 429DH 0000 C261H 5A32H 682FH 0100 mm mm 205CH 7120H AF3CH 1010 Flag I1 I0 U D N V C Z ––––↕↕↕↕

SUB SP, rp |||||||||||||||||| Subtract rp reg. from SP |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function SP ← SP - rp Mode Src: Register direct Subtracts the content of the rp register (BA/ Dst: Register direct HL) from the stack pointer (SP). Example Set Value Result Code MSB LSB SC SP rp SP 11001111CFH NVCZ 0100110rp4CH/4DH✽ 63C2H 2125H 429DH 0000 C261H 5A32H 682FH 0100 ✽ rp Mnemonic Code 205CH 7120H AF3CH 1010 BA 0 SUB SP, BA 4CH HL 1 SUB SP, HL 4DH

Flag I1 I0 U D N V C Z ––––↕↕↕↕

SUB SP, #mmnn |||| Subtract immediate data mmnn from SP ||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function SP ← SP - mmnn Mode Src: Immediate data Subtracts the 16-bit immediate data mmnn Dst: Register direct from the stack pointer (SP). Example Set Value Result Code MSB LSB SC S P mmnn S P 11001111CFH NVCZ 011010106AH 63C2H 2125H 429DH 0000 C261H 5A32H 682FH 0100 nn nn 205CH 7120H AF3CH 1010 mm mm

Flag I1 I0 U D N V C Z ––––↕↕↕↕

E0C88 CORE CPU MANUAL EPSON 187 4 INSTRUCTION SETS

SWAP A ||||||||||||||||||||||||| Swap high-order and low-order of A reg. |||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A(H) ↔ A(L) Mode Register direct Replaces the content of the lower 4 bits with the upper 4 bits of the A register. Example Set Value Result SC AA Code MSB LSB NVCZ 11110110F6H 4CH C4H–––– Flag I1 I0 U D N V C Z 62H 26H–––– ––––––––

SWAP [HL] |||||||||||||||||| Swap high-order and low-order of location [HL] ||||||||||||||||||||||| 3 cycles ||| Function [HL](H) ↔ [HL](L) Mode Register indirect Replaces the content of the lower 4 bits with the upper 4 bits of the data memory specified Example Set Value Result SC by the HL register. [HL] [HL] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 4CH C4H–––– 62H 26H–––– Code MSB LSB 11110111F7H

Flag I1 I0 U D N V C Z ––––––––

UPCK ||||||||||||||||||||||||||||||||| Unpack A reg. to BA reg. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A BA Mode Implide (Register direct) mn 0m0 n Unpacks the content of the A register and Example Set Value Result SC stores it in the BA register. The lower 4 bits ABA of the B register are substituted for the NVCZ content of the upper 4 bits of the A register 84H 0804H –––– and both of the upper 4 bits of the A register and B register become '0'.

Code MSB LSB 11011111DFH

Flag I1 I0 U D N V C Z ––––––––

188 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

XOR A, r |||||||||||||||||||||||| Exclusive OR r reg. and A reg. |||||||||||||||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A ∀ r Mode Src: Register direct Takes an exclusive OR of the content of the r Dst: Register direct register (A/B) and the content of the A Example Set Value Result register and stores the result in the A register. SC ABA Code MSB LSB NVCZ 0011100r38H/39H✽ 2CH41H6DH0––0 ✽ r Mnemonic Code 7AHB6HCCH1––0 A 0 XOR A, A 38H B 1 XOR A, B 39H

Flag I1 I0 U D N V C Z ––––↕ ––↕

XOR A, #nn ||||||||||||||||| Exclusive OR immediate data nn and A reg. |||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A ∀ nn Mode Src: Immediate data Takes an exclusive OR of the 8-bit immediate Dst: Register direct data nn and the content of the A register and stores the result in the A register. Example Set Value Result SC AnnA Code MSB LSB NVCZ 001110103AH 2CH41H6DH0––0 nn nn 7AHB6HCCH1––0

Flag I1 I0 U D N V C Z ––––↕ ––↕

XOR A, [BR:ll] |||||||||| Exclusive OR location [BR:ll] and A reg. |||||||||||||||||||||||||||||||||| 3 cycles ||| Function A ← A ∀ [BR:ll] Mode Src: 8-bit absolute Takes an exclusive OR of the content of the Dst: Register direct data memory and the content of the A register Example Set Value Result and stores the result in the A register. The SC data memory address has been specified by A [BR:ll]A the content of the BR register (upper byte NVCZ specification) and the 8-bit absolute address ll 2CH41H6DH0––0 (lower byte specification). 7AHB6HCCH1––0 The content of the EP register becomes the page address of the data memory (MODEL2/3).

Code MSB LSB 001111003CH

ll ll

Flag I1 I0 U D N V C Z ––––↕ ––↕

E0C88 CORE CPU MANUAL EPSON 189 4 INSTRUCTION SETS

XOR A, [hhll] ||||||||||||| Exclusive OR location [hhll] and A reg. ||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function A ← A ∀ [hhll] Flag I1 I0 U D N V C Z Takes an exclusive OR of the content of the ––––↕ ––↕ data memory that has been address specified by the 16-bit absolute address hhll and the Mode Src: 16-bit absolute content of the A register and stores the result Dst: Register direct in the A register. Example Set Value Result The content of the EP register becomes the SC page address of the data memory (MODEL2/3). A [hhll]A NVCZ Code MSB LSB 2CH41H6DH0––0 001111013DH 7AHB6HCCH1––0 ll ll

hh hh

XOR A, [HL] ||||||||||||||| Exclusive OR location [HL] and A reg. ||||||||||||||||||||||||||||||||||||||| 2 cycles ||| Function A ← A ∀ [HL] Mode Src: Register indirect Takes an exclusive OR of the content of the Dst: Register direct data memory that has been address specified Example Set Value Result by the HL register and the content of the A SC register and stores the result in the A register. A [HL] A The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 2CH41H6DH0––0 7AHB6HCCH1––0 Code MSB LSB 001110113BH

Flag I1 I0 U D N V C Z ––––↕ ––↕

XOR A, [ir] ||||||||||||||||||| Exclusive OR location [ir reg.] and A reg. ||||||||||||||||||||||||||||||||| 2 cycles |||

Function A ← A ∀ [ir] Flag I1 I0 U D N V C Z Takes an exclusive OR of the content of the ––––↕ ––↕ data memory that has been address specified by the ir register (IX/IY) and the content of Mode Src: Register indirect the A register and stores the result in the A Dst: Register direct register. The content of the XP register (at time of IX Example Set Value Result SC specification) or the YP register (at time of A [ir] A IY specification) becomes the page address NVCZ of the data memory (MODEL2/3). 2CH41H6DH0––0 7AHB6HCCH1––0 Code MSB LSB 0011111ir3EH/3FH✽

✽ ir Mnemonic Code IX 0 XOR A, [IX] 3EH IY 1 XOR A, [IY] 3FH

190 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

XOR A, [ir+dd] ||||||||| Exclusive OR location [ir reg. + dd] and A reg. ||||||||||||||||||||||||| 4 cycles |||

Function A ← A ∀ [ir+dd] Code MSB LSB Takes an exclusive OR of the content of the 11001110CEH data memory and the content of the A register ✽ and stores the result in the A register. The 0011100ir38H/39H data memory address has been specified by dd dd the sum of the content of the ir register (IX/ IY) and the displacement dd. ✽ ir Mnemonic Code The displacement dd is handled as signed IX 0 XOR A, [IX+dd] 38H data and the range is -128 to 127. IY 1 XOR A, [IY+dd] 39H The content of the XP register (at time of IX specification) or the YP register (at time of Flag I1 I0 U D N V C Z IY specification) becomes the page address ––––↕ ––↕ of the data memory (MODEL2/3). Mode Src: Register indirect with displacement Dst: Register direct

Example Set Value Result SC A [ir+dd] A NVCZ 2CH41H6DH0––0 7AHB6HCCH1––0

XOR A, [ir+L] |||||||||||| Exclusive OR location [ir reg. + L] and A reg. ||||||||||||||||||||||||||| 4 cycles |||

Function A ← A ∀ [ir+L] Code MSB LSB Takes an exclusive OR of the content of the 11001110CEH data memory and the content of the A register and stores the result in the A register. The 0011101ir3AH/3BH✽ data memory address has been specified by ✽ ir Mnemonic Code the sum of the content of the ir register (IX/ IX 0 XOR A, [IX+L] 3AH IY) and the content of the L register. The content of the L register is handled as IY 1 XOR A, [IY+L] 3BH signed data and the range is -128 to 127. Flag I1 I0 U D N V C Z The content of the XP register (at time of IX ––––↕ ––↕ specification) or the YP register (at time of IY specification) becomes the page address Mode Src: Register indirect with index register of the data memory (MODEL2/3). Dst: Register direct

Example Set Value Result SC A [ir+L] A NVCZ 2CH41H6DH0––0 7AHB6HCCH1––0

E0C88 CORE CPU MANUAL EPSON 191 4 INSTRUCTION SETS

XOR B, #nn |||||||||||||||| Exclusive OR immediate data nn and B reg. ||||||||||||||||||||||||||||||| 3 cycles ||| Function B ← B ∀ nn Mode Src: Immediate data Takes an exclusive OR of the 8-bit immediate Dst: Register direct data nn and the content of the B register and Example Set Value Result stores the result in the B register. SC BnnB Code MSB LSB NVCZ 11001110CEH 2CH41H6DH0––0 10111000B8H 7AHB6HCCH1––0

nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

XOR L, #nn ||||||||||||||||| Exclusive OR immediate data nn and L reg. ||||||||||||||||||||||||||||||| 3 cycles ||| Function L ← L ∀ nn Mode Src: Immediate data Takes an exclusive OR of the 8-bit immediate Dst: Register direct data nn and the content of the L register and stores the result in the L register. Example Set Value Result SC LnnL Code MSB LSB NVCZ 11001110CEH 2CH41H6DH0––0 10111001B9H 7AHB6HCCH1––0

nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

XOR H, #nn |||||||||||||||| Exclusive OR immediate data nn and H reg. ||||||||||||||||||||||||||||||| 3 cycles ||| Function H ← H ∀ nn Mode Src: Immediate data Takes an exclusive OR of the 8-bit immediate Dst: Register direct data nn and the content of the H register and Example Set Value Result stores the result in the H register. SC HnnH Code MSB LSB NVCZ 11001110CEH 2CH41H6DH0––0 10111010BAH 7AHB6HCCH1––0

nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

192 EPSON E0C88 CORE CPU MANUAL 4 INSTRUCTION SETS

XOR SC, #nn ||||||||||||| Exclusive OR immediate data nn and SC |||||||||||||||||||||||||||||||||||| 3 cycles ||| Function SC ← SC ∀ nn Mode Src: Immediate data Takes an exclusive OR of the 8-bit immediate Dst: Register direct data nn and the content of the system Example Set Value Result condition flag (SC) and sets the result in the SC system condition flag (SC). SC nn I1 I0 U D N V C Z Code MSB LSB 2CH41H01101101 100111109EH 7AHB6H11001100 nn nn

Flag I1 I0 U D N V C Z ↕↕↕↕↕↕↕↕

XOR [BR:ll], #nn |||| Exclusive OR immediate data nn and location [BR:ll] ||||||||||||||| 5 cycles |||

Function [BR:ll] ← [BR:ll] ∀ nn Flag I1 I0 U D N V C Z Takes an exclusive OR of the 8-bit immediate ––––↕ ––↕ data and the content of the data memory and stores the result in that address. The data Mode Src: Immediate data memory address has been specified by the Dst: 8-bit absolute content of the BR register (upper byte Example Set Value Result specification) and the 8-bit absolute address ll SC (lower byte specification). [BR:ll] nn [BR:ll] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 2CH41H6DH0––0 7AHB6HCCH1––0 Code MSB LSB 11011010DAH

ll ll

nn nn

XOR [HL], A ||||||||||||||| Exclusive OR A reg. and location [HL] ||||||||||||||||||||||||||||||||||||||| 4 cycles ||| Function [HL] ← [HL] ∀ A Mode Src: Register direct Takes an exclusive OR of the content of the Dst: Register indirect A register and the data memory that has been Example Set Value Result address specified by the HL register and SC stores the result in that address. [HL] A [HL] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 2CH41H6DH0––0 7AHB6HCCH1––0 Code MSB LSB 11001110CEH

001111003CH

Flag I1 I0 U D N V C Z ––––↕ ––↕

E0C88 CORE CPU MANUAL EPSON 193 4 INSTRUCTION SETS

XOR [HL], #nn ||||||||| Exclusive OR immediate data nn and location [HL] ||||||||||||||||||| 5 cycles ||| Function [HL] ← [HL] ∀ nn Mode Src: Immediate data Takes an exclusive OR of the 8-bit immediate Dst: Register indirect data nn and the data memory that has been Example Set Value Result address specified by the HL register and SC stores the result in that address. [HL] n n [HL] The content of the EP register becomes the NVCZ page address of the data memory (MODEL2/3). 2CH41H6DH0––0 7AHB6HCCH1––0 Code MSB LSB 11001110CEH

001111013DH

nn nn

Flag I1 I0 U D N V C Z ––––↕ ––↕

XOR [HL], [ir] |||||||||||| Exclusive OR location [ir reg.] and location [HL] ||||||||||||||||||||| 5 cycles ||| Function [HL] ← [HL] ∀ [ir] Mode Src: Register indirect Takes an exclusive OR of the content of the Dst: Register indirect data memory that has been address specified Example Set Value Result by the ir register (IX/IY) and the data SC memory that has been address specified by [HL] [ir] [HL] the HL register and stores the result in data NVCZ memory [HL]. 2CH41H6DH0––0 The content of the EP register becomes the 7AHB6HCCH1––0 page address of the data memory [HL] and the content of the XP register (at time of IX specification) or the YP register (at time of IY specification) becomes the page address of the data memory [ir] (MODEL2/3).

Code MSB LSB 11001110CEH

0011111ir3EH/3FH✽

✽ ir Mnemonic Code IX 0 XOR [HL], [IX] 3EH IY 1 XOR [HL], [IY] 3FH

Flag I1 I0 U D N V C Z ––––↕ ––↕

194 EPSON E0C88 CORE CPU MANUAL APPENDIX A OPERATION CODE MAP

APPENDIX A Operation Code Map Operation code map (1/3) ] ll CARS rr JRS rr CARL qqrr JRL qqrr JP HL DJR NZ,rr SWAP A SWAP [HL] RET RETE RETS CALL [hh INT [kk] JP [kk] Undefined Code NOP CARS C,rr CARS NC,rr CARS Z,rr CARS NZ,rr JRS C,rr JRS NC,rr JRS Z,rr JRS NZ,rr CARL C,qqrr CARL NC,qqrr CARL Z,qqrr CARL NZ,qqrr JRL C,qqrr JRL NC,qqrr JRL Z,qqrr JRL NZ,qqrr ],#nn ],#nn ],#nn ],#nn ],#nn ],#nn ll ll ll ll ll ll SUB BA,#mmnn SUB HL,#mmnn SUB IX,#mmnn SUB IY,#mmnn CP BA,#mmnn CP HL,#mmnn CP IX,#mmnn CP IY,#mmnn AND [BR: OR [BR: XOR [BR: CP [BR: BIT [BR: LD [BR: PACK UPCK ADD BA,#mmnn ADD HL,#mmnn ADD IX,#mmnn ADD IY,#mmnn LD BA,#mmnn LD HL,#mmnn LD IX,#mmnn LD IY,#mmnn EX BA,HL EX BA,IX EX BA,IY EX BA,SP EX A,B EX A,[HL] Expansion Code Expansion Code ] ] ] ] ll ll ll ll ],BA ],HL ],IX ],IY ll ll ll ll LD A,#nn LD B,#nn LD L,#nn LD H,#nn LD BR,#hh LD [HL],#nn LD [IX],#nn LD [IY],#nn LD BA,[hh LD HL,[hh LD IX,[hh LD IY,[hh LD [hh LD [hh LD [hh LD [hh PUSH BA PUSH HL PUSH IX PUSH IY PUSH BR PUSH EP PUSH IP PUSH SC POP BA POP HL POP IX POP IY POP BR POP EP POP IP POP SC INC BA INC HL INC IX INC IY BIT A,B BIT [HL],#nn BIT A,#nn BIT B,#nn DEC BA DEC HL DEC IX DEC IY AND SC,#nn OR SC,#nn XOR SC,#nn LD SC,#nn ] ll ] ll INC A INC B INC L INC H INC BR INC [BR: INC [HL] INC SP DEC A DEC B DEC L DEC H DEC BR DEC [ DEC [HL] DEC SP ] ll ],A ],B ],L ],H ],[HL] ],[IX] ],[IY] ll ll ll ll ll ll ll LD [IY],A LD [IY],B LD [IY],L LD [IY],H LD [IY],[BR: LD [IY],[HL] LD [IY],[IX] LD [IY],[IY] LD [BR: LD [BR: LD [BR: LD [BR: Undefined Code LD [BR: LD [BR: LD [BR: ] ] ll ll LD [IX],A LD [IX],B LD [IX],L LD [IX],H LD [IX],[BR: LD [IX],[HL] LD [IX],[IX] LD [IX],[IY] LD [HL],A LD [HL],B LD [HL],L LD [HL],H LD [HL],[BR: LD [HL],[HL] LD [HL],[IX] LD [HL],[IY] ] ] ll ll LD L,A LD L,B LD L,L LD L,H LD L,[BR: LD L,[HL] LD L,[IX] LD L,[IY] LD H,A LD H,B LD H,L LD H,H LD H,[BR: LD H,[HL] LD H,[IX] LD H,[IY] ] ] ll ll LD A,A LD A,B LD A,L LD A,H LD A,[BR: LD A,[HL] LD A,[IX] LD A,[IY] LD B,A LD B,B LD B,L LD B,H LD B,[BR: LD B,[HL] LD B,[IX] LD B,[IY] ] ] ] ] ll ll ll ll CP A,A CP A,B CP A,#nn CP A,[HL] CP A,[BR: CP A,[hh CP A,[IX] CP A,[IY] XOR A,A XOR A,B XOR A,#nn XOR A,[HL] XOR A,[BR: XOR A,[hh XOR A,[IX] XOR A,[IY] ] ] ] ] ll ll ll ll AND A,A AND A,B AND A,#nn AND A,[HL] AND A,[BR: AND A,[hh AND A,[IX] AND A,[IY] OR A,A OR A,B OR A,#nn OR A,[HL] OR A,[BR: OR A,[hh OR A,[IX] OR A,[IY] ] ] ] ] ll ll ll ll SUB A,A SUB A,B SUB A,#nn SUB A,[HL] SUB A,[BR: SUB A,[hh SUB A,[IX] SUB A,[IY] SBC A,A SBC A,B SBC A,#nn SBC A,[HL] SBC A,[BR: SBC A,[hh SBC A,[IX] SBC A,[IY] ] ] ] ] ll ll ll ll 0123456789ABCDEF ADD A,A ADD A,B ADD A,#nn ADD A,[HL] ADD A,[BR: ADD A,[hh ADD A,[IX] ADD A,[IY] ADC A,A ADC A,B ADC A,#nn ADC A,[HL] ADC A,[BR: ADC A,[hh ADC A,[IX] ADC A,[IY] H 0 1 2 3 4 5 6 7 8 9 F A B E C D 1st operation code L

E0C88 CORE CPU MANUAL EPSON 195 APPENDIX A OPERATION CODE MAP

Operation code map (2/3) CARS LT,rr CARS LE,rr CARS GT,rr CARS GE,rr CARS V,rr CARS NV,rr CARS P,rr CARS M,rr CARS F0,rr CARS F1,rr CARS F2,rr CARS F3,rr CARS NF0,rr CARS NF1,rr CARS NF2,rr CARS NF3,rr JRS LT,rr JRS LE,rr JRS GT,rr JRS GE,rr JRS V,rr JRS NV,rr JRS P,rr JRS M,rr JRS F0,rr JRS F1,rr JRS F2,rr JRS F3,rr JRS NF0,rr JRS NF1,rr JRS NF2,rr JRS NF3,rr ] ] ] ] ll ll ll ll ],A ],B ],L ],H ll ll ll ll Undefined Code Area LD [hh LD [hh LD [hh LD [hh MLT DIV LD L,[hh LD H,[hh LD B,[hh LD A,[hh LD A,BR LD A,SC LD BR,A LD SC,A LD NB,#bb LD EP,#pp LD XP,#pp LD YP,#pp LD A,NB LD A,EP LD A,XP LD A,YP LD NB,A LD EP,A LD XP,A LD YP,A AND B,#nn AND L,#nn AND H,#nn Undefined Code OR B,#nn OR L,#nn OR H,#nn Undefined Code XOR B,#nn XOR L,#nn XOR H,#nn CP B,#nn CP L,#nn CP H,#nn CP BR,#hh ] ] ll ll Undefined Code Area CPL A CPL B CPL [BR: CPL [HL] NEG A NEG B NEG [BR: NEG [HL] SEP HALT SLP ] ] ] ] ll ll ll ll RL A RL B RL [BR: RL [HL] RLC A RLC B RLC [BR: RLC [HL] RR A RR B RR [BR: RR [HL] RRC A RRC B RRC [BR: RRC [HL] ] ] ] ] ll ll ll ll SLA A SLA B SLA [BR: SLA [HL] SLL A SLL B SLL [BR: SLL [HL] SRA A SRA B SRA [BR: SRA [HL] SRL A SRL B SRL [BR: SRL [HL] LD [IY],[IX+dd] LD [IY],[IY+dd] LD [IY],[IX+L] LD [IY],[IY+L] Undefined Code Area Undefined Code Area LD [HL],[IX+dd] LD [HL],[IY+dd] LD [HL],[IX+L] LD [HL],[IY+L] LD [IX],[IX+dd] LD [IX],[IY+dd] LD [IX],[IX+L] LD [IX],[IY+L] LD L,[IX+dd] LD L,[IY+dd] LD L,[IX+L] LD L,[IY+L] LD [IX+dd],L LD [IY+dd],L LD [IX+L],L LD [IY+L],L LD H,[IX+dd] LD H,[IY+dd] LD H,[IX+L] LD H,[IY+L] LD [IX+dd],H LD [IY+dd],H LD [IX+L],H LD [IY+L],H LD A,[IX+dd] LD A,[IY+dd] LD A,[IX+L] LD A,[IY+L] LD [IX+dd],A LD [IY+dd],A LD [IX+L],A LD [IY+L],A LD B,[IX+dd] LD B,[IY+dd] LD B,[IX+L] LD B,[IY+L] LD [IX+dd],B LD [IY+dd],B LD [IX+L],B LD [IY+L],B CP A,[IX+dd] CP A,[IY+dd] CP A,[IX+L] CP A,[IY+L] CP [HL],A CP [HL],#nn CP [HL],[IX] CP [HL],[IY] XOR A,[IX+dd] XOR A,[IY+dd] XOR A,[IX+L] XOR A,[IY+L] XOR [HL],A XOR [HL],#nn XOR [HL],[IX] XOR [HL],[IY] AND A,[IX+dd] AND A,[IY+dd] AND A,[IX+L] AND A,[IY+L] AND [HL],A AND [HL],#nn AND [HL],[IX] AND [HL],[IY] OR A,[IX+dd] OR A,[IY+dd] OR A,[IX+L] OR A,[IY+L] OR [HL],A OR [HL],#nn OR [HL],[IX] OR [HL],[IY] SUB A,[IX+dd] SUB A,[IY+dd] SUB A,[IX+L] SUB A,[IY+L] SUB [HL],A SUB [HL],#nn SUB [HL],[IX] SUB [HL],[IY] SBC A,[IX+dd] SBC A,[IY+dd] SBC A,[IX+L] SBC A,[IY+L] SBC [HL],A SBC [HL],#nn SBC [HL],[IX] SBC [HL],[IY] 0123456789ABCDEF ADD A,[IX+dd] ADD A,[IY+dd] ADD A,[IX+L] ADD A,[IY+L] ADD [HL],A ADD [HL],#nn ADD [HL],[IX] ADD [HL],[IY] ADC A,[IX+dd] ADC A,[IY+dd] ADC A,[IX+L] ADC A,[IY+L] ADC [HL],A ADC [HL],#nn ADC [HL],[IX] ADC [HL],[IY] H 0 1 2 3 4 5 6 7 8 9 F A B E C D 2nd operation code (1st = CE) L

196 EPSON E0C88 CORE CPU MANUAL APPENDIX A OPERATION CODE MAP

Operation code map (3/3) LD SP,BA LD SP,HL LD SP,IX LD SP,IY LD HL,SP LD HL,PC Undefined Code Area LD BA,SP LD BA,PC LD IX,SP Undefined Code Area LD IY,SP Undefined Code LD BA,BA LD BA,HL LD BA,IX LD BA,IY LD HL,BA LD HL,HL LD HL,IX LD HL,IY LD IX,BA LD IX,HL LD IX,IX LD IX,IY LD IY,BA LD IY,HL LD IY,IX LD IY,IY LD BA,[IX] LD HL,[IX] LD IX,[IX] LD IY,[IX] LD [IX],BA LD [IX],HL LD [IX],IX LD [IX],IY LD BA,[IY] LD HL,[IY] LD IX,[IY] LD IY,[IY] LD [IY],BA LD [IY],HL LD [IY],IX LD [IY],IY LD BA,[HL] LD HL,[HL] LD IX,[HL] LD IY,[HL] LD [HL],BA LD [HL],HL LD [HL],IX LD [HL],IY PUSH A PUSH B PUSH L PUSH H POP A POP B POP L POP H PUSH ALL PUSH ALE POP ALL POP ALE Undefined Code Area ] ll ],SP ll LD [hh LD BA,[SP+dd] LD HL,[SP+dd] LD IX,[SP+dd] LD IY,[SP+dd] LD [SP+dd],BA LD [SP+dd],HL LD [SP+dd],IX LD [SP+dd],IY LD SP,[hh ADC BA,#mmnn ADC HL,#mmnn SBC BA,#mmnn SBC HL,#mmnn ADD SP,#mmnn SUB SP,#mmnn CP SP,#mmnn LD SP,#mmnn CP SP,BA CP SP,HL Undefined Code Area ADD IX,BA ADD IX,HL ADD IY,BA ADD IY,HL ADD SP,BA ADD SP,HL SUB IX,BA SUB IX,HL SUB IY,BA SUB IY,HL SUB SP,BA SUB SP,HL CP HL,BA CP HL,HL CP HL,IX CP HL,IY ADD HL,BA ADD HL,HL ADD HL,IX ADD HL,IY ADC HL,BA ADC HL,HL ADC HL,IX ADC HL,IY SUB HL,BA SUB HL,HL SUB HL,IX SUB HL,IY SBC HL,BA SBC HL,HL SBC HL,IX SBC HL,IY Undefined Code Area Undefined Code Area CP BA,BA CP BA,HL CP BA,IX CP BA,IY 0123456789ABCDEF ADD BA,BA ADD BA,HL ADD BA,IX ADD BA,IY ADC BA,BA ADC BA,HL ADC BA,IX ADC BA,IY SUB BA,BA SUB BA,HL SUB BA,IX SUB BA,IY SBC BA,BA SBC BA,HL SBC BA,IX SBC BA,IY H 0 1 2 3 4 5 6 7 8 9 F A B E C D 2nd operation code (1st = CF) L

E0C88 CORE CPU MANUAL EPSON 197 APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

APPENDIX B Instruction List by Addressing Mode Instruction list by addressing mode (1/12) 4 4 4 4 4 4 Cycle 3 3 3 3 3 3 ] ] ] ] ] ] ll ll ll ll ll ll Operand Byte A,[hh A,[hh A,[hh A,[hh A,[hh A,[hh 3 3 3 3 3 3 Cycle 2 2 2 2 2 2 ] ] ] ] ] ] ll ll ll ll ll ll 8-bit Absolute 16-bit Absolute Operand Byte A,[BR: A,[BR: A,[BR: A,[BR: A,[BR: A,[BR: 4 4 4 4 4 4 4 4 4 4 4 4 Cycle 2 2 2 2 2 2 2 2 2 2 2 2 Register Indirect with Index Register Operand Byte A,[IX+L] A,[IY+L] A,[IX+L] A,[IY+L] A,[IX+L] A,[IY+L] A,[IX+L] A,[IY+L] A,[IX+L] A,[IY+L] A,[IX+L] A,[IY+L] 4 4 4 4 4 4 4 4 4 4 4 4 Cycle 3 3 3 3 3 3 3 3 3 3 3 3 Register Indirect with Displacement Operand Byte A,[IX+dd] A,[IY+dd] A,[IX+dd] A,[IY+dd] A,[IX+dd] A,[IY+dd] A,[IX+dd] A,[IY+dd] A,[IX+dd] A,[IY+dd] A,[IX+dd] A,[IY+dd] 2 2 2 5 5 2 2 2 5 5 2 2 2 5 5 2 2 2 5 5 2 2 2 5 5 2 2 2 5 5 Cycle 1 1 1 2 2 1 1 1 2 2 1 1 1 2 2 1 1 1 2 2 1 1 1 2 2 1 1 1 2 2 Operand Byte A,[HL] A,[IX] A,[IY] [HL],[IX] [HL],[IY] A,[HL] A,[IX] A,[IY] [HL],[IX] [HL],[IY] A,[HL] A,[IX] A,[IY] [HL],[IX] [HL],[IY] A,[HL] A,[IX] A,[IY] [HL],[IX] [HL],[IY] A,[HL] A,[IX] A,[IY] [HL],[IX] [HL],[IY] A,[HL] A,[IX] A,[IY] [HL],[IX] [HL],[IY] 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 Cycle 1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 Register Direct Register Indirect Operand Byte A,A A,B [HL],A A,A A,B [HL],A A,A A,B [HL],A A,A A,B [HL],A A,A A,B [HL],A A,A A,B [HL],A 2 5 2 5 2 5 2 5 2 2 2 2 2 5 5 2 3 3 3 3 5 5 Cycle 2 3 2 3 2 3 2 3 2 3 3 3 2 3 3 2 3 3 3 2 3 3 Immediate ],#nn ],#nn ll ll Operand A,#nn [HL],#nn A,#nn [HL],#nn A,#nn [HL],#nn A,#nn [HL],#nn A,#nn B,#nn L,#nn H,#nn SC,#nn [BR: [HL],#nn A,#nn B,#nn L,#nn H,#nn SC,#nn [BR: [HL],#nn ADD ADC SUB SBC AND OR Mnemonic Byte 8-bit Arithmetic and Logic Operation

198 EPSON E0C88 CORE CPU MANUAL APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

Instruction list by addressing mode (2/12) 4 4 Cycle 3 3 ] ] ll ll Operand Byte A,[hh A,[hh 3 3 4 4 5 5 Cycle 2 2 2 2 3 3 ] ] ll ll ] ] ] ] ll ll ll ll 8-bit Absolute 16-bit Absolute Operand Byte A,[BR: A,[BR: [BR: [BR: [BR: [BR: 4 4 4 4 Cycle 2 2 2 2 Register Indirect with Index Register Operand Byte A,[IX+L] A,[IY+L] A,[IX+L] A,[IY+L] 4 4 4 4 Cycle 3 3 3 3 Register Indirect with Displacement Operand Byte A,[IX+dd] A,[IY+dd] A,[IX+dd] A,[IY+dd] 2 2 2 5 5 2 2 2 4 4 3 3 4 4 Cycle 1 1 1 2 2 1 1 1 2 2 1 1 2 2 Operand Byte A,[HL] A,[IX] A,[IY] [HL],[IX] [HL],[IY] A,[HL] A,[IX] A,[IY] [HL],[IX] [HL],[IY] [HL] [HL] [HL] [HL] 2 2 4 2 2 3 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 Cycle 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 Register Direct Register Indirect Operand Byte A,A A,B [HL],A A,A A,B [HL],A A,B A B L H BR A B L H BR A B A B 2 3 3 3 3 5 5 2 3 3 3 3 4 4 2 2 4 3 Cycle 2 3 3 3 2 3 3 2 3 3 3 3 3 3 2 2 3 2 Immediate ],#nn ],#nn ],#nn ll ll ll Operand A,#nn B,#nn L,#nn H,#nn SC,#nn [BR: [HL],#nn A,#nn B,#nn L,#nn H,#nn BR,#nn [BR: [HL],nn A,#nn B,#nn [BR: [HL],#nn XOR CP BIT INC DEC CPL NEG Mnemonic Byte 8-bit Arithmetic and Logic Operation

E0C88 CORE CPU MANUAL EPSON 199 APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

Instruction list by addressing mode (3/12) 5 5 5 5 Cycle 4 4 4 4 ] ] ] ] ll ll ll ll Operand Byte A,[hh B,[hh L,[hh H,[hh 3 3 3 3 Cycle 2 2 2 2 ] ] ] ] ll ll ll ll 8-bit Absolute 16-bit Absolute Operand Byte A,[BR: B,[BR: L,[BR: H,[BR: 4 4 4 4 4 4 4 4 Cycle 2 2 2 2 2 2 2 2 Register Indirect with Index Register Operand Byte A,[IX+L] A,[IY+L] B,[IX+L] B,[IY+L] L,[IX+L] L,[IY+L] H,[IX+L] H,[IY+L] 4 4 4 4 4 4 4 4 Cycle 3 3 3 3 3 3 3 3 Register Indirect with Displacement Operand Byte A,[IX+dd] A,[IY+dd] B,[IX+dd] B,[IY+dd] L,[IX+dd] L,[IY+dd] H,[IX+dd] H,[IY+dd] 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 Cycle 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 ],[HL] ],[IX] ],[IY] ll ll ll Operand Byte A,[HL] A,[IX] A,[IY] B,[HL] B,[IX] B,[IY] L,[HL] L,[IX] L,[IY] H,[HL] H,[IX] H,[IY] [BR: [BR: [BR: 1 1 1 1 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 2 3 3 3 3 3 5 5 5 5 Cycle 1 1 1 1 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 4 4 4 4 ],A ],B ],L ],H ],A ],B ],L ],H ll ll ll ll Register Direct Register Indirect ll ll ll ll Operand Byte A,A A,B A,L A,H A,BR A,SC A,NB A,EP A,XP A,YP B,A B,B B,L B,H L,A L,B L,L L,H H,A H,B H,L H,H BR,A SC,A [BR: [BR: [BR: [BR: [hh [hh [hh [hh 2 2 2 2 2 3 4 Cycle 2 2 2 2 2 2 3 Immediate ],#nn ll Operand A,#nn B,#nn L,#nn H,#nn BR,#hh SC,#nn [BR: LD Mnemonic Byte 8-bit Transfer

200 EPSON E0C88 CORE CPU MANUAL APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

Instruction list by addressing mode (4/12) Cycle Operand Byte 4 4 4 Cycle 2 2 2 ] ] ] ll ll ll 8-bit Absolute 16-bit Absolute Operand Byte [HL],[BR: [IY],[BR: [IX],[BR: 5 5 5 5 5 5 Cycle 2 2 2 2 2 2 Register Indirect with Index Register Operand Byte [HL],[IX+L] [HL],[IY+L] [IX],[IX+L] [IX],[IY+L] [IY],[IX+L] [IY],[IY+L] 5 5 5 5 5 5 Cycle 3 3 3 3 3 3 Register Indirect with Displacement Operand Byte [HL],[IX+dd] [HL],[IY+dd] [IX],[IX+dd] [IX],[IY+dd] [IY],[IX+dd] [IY],[IY+dd] 3 3 3 3 3 3 3 3 3 3 3 Cycle 1 1 1 1 1 1 1 1 1 1 1 Operand Byte [HL],[HL] [HL],[IX] [HL],[IY] [IX],{HL] [IX],[IX] [IX],[IY] [IY],[HL] [IY],[IX] [IY],[IY] A,[HL] [HL] 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 2 2 2 2 2 Cycle 1 1 1 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 1 1 Register Direct Register Indirect Operand Byte [HL],A [HL],B [HL],L [HL],H [IX],A [IX],B [IX],L [IX],H [IY],A [IY],B [IY],L [IY],H [IX+dd],A [IX+dd],B [IX+dd],L [IX+dd],H [IY+dd],A [IY+dd],B [IY+dd],L [IY+dd],H [IX+L],A [IX+L],B [IX+L],L [IX+L],H [IY+L],A [IY+L],B [IY+L],L [IY+L],H NB,A EP,A XP,A YP,A A,B A 3 3 3 4 3 3 3 Cycle 2 2 2 3 3 3 3 Immediate Operand [HL],#nn [IX],#nn [IY],#nn NB,#bb EP,#pp XP,#pp YP,#pp LD EX SWAP Mnemonic Byte 8-bit Transfer

E0C88 CORE CPU MANUAL EPSON 201 APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

Instruction list by addressing mode (5/12) Cycle Operand Byte 5 5 5 5 5 5 5 5 Cycle 3 3 3 3 3 3 3 3 ] ] ] ] ] ] ] ] ll ll ll ll ll ll ll ll 8-bit Absolute 16-bit Absolute Operand Byte [BR: [BR: [BR: [BR: [BR: [BR: [BR: [BR: Cycle Register Indirect with Index Register Operand Byte Cycle Register Indirect with Displacement Operand Byte 4 4 4 4 4 4 4 4 Cycle 2 2 2 2 2 2 2 2 Operand Byte [HL] [HL] [HL] [HL] [HL] [HL] [HL] [HL] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 Cycle 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 Register Direct Register Indirect Operand Byte A B A B A B A B A B A B A B A B Cycle Immediate Operand RL RLC RR RRC SLA SLL SRA SRL Mnemonic Byte Rotate/Shift

202 EPSON E0C88 CORE CPU MANUAL APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

Instruction list by addressing mode (6/12) Cycle Operand Byte Cycle 8-bit Absolute 16-bit Absolute Operand Byte Cycle Register Indirect with Index Register Operand Byte Cycle Register Indirect with Displacement Operand Byte Cycle Operand Byte 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 Cycle 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 Register Direct Register Indirect Operand Byte BA,BA BA,HL BA,IX BA,IY HL,BA HL,HL HL,IX HL,IY IX,BA IX,HL IY,BA IY,HL SP,BA SP,HL BA,BA BA,HL BA,IX BA,IY HL,BA HL,HL HL,IX HL,IY BA,BA BA,HL BA,IX BA,IY HL,BA HL,HL HL,IX HL,IY IX,BA IX,HL IY,BA IY,HL SP,BA SP,HL 3 3 3 3 4 4 4 3 3 3 3 4 Cycle 3 3 3 3 4 4 4 3 3 3 3 4 Immediate Operand BA,#mmnn HL,#mmnn IX,#mmnn IY,#mmnn SP,#mmnn BA,#mmnn HL,#mmnn BA,#mmnn HL,#mmnn IX,#mmnn IY,#mmnn SP,#mmnn ADD ADC SUB Mnemonic Byte 16-bit Arithmetic Operation

E0C88 CORE CPU MANUAL EPSON 203 APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

Instruction list by addressing mode (7/12) Cycle Operand Byte Cycle 8-bit Absolute 16-bit Absolute Operand Byte Cycle Register Indirect with Index Register Operand Byte Cycle Register Indirect with Displacement Operand Byte Cycle Operand Byte 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2 2 2 2 2 2 2 2 2 2 Cycle 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 Register Direct Register Indirect Operand Byte BA,BA BA,HL BA,IX BA,IY HL,BA HL,HL HL,IX HL,IY BA,BA BA,HL BA,IX BA,IY HL,BA HL,HL HL,IX HL,IY SP,BA SP,HL BA HL IX IY SP BA HL IX IY SP 4 4 3 3 3 3 4 Cycle 4 4 3 3 3 3 4 Immediate Operand BA,#mmnn HL,#mmnn BA,#mmnn HL,#mmnn IX,#mmnn IY,#mmnn SP,#mmnn SBC CP INC DEC Mnemonic Byte 16-bit Arithmetic Operation

204 EPSON E0C88 CORE CPU MANUAL APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

Instruction list by addressing mode (8/12) 5 5 5 5 6 Cycle 3 3 3 3 4 ] ] ] ] ] ll ll ll ll ll Operand Byte SP,[hh IY,[hh BA,[hh HL,[hh IX,[hh Cycle 8-bit Absolute 16-bit Absolute Operand Byte Cycle Register Indirect with Index Register Operand Byte 6 6 6 6 Cycle 3 3 3 3 Register Indirect with Displacement Operand Byte BA,[SP+dd] HL,[SP+dd] IX,[SP+dd] IY,[SP+dd] 5 5 5 5 5 5 5 5 5 5 5 5 Cycle 2 2 2 2 2 2 2 2 2 2 2 2 Operand Byte BA,[HL] BA,[IX] BA,[IY] HL,[HL] HL,[IX] HL,[IY] IX,[HL] IX,[IX] IX,[IY] IY,[HL] IY,[IX] IY,[IY] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 5 5 5 5 6 Cycle 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 4 ],BA ],HL ],IX ],IY ],SP Register Direct Register Indirect ll ll ll ll ll Operand Byte BA,BA BA,HL BA,IX BA,IY BA,SP BA,PC HL,BA HL,HL HL,IX HL,IY HL,SP HL,PC IX,BA IX,HL IX,IX IX,IY IX,SP IY,BA IY,HL IY,IX IY,IY IY,SP SP,BA SP,HL SP,IX SP,IY [hh [hh [hh [hh [hh 3 3 3 3 4 Cycle 3 3 3 3 4 Immediate Operand BA,#mmnn HL,#mmnn IX,#mmnn IY,#mmnn SP,#mmnn LD Mnemonic Byte 16-bit Transfer

E0C88 CORE CPU MANUAL EPSON 205 APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

Instruction list by addressing mode (9/12) Cycle Operand Byte Cycle 8-bit Absolute 16-bit Absolute Operand Byte Cycle Register Indirect with Index Register Operand Byte Cycle Register Indirect with Displacement Operand Byte Cycle Operand Byte 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 3 3 3 3 Cycle 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 1 1 1 1 Register Direct Register Indirect Operand Byte [HL],BA [HL],HL [HL],IX [HL],IY [IX],BA [IX],HL [IX],IX [IX],IY [IY],BA [IY],HL [IY],IX [IY],IY [SP+dd],BA [SP+dd],HL [SP+dd],IX [SP+dd],IY BA,HL BA,IX BA,IY BA,SP Cycle Immediate Operand LD EX Mnemonic Byte 16-bit Transfer

206 EPSON E0C88 CORE CPU MANUAL APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

Instruction list by addressing mode (10/12) Cycle Operand Byte Cycle 12 Register Direct Others Operand Byte HL 3 3 3 3 3 Cycle 3 3 3 3 3 PC Relative Sined 16-bit Operand Byte qqrr C,qqrr NC,qqrr Z,qqrr NZ,qqrr 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 Cycle 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 Sined 8-bit PC Relative Operand Byte rr C,rr NC,rr Z,rr NZ,rr LT,rr LE,rr GT,rr GE,rr V,rr NV,rr P,rr M,rr F0,rr F1,rr F2,rr F3,rr NF0,rr NF1,rr NF2,rr NF3,rr NZ,rr Cycle 16-bit Indirect Operand Byte Cycle 24 8-bit Indirect Operand [kk] JRS JRL JP DJR Mnemonic Byte Branch

E0C88 CORE CPU MANUAL EPSON 207 APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

Instruction list by addressing mode (11/12) 4 5 6 Max. 3 4 5 Min. 2 1 1 Operand Byte Ð 3 3 3 3 Skip 6 6 6 6 6 Max. 5 5 5 5 5 Min. 3 3 3 3 3 Operand Byte qqrr C,qqrr NC,qqrr Z,qqrr NZ,qqrr Ð 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 Skip 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 Cycle (Min.: Minimum mode, Max.: Maximum Skip: Not branched) Max. 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 Min. 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 Operand Byte rr C,rr NC,rr Z,rr NZ,rr LT,rr LE,rr GT,rr GE,rr V,rr NV,rr P,rr M,rr F0,rr F1,rr F2,rr F3,rr NF0,rr NF1,rr NF2,rr NF3,rr 8 Max. Min. 37 16-bit Indirect Sined 8-bit PC Relative Sined 16-bit PC Relative Others ] ll Operand Byte [hh 8 Max. Cycle Cycle Cycle Cycle Cycle Min. 27 8-bit Indirect Operand [kk] CARS CARL CALL RET RETE RETS INT Mnemonic Byte Branch

208 EPSON E0C88 CORE CPU MANUAL APPENDIX B INSTRUCTION LIST BY ADDRESSING MODE

Instruction list by addressing mode (12/12) 2 2 3 2 3 3 12 13 Cycle Cycle Cycle 2 2 1 1 2 1 2 2 Implide Implide Operand Operand Operand MLT DIV PACK UPCK SEP NOP HALT SLP Mnemonic Byte Mnemonic Byte Mnemonic Byte Multiplication and Division Auxiliary Operation System Control 11 14 12 15 Cycle 2 2 2 2 Implide Operand Byte ALL ALE ALL ALE 3 3 3 3 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 Cycle 2 2 2 2 1 1 1 1 1 1 1 1 2 2 2 2 1 1 1 1 1 1 1 1 Register Direct Operand A B L H BR SC EP IP BA HL IX IY A B L H BR SC EP IP BA HL IX IY POP PUSH Mnemonic Byte Stack Control

E0C88 CORE CPU MANUAL EPSON 209 APPENDIX C INSTRUCTION INDEX

APPENDIX C Instruction Index

ADC: 8-bit Addition with Carry ADD: 16-bit Addition ADC A, A ...... 60 ADD BA, BA ...... 71 ADC A, B ...... 60 ADD BA, HL ...... 71 ADC A, #nn ...... 60 ADD BA, IX ...... 71 ADC A, [BR:ll] ...... 60 ADD BA, IY ...... 71 ADC A, [hhll] ...... 61 ADD BA, #mmnn ...... 72 ADC A, [HL] ...... 61 ADD HL, BA ...... 72 ADC A, [IX] ...... 62 ADD HL, HL ...... 72 ADC A, [IX+dd] ...... 62 ADD HL, IX ...... 72 ADC A, [IX+L] ...... 63 ADD HL, IY ...... 72 ADC A, [IY] ...... 62 ADD HL, #mmnn ...... 72 ADC A, [IY+dd] ...... 62 ADD IX, BA ...... 73 ADC A, [IY+L] ...... 63 ADD IX, HL ...... 73 ADC [HL], A ...... 63 ADD IX, #mmnn ...... 73 ADC [HL], #nn ...... 64 ADD IY, BA ...... 73 ADC [HL], [IX] ...... 64 ADD IY, HL ...... 73 ADC [HL], [IY] ...... 64 ADD IY, #mmnn ...... 74 ADD SP, BA ...... 74 ADC: 16-bit Addition with Carry ADD SP, HL ...... 74 ADC BA, BA ...... 65 ADD SP, #mmnn ...... 74 ADC BA, HL ...... 65 ADC BA, IX ...... 65 AND: Logical Product ADC BA, IY ...... 65 AND A, A ...... 75 ADC BA, #mmnn ...... 65 AND A, B ...... 75 ADC HL, BA ...... 66 AND A, #nn ...... 75 ADC HL, HL ...... 66 AND A, [BR:ll] ...... 75 ADC HL, IX ...... 66 AND A, [hhll] ...... 76 ADC HL, IY ...... 66 AND A, [HL] ...... 76 ADC HL, #mmnn ...... 66 AND A, [IX] ...... 76 AND A, [IX+dd] ...... 77 ADD: 8-bit Addition AND A, [IX+L] ...... 77 ADD A, A ...... 67 AND A, [IY] ...... 76 ADD A, B ...... 67 AND A, [IY+dd] ...... 77 ADD A, #nn ...... 67 AND A, [IY+L] ...... 77 ADD A, [BR:ll] ...... 67 AND B, #nn ...... 78 ADD A, [hhll] ...... 68 AND H, #nn ...... 78 ADD A, [HL] ...... 68 AND L, #nn ...... 78 ADD A, [IX] ...... 68 AND SC, #nn ...... 79 ADD A, [IX+dd] ...... 69 AND [BR:ll], #nn...... 79 ADD A, [IX+L] ...... 69 AND [HL], A ...... 79 ADD A, [IY] ...... 68 AND [HL], #nn ...... 80 ADD A, [IY+dd] ...... 69 AND [HL], [IX] ...... 80 ADD A, [IY+L] ...... 69 AND [HL], [IY] ...... 80 ADD [HL], A ...... 70 ADD [HL], #nn ...... 70 BIT: Bit Test ADD [HL], [IX] ...... 71 BIT A, B ...... 81 ADD [HL], [IY] ...... 71 BIT A, #nn ...... 81

210 EPSON E0C88 CORE CPU MANUAL APPENDIX C INSTRUCTION INDEX

BIT: Bit Test CP: 8-bit Comparison BIT B, #nn ...... 81 CP B, #nn ...... 93 BIT [BR:ll], #nn...... 82 CP BR, #hh...... 94 BIT [HL], #nn ...... 82 CP H, #nn ...... 94 CP L, #nn ...... 94 CALL: Indirect Call CP [BR:ll], #nn...... 95 CALL [hhll] ...... 83 CP [HL], A ...... 95 CARL: Relative Call (long) CP [HL], #nn ...... 96 CP [HL], [IX] ...... 96 CARL C, qqrr...... 85 CP [HL], [IY] ...... 96 CARL NC, qqrr ...... 85 CARL NZ, qqrr ...... 85 CP: 16-bit Comparison CARL qqrr ...... 84 CP BA, BA ...... 97 CARL Z, qqrr ...... 85 CP BA, HL ...... 97 CARS: Relative Call (short) CP BA, IX ...... 97 CP BA, IY ...... 97 CARS C, rr...... 87 CP BA, #mmnn ...... 97 CARS F0, rr ...... 88 CP HL, BA ...... 98 CARS F1, rr ...... 88 CP HL, HL ...... 98 CARS F2, rr ...... 88 CP HL, IX ...... 98 CARS F3, rr ...... 88 CP HL, IY ...... 98 CARS GE, rr ...... 88 CP HL, #mmnn ...... 98 CARS GT, rr ...... 88 CP IX, #mmnn ...... 99 CARS LE, rr ...... 88 CP IY, #mmnn ...... 99 CARS LT, rr ...... 88 CP SP, BA ...... 100 CARS M, rr ...... 88 CP SP, HL ...... 100 CARS NC, rr ...... 87 CP SP, #mmnn ...... 100 CARS NF0, rr ...... 88 CARS NF1, rr ...... 88 CPL: Complement of 1 CARS NF2, rr ...... 88 CPL A ...... 101 CARS NF3, rr ...... 88 CPL B ...... 101 CARS NV, rr ...... 88 CPL [BR:ll]...... 101 CARS NZ, rr ...... 87 CPL [HL] ...... 101 CARS P, rr ...... 88 CARS rr ...... 86 DEC: 8-bit Decrement (-1) CARS V, rr ...... 88 DEC A ...... 102 CARS Z, rr ...... 87 DEC B ...... 102 DEC BR...... 102 CP: 8-bit Comparison DEC H ...... 102 CP A, A ...... 90 DEC L ...... 102 CP A, B ...... 90 DEC [BR:ll]...... 102 CP A, #nn ...... 90 DEC [HL] ...... 103 CP A, [BR:ll] ...... 90 CP A, [hhll] ...... 91 DEC: 16-bit Decrement (-1) CP A, [HL] ...... 91 DEC BA ...... 103 CP A, [IX] ...... 92 DEC HL...... 103 CP A, [IX+dd] ...... 92 DEC IX ...... 103 CP A, [IX+L] ...... 93 DEC IY ...... 103 CP A, [IY] ...... 92 DEC SP ...... 103 CP A, [IY+dd] ...... 92 CP A, [IY+L] ...... 93 DIV: Division DIV ...... 104

E0C88 CORE CPU MANUAL EPSON 211 APPENDIX C INSTRUCTION INDEX

DJR: Relative Jump with B Register Decrement JRS: Relative Jump (short) DJR NZ, rr ...... 104 JRS GE, rr ...... 113 JRS GT, rr ...... 113 EX: 8-bit Data Exchange JRS LE, rr ...... 113 EX A, B ...... 105 JRS LT, rr ...... 113 EX A, [HL] ...... 105 JRS M, rr ...... 113 EX: 16-bit Data Exchange JRS NC, rr ...... 113 JRS NF0, rr ...... 113 EX BA, HL ...... 105 JRS NF1, rr ...... 113 EX BA, IX ...... 105 JRS NF2, rr ...... 113 EX BA, IY ...... 105 JRS NF3, rr ...... 113 EX BA, SP ...... 105 JRS NV, rr ...... 113 HALT: HALT mode JRS NZ, rr ...... 113 JRS P, rr ...... 113 HALT ...... 106 JRS rr ...... 112 INC: 8-bit Increment (+1) JRS V, rr ...... 113 JRS Z, rr ...... 113 INC A ...... 106 INC B ...... 106 LD: 8-bit Load INC BR...... 106 LD A, A ...... 115 INC H ...... 106 LD A, B ...... 115 INC L ...... 106 LD A, BR ...... 115 INC [BR:ll]...... 107 LD A, EP ...... 116 INC [HL] ...... 107 LD A, H ...... 115 INC: 16-bit Increment (+1) LD A, L...... 115 LD A, NB ...... 116 INC BA ...... 107 LD A, SC ...... 115 INC HL...... 107 LD A, XP ...... 116 INC IX ...... 107 LD A, YP ...... 116 INC IY ...... 107 LD A, #nn ...... 122 INC SP ...... 108 LD A, [BR:ll] ...... 125 INT: Software Interrupt LD A, [hhll] ...... 127 LD A, [HL] ...... 127 INT [kk] ...... 108 LD A, [IX] ...... 129 JP: Indirect Jump LD A, [IX+dd] ...... 132 JP HL...... 109 LD A, [IX+L] ...... 135 JP [kk] ...... 109 LD A, [IY] ...... 130 LD A, [IY+dd] ...... 133 JRL: Relative Jump (long) LD A, [IY+L] ...... 136 JRL C, qqrr...... 111 LD B, A ...... 115 JRL NC, qqrr ...... 111 LD B, B...... 115 JRL NZ, qqrr ...... 111 LD B, H ...... 115 JRL qqrr ...... 110 LD B, L ...... 115 JRL Z, qqrr ...... 111 LD B, #nn ...... 122 LD B, [BR:ll] ...... 125 JRS: Relative Jump (short) LD B, [hhll] ...... 127 JRS C, rr...... 113 LD B, [HL] ...... 127 JRS F0, rr ...... 113 LD B, [IX] ...... 129 JRS F1, rr ...... 113 LD B, [IX+dd] ...... 132 JRS F2, rr ...... 113 LD B, [IX+L] ...... 135 JRS F3, rr ...... 113 LD B, [IY] ...... 130

212 EPSON E0C88 CORE CPU MANUAL APPENDIX C INSTRUCTION INDEX

LD: 8-bit Load LD: 8-bit Load LD B, [IY+dd] ...... 133 LD [hhll], A ...... 118 LD B, [IY+L] ...... 136 LD [hhll], B ...... 118 LD BR, A ...... 116 LD [hhll], H ...... 118 LD BR, #hh...... 122 LD [hhll], L...... 118 LD EP, A ...... 117 LD [HL], A ...... 118 LD EP, #pp ...... 123 LD [HL], B ...... 118 LD H, A ...... 115 LD [HL], H ...... 118 LD H, B ...... 115 LD [HL], L ...... 118 LD H, H ...... 115 LD [HL], #nn ...... 124 LD H, L...... 115 LD [HL], [BR:ll]...... 126 LD H, #nn ...... 122 LD [HL], [HL] ...... 128 LD H, [BR:ll] ...... 125 LD [HL], [IX] ...... 129 LD H, [hhll] ...... 127 LD [HL], [IX+dd] ...... 132 LD H, [HL] ...... 127 LD [HL], [IX+L] ...... 135 LD H, [IX] ...... 129 LD [HL], [IY] ...... 131 LD H, [IX+dd] ...... 132 LD [HL], [IY+dd] ...... 134 LD H, [IX+L] ...... 135 LD [HL], [IY+L] ...... 137 LD H, [IY] ...... 130 LD [IX], A ...... 119 LD H, [IY+dd] ...... 133 LD [IX], B ...... 119 LD H, [IY+L] ...... 136 LD [IX], H ...... 119 LD L, A...... 115 LD [IX], L...... 119 LD L, B ...... 115 LD [IX], #nn ...... 125 LD L, H...... 115 LD [IX], [BR:ll] ...... 126 LD L, L ...... 115 LD [IX], [HL] ...... 128 LD L, #nn ...... 122 LD [IX], [IX] ...... 130 LD L, [BR:ll] ...... 125 LD [IX], [IX+dd] ...... 133 LD L, [hhll]...... 127 LD [IX], [IX+L] ...... 136 LD L, [HL] ...... 127 LD [IX], [IY] ...... 131 LD L, [IX]...... 129 LD [IX], [IY+dd] ...... 134 LD L, [IX+dd] ...... 132 LD [IX], [IY+L] ...... 137 LD L, [IX+L] ...... 135 LD [IX+dd], A ...... 120 LD L, [IY]...... 130 LD [IX+dd], B ...... 120 LD L, [IY+dd] ...... 133 LD [IX+dd], H ...... 120 LD L, [IY+L] ...... 136 LD [IX+dd], L ...... 120 LD NB, A ...... 117 LD [IX+L], A ...... 121 LD NB, #bb ...... 123 LD [IX+L], B ...... 121 LD SC, A ...... 116 LD [IX+L], H ...... 121 LD SC, #nn ...... 122 LD [IX+L], L ...... 121 LD XP, A ...... 117 LD [IY], A ...... 119 LD XP, #pp ...... 123 LD [IY], B ...... 119 LD YP, A ...... 117 LD [IY], H ...... 119 LD YP, #pp ...... 124 LD [IY], L...... 119 LD [BR:ll], A ...... 117 LD [IY], #nn ...... 125 LD [BR:ll], B ...... 117 LD [IY], [BR:ll] ...... 126 LD [BR:ll], H ...... 117 LD [IY], [HL] ...... 128 LD [BR:ll], L ...... 117 LD [IY], [IX] ...... 130 LD [BR:ll], #nn...... 124 LD [IY], [IX+dd] ...... 133 LD [BR:ll], [HL]...... 128 LD [IY], [IX+L] ...... 136 LD [BR:ll], [IX] ...... 129 LD [IY], [IY] ...... 131 LD [BR:ll], [IY] ...... 131 LD [IY], [IY+dd] ...... 134

E0C88 CORE CPU MANUAL EPSON 213 APPENDIX C INSTRUCTION INDEX

LD: 8-bit Load LD: 16-bit Load LD [IY], [IY+L] ...... 137 LD IY, SP ...... 139 LD [IY+dd], A ...... 120 LD IY, #mmnn ...... 143 LD [IY+dd], B ...... 120 LD IY, [hhll] ...... 144 LD [IY+dd], H ...... 120 LD IY, [HL] ...... 145 LD [IY+dd], L ...... 120 LD IY, [IX] ...... 146 LD [IY+L], A ...... 121 LD IY, [IY] ...... 146 LD [IY+L], B...... 121 LD IY, [SP+dd] ...... 147 LD [IY+L], H ...... 121 LD SP, BA ...... 140 LD [IY+L], L ...... 121 LD SP, HL ...... 140 LD SP, IX ...... 140 LD: 16-bit Load LD SP, IY ...... 140 LD BA, BA ...... 138 LD SP, #mmnn ...... 144 LD BA, HL ...... 138 LD SP, [hhll]...... 145 LD BA, IX ...... 138 LD [hhll], BA ...... 140 LD BA, IY ...... 138 LD [hhll], HL ...... 140 LD BA, PC ...... 138 LD [hhll], IX ...... 140 LD BA, SP ...... 138 LD [hhll], IY ...... 140 LD BA, #mmnn ...... 143 LD [hhll], SP...... 141 LD BA, [hhll] ...... 144 LD [HL], BA ...... 141 LD BA, [HL] ...... 145 LD [HL], HL...... 141 LD BA, [IX] ...... 146 LD [HL], IX ...... 141 LD BA, [IY] ...... 146 LD [HL], IY ...... 141 LD BA, [SP+dd] ...... 147 LD [IX], BA ...... 142 LD HL, BA ...... 138 LD [IX], HL ...... 142 LD HL, HL ...... 138 LD [IX], IX ...... 142 LD HL, IX ...... 138 LD [IX], IY ...... 142 LD HL, IY ...... 138 LD [IY], BA ...... 142 LD HL, PC ...... 139 LD [IY], HL ...... 142 LD HL, SP ...... 139 LD [IY], IX ...... 142 LD HL, #mmnn ...... 143 LD [IY], IY ...... 142 LD HL, [hhll] ...... 144 LD [SP+dd], BA ...... 143 LD HL, [HL]...... 145 LD [SP+dd], HL ...... 143 LD HL, [IX] ...... 146 LD [SP+dd], IX ...... 143 LD HL, [IY] ...... 146 LD [SP+dd], IY ...... 143 LD HL, [SP+dd] ...... 147 LD IX, BA ...... 138 MLT: Multiplication LD IX, HL ...... 138 MLT ...... 147 LD IX, IX ...... 138 LD IX, IY ...... 138 NEG: Negate (complement of 2) LD IX, SP ...... 139 NEG A ...... 148 LD IX, #mmnn ...... 143 NEG B ...... 148 LD IX, [hhll] ...... 144 NEG [BR:ll]...... 148 LD IX, [HL] ...... 145 NEG [HL] ...... 148 LD IX, [IX] ...... 146 NOP: No Operation LD IX, [IY] ...... 146 LD IX, [SP+dd] ...... 147 NOP ...... 149 LD IY, BA ...... 138 OR: Logical Sum LD IY, HL ...... 138 LD IY, IX ...... 138 OR A, A ...... 149 LD IY, IY ...... 138 OR A, B ...... 149

214 EPSON E0C88 CORE CPU MANUAL APPENDIX C INSTRUCTION INDEX

OR: Logical Sum PUSH: Push OR A, #nn ...... 149 PUSH IX ...... 158 OR A, [BR:ll] ...... 150 PUSH IY ...... 158 OR A, [hhll] ...... 150 PUSH L ...... 158 OR A, [HL] ...... 150 PUSH SC ...... 160 OR A, [IX] ...... 151 OR A, [IX+dd] ...... 151 RET: Return OR A, [IX+L] ...... 152 RET ...... 161 OR A, [IY] ...... 151 RET: Return from Exception Processing OR A, [IY+dd] ...... 151 OR A, [IY+L] ...... 152 RETE ...... 161 OR B, #nn ...... 152 RET: Return & Skip OR H, #nn ...... 153 OR L, #nn ...... 152 RETS ...... 162 OR SC, #nn ...... 153 RL: Rotate to Left with Carry OR [BR:ll], #nn...... 153 OR [HL], A ...... 154 RL A ...... 162 OR [HL], #nn ...... 154 RL B ...... 162 OR [HL], [IX] ...... 154 RL [BR:ll]...... 163 OR [HL], [IY] ...... 154 RL [HL] ...... 163 PACK: Pack RL: Rotate to Left PACK ...... 155 RLC A ...... 163 RLC B ...... 163 POP: Pop RLC [BR:ll]...... 164 POP A ...... 155 RLC [HL] ...... 164 POP ALE ...... 157 RL: Rotate to Right with Carry POP ALL ...... 157 POP B ...... 155 RR A ...... 164 POP BA ...... 155 RR B ...... 164 POP BR...... 156 RR [BR:ll]...... 165 POP EP ...... 156 RR [HL] ...... 165 POP H ...... 155 RL: Rotate to Right POP HL...... 155 RRC A ...... 166 POP IP ...... 156 RRC B ...... 166 POP IX ...... 155 RRC [BR:ll]...... 166 POP IY ...... 155 RRC [HL] ...... 166 POP L ...... 155 POP SC ...... 156 SBC: 8-bit Subtraction with Carry PUSH: Push SBC A, A ...... 167 SBC A, B ...... 167 PUSH A ...... 158 SBC A, #nn ...... 167 PUSH ALE ...... 160 SBC A, [BR:ll] ...... 167 PUSH ALL ...... 160 SBC A, [hhll] ...... 168 PUSH B ...... 158 SBC A, [HL] ...... 168 PUSH BA ...... 158 SBC A, [IX] ...... 168 PUSH BR...... 159 SBC A, [IX+dd] ...... 169 PUSH EP ...... 159 SBC A, [IX+L] ...... 169 PUSH H ...... 158 SBC A, [IY] ...... 168 PUSH HL...... 158 SBC A, [IY+dd] ...... 169 PUSH IP ...... 159 SBC A, [IY+L] ...... 169

E0C88 CORE CPU MANUAL EPSON 215 APPENDIX C INSTRUCTION INDEX

SBC: 8-bit Subtraction with Carry SUB: 8-bit Subtraction SBC [HL], A ...... 170 SUB A, [BR:ll] ...... 180 SBC [HL], #nn ...... 170 SUB A, [hhll] ...... 181 SBC [HL], [IX] ...... 171 SUB A, [HL] ...... 181 SBC [HL], [IY] ...... 171 SUB A, [IX] ...... 181 SUB A, [IX+dd] ...... 182 SBC: 16-bit Subtraction with Carry SUB A, [IX+L] ...... 182 SBC BA, BA ...... 171 SUB A, [IY] ...... 181 SBC BA, HL ...... 171 SUB A, [IY+dd] ...... 182 SBC BA, IX ...... 171 SUB A, [IY+L] ...... 182 SBC BA, IY ...... 171 SUB [HL], A ...... 183 SBC BA, #mmnn ...... 172 SUB [HL], #nn ...... 183 SBC HL, BA ...... 172 SUB [HL], [IX] ...... 184 SBC HL, HL ...... 172 SUB [HL], [IY] ...... 184 SBC HL, IX ...... 172 SBC HL, IY ...... 172 SUB: 16-bit Subtraction SBC HL, #mmnn ...... 172 SUB BA, BA ...... 184 SUB BA, HL ...... 184 SEP: Code Extension SUB BA, IX ...... 184 SEP ...... 173 SUB BA, IY ...... 184 SLA: Shift to Left Arithmetic SUB BA, #mmnn ...... 185 SUB HL, BA ...... 185 SLA A ...... 173 SUB HL, HL ...... 185 SLA B ...... 173 SUB HL, IX ...... 185 SLA [BR:ll]...... 174 SUB HL, IY ...... 185 SLA [HL] ...... 174 SUB HL, #mmnn ...... 185 SLL: Shift to Left Logical SUB IX, BA ...... 186 SUB IX, HL ...... 186 SLL A ...... 175 SUB IX, #mmnn ...... 186 SLL B ...... 175 SUB IY, BA ...... 186 SLL [BR:ll]...... 175 SUB IY, HL ...... 186 SLL [HL] ...... 176 SUB IY, #mmnn ...... 187 SLP: SLEEP Mode SUB SP, BA ...... 187 SUB SP, HL ...... 187 SLP ...... 176 SUB SP, #mmnn ...... 187 SRA: Shift to Right Arithmetic SWAP: Exchange (upper/lower 4 bits) SRA A ...... 177 SWAP A ...... 188 SRA B ...... 177 SWAP [HL] ...... 188 SRA [BR:ll]...... 177 SRA [HL] ...... 178 UPCK: Unpack SRL: Shift to Right Logical UPCK ...... 188 SRL A ...... 178 XOR: Exclusive OR SRL B ...... 178 XOR A, A ...... 189 SRL [BR:ll]...... 179 XOR A, B ...... 189 SRL [HL] ...... 179 XOR A, #nn ...... 189 SUB: 8-bit Subtraction XOR A, [BR:ll] ...... 189 XOR A, [hhll] ...... 190 SUB A, A ...... 180 XOR A, [HL] ...... 190 SUB A, B ...... 180 XOR A, [IX] ...... 190 SUB A, #nn ...... 180

216 EPSON E0C88 CORE CPU MANUAL APPENDIX C INSTRUCTION INDEX

XOR: Exclusive OR XOR A, [IX+dd] ...... 191 XOR A, [IX+L] ...... 191 XOR A, [IY] ...... 190 XOR A, [IY+dd] ...... 191 XOR A, [IY+L] ...... 191 XOR B, #nn ...... 192 XOR H, #nn ...... 192 XOR L, #nn ...... 192 XOR SC, #nn ...... 193 XOR [BR:ll], #nn...... 193 XOR [HL], A ...... 193 XOR [HL], #nn ...... 194 XOR [HL], [IX] ...... 194 XOR [HL], [IY] ...... 194

E0C88 CORE CPU MANUAL EPSON 217 International Sales Operations

AMERICA ASIA

EPSON ELECTRONICS AMERICA, INC. - HONG KONG, CHINA - - HEADQUARTERS - EPSON HONG KONG LTD. 20/F., Harbour Centre, 25 Harbour Road 1960 E. Grand Avenue Wanchai, HONG KONG EI Segundo, CA 90245, U.S.A. Phone: +852-2585-4600 Fax: +852-2827-4346 Phone: +1-310-955-5300 Fax: +1-310-955-5400 Telex: 65542 EPSCO HX - SALES OFFICES - - CHINA - West 150 River Oaks Parkway SHANGHAI EPSON ELECTRONICS CO., LTD. San Jose, CA 95134, U.S.A. 4F, Bldg., 27, No. 69, Gui Jing Road Phone: +1-408-922-0200 Fax: +1-408-922-0238 Caohejing, Shanghai, CHINA Phone: 21-6485-5552 Fax: 21-6485-0775 Central 1450 East American Lane, Suite 1550 - TAIWAN, R.O.C. - Schaumburg, IL 60173, U.S.A. Phone: +1-847-517-7667 Fax: +1-847-517-7601 EPSON TAIWAN TECHNOLOGY & TRADING LTD. 10F, No. 287, Nanking East Road, Sec. 3 101 Virginia Street, Suite 290 Taipei, TAIWAN, R.O.C. Crystal Lake, IL 60014, U.S.A. Phone: 02-2717-7360 Fax: 02-2712-9164 Phone: +1-815-455-7630 Fax: +1-815-455-7633 Telex: 24444 EPSONTB Northeast 301 Edgewater Place, Suite 120 HSINCHU OFFICE Wakefield, MA 01880, U.S.A. 13F-3, No. 295, Kuang-Fu Road, Sec. 2 Phone: +1-781-246-3600 Fax: +1-781-246-5443 HsinChu 300, TAIWAN, R.O.C. Southeast Phone: 03-573-9900 Fax: 03-573-9169 4300 Six Forks Road, Suite 430 Raleigh, NC 27609, U.S.A. - SINGAPORE - Phone: +1-919-781-7667 Fax: +1-919-781-6778 EPSON SINGAPORE PTE., LTD. 1700 Spinnaker Drive No. 1 Temasek Avenue, #36-00 Alpharetta, GA 30005, U.S.A. Millenia Tower, SINGAPORE 039192 Phone: +1-770-754-4872 Fax: +1-770-753-0601 Phone: +65-337-7911 Fax: +65-334-2716

EUROPE - KOREA - SEIKO EPSON CORPORATION EPSON EUROPE ELECTRONICS GmbH KOREA OFFICE - HEADQUARTERS - 50F, KLI 63 Bldg., 60 Yoido-Dong Riesstrasse 15 Youngdeungpo-Ku, Seoul, 150-010, KOREA 80992 Muenchen, GERMANY Phone: 02-784-6027 Fax: 02-767-3677 Phone: +49-(0)89-14005-0 Fax: +49-(0)89-14005-110 - JAPAN - - GERMANY - SEIKO EPSON CORPORATION SALES OFFICE ELECTRONIC DEVICES MARKETING DIVISION Breidenbachstrasse 46 D-51373 Leverkusen, GERMANY Electronic Device Marketing Department Phone: +49-(0)214-83070-0 Fax: +49-(0)214-83070-10 IC Marketing & Engineering Group - UNITED KINGDOM - 421-8, Hino, Hino-shi, Tokyo 191-8501, JAPAN Phone: +81-(0)42-587-5816 Fax: +81-(0)42-587-5624 UK BRANCH OFFICE G6 Doncastle House, Doncastle Road ED International Marketing Department I Bracknell, Berkshire RG12 8PE, ENGLAND (Europe & U.S.A.) Phone: +44-(0)1344-381700 Fax: +44-(0)1344-381701 421-8, Hino, Hino-shi, Tokyo 191-8501, JAPAN Phone: +81-(0)42-587-5812 Fax: +81-(0)42-587-5564 - FRANCE - FRENCH BRANCH OFFICE ED International Marketing Department II 1 Avenue de l' Atlantique, LP 915 Les Conquerants (Asia) Z.A. de Courtaboeuf 2, F-91976 Les Ulis Cedex, FRANCE 421-8, Hino, Hino-shi, Tokyo 191-8501, JAPAN Phone: +33-(0)1-64862350 Fax: +33-(0)1-64862355 Phone: +81-(0)42-587-5814 Fax: +81-(0)42-587-5110 In pursuit of “Saving” Technology, Epson electronic devices. Our lineup of semiconductors, liquid crystal displays and quartz devices assists in creating the products of our customers’ dreams. Epson IS energy savings. ELECTRONIC DEVICES MARKETING DIVISION

■ Electronic devices information on Epson WWW server http://www.epson.co.jp First issue MARCH 1993, Printed APRIL 1999 in Japan M B