IT
Epson logo
Manuale d'uso ufficiale

Epson 6200A

97 pagine·543 KB·Scheda di rete·PDF·EN
Epson 6200A
Indice dei contenuti 39 sezioni 1 DESCRIPTION · 1.1 System Features · 1.2 Instruction Set Features · 1.3 Differences between S1C6200 and S1C6200A · … MostraNascondi
Page 1 of the Epson 6200A user manual — CMOS 4-BIT SINGLE CHIP MICROCOMPUTER S1C6200/6200A
Pagina 1 · clicca per ingrandire
Pagina 1

CMOS 4-BIT SINGLE CHIP MICROCOMPUTER S1C6200/6200A

Core CPU Manual

MF297-07a

Page 2 of the Epson 6200A user manual — NOTICE
Pagina 2 · clicca per ingrandire
Pagina 2

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 Law of Japan and may require an export license from the Ministry of International Trade and Industry or other approval from another government agency.

© SEIKO EPSON CORPORATION 2001, All rights reserved.

Page 3 of the Epson 6200A user manual — Development tools
Pagina 3 · clicca per ingrandire
Pagina 3

Configuration of product number

Devices

S1 C 60N01 F 0A01

Packing specifications 00 : Besides tape & reel 0A : TCP BL 2 directions 0B : Tape & reel BACK 0C : TCP BR 2 directions 0D : TCP BT 2 directions 0E : TCP BD 2 directions 0F : Tape & reel FRONT 0G : TCP BT 4 directions 0H : TCP BD 4 directions 0J : TCP SL 2 directions 0K : TCP SR 2 directions 0L : Tape & reel LEFT 0M : TCP ST 2 directions 0N : TCP SD 2 directions 0P : TCP ST 4 directions 0Q : TCP SD 4 directions 0R : Tape & reel RIGHT 99 : Specs not fixed

Specification

Package Ddie form; F: QFP

Model number

Model name Cmicrocomputer, digital products
Product classification S1semiconductor

Development tools

S5U1 C 60R08 D1 1

Packing specifications 00standard packing
Version 1Version 1

Tool type Hx : ICE Ex : EVA board Px : Peripheral board Wx : Flash ROM writer for the microcomputer Xx : ROM writer peripheral board

Cx : C compiler package Ax : Assembler package Dx : Utility tool by the model Qx : Soft simulator

Corresponding model number 60R08for S1C60R08
Tool classification Cmicrocomputer use
Product classification S5U1development tool for semiconductor products
Page 4 of the Epson 6200A user manual
Pagina 4 · clicca per ingrandire
Pagina 4
Page 4 of the Epson 6200A user manual
Page 6 of the Epson 6200A user manual
Pagina 6 · clicca per ingrandire
Pagina 6
Page 6 of the Epson 6200A user manual
Page 7 of the Epson 6200A user manual — 1.3 Differences between S1C6200 and S1C6200A
Pagina 7 · clicca per ingrandire
Pagina 7

1 D ESCRIPTION

The S1C6200/6200A is the Core CPU of the S1C62 Family of CMOS 4-bit single-chip microcomput- ers. The CPU features a highly-integrated architecture. Memory-mapped peripheral circuits can include RAM, ROM, I/O ports, interrupt controllers, timers and LCD drivers, depending upon the application.

The memory address space is divided into program and data memory, each with data and address lines. Program memory consists of on-chip ROM, containing instructions to be executed by the CPU. Data memory consists of RAM and memory-mapped I/O, as determined by the design of the peripheral cir- cuitry.

A large memory as well as instructions capable of 8-bit data manipulation enhance the functionality of the S1C62 Family. Implementation of a common Core CPU ensures that a wide range of application-specific devices can be designed and fabricated with the minimum turnaround time.

1.1 System Features

  • Common Core CPU for all S1C62 Family microcomputers
  • UP to 8,192 12-bit words of program memory (ROM)
  • UP to 4,096 4-bit words of data memory (RAM/peripheral circuits)
  • Memory-mapped I/O
  • 5, 7 or 12 clock cycle instructions
  • 109 instructions
  • Up to 85 levels of subroutine nesting
  • 8-bit stack pointer
  • Up to 15 interrupt vectors
  • Two standby modes
  • Low-power CMOS process

1.2 Instruction Set Features

  • Four addressing modes: one direct, two indirect, and one stack pointer
  • Direct addressing transfers data to and from data memory with a single instruction, resulting in more
  • 8-bit load instructions and table look-up instructions
  • Arithmetic operations in either hexadecimal or decimal
  • Arithmetic and logical instructions: addition, subtraction, logical AND, OR, exclusive-OR, comparison

1.3 Differences between S1C6200 and S1C6200A

There are some differences in the following operation/circuit between the S1C6200 and the S1C6200A. For the detailes of each difference, refer to the section enclosed with parentheses.

  • Initial setting of D (decimal) flag (refer to Section 2.5.5, "Initial reset".)
  • Interrupt circuit

– Interrupt timing (refer to Section 2.5.3, "Operation during interrupt generation".) – Writing to interrupt mask registers and reading of interrupt flags (refer to Appendix A, "S1C6200A (Advanced S1C6200) Core CPU".)

efficient code · and rotation

Page 8 of the Epson 6200A user manual — RP (4)
Pagina 8 · clicca per ingrandire
Pagina 8

Data Memory RAM, Peripheral I/O (4,096 4-bit words max.)

XP (4)

YP (4)

8-bit address bus 13-bit address bus

RP (4)

YHL (8)

XHL (8)

A (4)

B (4)

TEMPB (5)

TEMPA (5)

ALU

I D Z C

S1C6200 CORE CPU

Program Memory

ROM (8,192 12-bit words max.)

Fig. 1.1 Block diagram

Show 11 more labels / short text on this page
4-bit address bus · Oscillator · 4-bit data bus · Interrupt Controller · Timing Generator · Stack Pointer (8) · Program Counter Block · Micro-Instructions · Instruction Decorder · Instruction Register (12) · 12-bit data bus
Page 9 of the Epson 6200A user manual — 2.1 Program Memory (ROM)
Pagina 9 · clicca per ingrandire
Pagina 9

2 MEMORY AND OPERATIONS

2 M EMORY AND O PERATIONS

A single-chip microcomputer using the S1C6200/6200A Core CPU has four major blocks: the program memory (ROM), the data memory (RAM and I/O), the arithmetic logic unit (ALU) and the timing generator circuit. This section describes each of these blocks in detail.

2.1 Program Memory (ROM)

Program memory contains the instructions that the CPU executes. Figure 2.1.1 shows the configuration of the program memory.

Each instruction is a 12-bit word. Program memory can also be used for data tables for the table look-up instructions.

There are two banks of program memory. Each bank is subdivided into 16 pages of 256 words (or steps). That is:

Program memory = 2 banks

= 8,192 steps 1 bank = 4,096 steps = 16 pages 1 page = 256 steps 1 step = 1 word = 12 bits

Certain addresses in ROM have specific functions, as shown in Table 2.1.1.

Table 2.1.1 Allocated program memory

AddressFunction Bank 0, Page 1, Step 0Reset vector Bank 0, Page 1, Step 1 to 15Interrupt vectors used while a program is running in bank 0 Bank 0, Page 0, Step 0 to 255Bank 0, page 0 area Direct call subroutines for use by CALZ while a program is running in bank 0 Bank 1, Page 1, Step 1 to 15Interrupt vectors used while a program is running in bank 1 Bank 1, Page 0, Step 0 to 255Bank 1, page 0 area Direct call subroutines for use by CALZ while a program is running in bank 1

Page 1 Reset vector

Bank 0Page 15 Bank 0Page 14 Step 0 Step 1 Step254 Step 255
Bank 1Page 15 Bank 1Page 14 Step 0 Step 1 Step254 Step 255

Step 0 Step 1

vectors for Bank 0

Bank 1Page 3 Bank 1Page 2 Step 0 Bank 1 Page 0 Step 0 Step 1 Bank 1 Page 1 Step 0 Step 1Interru Step 254 Step 15 Step 255 Step 254 Step 255

Step 254 Step 255

Step 0 Step 1

Step 254 Step 255

Program or data code area

Program or data code or CALZ subloutines in Bank 0

Program or data code or CALZ subloutines in Bank 1

Fig. 2.1.1 Program memory configuration

Show 71 more labels / short text on this page
Bank 0 · Interrupt · PCS (within bank) · Step 15 · · · Bank 0 · Page 3 · · · · Bank 0 · Page 2 · · · Step 0 · · · · · · Bank 0 · Page 0 · · · · · · · · · · · · · · 12-bit instructions · · · · PCP (within bank) · · · · · · · · · · · · · · · · · · · · · PCB (between banks) · · · · · · · · ·
Page 10 of the Epson 6200A user manual — 2.1.2 Flags
Pagina 10 · clicca per ingrandire
Pagina 10

2 MEMORY AND OPERATIONS

2.1.1 Program counter block

The program counter is used to point to the next instruction step to be executed by the CPU. See Figure 2.1.1.1.

The program counter has the following registers.

Table 2.1.1.1 Program counter registers

RegisterSize PCB (Program Counter-Bank)1-bit register PCP (Program Counter-Page)4-bit counter PCS (Program Counter-Step)8-bit counter NBP (New Bank Pointer)1-bit register NPP (New Page Pointer)4-bit register

Program memory

(8,192 12-bit words max.)

PCB

PCP

PCS

NBP

NPP

Fig. 2.1.1.1 Program counter configuration

PCB, PCP and PCS together from a 13-bit counter which can address any location in program memory.

PCP and PCS together from a 12-bit counter which can address any location within a given bank of pro- gram memory. Each time an instruction other than a jump is executed, this counter increments by one. Thus, a jump instruction does not need to be executed between the last step of one page and the first step of the next.

The contents of NBP and NPP are loaded into PCB and PCP each time an instruction is executed. On reset, NBP and NPP are loaded with the same values as PCB and PCP.

2.1.2 Flags

The following flags are provided.

Table 2.1.2.1 Flags

FlagMenusSize InterruptI1: Enabled 0: Disabled Decimal modeD1: Decimal 0: Hexadecimal ZeroZ1: Set 0: Ignored CarryC1: Set 0: Ignored
Show 7 more labels / short text on this page
Address decoder · (1) · (4) · (8) · (1) · (4) · Program counter block
Page 11 of the Epson 6200A user manual — 2.1.5 Call instructions
Pagina 11 · clicca per ingrandire
Pagina 11

2 MEMORY AND OPERATIONS

2.1.3 Jump instructions

A jump can be made using the instructions in Table 2.1.3.1.

Table 2.1.3.1 Jump instructions

Type of jumpInstruction UnconditionalJP ConditionalJP C, JP NC, JP Z, JP NZ Subroutine callCALL, CALZ ReturnRET, RETS, RETD Page setPSET IndirectJPBA

The differences between jumps within the same page and jumps from one page to another is as follows.

  • Jumps within the same page

A jump can be made within the same page using any of the following instructions:

JP, JP C, JP Z, JP NZ, JPBA or CALL

The destination address is specified by the 8-bit operand. A label can be used to specify a destination address with the S1C62 Family cross assembler.

  • Jumps from one page to another

The destination bank and page should be set using PSET before executing a JP instruction.

2.1.4 PSET with jump instructions

PSET loads the four low-order bits (page part) of its 5-bit operand to NPP (new page pointer) and loads the high-order bit (bank part) to NBP (new bank pointer). Executing a JP instruction immediately after PSET causes a jump to the bank specified by NBP, the page specified by NPP and the step specified by the JP instruction operand. See Figure 2.1.4.1.

Bank 0

Page 15 Bank 0

Jump with PSET can go anywhere within the program memory

Step 0 Step 1

Jump can go between banks

Page 3 Bank 0

PSET JUMP

Page 2 Bank 0

Page 1 Bank 0

Step 254 Step 255

Page 0 Bank 0

Bank 1

Page 15 Bank 1 Bank 1

Step 0 Step 1

Step 0 Step 1

JUMP

Page 3 Bank 1

Step 254 Step 255

Page 2 Bank 1

Page 1 Bank 1

Step 254 Step 255

Page 0 Bank 1

Step 0 Step 1

Jump without PSET can go anywhere within one page

Step 254 Step 255

Fig. 2.1.4.1 The PSET and jump instructions

2.1.5 Call instructions

As only the page data specified by NPP is loaded to PCP when a call instruction is executed, subroutine calls between banks are not possible. Jumps between banks can only be made using JP instructions.

Bank 0 · Page 14 · Page 14

Page 12 of the Epson 6200A user manual — CALZ
Pagina 12 · clicca per ingrandire
Pagina 12

2 MEMORY AND OPERATIONS

2.1.6 PSET instruction

Jump or call instructions must follow PSET immediately in order for PSET to affect the destination address. When a jump or call is not immediately preceded by PSET, the destination address is within the current page.

Some examples using PSET are shown in Table 2.1.6.1.

Table 2.1.6.1 PSET examples

BankPageStapInstructionOperation 0 0 • • 0 0 0 • • 0 0 0 • • 0 • •01H 01H • • 01H 01H 01H • • 01H 01H 01H • • 01H • •10H 11H • • 21H 22H 23H • • 55H 56H 57H • • 60H 61H 62H 63H • •PSET 13H JP 08H • • PSET 15H NOP5 JP 09H • • SCF PSET 14H JP C, 07H • • RFC PSET 05H JP C, 08H JP 09H • •The program jumps to bank 1, page 3, step 8. The data set by PSET is canceled. The program jumps to bank 0, page 1, step 9. C flag is set. The program jumps to bank 1, page 4, step 7 because C flag = 1. C flag is reset. No jump occurs because C flag = 0. The data set by PSET is canceled, and the program jumps to bank 0, page 1, step 9.

2.1.7 CALZ instruction

CALZ is a direct subroutine call instruction. It calls a subroutine, in page 0 of the current bank, from any page without requiring the use of PSET.

If CALZ is executed immediately after PSET, the bank and page set by PSET is canceled. This allows direct subroutine calls to page 0, minimizing repeated code and unnecessary use of PSET. See Figure 2.1.7.1.

Bank 0 Page 0

EEE

RET

Bank 0 Page 2

PSET

0AH

Not effect on destination of CALZ

CALZ

EEE

LD

A,0

Fig. 2.1.7.1 The use of the CALZ instruction

Page 13 of the Epson 6200A user manual — 2.1.9 Stack considerations for call instructions
Pagina 13 · clicca per ingrandire
Pagina 13

2 MEMORY AND OPERATIONS

The difference between CALL and CALZ is shown in Figure 2.1.7.2.

CALL with PSET can go anywhere within a bank

Bank 0 Bank 1

Page 15 Bank 0

Page 15 Bank 1 Bank 1

Step 0 Step 1

Step 0 Step 1

CALL

PSET CALL

CALZ

Page 1 Bank 0

Step 254 Step 255

Page 1 Bank 1

Step 254 Step 255

Page 0 Bank 0

Page 0 Bank 1

Step 0 Step 1

Step 0 Step 1

CALZ

CALL without PSET can go anywhere in a page

CALL and CALZ cannot go between banks

Step 254 Step 255

Step 254 Step 255

CALZ can only go to page 0 of the current bank

Fig. 2.1.7.2 The difference between CALL and CALZ instructions

2.1.8 RET and RETS instructions

The RET instruction causes a return from a subroutine to the address immediately following the address from where that subroutine was called. The RETS instruction causes a return to the address following this address. Proper use of RET and RETS allows simple conditional exits subroutines back to the main routine. See Figure 2.1.8.1.

Bank 0 Page 0 Program memory

PSET

0AH

CALL

DDD

LD

A,0

LD Bank 0 Page 10

B,0

DDD

RET

RETS

Fig. 2.1.8.1 Difference between RET and RETS instructions

2.1.9 Stack considerations for call instructions

When a subroutine is called, the return address is loaded into the stack and retrieved when control is returned to the calling program. Nesting allows efficient usage of the stack area.

As the stack area resides in the data memory, care should be taken to ensure that the stack area is not corrupted by other data.

Show 8 more labels / short text on this page
Bank 0 · Page 14 · Page 14 · Bank 0 · Page 3 · Bank 1 · Page 3 · Program memory
Page 14 of the Epson 6200A user manual — X P
Pagina 14 · clicca per ingrandire
Pagina 14

2 MEMORY AND OPERATIONS

2.2 Data Memory

The data memory area comprises 4,096 4-bit words. The RAM, timer, I/O and other peripheral circuits are mapped into this memory according to the designer's specifications. Figure 2.2.1 shows the data memory configuration.

Step 0 Step 1

RP Page 0 only

XHL or YHL (within page)

Step 254 Step 255

Step 0 Step 1

XP or YP (page specification) SP Page 0 only

Memory or I/O

Step 254 Step 255

4-bit data

Register area

Fig. 2.2.1 Data memory configuration

2.2.1 Data memory addressing

The following registers and pointers, which are described in detail below, are used to address the data memory.

Table 2.2.1.1 Registers and pointer for data memory addressing

Index Register X Index Register Y Stack Pointer Register

IX IY SP RP

12 12 8 4

  • Index register IX

MSB

LSB 4 4

Index register IX has a 4-bit page part (XP) and an 8- bit register (XHL), and can address any location in the data memory. See Figure 2.2.1.1.

X P

X H X L

X HL

XHL is divided into two 4-bit groups: the four high- order bits (XH) and the four low-order bits (XL), and can address any location within a page. Fig. 2.2.1.1 The configuration of the index register IX

– MX is the data memory location whose address is specified by IX.

– M(X) refers to the contents of the data memory location whose address is specified by IX.

– XHL can be incremented by 1 or 2 using a post-increment instruction (LDPX, ACPX, SCPX, LBPX or RETD). An overflow occurring in XHL does not affect the flags.

Show 104 more labels / short text on this page
Page 15 · Page 14 · · · · · · · · · · · Page 3 · · · · · Page 2 · · · · · · Page 1 · · · · · · · · Page 0 · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · Step 15 · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · Register/Pointer Mnemonic · Size (bits)
Page 15 of the Epson 6200A user manual — LD LD LD LD INC DEC
Pagina 15 · clicca per ingrandire
Pagina 15

2 MEMORY AND OPERATIONS

  • Index register IY

Index register IY is like the index register IX: it has a 4-bit page part (YP), an 8-bit register (YHL), and can address any location in the data memory. See Figure 2.2.1.2.

MSB

LSB 4 4

Y P

Y H Y L

Y HL

YHL is divided into two 4-bit groups: the four high- order bits (YH) and the four low-order bits (YL), and can address any location within a page. Fig. 2.2.1.2 The configuration of the index register IY

IY

– MY is the data memory location whose address is specified by IY.

– M(Y) refers to the contents of the data memory location whose address is specified by IY.

– YHL can be incremented by 1 using a post-increment instruction (LDPY, ACPY or SCPY). An overflow occurring in YHL does not affect the flags.

  • Stack pointer SP

The stack area resides in the data memory. The 8-bit, push-down/pop-up stack pointer (SP) is used to address an element within the stack.

Table 2.2.1.2 Stack usage

Since it is an 8-bit pointer, SP can only address 256 words out of the total 4,096 words of data memory. When SP is used, the high-order 4 bits (page part) of the data memory address are 0, giving a stack area of 256 words in the address range 000H to 0FFH.

Operation Instruction Stack usage

PUSH

DEC SP

In systems with a RAM area of less than 256 words, the entire RAM area can be used as the stack area.

RET, RETS or RETD

POP

INC SP

Stack area usage is shown in Table 2.2.1.2.

The PUSH instruction can be used to store registers and flags in the stack in single-word (4-bit) units. The POP instruction is used to retrieve this data.

When an interrupt occurs or a call instruction is executed, the return address from the program counter is pushed onto the stack. When a return instruction is executed, the return address is retrieved from the stack and loaded into the program counter.

On an interrupt, only the program counter is saved on the stack; flag and register data are not saved. Programs should be designed so that flag and register data are pushed onto the stack by the interrupt service routines.

Following a system reset, SP should be initialized using the LD SPH,r or LD SPL,r instructions, where r represents A, B, MX or MY (4 bits).

Stack pointer data can be read using LD r,SPH or LD r,SPL.

  • Register pointer RP

The register pointer (RP) is a 4-bit register used to address the first 16 words of data memory, or the register area. Direct addressing can be used to read from, write to, increment or decrement any location within this area efficiently, using a single instruction.

Programs cannot directly access RP. It uses the operand of direct addressing instructions. The instructions that can access the register area of data memory are:

LD INC DEC

A,Mn B,Mn Mn,A Mn,B Mn Mn

A ← M(n) B ← M(n) M(n) ← A M(n) ← B M(n) ← M(n) + 1 M(n) ← M(n) – 1 n: 0 to F

where M(n) is the contents of a data memory location within the register area.

As the register area can also be indirectly accessed using IX, IY or SP, the stack area should not grow to address 000H to 00FH when RP is used.

Show 9 more labels / short text on this page
Push-down · Interrupt · (SP is decremented) · CALL or CALZ · Pop-up · +3 · (SP is incremented) · +1 · +1
Page 16 of the Epson 6200A user manual — 2.3.1 D (decimal) flag and decimal operations
Pagina 16 · clicca per ingrandire
Pagina 16

2 MEMORY AND OPERATIONS

2.3 ALU (Arithmetic Logic Unit) and Registers

Table 2.3.1 shows ALU operations between the 4-bit registers, TEMPA and TEMPB.

Table 2.3.1 ALU register operation

ADD

ADC

SUB

SBC

AND

OR

XOR

CP

FAN

Rotate right, with carry

RRC

Rotate left, with carry

RLC

NOT

The Z (zero) flag is set when the result of ALU operation is

C 3 2 1 0 X 0 X: Don't care.

The C (carry) flag is set when an add operation causes a carry or when a subtract operation causes a borrow.

2.3.1 D (decimal) flag and decimal operations

Setting the D (decimal) flag activates the decimal mode, allowing decimal addition and subtraction. Table 2.3.1.1 shows the relations of actual (decimal) results, ALU outputs, and the values of the C and Z flags.

Table 2.3.1.1 Results of hexadecimal and decimal operations

D = 0Result of hexadecimal operation
D = 1Result of decimal operation
D = 0Result of hexadecimal operation
D = 1Result of decimal operation

Z 1 0 1 0

Z 1 0 1 0 1 0

Z 1 0 1 0

Z 0 1 0 1 0

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

0 1

0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F

0 1

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5

-16 -15 -14 -13 -12 -11 -10

1 0

0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F

1 0

A B C D E F 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 A B C D E F

-9 -8 -7 -6 -5 -4 -3 -2 -1

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Show 19 more labels / short text on this page
Operation Instruction · Add, without carry · Add, with carry · Subtract, without borrow · Subtract, with borrow · Logical-AND · Logical-OR · Exclusive-OR · Comparison · Flag bit test · Invert · Subtraction Addition Actual · Actual · result · result · ALU output · ALU output · ALU output · ALU output
Page 17 of the Epson 6200A user manual — 2.4.1 HALT and SLP (sleep) modes
Pagina 17 · clicca per ingrandire
Pagina 17

2 MEMORY AND OPERATIONS

Hexadecimal operations will not always produce the correct result if performed in decimal mode.

  • An add instruction with carry (for example, ADC XH, i ) which uses index registers XH, XL, YH and YL,

does not involve decimal correction even if it is performed in the decimal mode. This is because it uses an 8-bit field for 4-bit data.

  • The results of the compare instruction (CP) is not decimal-corrected, because the carry flag is ignored.
  • The result of the register memory increment instruction (INC M n ) and decrement instruction (DEC M n )

are not decimal-corrected.

2.3.2 A and B registers

The A and B registers are 4-bit general-purpose registers used as accumulators. They transfer data and perform ALU operations with other registers, data memory and immediate data.

The data in A can be paired with that in B for use as an indirect jump address by the JPBA instruction.

2.4 Timing Generator

S1C6200/6200A instructions can be divided into three different types depending on the number of clock cycles per instruction: 5, 7 or 12 clock cycles. The more complex the instruction, the more cycles it requires. Note that the number of clock cycles determines the duration of instructions which, in turn, will affect any timing performed in software.

As shown in Figure 2.4.1, the first state of all instructions is a fetch cycle. This is followed by a number of execute cycles.

5-clock/7-clock instructions

12-clock instructions

Fig. 2.4.1 Instruction execution timing

2.4.1 HALT and SLP (sleep) modes

HALT and SLP cause the CPU to store the return address on the stack and then stop. HALT will only stop the CPU; the system clock will continue to run. SLP also stops the system clock, resulting in reduced power consumption. The CPU can be restarted by an interrupt.

As interrupts are not automatically enabled by the execution of HALT or SLP, programs should always enable interrupts before executing HALT or SLP, otherwise they will hang waiting for an interrupt.

Show 27 more labels / short text on this page
Clock · Status · Fetch Execute Fetch · Execute · State · 0 State · 1 State · 2 State · 0 State · 1 State · 2 State · Instruction · register · Date memory · Clock · Status · Fetch · Execute · State · 0 State · 1 State · 2 State · 3 State · 4 State · 5 State · Instruction · register
Page 18 of the Epson 6200A user manual — PSET + CALL PSET + JP
Pagina 18 · clicca per ingrandire
Pagina 18

2 MEMORY AND OPERATIONS

2.5 Interrupts

The S1C6200/6200A can have up to 15 interrupt vectors. When used with peripheral circuits, these allow internal and external interrupts to be processed easily. See Figure 2.5.3.1 through 2.5.3.4.

2.5.1 Interrupt vectors

The interrupt vectors are assigned to steps 1 to 15 in page 1 of each bank of the program memory. When an interrupt occurs, the program jumps to the appropriate interrupt vector in the current bank.

The priority and linking of these vectors to actual outside events depends on the configuration of the peripheral circuits and therefore is device-specific. This information can be found in the technical manuals for the specific device.

2.5.2 I (interrupt) flag

The I (interrupt) flag enables or disables all interrupts.

When DI or RST F is used to reset the I flag, interrupts are disabled with that instruction step. When EI or SET F is used to set the I flag, interrupts are enabled after the following instruction step. For example, to return control from the interrupt subroutine to the main routine, the sequence EI, RET, does not enable interrupts until after RET has been executed.

The I flag is reset to 0 (DI) on reset.

2.5.3 Operation during interrupt generation

When an interrupt is generated, the program is halted, the program counter (PCP and PCS) is stored on the stack, the I flag is reset to DI mode and NPP is set to 1. The program then branches to the interrupt vector corresponding to the interrupt request. Registers and flags are unaffected by an interrupt.

Register and flag data must be saved by the program since they are not automatically stored on the stack.

The I flag can be set to 1 (EI) within the interrupt subroutine, because nesting of multiple interrupts is available.

If an interrupt is generated while the CPU is in HALT or SLP mode, the CPU is restarted and the interrupt serviced. When the interrupt service routine is completed, the program resumes from the instruction following the HALT or SLP.

<Differences between S1C6200 and S1C6200A> In the S1C6200 and the S1C6200A, the time it takes to complete interrupt processing by hardware after the Core CPU receives the interrupt request is different as follows:

Table 2.5.3.1 Required interrupt processing time

a) During instruction execution

12-cycle instruction execution 7-cycle instruction execution 5-cycle instruction execution

12.5 to 24.5 12.5 to 19.5 12.5 to 17.5 14 to 15 12.5 to 24.5 12.5 to 22.5

13 to 25 13 to 20 13 to 18 14 to 15 13 to 25 13 to 23

b) At HALT mode c) During PSET instruction execution

PSET + CALL PSET + JP

S1C6200A (clock cycles) · S1C6200 (clock cycles) · Item

Page 19 of the Epson 6200A user manual — HALT
Pagina 19 · clicca per ingrandire
Pagina 19

2 MEMORY AND OPERATIONS

S1C6200

INT1 (*1) INT2 (*1) JP (*2)

Interrupt processing:

12-clock instruction 7-clock instruction 5-clock instruction

... 13 to 25 clock cycles ... 13 to 20 clock cycles ... 13 to 18 clock cycles

S1C6200A

INT1 (*1) INT2 (*1) JP (*2)

Interrupt processing:

12-clock instruction 7-clock instruction 5-clock instruction

... 12.5 to 24.5 clock cycles ... 12.5 to 19.5 clock cycles ... 12.5 to 17.5 clock cycles

INT1 and INT2 are dummy instructions Branches to the top of the interrupt service routine Status:

Execute Note(*1) (*2)

Fig. 2.5.3.1 Interrupt timing during execution

S1C6200/6200A

Instruction 5-clock Instrruction Interrupt

HALT

INT1 (*1) INT2 (*1) JP (*2)

Interrupt processing14 to 15 clock cycles

INT1 and INT2 are dummy instructions Branches to the top of the interrupt service routine Status:

Execute Note(*1) (*2)

Fig. 2.5.3.2 Interrupt timing in the HALT mode

Show 16 more labels / short text on this page
Clock · Status · Instruction · 5-clock Instrruction · 12-clock Instrruction · Interrupt · Clock · Status · Instruction 5-clock Instrruction · 12-clock Instrruction · Interrupt · Fetch · System clock · CPU clock · Status · Fetch
Page 20 of the Epson 6200A user manual — PSET + CALL
Pagina 20 · clicca per ingrandire
Pagina 20

2 MEMORY AND OPERATIONS

S1C6200/6200A

SLEEP

INT1 (*1) INT2 (*1) JP (*2)

Interrupt processing14 to 15 clock cycles

INT1 and INT2 are dummy instructions Branches to the top of the interrupt service routine Status:

Execute Note(*1) (*2)

Fig. 2.5.3.3 Interrupt timing in SLEEP mode

S1C6200

PSET

CALL

INT1 (*1) INT2 (*1) JP (*2)

... 13 to 25 clock cycles ... 13 to 23 clock cycles Interrupt processing:

PSET + CALL

PSET + JP

S1C6200A

CALL

INT1 (*1) INT2 (*1) JP (*2)

... 12.5 to 24.5 clock cycles ... 12.5 to 22.5 clock cycles Interrupt processing:

PSET + CALL

PSET + JP

INT1 and INT2 are dummy instructions Branches to the top of the interrupt service routine Status:

Execute Note(*1) (*2)

Fig. 2.5.3.4 Interrupt timing with PSET

Show 15 more labels / short text on this page
System clock · CPU clock · Status · Instruction 5-clock Instrruction · Interrupt · Fetch · Clock · Status · Instruction · Interrupt · Clock · Status · Instruction PSET · Interrupt · Fetch
Page 21 of the Epson 6200A user manual — PCS
Pagina 21 · clicca per ingrandire
Pagina 21

2 MEMORY AND OPERATIONS

2.5.4 Initial reset

On reset, the registers and flags are set as shown in Table 2.5.4.1.

Table 2.5.4.1 Reset value

PCS

00H

PCP

01H

PCB

00H

NPP

01H

NBP

SP

IY

RP

A

B

0H

D

Z

* S1C6200 ...Undefined S1C6200A ...0

<Difference between S1C6200 and S1C6200A> There is a difference in the setting value of the D (decimal) flag at initial reset between the S1C6200 and the S1C6200A.

Table 2.5.4.2 D (decimal) flag initial setting

D (decimal) flag setting

When using the model loaded with the S1C6200 Core CPU, set or reset the D flag in the user's initial routine before using an arithmetic instruction. (refer to the SDF and RDF instructions.)

Show 29 more labels / short text on this page
Bit length · Value · Program Counter Step · Program Counter Page · Program Counter Bank · New Page Pointer · New Bank Pointer · Undefined · Stack Pointer · Undefined · Index Register · Undefined · Index Register · Undefined · Register Pointer · Undefined · General Register · Undefined · General Register · Undefined · Interrupt Flag · Decimal Flag · * · Zero Flag · Undefined · Carry Flag · Undefined · 0 CPU Core · S1C6200 Undefined S1C6200A
Page 22 of the Epson 6200A user manual — c. Index by operation code
Pagina 22 · clicca per ingrandire
Pagina 22

3 I NSTRUCTION S ET

This chapter describes the entire instruction set of the S1C6200/6200A Core CPU. A subset is allocated to each device within the S1C62 Family according to the configuration of the device. Therefore not all instructions are available in every device. The relevant information is in the technical manual for each device.

The source format and a description of the assembler is in the series-specific cross assembler manuals.

The instruction set contains 109 instructions. Each instruction comprises of one 12-bit word.

3.1 Instruction Indices

Three index tables are used for easy reference instructions.

a. Index by function

The instructions are arranged by function. 1. Branch 2. System control 3. Flag operation 4. Stack operation 5. Index operation 6. Data transfer 7. Arithmetic and logical operation

b. Index in alphabetical order

The instructions are arranged in alphabetical order. Page number references are provided.

c. Index by operation code

The instructions are arranged in numerical order by operation code.

Page 23 of the Epson 6200A user manual — ADC
Pagina 23 · clicca per ingrandire
Pagina 23

3.1.1 By function

Classification Operand Clock Operation Code Flag Mne- monic Operation

B

A

I D Z C

PSET

NBP ← p4, NPP ← p3~p0

JP

PCB ← NBP, PCP ← NPP, PCS ← s7~s0

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if C=1

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if C=0

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if Z=1

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if Z=0

JPBA

PCB ← NBP, PCP ← NPP, PCSH ← B, PCSL ← A

CALL

M(SP-1) ← PCP, M(SP-2) ← PCSH, M(SP-3) ← PCSL+1

SP ← SP-3, PCP ← NPP, PCS ← s7~s0

CALZ

M(SP-1) ← PCP, M(SP-2) ← PCSH, M(SP-3) ← PCSL+1

SP ← SP-3, PCP ← 0, PCS ← s7~s0

RET

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)

SP ← SP+3

RETS

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)

SP ← SP+3, PC ← PC+1

RETD

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)

SP ← SP+3, M(X) ← e3~e0, M(X+1) ← e7~e4, X ← X+2

NOP5

No operation (5 clock cycles)

NOP7

No operation (7 clock cycles)

HALT

SLP

INC

X ← X+1

Y

Y ← Y+1

LD

XH ← e7~e4, XL ← e3~e0

YH ← e7~e4, YL ← e3~e0

r ← Y H

ADC

Show 176 more labels / short text on this page
Branch · p · p4 · p3 · p2 · p1 · p0 · instructions · s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · C, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · NC, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · Z, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · NZ, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0 · System · control · instructions · Halt (stop clock) · SLEEP (stop oscillation) · Index · instructions · X, e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0 · Y, e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0 · XP, r · r1 · r0 · XP ← r · XH, r · r1 · r0 · XH ← r · XL, r · r1 · r0 · XL ← r · YP, r · r1 · r0 · YP ← r · YH, r · r1 · r0 · YH ← r · YL, r · r1 · r0 · YL ← r · r, XP · r1 · r0 · r ← XP · r, XH · r1 · r0 · r ← XH · r, XL · r1 · r0 · r ← XL · r, YP · r1 · r0 · r ← YP · r, YH · r1 · r0 · r, YL · r1 · r0 · r ← YL · XH, i · XH ← XH+i3~i0+C · ↑ · ↓ · ↑ · ↓ · XL, i · XL ← XL+i3~i0+C · ↑ · ↓ · ↑ · ↓ · YH, i · YH ← YH+i3~i0+C · ↑ · ↓ · ↑ · ↓ · YL, i · YL ← YL+i3~i0+C · ↑ · ↓ · ↑ · ↓
Page 24 of the Epson 6200A user manual — XP
Pagina 24 · clicca per ingrandire
Pagina 24

Clock Operation Code Flag

B

A

I D Z C

CP

LD

LDPX

M(X) ← i3~i0, X ← X+1

r ← q, X ← X+1

LDPY

M(Y) ← i3~i0, Y ← Y+1

r ← q, Y ← Y+1

LBPX

M(X) ← e3~e0, M(X+1) ← e7~e4, X ← X+2

SET

F ← FVi3~i0

RST

F ← FΛi3~i0

SCF

C ← 1

RCF

C ← 0

SZF

Z ← 1

RZF

Z ← 0

SDF

D ← 1 (Decimal Adjuster ON)

RDF

D ← 0 (Decimal Adjuster OFF)

EI

I ← 1 (Enables Interrupt)

DI

I ← 0 (Disables Interrupt)

INC

SP

SP ← SP+1

DEC

SP

SP ← SP-1

PUSH

SP ← SP-1, M(SP) ← r

XP

SP ← SP-1, M(SP) ← XP

XH

SP ← SP-1, M(SP) ← XH

SP ← SP-1, M(SP) ← XL

YP

SP ← SP-1, M(SP) ← YP

YH

SP ← SP-1, M(SP) ← YH

YL

SP ← SP-1, M(SP) ← YL

F

SP ← SP-1, M(SP) ← F

POP

r ← M(SP), SP ← SP+1

XP

XP ← M(SP), SP ← SP+1

XH

XH ← M(SP), SP ← SP+1

XL ← M(SP), SP ← SP+1

YP

YP ← M(SP), SP ← SP+1

Show 113 more labels / short text on this page
Mne- monic Operation · Classification Operand · Index · XH, i · ↑ · ↑ · XH-i3~i0 · ↓ · ↓ · XL, i · ↑ · ↑ · XL-i3~i0 · ↓ · ↓ · instructions · YH, i · ↑ · ↑ · YH-i3~i0 · ↓ · ↓ · YL, i · ↑ · ↑ · YL-i3~i0 · ↓ · ↓ · Data · r, i · r1 · r0 · r ← i3~i0 · transfer · r, q · r1 · r0 · q1 · q0 · r ← q · instructions · A, Mn · n3 · n2 · n1 · n0 · A ← M(n3~n0) · B, Mn · n3 · n2 · n1 · n0 · B ← M(n3~n0) · Mn, A · n3 · n2 · n1 · n0 · M(n3~n0) ← A · Mn, B · n3 · n2 · n1 · n0 · M(n3~n0) ← B · MX, i · r, q · r1 · r0 · q1 · q0 · MY, i · r, q · r1 · r0 · q1 · q0 · MX, e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0 · F, i · ↑ · ↑ · ↑ · ↑ · F, i · ↓ · ↓ · ↓ · ↓ · instructions · ↑ · ↓ · ↑ · ↓ · ↑ · ↓ · ↑ · ↓ · Stack · instructions · r · r1 · r0 · r · r1 · r0
Page 25 of the Epson 6200A user manual — NOT
Pagina 25 · clicca per ingrandire
Pagina 25

Clock Operation Code Flag

B

A

I D Z C

POP

YH

YH ← M(SP), SP ← SP+1

YL

YL ← M(SP), SP ← SP+1

F

F ← M(SP), SP ← SP+1

LD

ADD

ADC

SUB

SBC

AND

r ← rΛi3~i0

r ← rΛq

OR

r ← rVi3~i0

r ← rVq

XOR

r ← r∀i3~i0

r ← r∀q

CP

FAN

RLC

d3 ← d2, d2 ← d1, d1 ← d0, d0 ← C, C ← d3

RRC

d3 ← C, d2 ← d3, d1 ← d2, d0 ← d1, C ← d0

INC

DEC

ACPX

M(X) ← M(X)+r+C, X ← X+1

ACPY

M(Y) ← M(Y)+r+C, Y ← Y+1

SCPX

M(X) ← M(X)-r-C, X ← X+1

SCPY

M(Y) ← M(Y)-r-C, Y ← Y+1

NOT

Show 240 more labels / short text on this page
Classification Operand · Mne- monic Operation · Stack · instructions · ↑↓ ↓ · ↑↑ · ↑ · ↓ · ↓ · SPH, r · r1 · r0 · SPH ← r · SPL, r · r1 · r0 · SPL ← r · r, SPH · r1 · r0 · r ← SPH · r, SPL · r1 · r0 · r ← SPL · Arithmetic · r, i · r1 · r0 · ↑ · ↑ · r ← r+i3~i0 · # · ↓ · ↓ · instructions · r, q · r1 · r0 · q1 · q0 · ↑ · ↑ · r ← r+q · # · ↓ · ↓ · r, i · r1 · r0 · ↑ · ↑ · r ← r+i3~i0+C · # · ↓ · ↓ · r, q · r1 · r0 · q1 · q0 · ↑ · ↑ · r ← r+q+C · # · ↓ · ↓ · r, q · r1 · r0 · q1 · q0 · ↑ · ↑ · r ← r-q · # · ↓ · ↓ · r, i · r1 · r0 · ↑ · ↑ · r ← r-i3~i0-C · # · ↓ · ↓ · r, q · r1 · r0 · q1 · q0 · ↑ · ↑ · r ← r-q-C · # · ↓ · ↓ · r, i · r1 · r0 · ↑ · ↓ · r, q · r1 · r0 · q1 · q0 · ↑ · ↓ · r, i · r1 · r0 · ↑ · ↓ · r, q · r1 · r0 · q1 · q0 · ↑ · ↓ · r, i · r1 · r0 · ↑ · ↓ · r, q · r1 · r0 · q1 · q0 · ↑ · ↓ · r, i · r1 · r0 · ↑ · ↑ · r-i3~i0 · ↓ · ↓ · r, q · r1 · r0 · q1 · q0 · ↑ · ↑ · r-q · ↓ · ↓ · r, i · r1 · r0 · ↑ · rΛi3~i0 · ↓ · r, q · r1 · r0 · q1 · q0 · ↑ · rΛq · ↓ · r · r1 · r0 · r1 · r0 · ↑ · ↑ · ↓ · ↓ · r · r1 · r0 · ↑ · ↑ · ↓ · ↓ · Mn · n3 · n2 · n1 · n0 · ↑ · ↑ · M(n3~n0) ← M(n3~n0)+1 · ↓ · ↓ · Mn · n3 · n2 · n1 · n0 · ↑ · ↑ · M(n3~n0) ← M(n3~n0)-1 · ↓ · ↓ · MX, r · r1 · r0 · ↑ · ↑ · # · ↓ · ↓ · MY, r · r1 · r0 · ↑ · ↑ · # · ↓ · ↓ · MX, r · r1 · r0 · ↑ · ↑ · # · ↓ · ↓ · MY, r · r1 · r0 · ↑ · ↑ · # · ↓ · ↓ · r · r1 · r0 · ↑ · r ← r · ↓
Page 26 of the Epson 6200A user manual — LBPX
Pagina 26 · clicca per ingrandire
Pagina 26

3.1.2 In alphabetical order

Page Operand Clock Operation Code Flag Mne- monic Operation

B

A

I D Z C

ACPX

M(X) ← M(X)+r+C, X ← X+1

ACPY

M(Y) ← M(Y)+r+C, Y ← Y+1

ADC

ADD

AND

r ← rΛi3~i0

r ← rΛq

CALL

M(SP-1) ← PCP, M(SP-2) ← PCSH, M(SP-3) ← PCSL+1

SP ← SP-3, PCP ← NPP, PCS ← s7~s0

CALZ

M(SP-1) ← PCP, M(SP-2) ← PCSH, M(SP-3) ← PCSL+1

SP ← SP-3, PCP ← 0, PCS ← s7~s0

CP

DEC

SP

SP ← SP-1

DI

I ← 0 (Disables Interrupt)

EI

I ← 1 (Enables Interrupt)

FAN

HALT

INC

SP

SP ← SP+1

X ← X+1

Y

Y ← Y+1

JPBA

PCB ← NBP, PCP ← NPP, PCSH ← B, PCSL ← A

JP

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if C=1

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if C=0

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if Z=0

PCB ← NBP, PCP ← NPP, PCS ← s7~s0

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if Z=1

LBPX

M(X) ← e3~e0, M(X+1) ← e7~e4, X ← X+2

Show 243 more labels / short text on this page
MX, r · r1 · r0 · # · ↑ · ↓ · ↑ · ↓ · MY, r · r1 · r0 · # · ↑ · ↓ · ↑ · ↓ · r, i · r1 · r0 · # · ↑ · ↓ · ↑ · ↓ · r ← r+i3~i0+C · r, q · r1 · r0 · q1 · q0 · # · ↑ · ↓ · ↑ · ↓ · r ← r+q+C · XH, i · ↑ · ↓ · ↑ · ↓ · XH ← XH+i3~i0+C · XL, i · ↑ · ↓ · ↑ · ↓ · XL ← XL+i3~i0+C · YH, i · ↑ · ↓ · ↑ · ↓ · YH ← YH+i3~i0+C · YL, i · ↑ · ↓ · ↑ · ↓ · YL ← YL+i3~i0+C · r, i · r1 · r0 · # · ↑ · ↓ · ↑ · ↓ · r ← r+i3~i0 · r, q · r1 · r0 · q1 · q0 · ↑ · ↑ · r ← r+q · # · ↓ · ↓ · r, i · r1 · r0 · ↑ · ↓ · r, q · r1 · r0 · q1 · q0 · ↑ · ↓ · s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · r, i · r1 · r0 · ↑ · ↓ · ↑ · ↓ · r-i3~i0 · r, q · r1 · r0 · q1 · q0 · ↑ · ↓ · ↑ · ↓ · r-q · XH, i · ↑ · ↓ · ↑ · ↓ · XH-i3~i0 · XL, i · ↑ · ↓ · ↑ · ↓ · XL-i3~i0 · YH, i · ↑ · ↓ · ↑ · ↓ · YH-i3~i0 · YL, i · ↑ · ↑ · YL-i3~i0 · ↓ · ↓ · Mn · n3 · n2 · n1 · n0 · M(n3~n0) ← M(n3~n0)-1 · ↑ · ↓ · ↑ · ↓ · ↓ · ↑ · r, i · r1 · r0 · ↑ · ↓ · rΛi3~i0 · r, q · r1 · r0 · q1 · q0 · ↑ · ↓ · rΛq · Halt (stop clock) · Mn · n3 · n2 · n1 · n0 · ↑ · ↓ · ↑ · ↓ · M(n3~n0) ← M(n3~n0)+1 · C, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · NC, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · NZ, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · Z, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · MX, e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0
Page 27 of the Epson 6200A user manual — XH
Pagina 27 · clicca per ingrandire
Pagina 27

Page Operand Clock Operation Code Flag Mne- monic Operation

B

A

I D Z C

LD

XH ← e7~e4, XL ← e3~e0

YH ← e7~e4, YL ← e3~e0

LDPX

M(X) ← i3~i0, X ← X+1

r ← q, X ← X+1

LDPY

M(Y) ← i3~i0, Y ← Y+1

r ← q, Y ← Y+1

NOP5

No operation (5 clock cycles)

NOP7

No operation (7 clock cycles)

NOT

OR

r ← rVi3~i0

r ← rVq

POP

F

F ← M(SP), SP ← SP+1

r ← M(SP), SP ← SP+1

XH

XH ← M(SP), SP ← SP+1

XL ← M(SP), SP ← SP+1

XP

XP ← M(SP), SP ← SP+1

YH

YH ← M(SP), SP ← SP+1

YL

YL ← M(SP), SP ← SP+1

YP

YP ← M(SP), SP ← SP+1

Show 152 more labels / short text on this page
A, Mn · n3 · n2 · n1 · n0 · A ← M(n3~n0) · B, Mn · n3 · n2 · n1 · n0 · B ← M(n3~n0) · Mn, A · n3 · n2 · n1 · n0 · M(n3~n0) ← A · Mn, B · n3 · n2 · n1 · n0 · M(n3~n0) ← B · r, i · r1 · r0 · r ← i3~i0 · r, q · r1 · r0 · q1 · q0 · r ← q · r, SPH · r1 · r0 · r ← SPH · r, SPL · r1 · r0 · r ← SPL · r, XH · r1 · r0 · r ← XH · r, XL · r1 · r0 · r ← XL · r, XP · r1 · r0 · r ← XP · r, YH · r1 · r0 · r ← YH · r, YL · r1 · r0 · r ← YL · r, YP · r1 · r0 · r ← YP · SPH, r · r1 · r0 · SPH ← r · SPL, r · r1 · r0 · SPL ← r · XH, r · r1 · r0 · XH ← r · XL, r · r1 · r0 · XL ← r · XP, r · r1 · r0 · XP ← r · X, e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0 · YH, r · r1 · r0 · YH ← r · YL, r · r1 · r0 · YL ← r · YP, r · r1 · r0 · YP ← r · Y, e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0 · MX, i · r, q · r1 · r0 · q1 · q0 · MY, i · r, q · r1 · r0 · q1 · q0 · r · r1 · r0 · ↑ · ↓ · r ← r · r, i · r1 · r0 · ↑ · ↓ · r, q · r1 · r0 · q1 · q0 · ↑ · ↓ · ↑↓ ↑↓ ↑↓ · ↑ · ↓ · r · r1 · r0
Page 28 of the Epson 6200A user manual — SLP
Pagina 28 · clicca per ingrandire
Pagina 28

Page Operand Clock Operation Code Flag Mne- monic Operation

B

A

I D Z C

PSET

NBP ← p4, NPP ← p3~p0

PUSH

F

SP ← SP-1, M(SP) ← F

SP ← SP-1, M(SP) ← r

XH

SP ← SP-1, M(SP) ← XH

SP ← SP-1, M(SP) ← XL

XP

SP ← SP-1, M(SP) ← XP

YH

SP ← SP-1, M(SP) ← YH

YL

SP ← SP-1, M(SP) ← YL

YP

SP ← SP-1, M(SP) ← YP

RCF

C ← 0

RDF

D ← 0 (Decimal Adjuster OFF)

RET

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)

SP ← SP+3

RETD

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)

SP ← SP+3, M(X) ← e3~e0, M(X+1) ← e7~e4, X ← X+2

RETS

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)

SP ← SP+3, PC ← PC+1

RLC

d3 ← d2, d2 ← d1, d1 ← d0, d0 ← C, C ← d3

RRC

d3 ← C, d2 ← d3, d1 ← d2, d0 ← d1, C ← d0

RST

F ← FΛi3~i0

RZF

Z ← 0

SBC

SCF

C ← 1

SCPX

M(X) ← M(X)-r-C, X ← X+1

SCPY

M(Y) ← M(Y)-r-C, Y ← Y+1

SDF

D ← 1 (Decimal Adjuster ON)

SET

F ← FVi3~i0

SLP

SUB

SZF

Z ← 1

XOR

r ← r∀i3~i0

r ← r∀q

Show 110 more labels / short text on this page
p · p4 · p3 · p2 · p1 · p0 · r · r1 · r0 · ↓ · ↓ · e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0 · r · r1 · r0 · r1 · r0 · ↑ · ↓ · ↑ · ↓ · r · r1 · r0 · ↑ · ↓ · ↑ · ↓ · F, i · ↓ · ↓ · ↓ · ↓ · ↓ · r, i · r1 · r0 · r ← r-i3~i0-C · # · ↑ · ↓ · ↑ · ↓ · r, q · r1 · r0 · q1 · q0 · # · ↑ · ↓ · ↑ · ↓ · r ← r-q-C · ↑ · MX, r · r1 · r0 · # · ↑ · ↓ · ↑ · ↓ · MY, r · r1 · r0 · # · ↑ · ↓ · ↑ · ↓ · ↑ · F, i · ↑ · ↑ · ↑ · ↑ · SLEEP (stop oscillation) · r, q · r1 · r0 · q1 · q0 · # · ↑ · ↓ · ↑ · ↓ · r ← r-q · ↑ · r, i · r1 · r0 · ↑ · ↓ · r, q · r1 · r0 · q1 · q0 · ↑ · ↓
Page 29 of the Epson 6200A user manual — NOT
Pagina 29 · clicca per ingrandire
Pagina 29

3.1.3 By operation code

Operand Clock Operation Code Flag Mne- monic Operation Operation Code (HEX)

B

A

I D Z C

JP

PCB ← NBP, PCP ← NPP, PCS ← s7~s0

RETD

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)

SP ← SP+3, M(X) ← e3~e0, M(X+1) ← e7~e4, X ← X+2

JP

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if C=1

JP

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if C=0

CALL

M(SP-1) ← PCP, M(SP-2) ← PCSH, M(SP-3) ← PCSL+1

SP ← SP-3, PCP ← NPP, PCS ← s7~s0

CALZ

M(SP-1) ← PCP, M(SP-2) ← PCSH, M(SP-3) ← PCSL+1

SP ← SP-3, PCP ← 0, PCS ← s7~s0

JP

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if Z=1

JP

PCB ← NBP, PCP ← NPP, PCS ← s7~s0 if Z=0

LD

YH ← e7~e4, YL ← e3~e0

LBPX

M(X) ← e3~e0, M(X+1) ← e7~e4, X ← X+2

ADC

ADC

ADC

ADC

CP

CP

CP

CP

ADD

ADC

SUB

SBC

AND

r ← rΛq

OR

r ← rVq

XOR

r ← r∀q

RLC

d3 ← d2, d2 ← d1, d1 ← d0, d0 ← C, C ← d3

LD

XH ← e7~e4, XL ← e3~e0

ADD

ADC

AND

r ← rΛi3~i0

OR

r ← rVi3~i0

XOR

r ← r∀i3~i0

NOT

SBC

FAN

CP

LD

Show 324 more labels / short text on this page
000 to 0FF · s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · 100 to 1FF · e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0 · 200 to 2FF · C, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · 300 to 3FF · NC, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · 400 to 4FF · s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · 500 to 5FF · s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · 600 to 6FF · Z, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · 700 to 7FF · NZ, s · s7 · s6 · s5 · s4 · s3 · s2 · s1 · s0 · 800 to 8FF · Y, e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0 · 900 to 9FF · MX, e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0 · A00 to A0F · XH, i · ↑ · ↑ · XH ← XH+i3~i0+C · ↓ · ↓ · A10 to A1F · XL, i · ↑ · ↑ · XL ← XL+i3~i0+C · ↓ · ↓ · A20 to A2F · YH, i · ↑ · ↑ · YH ← YH+i3~i0+C · ↓ · ↓ · A30 to A3F · YL, i · ↑ · ↑ · YL ← YL+i3~i0+C · ↓ · ↓ · A40 to A4F · XH, i · ↑ · ↑ · XH-i3~i0 · ↓ · ↓ · A50 to A5F · XL, i · ↑ · ↑ · XL-i3~i0 · ↓ · ↓ · A60 to A6F · YH, i · ↑ · ↑ · YH-i3~i0 · ↓ · ↓ · A70 to A7F · YL, i · ↑ · ↑ · YL-i3~i0 · ↓ · ↓ · A80 to A8F · r, q · r1 · r0 · q1 · q0 · ↑ · ↑ · r ← r+q · # · ↓ · ↓ · A90 to A9F · r, q · r1 · r0 · q1 · q0 · ↑ · ↑ · r ← r+q+C · # · ↓ · ↓ · AA0 to AAF · r, q · r1 · r0 · q1 · q0 · ↑ · ↑ · r ← r-q · # · ↓ · ↓ · AB0 to ABF · r, q · r1 · r0 · q1 · q0 · ↑ · ↑ · r ← r-q-C · # · ↓ · ↓ · AC0 to ACF · r, q · r1 · r0 · q1 · q0 · ↑ · ↓ · AD0 to ADF · r, q · r1 · r0 · q1 · q0 · ↑ · ↓ · AE0 to AEF · r, q · r1 · r0 · q1 · q0 · ↑ · ↓ · AF0 to AFF · r · r1 · r0 · r1 · r0 · ↑ · ↑ · ↓ · ↓ · B00 to BFF · X, e · e7 · e6 · e5 · e4 · e3 · e2 · e1 · e0 · C00 to C3F · r, i · r1 · r0 · ↑ · ↑ · r ← r+i3~i0 · # · ↓ · ↓ · C40 to C7F · r, i · r1 · r0 · ↑ · ↑ · r ← r+i3~i0+C · # · ↓ · ↓ · C80 to CBF · r, i · r1 · r0 · ↑ · ↓ · CC0 to CFF · r, i · r1 · r0 · ↑ · ↓ · D00 to D3F · r, i · r1 · r0 · ↑ · ↓ · D0F to D3F · r · r1 · r0 · ↑ · r ← r · ↓ · D40 to D7F · r, i · r1 · r0 · ↑ · ↑ · r ← r-i3~i0-C · # · ↓ · ↓ · D80 to DBF · r, i · r1 · r0 · ↑ · rΛi3~i0 · ↓ · DC0 to DFF · r, i · r1 · r0 · ↑ · ↑ · r-i3~i0 · ↓ · ↓ · E00 to E3F · r, i · r1 · r0 · r ← i3~i0
Page 30 of the Epson 6200A user manual — F5D
Pagina 30 · clicca per ingrandire
Pagina 30

Operand Clock Operation Code Flag Mne- monic Operation Operation Code (HEX)

B

A

I D Z C

PSET

NBP ← p4, NPP ← p3~p0

LDPX

M(X) ← i3~i0, X ← X+1

LDPY

M(Y) ← i3~i0, Y ← Y+1

LD

LD

LD

RRC

d3 ← C, d2 ← d3, d1 ← d2, d0 ← d1, C ← d0

LD

LD

LD

LD

LD

LD

LD

LD

LD

LD

EE0

INC

X ← X+1

LDPX

r ← q, X ← X+1

EF0

INC

Y

Y ← Y+1

LDPY

r ← q, Y ← Y+1

CP

FAN

ACPX

M(X) ← M(X)+r+C, X ← X+1

ACPY

M(Y) ← M(Y)+r+C, Y ← Y+1

SCPX

M(X) ← M(X)-r-C, X ← X+1

SCPY

M(Y) ← M(Y)-r-C, Y ← Y+1

SET

F ← FVi3~i0

F41

SCF

C ← 1

F42

SZF

Z ← 1

F44

SDF

D ← 1 (Decimal Adjuster ON)

F48

EI

I ← 1 (Enables Interrupt)

RST

F ← FΛi3~i0

F57

DI

I ← 0 (Disables Interrupt)

F5B

RDF

D ← 0 (Decimal Adjuster OFF)

F5D

RZF

Z ← 0

F5E

RCF

C ← 0

INC

DEC

LD

Show 203 more labels / short text on this page
E40 to E5F · p · p4 · p3 · p2 · p1 · p0 · E60 to E6F · MX, i · E70 to E7F · MY, i · E80 to E83 · XP, r · r1 · r0 · XP ← r · E84 to E87 · XH, r · r1 · r0 · XH ← r · E88 to E8B · XL, r · r1 · r0 · XL ← r · E8C to E8F · r · r1 · r0 · ↑ · ↑ · ↓ · ↓ · E90 to E93 · YP, r · r1 · r0 · YP ← r · E94 to E97 · YH, r · r1 · r0 · YH ← r · E98 to E9B · YL, r · r1 · r0 · YL ← r · EA0 to EA3 · r, XP · r1 · r0 · r ← XP · EA4 to EA7 · r, XH · r1 · r0 · r ← XH · EA8 to EAB · r, XL · r1 · r0 · r ← XL · EB0 to EB3 · r, YP · r1 · r0 · r ← YP · EB4 to EB7 · r, YH · r1 · r0 · r ← YH · EB8 to EBB · r, YL · r1 · r0 · r ← YL · EC0 to ECF · r, q · r1 · r0 · q1 · q0 · r ← q · EE0 to EEF · r, q · r1 · r0 · q1 · q0 · EF0 to EFF · r, q · r1 · r0 · q1 · q0 · F00 to F0F · r, q · r1 · r0 · q1 · q0 · ↑ · ↑ · r-q · ↓ · ↓ · F10 to F1F · r, q · r1 · r0 · q1 · q0 · ↑ · rΛq · ↓ · F28 to F2B · MX, r · r1 · r0 · ↑ · ↑ · # · ↓ · ↓ · F2C to F2F · MY, r · r1 · r0 · ↑ · ↑ · # · ↓ · ↓ · F38 to F3B · MX, r · r1 · r0 · ↑ · ↑ · # · ↓ · ↓ · F3C to F3F · MY, r · r1 · r0 · ↑ · ↑ · # · ↓ · ↓ · F40 to F4F · F, i · ↑ · ↑ · ↑ · ↑ · ↑ · ↑ · ↑ · ↑ · F50 to F5F · F, i · ↓ · ↓ · ↓ · ↓ · ↓ · ↓ · ↓ · ↓ · F60 to F6F · Mn · n3 · n2 · n1 · n0 · ↑ · ↑ · M(n3~n0) ← M(n3~n0)+1 · ↓ · ↓ · F70 to F7F · Mn · n3 · n2 · n1 · n0 · ↑ · ↑ · M(n3~n0) ← M(n3~n0)-1 · ↓ · ↓ · F80 to F8F · Mn, A · n3 · n2 · n1 · n0 · M(n3~n0) ← A
Page 31 of the Epson 6200A user manual — FFF
Pagina 31 · clicca per ingrandire
Pagina 31

Operand Clock Operation Code Flag Mne- monic Operation Operation Code (HEX)

B

A

I D Z C

LD

LD

LD

PUSH

SP ← SP-1, M(SP) ← r

FC4

PUSH

XP

SP ← SP-1, M(SP) ← XP

FC5

PUSH

XH

SP ← SP-1, M(SP) ← XH

FC6

PUSH

SP ← SP-1, M(SP) ← XL

FC7

PUSH

YP

SP ← SP-1, M(SP) ← YP

FC8

PUSH

YH

SP ← SP-1, M(SP) ← YH

FC9

PUSH

YL

SP ← SP-1, M(SP) ← YL

FCA

PUSH

F

SP ← SP-1, M(SP) ← F

FCB

DEC

SP

SP ← SP-1

POP

r ← M(SP), SP ← SP+1

FD4

POP

XP

XP ← M(SP), SP ← SP+1

FD5

POP

XH

XH ← M(SP), SP ← SP+1

FD6

POP

XL ← M(SP), SP ← SP+1

FD7

POP

YP

YP ← M(SP), SP ← SP+1

FD8

POP

YH

YH ← M(SP), SP ← SP+1

FD9

POP

YL

YL ← M(SP), SP ← SP+1

FDA

POP

F

F ← M(SP), SP ← SP+1

FDB

INC

SP

SP ← SP+1

FDE

RETS

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)

SP ← SP+3, PC ← PC+1

FDF

RET

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2)

SP ← SP+3

LD

LD

FE8

JPBA

PCB ← NBP, PCP ← NPP, PCSH ← B, PCSL ← A

LD

LD

FF8

HALT

FF9

SLP

FFB

NOP5

No operation (5 clock cycles)

FFF

NOP7

No operation (7 clock cycles)

Show 54 more labels / short text on this page
F90 to F9F · Mn, B · n3 · n2 · n1 · n0 · M(n3~n0) ← B · FA0 to FAF · A, Mn · n3 · n2 · n1 · n0 · A ← M(n3~n0) · FB0 to FBF · B, Mn · n3 · n2 · n1 · n0 · B ← M(n3~n0) · FC0 to FC3 · r · r1 · r0 · FD0 to FD3 · r · r1 · r0 · ↑↓ ↑↓ · ↑↑ · ↓ ↓ · FE0 to FE3 · SPH, r · r1 · r0 · SPH ← r · FE4 to FE7 · r, SPH · r1 · r0 · r ← SPH · FF0 to FF3 · SPL, r · r1 · r0 · SPL ← r · FF4 to FF7 · r, SPL · r1 · r0 · r ← SPL · Halt (stop clock) · SLEEP (stop oscillation)
Page 32 of the Epson 6200A user manual — 3.3 Flags
Pagina 32 · clicca per ingrandire
Pagina 32

3.2 Operands

This section describes the operands used in the instructions.

p 5-bit immediate data or labels 00H to 1FH. Used to specify a destination address. s 8-bit immediate data or labels 00H to FFH. Used to specify a destination address. e 8-bit immediate data 00H to FFH. i 4-bit immediate data 00H to 0FH. r 2-bit immediate data. See Table 3.2.1. q 2-bit immediate data. See Table 3.2.1.

The contents of A, B, MX, MY are referenced using r and q as shown in the following table.

Table 3.2.1 Values of r and q

r1 or q1

r0 or q0

A

B

MX

MY

A A register B B register XP XP register---four high-order bits of IX YP YP register---four high-order bits of IY X XHL register---eight low-order bits of IX Y YHL register---eight low-order bits of IY XH XH register---four high-order bits of XHL XL XL register---four low-order bits of XHL YH YH register---four high-order bits of YHL YL YL register---four low-order bits of YHL SP Stack pointer SP SPH Four high-order bits of SP SPL Four low-order bits of SP F Flag register (IF, DF, ZF, CF) MX Data memory location whose address is specified by IX MY Data memory location whose address is specified by IY Mn Data memory location within the register area (000H to 00FH), specified by immediate data n (0H to FH) C Carry NC No carry Z Zero NZ Not zero

3.3 Flags

1. Carry flag The carry flag is set if a carry was generated by the previous operation. It is affected by 17 arithmetic and logical instructions, four flag operations, eight index operation instructions and the POP F instruction.
2. Zero flag The zero flag is set if a zero occurred in the previous operation. It is affected by 26 arithmetic and logical instructions, four flag operations, eight index operation instructions and the POP F instruction.
3. Decimal flag The decimal flag enables decimal addition and subtraction when set. It is set by SDF or SET F,i and reset by RDF or RST F, i . It is affected by the POP F instruction.
4. Interrupt flag The interrupt flag enables interrupts when set. It is set by EI or SET F, i and reset by DI or RST F, i . It is affected by the POP F instruction. When an interrupt is generated, the I flag is automatically reset. It is not automatically set at the end of the interrupt service routine.
Page 33 of the Epson 6200A user manual — 3.5 Instruction Descriptions
Pagina 33 · clicca per ingrandire
Pagina 33

3.4 Instruction Types

Instructions are divided into six types according to the size of the operand.

(I) MSB LSB

exJP CALL LBPX

etc.

(II) MSB LSB

exADD LD FAN

r, i r, i r, i

etc.

(III)

exPSET p

(IV)

exSET LD INC

F, i r, q Mn

etc.

(V)

exACPX LD PUSH

MX, r XH, r r

etc.

(VI)

exJPBA POP INC

YL X

etc.

3.5 Instruction Descriptions

This section describes S1C6200/6200A instructions in alphabetical order.

Show 6 more labels / short text on this page
s s MX,e · Op-code 8-bit operand · Op-code 6-bit operand · Op-code 5-bit operand · Op-code 4-bit operand · Op-code 2-bit operand
Page 34 of the Epson 6200A user manual — ACPY MY,r
Pagina 34 · clicca per ingrandire
Pagina 34

ACPX MX,r Add with carry r-register to M(X), increment X by 1

ACPX MX,r

M(X) ← M(X) + r + C, X ← X + 1

1 0 0 1 0 1 0 r1 r0 F28H to F2BH

Set if a carry is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Adds the carry bit and the contents of the r-register to the data memory location addressed by IX. X is incremented by one. Incrementing X does not affect the flags.

ACPX MX,A ACPX MX,MY X register 1010 0000 1010 0001 1010 0010 Y register 0100 0110 0100 0110 0100 0110 Memory (A0H) 0110 1111 1111 Memory (A1H) 0011 0011 0111 Memory (46H) 0100 0100 0100 A register 1000 1000 1000 C flag 1 0 0 Z flag 0 0 0

ACPY MY,r Add with carry r-register to M(Y), increment Y by 1

ACPY MY,r

M(Y) ← M(Y) + r + C, Y ← Y + 1

1 0 0 1 0 1 1 r1 r0 F2CH to F2FH

Set if a carry is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Adds the carry bit and the contents of the r-register to the data memory location addressed by IY. Y is incremented by one. Incrementing Y does not affect the flags.

ACPY MY,A ACPY MY,MX X register 0010 0001 0010 0001 0010 0001 Y register 0000 1110 0000 1111 0001 0000 Memory (0EH) 1000 1011 1011 Memory (0FH) 0100 0100 1010 Memory (21H) 0110 0110 0110 A register 0010 0010 0010 C flag 1 0 0 Z flag 0 0 0

Page 35 of the Epson 6200A user manual — ADC r,q
Pagina 35 · clicca per ingrandire
Pagina 35

ADC r,i Add with carry immediate data i to r-register

ADC r,i

r ← r + i3 to i0 + C

1 1 0 0 0 1 r1 r0 i3 i2 i1 i0 C40H to C7FH

Set if a carry is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Adds the carry bit and immediate data i to the r-register.

ADC MX,3 ADC B,7 Memory (MX) 0100 1000 1000 B register 1001 1001 0000 C flag 1 0 1 Z flag 1 0 1

ADC r,q Add with carry q-register to r-register

ADC r,q

r ← r + q + C

1 0 1 0 1 0 0 1 r1 r0 q1 q0 A90H to A9FH

Set if a carry is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Adds the carry bit and the contents of the q-register to the r-register.

ADC MY,A ADC MX,B A register 0101 0101 0101 B register 0001 0001 0001 Memory (MX) 0111 0111 1001 Memory (MY) 1011 0001 0001 C flag 1 1 0 Z flag 0 0 0

Page 36 of the Epson 6200A user manual — ADC XL,i
Pagina 36 · clicca per ingrandire
Pagina 36

ADC XH,i Add with carry immediate data i to XH

ADC XH,i

XH ← XH + i3 to i0 + C

1 0 1 0 i3 i2 i1 i0 A00H to A0FH

Set if a carry is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Adds the carry bit and immediate data i to XH, the four high-order bits of XHL.

ADC XH,2 ADC XH,4 XH register 1001 1100 0000 C flag 1 0 1 Z flag 0 0 1

ADC XL,i Add with carry immediate data i to XL

ADC XL,i

XL ← XL + i3 to i0 + C

1 0 1 0 1 i3 i2 i1 i0 A10H to A1FH

Set if a carry is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Adds the carry bit and immediate data i to XL, the four low-order bits of XHL.

ADC XL,3 ADC XL,0EH XL register 0000 0100 0010 C flag 1 0 1 Z flag 1 0 0

Page 37 of the Epson 6200A user manual — ADC YL,i
Pagina 37 · clicca per ingrandire
Pagina 37

ADC YH,i Add with carry immediate data i to YH

ADC YH,i

YH ← YH + i3 to i0 + C

1 0 1 0 0 0 1 0 i3 i2 i1 i0 A20H to A2FH

Set if a carry is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Adds the carry bit and immediate data i to YH, the four high-order bits of YHL.

ADC YH,3 ADC YH,6 YH register 1010 1110 0100 C flag 1 0 1 Z flag 0 0 0

ADC YL,i Add with carry immediate data i to YL

ADC YL,i

YL ← YL + i3 to i0 + C

1 0 1 0 0 0 1 1 i3 i2 i1 i0 A30H to A3FH

Set if a carry is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Adds the carry bit and immediate data i to YL, the four low-order bits of YHL.

ADC YL,3 ADC YL,2 YL register 1010 1110 0000 C flag 1 0 1 Z flag 0 0 1

Page 38 of the Epson 6200A user manual — ADD r,q
Pagina 38 · clicca per ingrandire
Pagina 38

ADD r,i Add immediate data i to r-register

ADD r,i

r ← r + i3 to i0

1 1 0 r1 r0 i3 i2 i1 i0 C00H to C3FH

Set if a carry is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Adds immediate data i to the contents of the r-register.

ADD A,5 ADD MY,2 A register 1010 1111 1111 Memory (MY) 0110 0110 1000 C flag 1 0 0 Z flag 0 0 0

ADD r,q Add q-register to r-register

ADD r,q

r ← r + q

1 0 1 0 1 0 0 0 r1 r0 q1 q0 A80H to A8FH

Set if a carry is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Adds the contents of the q-register to the contents of the r-register.

ADD A,MY ADD MX,B A register 0010 1111 1111 B register 0100 0100 0100 Memory (MX) 0111 0111 1011 Memory (MY) 1101 1101 1101 C flag 1 0 0 Z flag 1 0 0

Page 39 of the Epson 6200A user manual — AND r,q
Pagina 39 · clicca per ingrandire
Pagina 39

AND r,i Logical AND immediate data i with r-register

AND r,i

r ← r ∧ i3 to i0

1 1 0 0 1 0 r1 r0 i3 i2 i1 i0 C80H to CBFH

Not affected Set if the result is zero; otherwise, reset. Not affected Not affected

Performs a logical AND operation between immediate data i and the contents of the r-register. The result is stored in the r-register.

AND A,5 AND MX,3 A register 0110 0100 0100 Memory (MX) 1000 1000 0000 C flag 1 1 1 Z flag 0 0 1

AND r,q Logical AND q-register with r-register

AND r,q

r ← r ∧ q

1 0 1 0 1 1 0 0 r1 r0 q1 q0 AC0H to ACFH

Not affected Set if the result is zero; otherwise, reset. Not affected Not affected

Performs a logical AND operation between the contents of the q-register and the contents of the r-register. The result is stored in the r-register.

AND MX,A AND B,MY A register 0100 0100 0100 B register 1011 1011 0010 Memory (MX) 1010 0000 0000 Memory (MY) 0010 0010 0010 C flag 0 0 0 Z flag 0 1 0

Page 40 of the Epson 6200A user manual — CALZ s
Pagina 40 · clicca per ingrandire
Pagina 40

CALL s Call subroutine

CALL s

M(SP-1) ← PCP, M(SP-2) ← PCSH, M(SP-3) ← PCSL + 1, SP ← SP - 3, PCP ← NPP, PCS ← s7 to s0

0 1 0 0 s7 s6 s5 s4 s3 s2 s1 s0 400H to 4FFH

Pushes the program counter (PCP, PCS) onto the stack as the return address, then calls the subroutine addressed by NPP and the 8-bit operand.

PSET 06H CALL 10H PCP 0011 0011 0110 PCS 0010 1100 0010 1100 0001 0000 NPP 0001 0110 0110 SP C0 C0 BD Memory (SP-1) xxxx xxxx 0011 Memory (SP-2) xxxx xxxx 0010 Memory (SP-3) xxxx xxxx 1101

CALZ s Call subroutine at page zero

CALZ s

M(SP-1) ← PCP, M(SP-2) ← PCSH, M(SP-3) ← PCSL + 1, SP ← SP - 3, PCP ← 0, PCS ← s7 to s0

0 1 0 1 s7 s6 s5 s4 s3 s2 s1 s0 500H to 5FFH

Pushes the program counter (PCP, PCS) onto the stack as the return address, then calls the subroutine addressed by the 8-bit operand. As NPP is reset to 0H, only a subroutine in page 0 can be called.

CALZ 10H PCP 1010 0000 PCS 0010 1110 0001 0000 SP CA C7 Memory (SP-1) xxxx 1010 Memory (SP-2) xxxx 0010 Memory (SP-3) xxxx 1111

Page 41 of the Epson 6200A user manual — CP r,q
Pagina 41 · clicca per ingrandire
Pagina 41

CP r,i Compare immediate data i with r-register

CP r,i

r - i3 to i0

1 1 0 1 1 1 r1 r0 i3 i2 i1 i0 DC0H to DFFH

Set if r < i3 to i0; otherwise, reset. Set if r = i3 to i0; otherwise, reset. Not affected Not affected

Compares immediate data i to the r-register by subtracting i from the contents of r. The r-register remains unchanged. 1. When Z = 0 and C = 0 then i < r 2. When Z = 1 and C = 0 then i = r 3. When Z = 0 and C = 1 then i > r

CP A,4 CP MX,7 CP B,2 A register 0100 B register 1010 Memory (MX) 0010 C flag 1 0 1 0 Z flag 0 1 0 0

CP r,q Compare q-register with r-register

CP r,q

1 0 r1 r0 q1 q0 F00H to F0FH

Set if r < q; otherwise, reset. Set if r = q; otherwise, reset. Not affected Not affected

Compares the q-register to the r-register by subtracting the contents of q from the contents of r. The registers remain unchanged. 1. When Z = 0 and C = 0 then q < r 2. When Z = 1 and C = 0 then q = r 3. When Z = 0 and C = 1 then q > r

CP A,B CP MY,A A register 1000 1000 1000 B register 0100 0100 0100 Memory (MY) 0111 0111 0111 C flag 0 0 1 Z flag 0 0 0

r - q

Page 42 of the Epson 6200A user manual — CP XL,i
Pagina 42 · clicca per ingrandire
Pagina 42

CP XH,i Compare immediate data i with XH

CP XH,i

XH - i3 to i0

1 0 1 0 0 1 0 0 i3 i2 i1 i0 A40H to A4FH

Set if XH < i3 to i0; otherwise, reset. Set if XH = i3 to i0; otherwise, reset. Not affected Not affected

Compares immediate data i to XH by subtracting i from the contents of XH. XH remains unchanged. 1. When Z = 0 and C = 0 then i < XH 2. When Z = 1 and C = 0 then i = XH 3. When Z = 0 and C = 1 then i > XH

CP XH,2 CP XH,4 CP XH,9 XH register 0100 C flag 1 0 0 1 Z flag 0 0 1 0

CP XL,i Compare immediate data i with XL

CP XL,i

XL - i3 to i0

1 0 1 0 0 1 0 1 i3 i2 i1 i0 A50H to A5FH

Set if XL < i3 to i0; otherwise, reset. Set if XL = i3 to i0; otherwise, reset. Not affected Not affected

Compares immediate data i to XL by subtracting i from the contents of XL. XL remains unchanged. 1. When Z = 0 and C = 0 then i < XL 2. When Z = 1 and C = 0 then i = XL 3. When Z = 0 and C = 1 then i > XL

CP XL,7 CP XL,9 CP XL,0AH XL register 1001 C flag 0 0 0 1 Z flag 0 0 1 0

Page 43 of the Epson 6200A user manual — CP YL,i
Pagina 43 · clicca per ingrandire
Pagina 43

CP YH,i Compare immediate data i with YH

CP YH,i

YH - i3 to i0

1 0 1 0 0 1 1 0 i3 i2 i1 i0 A60H to A6FH

Set if YH < i3 to i0; otherwise, reset. Set if YH = i3 to i0; otherwise, reset. Not affected Not affected

Compares immediate data i to YH by subtracting i from the contents of YH. YH remains unchanged. 1. When Z = 0 and C = 0 then i < YH 2. When Z = 1 and C = 0 then i = YH 3. When Z = 0 and C = 1 then i > YH

CP YH,0AH CP YH,3 CP YH,0FH YH register 1010 C flag 1 0 0 1 Z flag 0 1 0 0

CP YL,i Compare immediate data i with YL

CP YL,i

YL - i3 to i0

1 0 1 0 0 1 1 1 i3 i2 i1 i0 A70H to A7FH

Set if YL < i3 to i0; otherwise, reset. Set if YL = i3 to i0; otherwise, reset. Not affected Not affected

Compares immediate data i to YL by subtracting i from the contents of YL. YL remains unchanged. 1. When Z = 0 and C = 0 then i < YL 2. When Z = 1 and C = 0 then i = YL 3. When Z = 0 and C = 1 then i > YL

CP YL,5 CP YL,1 CP YL,4 YL register 0100 C flag 0 1 0 0 Z flag 1 0 0 1

Page 44 of the Epson 6200A user manual — DEC SP
Pagina 44 · clicca per ingrandire
Pagina 44

DEC Mn

Decrement memory

DEC Mn

M(n3 to n0) ← M(n3 to n0) - 1

1 0 1 1 1 n3 n2 n1 n0 F70H to F7FH

Set if a borrow is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Decrements the contents of the data memory location addressed by Mn by 1.

DEC M0 DEC M2 DEC M0FH Memory (00H) 1001 1000 1000 1000 Memory (02H) 0000 0000 1111 1111 Memory (0FH) 0001 0001 0001 0000 C flag 1 0 1 0 Z flag 0 0 0 1

DEC SP Decrement stack pointer

DEC SP

SP ← SP - 1

1 0 0 1 0 1 1 FCBH

Decrements the contents of the stack pointer by 1. This operation does not affect the flags.

DEC SP Memory (SP) 1011 0001 1011 0000 C flag 0 0 Z flag 1 1

Page 45 of the Epson 6200A user manual — EI
Pagina 45 · clicca per ingrandire
Pagina 45

DI Disable interrupts

DI

1 0 1 0 1 0 1 1 1 F57H

Not affected Not affected Not affected Reset

Disables all interrupts.

DI C flag 0 0 Z flag 1 1 D flag 0 0 I flag 1 0

EI Enable interrupts

EI

1 0 1 0 0 1 0 0 0 F48H

Not affected Not affected Not affected Set

Enables all interrupts.

EI C flag 1 1 Z flag 0 0 D flag 0 0 I flag 0 1

Page 46 of the Epson 6200A user manual — FAN r,q
Pagina 46 · clicca per ingrandire
Pagina 46

FAN r,i Logical AND immediate data i with r-register for flag check

FAN r,i

r ∧ i3 to i0

1 1 0 1 1 0 r1 r0 i3 i2 i1 i0 D80H to DBFH

Not affected Set if the result is zero; otherwise, reset. Not affected Not affected

Performs a logical AND operation between immediate data i and the contents of the r-register. Only the Z flag is affected. The r-register remains unchanged.

FAN A,7 FAN MY,9 FAN B,2 A register 1000 B register 0100 Memory (MY) 1000 C flag 1 Z flag 0 1 0 1

FAN r,q Logical AND q-register with r-register for flag check

FAN r,q

1 0 0 0 1 r1 r0 q1 q0 F10H to F1FH

Not affected Set if the result is zero; otherwise, reset. Not affected Not affected

Performs a logical AND operation between the contents of the q-register and the contents of the r-register. Only the Z flag is affected. The registers remains unchanged.

FAN A,B FAN MX,B FAN A,MY A register 1000 B register 1010 Memory (MX) 0101 Memory (MY) 1110 C flag 0 Z flag 0 0 1 0

r ∧ q

Page 47 of the Epson 6200A user manual — INC Mn
Pagina 47 · clicca per ingrandire
Pagina 47

HALT Halt

HALT

1 0 0 0 FF8H

Stops the CPU. When an interrupt occurs, PCP and PCS are pushed onto the stack as the return address and the interrupt service routine is executed.

Instruction State PCP PCS I flag HALT RUN 0001 0011 0011 1 HALT Interrupt 0001 0011 0100 1 RUN 0001 Interrupt vector address 0

INC Mn Increment memory by 1

INC Mn

M(n3 to n0) ← M(n3 to n0) + 1

1 0 1 1 0 n3 n2 n1 n0 F60H to F6FH

Set if a carry is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

The contents of the data memory location addressed by Mn is incremented by 1.

INC M1 INC M3 INC M0DH Memory (01H) 0100 0101 0101 0101 Memory (03H) 1111 1111 0000 0000 Memory (0DH) 0111 0111 0111 1000 C flag 0 0 1 0 Z flag 1 0 1 0

Stops CPU

Page 48 of the Epson 6200A user manual — INC X
Pagina 48 · clicca per ingrandire
Pagina 48

Increment stack pointer by 1 INC SP

INC SP

SP ← SP + 1

1 0 1 1 0 1 1 FDBH

Increments the contents of the stack pointer by 1. This operation does not affect the flags.

INC SP SP 1110 1111 1111 0000 C flag 0 0 Z flag 0 0

INC X Increment X-register by 1

INC X

X ← X + 1

1 1 1 0 1 1 1 0 EE0H

Increments the contents of register X by 1. This operation does not affect the flags.

INC X X register 1111 1110 1111 1111 C flag 1 1 Z flag 0 0

Page 49 of the Epson 6200A user manual — JPBA
Pagina 49 · clicca per ingrandire
Pagina 49

INC Y Increment Y-register by 1

INC Y

Y ← Y + 1

1 1 1 0 1 0 EF0H

Increments the contents of register Y by 1. This operation does not affect the flags.

INC Y Y register 1011 0111 1011 1000 C flag 1 1 Z flag 0 0

JPBA Indirect jump using registers A and B

JPBA

PCB ← NBP, PCP ← NPP, PCSH ← B, PCSL ← A

1 0 1 0 0 0 FE8H

Uses the contents of a- and b-registers to specify the destination address of the jump. The b-register contains the four high-order bits of the address and the a- register contains the four low-order bits of the address.

PSET 15H JPBA PCB 0 0 1 NBP 0 1 1 PCP 1000 1000 0101 NPP 0001 0101 0101 PCS 1001 0000 1001 0001 0000 0110 A register 0110 0110 0110 B register 0000 0000 0000

Page 50 of the Epson 6200A user manual — JP NC,s
Pagina 50 · clicca per ingrandire
Pagina 50

JP C,s Jump if carry flag is set

JP C,s

PCB ← NBP, PCP ← NPP, PCS ← s7 to s0 if C = 1

0 0 1 0 s7 s6 s5 s4 s3 s2 s1 s0 200H to 2FFH

Jumps to the destination address specified by the 8-bit operand when the carry flag is set.

ADD A,8 PSET 06H JP C,10H PCB 0 NBP 0 PCP 0010 0010 0010 0110 NPP 0001 0001 0110 0110 PCS 0011 1100 0011 1101 0011 1110 0001 0000 A register 1000 0000 0000 0000 C flag 0 1 1 1

JP NC,s Jump if not carry

JP NC,s

PCB ← NBP, PCP ← NPP, PCS ← s7 to s0 if C = 0

0 0 1 1 s7 s6 s5 s4 s3 s2 s1 s0 300H to 3FFH

Jumps to the destination address specified by the 8-bit operand when the carry flag is not set.

PSET 11H JP NC,10H PCB 0 0 1 NBP 0 1 1 PCP 1001 1001 0001 NPP 0001 0001 0001 PCS 1000 1111 1001 0000 0001 0000 C flag 0 0 0

Page 51 of the Epson 6200A user manual — JP s
Pagina 51 · clicca per ingrandire
Pagina 51

JP NZ,s Jump if not zero

JP NZ,s

PCB ← NBP, PCP ← NPP, PCS ← s7 to s0 if Z = 0

0 1 1 1 s7 s6 s5 s4 s3 s2 s1 s0 700H to 7FFH

Jumps to the destination address specified by the 8-bit operand when the zero flag is not set.

JP NZ,10H PCB 1 1 NBP 1 1 PCP 0000 0000 NPP 0000 0000 PCS 0000 0111 0001 0000 Z flag 0 0

JP s Jump

JP s

PCB ← NBP, PCP ← NPP, PCS ← s7 to s0

0 s7 s6 s5 s4 s3 s2 s1 s0 000H to 0FFH

Unconditional jump to the destination address specified by the 8-bit operand.

PSET 0AH JP 10H PCB 0 0 0 NBP 0 0 0 PCP 0000 0000 1010 NPP 0001 1010 1010 PCS 0100 0010 0100 0011 0001 0000

Page 52 of the Epson 6200A user manual — LBPX MX,e
Pagina 52 · clicca per ingrandire
Pagina 52

JP Z,s Jump if zero

JP Z,s

PCB ← NBP, PCP ← NPP, PCS ← s7 to s0 if Z = 1

0 1 1 0 s7 s6 s5 s4 s3 s2 s1 s0 600H to 6FFH

Jumps to the destination address specified by the 8-bit operand when the zero flag is set.

SUB A,B PSET 1BH JP Z,10H PCB 0 0 0 1 NBP 0 0 1 1 PCP 0101 0101 0101 1011 NPP 0001 0001 1011 1011 PCS 0000 0010 0000 0011 0000 0100 0001 0000 A register 0110 0000 0000 0000 B register 0110 Z flag 0 1 1 1

LBPX MX,e Load immediate data e to memory, and increment X by 2

LBPX MX,e

M(X) ← e3 to e0, M(X+1) ← e7 to e4, X ← X + 2

1 0 0 1 e7 e6 e5 e4 e3 e2 e1 e0 900H to 9FFH

Stores 8-bit immediate data e in two, consecutive 4-bit locations in data memory. The X-register is incremented by 2. An overflow in X does not affect the flags.

LBPX MX,18H LBPX MX,36H X register 0001 1110 0010 0000 0010 0010 Memory (1EH) 0010 1000 1000 Memory (1FH) 1111 0001 0001 Memory (20H) 0000 0000 0110 Memory (21H) 0111 0111 0011

Page 53 of the Epson 6200A user manual — LD B,Mn
Pagina 53 · clicca per ingrandire
Pagina 53

LD A,Mn Load memory into A-register

LD A,Mn

A ← M(n3 to n0)

1 0 1 0 n3 n2 n1 n0 FA0H to FAFH

Loads the contents of the data memory location addressed by Mn into the A- register.

LD A,M5 LD A,M6 A register 0100 1111 0100 Memory (05H) 1111 1111 1111 Memory (06H) 0100 0100 0100

LD B,Mn Load memory into B-register

LD B,Mn

B ← M(n3 to n0)

1 0 1 1 n3 n2 n1 n0 FB0H to FBFH

Loads the contents of the data memory location addressed by Mn into the B- register.

LD B,M7 LD B,M8 B register 0100 0110 1010 Memory (07H) 0110 0110 0110 Memory (08H) 1010 1010 1010

Page 54 of the Epson 6200A user manual — LD Mn,B
Pagina 54 · clicca per ingrandire
Pagina 54

LD Mn,A Load A-register into memory

LD Mn,A

M(n3 to n0) ← A

1 0 0 0 n3 n2 n1 n0 F80H to F8FH

Loads the contents of the A-register into the location addressed by Mn.

LD M0AH,A LD M0BH,A A register 0110 0110 0110 Memory (0AH) 0100 0110 0110 Memory (0BH) 1011 1011 0110

LD Mn,B Load B-register into memory

LD Mn,B

M(n3 to n0) ← B

1 0 0 1 n3 n2 n1 n0 F90H to F9FH

Loads the contents of the B-register into the data memory location addressed by Mn.

LD M0,B LD M1,B B register 0100 0100 0100 Memory (00H) 1011 0100 0100 Memory (01H) 1111 1111 0100

Page 55 of the Epson 6200A user manual — LDPX r,q
Pagina 55 · clicca per ingrandire
Pagina 55

LDPX MX,i Load immediate data i into MX, increment X by 1

LDPX MX,i

M(X) ← i3 to i0, X ← X + 1

1 1 1 0 0 1 1 0 i3 i2 i1 i0 E60H to E6FH

Loads immediate data i into the data memory location addressed by IX. X is incremented by 1. Incrementing X does not affect the flags.

LDPX MX,7 LDPX MX,0AH X register 1000 0011 1000 0100 1000 0101 Memory (83H) 0010 0111 0111 Memory (84H) 1001 1001 1010

LDPX r,q Load q-register into r-register, increment X by 1

LDPX r,q

r ← q, X ← X + 1

1 1 1 0 1 1 1 0 r1 r0 q1 q0 EE0H to EEFH

Loads the contents of the q-register into the r-register. X is incremented by 1. Incrementing X does not affect the flags.

LDPX A,B LDPX B,MY X register 0100 1001 0100 1010 0100 1011 A register 1010 1101 1101 B register 1101 1101 0000 Memory (MY) 0000 0000 0000

Page 56 of the Epson 6200A user manual — LDPY r,q
Pagina 56 · clicca per ingrandire
Pagina 56

LDPY MY,i Load immediate data i into MY, increment Y by 1

LDPY MY,i

M(Y) ← i3 to i0, Y ← Y + 1

1 1 1 0 0 1 1 1 i3 i2 i1 i0 E70H to E7FH

Loads immediate data i into the data memory location addressed by IY. Y is incremented by 1. Incrementing Y does not affect the flags.

LDPY MY,7 LDPY MY,0 Y register 0010 1101 0010 1110 0010 1111 Memory (2DH) 1010 0111 0111 Memory (2EH) 0010 0010 0000

LDPY r,q Load q-register into r-register, increment Y by 1

LDPY r,q

r ← q, Y ← Y + 1

1 1 1 0 1 r1 r0 q1 q0 EF0H to EFFH

Loads the contents of the q-register into the r-register. Y is incremented by 1. Incrementing Y does not affect the flags.

LDPY A,B LDPY MX,B Y register 0100 1000 0100 1001 0100 1010 A register 1010 1000 1000 B register 1000 1000 1000 Memory (MX) 0010 0010 1000

Page 57 of the Epson 6200A user manual — LD r,q
Pagina 57 · clicca per ingrandire
Pagina 57

LD r,i Load immediate data i into r-register

LD r,i

r ← i3 to i0

1 1 1 0 0 0 r1 r0 i3 i2 i1 i0 E00H to E3FH

Loads immediate data i into the r-register.

LD A,6 LD MY,0 A register 0101 0110 0110 Memory (MY) 1001 1001 0000

LD r,q Load q-register into r-register

LD r,q

1 1 1 0 1 1 0 0 r1 r0 q1 q0 EC0H to ECFH

The contents of the q-register are loaded into the r-register.

LD A,B LD B,MY A register 0010 0000 0000 B register 0000 0000 0110 Memory (MY) 0110 0110 0110

r ← q

Page 58 of the Epson 6200A user manual — LD r,SPL
Pagina 58 · clicca per ingrandire
Pagina 58

LD r,SPH Load SPH into r-register

LD r,SPH

1 0 0 1 r1 r0 FE4H to FE7H

Loads the four high-order bits of the stack pointer into the r-register.

LD MX,SPH LD A,SPH SPH 0111 0111 0111 A register 0000 0000 0111 Memory (MX) 1100 0111 0111

LD r,SPL Load SPL into r-register

LD r,SPL

1 0 1 r1 r0 FF4H to FF7H

Loads the four low-order bits of the stack pointer into the r-register.

LD A,SPL LD MY,SPL SPL 1001 1001 1001 A register 0010 1001 1001 Memory (MY) 0000 0000 1001

r ← SPH · r ← SPL

Page 59 of the Epson 6200A user manual — LD r,XL
Pagina 59 · clicca per ingrandire
Pagina 59

LD r,XH Load XH into r-register

LD r,XH

1 1 1 0 1 0 1 0 0 1 r1 r0 EA4H to EA7H

Loads the four high-order bits of register X into the r-register.

LD B,XH LD MX,XH XH register 1010 1010 1010 B register 0010 1010 1010 Memory (MX) 0000 0000 1010

LD r,XL Load XL into r-register

LD r,XL

1 1 1 0 1 0 1 0 1 0 r1 r0 EA8H to EABH

Loads the four low-order bits of register X into the r-register.

LD MY,XL LD A,XL XL register 0000 0000 0000 A register 1101 1101 0000 Memory (MY) 0001 0000 0000

r ← XH · r ← XL

Page 60 of the Epson 6200A user manual — LD r,YH
Pagina 60 · clicca per ingrandire
Pagina 60

LD r,XP Load XP into r-register

LD r,XP

1 1 1 0 1 0 1 0 0 0 r1 r0 EA0H to EA3H

Loads the 4-bit page part of index register IX into the r-register.

LD MX,XP LD A,XP XP register 1111 1111 1111 A register 0010 0010 1111 Memory (MX) 0101 1111 1111

LD r,YH Load YH into r-register

LD r,YH

1 1 1 0 1 0 1 1 0 1 r1 r0 EB4H to EB7H

Loads the four high-order bits of register Y into the r-register.

LD A,YH LD MY,YH YH register 1010 1010 1010 A register 1100 1010 1010 Memory (MY) 1110 1110 1010

r ← XP · r ← YH

Page 61 of the Epson 6200A user manual — LD r,YP
Pagina 61 · clicca per ingrandire
Pagina 61

LD r,YL Load YL into r-register

LD r,YL

1 1 1 0 1 0 1 1 1 0 r1 r0 EB8H to EBBH

Loads the four low-order bits of register Y into the r-register.

LD B,YL LD MX,YL YL register 0000 0000 0000 B register 0110 0000 0000 Memory (MX) 1011 1011 0000

LD r,YP Load YP into r-register

LD r,YP

1 1 1 0 1 0 1 1 0 0 r1 r0 EB0H to EB3H

Loads the 4-bit page part of index register IY into the r-register.

LD MY,YP LD B,YP YP register 1010 1010 1010 B register 1100 1100 1010 Memory (MY) 0110 1010 1010

r ← YL · r ← YP

Page 62 of the Epson 6200A user manual — LD SPL,r
Pagina 62 · clicca per ingrandire
Pagina 62

LD SPH,r Load r-register into SPH

LD SPH,r

1 0 0 0 r1 r0 FE0H to FE3H

Loads the contents of the r-register into the four high-order bits of the stack pointer.

LD SPH,A LD SPH,MY SPH 1001 0011 1100 A register 0011 0011 0011 Memory (MY) 1100 1100 1100

LD SPL,r Load r-register into SPL

LD SPL,r

1 0 0 r1 r0 FF0H to FF3H

Loads the contents of the r-register into the four low-order bits of the stack pointer.

LD SPL,B LD SPL,MX SPL 1011 0111 1111 B register 0111 0111 0111 Memory (MX) 1111 1111 1111

SPH ← r · SPL ← r

Page 63 of the Epson 6200A user manual — LD XH,r
Pagina 63 · clicca per ingrandire
Pagina 63

LD X,e Load immediate data e into X-register

LD X,e

XH ← e7 to e4, XL ← e3 to e0

1 0 1 1 e7 e6 e5 e4 e3 e2 e1 e0 B00H to BFFH

Loads 8-bit immediate data e into register X.

LD X,6FH XH register 0000 0110 XL register 1011 1111

LD XH,r Load r-register into XH

LD XH,r

1 1 1 0 1 0 1 r1 r0 E84H to E87H

Loads the contents of the r-register into the four high-order bits of register X.

LD XH,A LD XH,MY XH register 0000 1011 0110 A register 1011 1011 1011 Memory (MY) 0110 0110 0110

XH ← r

Page 64 of the Epson 6200A user manual — LD XP,r
Pagina 64 · clicca per ingrandire
Pagina 64

LD XL,r Load r-register into XL

LD XL,r

1 1 1 0 1 0 0 0 1 0 r1 r0 E88H to E8BH

Loads the contents of the r-register into the four low-order bits of register X.

LD XL,MY LD XL,A XL register 0000 0010 1011 A register 1011 1011 1011 Memory (MY) 0010 0010 0010

LD XP,r Load r-register into XP

LD XP,r

1 1 1 0 1 0 r1 r0 E80H to E83H

Loads the contents of the r-register into the 4-bit page part of index register IX.

LD XP,B LD XP,MX XP register 1001 0001 1011 B register 0001 0001 0001 Memory (MX) 1011 1011 1011

XL ← r · XP ← r

Page 65 of the Epson 6200A user manual — LD YH,r
Pagina 65 · clicca per ingrandire
Pagina 65

LD Y,e Load immediate data e into Y-register

LD Y,e

YH ← e7 to e4, YL ← e3 to e0

1 0 0 0 e7 e6 e5 e4 e3 e2 e1 e0 800H to 8FFH

Loads 8-bit immediate data e into register Y.

LD Y,E1H YH register 0001 1110 YL register 1100 0001

LD YH,r Load r-register into YH

LD YH,r

1 1 1 0 1 0 0 1 0 1 r1 r0 E94H to E97H

Loads the contents of the r-register into the four high-order bits of register Y.

LD YH,B LD YH,MX YH register 0000 0110 0101 B register 0110 0110 0110 Memory (MX) 0101 0101 0101

YH ← r

Page 66 of the Epson 6200A user manual — LD YP,r
Pagina 66 · clicca per ingrandire
Pagina 66

LD YL,r Load r-register into YL

LD YL,r

1 1 1 0 1 0 0 1 1 0 r1 r0 E98H to E9BH

Loads the contents of the r-register into the four low-order bits of register Y.

LD YL,B LD YL,MX YL register 1011 1010 0111 B register 1010 1010 1010 Memory (MX) 0111 0111 0111

LD YP,r Load r-register into YP

LD YP,r

1 1 1 0 1 0 0 1 0 0 r1 r0 E90H to E93H

Loads the contents of the r-register into the 4-bit page part of index register IY.

LD YP,MX LD YP,A YP register 0011 0000 0100 A register 0100 0100 0100 Memory (MX) 0000 0000 0000

YL ← r · YP ← r

Page 67 of the Epson 6200A user manual — NOP7
Pagina 67 · clicca per ingrandire
Pagina 67

NOP5 No operation for 5 clock cycles

NOP5

No operation (5 clock cycles)

1 0 1 1 FFBH

Increments the program counter by 1. Has no other effect for 5 clock cycles.

NOP5 PCB 0 0 PCP 0011 0011 PCS 0001 0011 0001 0100

NOP7 No operation for 7 clock cycles

NOP7

No operation (7 clock cycles)

1 FFFH

Increments the program counter by 1. Has no other effect for 7 clock cycles.

NOP7 PCB 0 0 PCP 1010 1010 PCS 1001 1001 1001 1010

Page 68 of the Epson 6200A user manual — OR r,i
Pagina 68 · clicca per ingrandire
Pagina 68

NOT r NOT r-register (one's complement)

NOT r

1 1 0 1 0 0 r1 r0 1 D0FH to D3FH

Not affected Set if the result is zero; otherwise, reset. Not affected Not affected

Performs a one's complement operation on the contents of the r-register.

NOT A NOT MY A register 1001 0110 0110 Memory (MY) 1111 1111 0000 Z flag 0 0 1

OR r,i Logical OR immediate data i with r-register

OR r,i

r ← r ∨ i3 to i0

1 1 0 0 1 1 r1 r0 i3 i2 i1 i0 CC0H to CFFH

Not affected Set if the result is zero; otherwise, reset. Not affected Not affected

Performs a logical OR operation between immediate data i and the contents of the r-register. The result is stored in the r-register.

OR B,5 OR MX,0BH B register 0100 0101 0101 Memory (MX) 0011 0011 0111 Z flag 0 0 0

r ← r

Page 69 of the Epson 6200A user manual — POP F
Pagina 69 · clicca per ingrandire
Pagina 69

OR r,q Logical OR q-register with r-register

OR r,q

r ← r ∨ q

1 0 1 0 1 1 0 1 r1 r0 q1 q0 AD0H to ADFH

Not affected Set if the result is zero; otherwise, reset. Not affected Not affected

Performs a logical OR operation between the contents of the q-register and the contents of the r-register. The result is stored in the r-register.

OR MY,0 OR A,0CH A register 0011 0011 1111 Memory (MY) 0000 0000 0000 Z flag 0 1 0

POP F Pop stack data into flags

POP F

F ← M(SP), SP ← SP + 1

1 0 1 1 0 1 0 FDAH

Set or Reset by M(SP) data Set or Reset by M(SP) data Set or Reset by M(SP) data Set or Reset by M(SP) data

Replaces the flags (F) with the contents of the data memory location addressed by the stack pointer. SP is incremented by 1.

POP F SP C0 C1 Memory (C0H) 1001 1001 Flags (I,D,Z,C) 0001 1001

23 22 21 20 M(SP) =

flag

Page 70 of the Epson 6200A user manual — POP XH
Pagina 70 · clicca per ingrandire
Pagina 70

POP r Pop stack data into r-register

POP r

r ← M(SP), SP ← SP + 1

1 0 1 0 0 r1 r0 FD0H to FD3H

Loads the contents of the data memory location addressed by the stack pointer into the r-register. SP is incremented by 1.

POP B SP C0 C1 Memory (C0H) 1001 1001 B register 0101 1001

23 22 21 20 M(SP) =

= r-register 20 21 22 23

POP XH Pop stack data into XH

POP XH

XH ← M(SP), SP ← SP + 1

1 0 1 0 1 0 1 FD5H

Loads the contents of the data memory location addressed by the stack pointer into XH, the four high-order bits of X. SP is incremented by 1.

POP XH SP CE CF Memory (CEH) 0110 0110 XH register 0010 0110

23 22 21 20 M(SP) =

= XH 20 21 22 23

Page 71 of the Epson 6200A user manual — POP XP
Pagina 71 · clicca per ingrandire
Pagina 71

POP XL Pop stack data into XL

POP XL

XL ← M(SP), SP ← SP + 1

1 0 1 0 1 1 0 FD6H

Loads the contents of the data memory location addressed by the stack pointer into XL, the four low-order bits of X. SP is incremented by 1.

POP XL SP C0 C1 Memory (C0H) 0001 0001 XL register 1101 0001

23 22 21 20 M(SP) =

= XL 20 21 22 23

POP XP Pop stack data into XP

POP XP

XP ← M(SP), SP ← SP + 1

1 0 1 0 1 0 0 FD4H

Loads the contents of the data memory location addressed by the stack pointer into XP, the 4-bit page part of IX. SP is incremented by 1.

POP XP SP B4 B5 Memory (B4H) 0101 0101 XP register 0111 0101

23 22 21 20 M(SP) =

= XP 20 21 22 23

Page 72 of the Epson 6200A user manual — POP YL
Pagina 72 · clicca per ingrandire
Pagina 72

POP YH Pop stack data into YH

POP YH

YH ← M(SP), SP ← SP + 1

1 0 1 1 0 0 0 FD8H

Loads the contents of the data memory location addressed by the stack pointer into YH, the four high-order bits of Y. SP is incremented by 1.

POP YH SP C1 C2 Memory (C1H) 1101 1101 YH register 0010 1101

23 22 21 20 M(SP) =

= YH 20 21 22 23

POP YL Pop stack data into YL

POP YL

YL ← M(SP), SP ← SP + 1

1 0 1 1 0 0 1 FD9H

Loads the contents of the data memory location addressed by the stack pointer into YL, the four low-order bits of Y. SP is incremented by 1.

POP YL SP CA CB Memory (CAH) 0100 0100 YL register 0101 0100

23 22 21 20 M(SP) =

= YL 20 21 22 23

Page 73 of the Epson 6200A user manual — PSET p
Pagina 73 · clicca per ingrandire
Pagina 73

POP YP Pop stack data into YP

POP YP

YP ← M(SP), SP ← SP + 1

1 0 1 0 1 1 1 FD7H

Loads the contents of the data memory location addressed by the stack pointer into YP, the 4-bit page part of IY. SP is incremented by 1.

POP YP SP C0 C1 Memory (C0H) 0000 0000 YP register 0001 0000

23 22 21 20 M(SP) =

= YP 20 21 22 23

PSET p Page set

PSET p

NBP ← p4, NPP ← p3 to p0

1 1 1 0 0 1 0 p4 p3 p2 p1 p0 E40H to E5FH

Loads the most-significant bit of the 5-bit immediate data p to the new bank pointer (NBP) and the four low-order bits to the new page pointer (NPP).

PSET 1FH JP 00H PCB 0 0 1 NBP 0 1 1 PCP 1000 1000 1111 NPP 0001 1111 1111 PCS 0010 0011 0010 0100 0000 0000

Page 74 of the Epson 6200A user manual — Z D
Pagina 74 · clicca per ingrandire
Pagina 74

PUSH F Push flag onto stack

PUSH F

SP' ← SP - 1, M(SP') ← F

1 0 0 1 0 1 0 FCAH

Decrements the stack pointer by 1 and loads the flags (F) into the data memory location addressed by SP.

PUSH F SP D0 CF Memory (CFH) 0100 0001 Flags (I,D,Z,C) 0001 0001

23 22 21 20 M(SP) =

flag

Z D

PUSH r Push r-register onto stack

PUSH r

SP' ← SP - 1, M(SP') ← r

1 0 r1 r0 FC0H to FC3H

Decrements the stack pointer by 1 and loads the contents of the r-register into the data memory location addressed by SP.

PUSH A SP D0 CF Memory (CFH) 1000 0010 A register 0010 0010

23 22 21 20 M(SP) =

= r-register 20 21 22 23

Page 75 of the Epson 6200A user manual — PUSH XL
Pagina 75 · clicca per ingrandire
Pagina 75

PUSH XH Push XH onto stack

PUSH XH

SP' ← SP - 1, M(SP') ← XH

1 0 0 0 1 0 1 FC5H

Decrements the stack pointer by 1 and loads the contents of XH, the four high- order bits of XHL, into the data memory location addressed by SP.

PUSH XH SP CC CB Memory (CBH) 0000 1000 XH register 1000 1000

23 22 21 20 M(SP) =

= XH 20 21 22 23

PUSH XL Push XL onto stack

PUSH XL

SP' ← SP - 1, M(SP') ← XL

1 0 0 0 1 1 0 FC6H

Decrements the stack pointer by 1 and loads the contents of XL, the four low-order bits of XHL, into the data memory location addressed by SP.

PUSH XL SP D0 CF Memory (CFH) 1111 0110 XL register 0110 0110

23 22 21 20 M(SP) =

= XL 20 21 22 23

Page 76 of the Epson 6200A user manual — PUSH YH
Pagina 76 · clicca per ingrandire
Pagina 76

PUSH XP Push XP onto stack

PUSH XP

SP' ← SP - 1, M(SP') ← XP

1 0 0 0 1 0 0 FC4H

Decrements the stack pointer by 1 and loads the contents of XP, the page part of IX, into the data memory location addressed by SP.

PUSH XP SP D0 CF Memory (CFH) 0011 0000 XP register 0000 0000

23 22 21 20 M(SP) =

= XP 20 21 22 23

PUSH YH Push YH onto stack

PUSH YH

SP' ← SP - 1, M(SP') ← YH

1 0 0 1 0 0 0 FC8H

Decrements the stack pointer by 1 and loads the contents of YH, the four high- order bits of YHL, into the data memory location addressed by SP.

PUSH YH SP BF BE Memory (BEH) 0100 0001 YH register 0001 0001

23 22 21 20 M(SP) =

= YH 20 21 22 23

Page 77 of the Epson 6200A user manual — PUSH YP
Pagina 77 · clicca per ingrandire
Pagina 77

PUSH YL Push YL onto stack

PUSH YL

SP' ← SP - 1, M(SP') ← YL

1 0 0 1 0 0 1 FC9H

Decrements the stack pointer by 1 and loads the contents of YL, the four low-order bits of YHL, into the data memory location addressed by SP.

PUSH YL SP D0 CF Memory (CFH) 0001 0111 YL register 0111 0111

23 22 21 20 M(SP) =

= YL 20 21 22 23

PUSH YP Push YP onto stack

PUSH YP

SP' ← SP - 1, M(SP') ← YP

1 0 0 0 1 1 1 FC7H

Decrements the stack pointer by 1 and loads the contents of YP, the page part of IY, into the data memory location addressed by SP.

PUSH YP SP C0 BF Memory (BFH) 1111 0000 YP register 0000 0000

23 22 21 20 M(SP) =

= YP 20 21 22 23

Page 78 of the Epson 6200A user manual — RDF
Pagina 78 · clicca per ingrandire
Pagina 78

RCF Reset carry flag

RCF

C ← 0

1 0 1 0 1 0 F5EH

Reset Not affected Not affected Not affected

Resets the C (carry) flag.

ADD A,4 RCF A register 1101 0001 0001 C flag 0 1 0

RDF Reset decimal flag

RDF

D ← 0

1 0 1 0 1 1 0 1 1 F5BH

Not affected Not affected Reset Not affected

Resets the D (decimal) flag.

ADD A,8 RDF LD A,6 ADD A,8 A register 0110 0100 0100 0110 1110 D flag 1 1 0 0 0 C flag 0 1 1 1 0 Z flag 0

Page 79 of the Epson 6200A user manual — RETD e
Pagina 79 · clicca per ingrandire
Pagina 79

RET Return from subroutine

RET

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2), SP ← SP + 3

1 0 1 FDFH

Jumps to the return address that was pushed onto the stack when the subroutine was called.

RET PCP 1101 0010 PCS 1000 1101 0010 1101 SP BD C0 Memory (SP) 1101 1101 Memory (SP+1) 0010 0010 Memory (SP+2) 0010 0010

RETD e Load immediate data e to memory, and increment X by 2, then return

RETD e

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2), SP ← SP + 3, M(X) ← e3 to e0, M(X+1) ← e7 to e4, X ← X + 2

0 0 0 1 e7 e6 e5 e4 e3 e2 e1 e0 100H to 1FFH

Loads 8-bit immediate data e into the data memory location addressed by IX and executes the RET command. X is incremented by 2.

RETD F5H PCP 0000 0010 PCS 1010 1011 0010 1101 SP BD C0 Memory (SP) 1101 1101 Memory (SP+1) 0010 0010 Memory (SP+2) 0010 0010 X register 0010 1010 0010 1100 Memory (2AH) 0000 0101 Memory (2BH) 0000 1111

Page 80 of the Epson 6200A user manual — RLC r
Pagina 80 · clicca per ingrandire
Pagina 80

RETS Return then skip an instruction

RETS

PCSL ← M(SP), PCSH ← M(SP+1), PCP ← M(SP+2), SP ← SP + 3, PC ← PC + 1

1 0 1 0 FDEH

Jumps to the return address that was pushed onto the stack when the subroutine was called and then skips one instruction.

RETS PCP 0110 0000 PCS 1001 0000 0000 0111 SP B0 B3 Memory (SP) 0110 0110 Memory (SP+1) 0000 0000 Memory (SP+2) 0000 0000

RLC r Rotate r-register left with carry

RLC r

d3 ← d2, d2 ← d1, d1 ← d0, d0 ← C, C ← d3

1 0 1 0 1 r1 r0 r1 r0 AF0H to AFFH

Set when the high-order bit of the r-register is 1; otherwise, reset. Not affected Not affected Not affected

Shifts the contents of the r-register one bit to the left. The high-order bit is shifted into the carry flag and the carry bit becomes the low-order bit of the r-register.

C C d3

d3 d2 d1 d0

d2 d1 d0

RLC A A register 0011 0111 C flag 1 0

r-register C C · r-register

Page 81 of the Epson 6200A user manual — RST F,i
Pagina 81 · clicca per ingrandire
Pagina 81

RRC r Rotate r-register right with carry

RRC r

d3 ← C, d2 ← d3, d1 ← d2, d0 ← d1, C ← d0

1 1 1 0 1 0 0 0 1 1 r1 r0 E8CH to E8FH

Set when the low-order bit of the r-register is 1; otherwise, reset. Not affected Not affected Not affected

Shifts the contents of the r-register one bit to the right. The low-order bit is shifted into the carry flag and the carry bit becomes the high-order bit of the r-register.

d3 d2 d1 r-register C

d3 d2 d1 d0

RRC MY Memory (MY) 1010 1101 C flag 1 0

RST F,i Reset flags using immediate data i

RST F,i

F ← F ∧ i3 to i0

1 0 1 0 1 i3 i2 i1 i0 F50H to F5FH

Reset if i0 is zero; otherwise, not affected. Reset if i1 is zero; otherwise, not affected. Reset if i2 is zero; otherwise, not affected. Reset if i3 is zero; otherwise, not affected.

Performs a logical AND operation between immediate data i and the contents of the flags. The result is stored in each respective flag.

RST F,2 Flags (I,D,Z,C) 1010 0010

r-register · C d0

Page 82 of the Epson 6200A user manual — SBC r,i
Pagina 82 · clicca per ingrandire
Pagina 82

RZF Reset zero flag

RZF

Z ← 0

1 0 1 0 1 1 1 0 1 F5DH

Not affected Reset Not affected Not affected

Resets the Z (zero) flag.

ADD A,3 RZF Z flag 0 1 0 A register 1101 0000 0000

SBC r,i Subtract with carry immediate data i from r-register

SBC r,i

r ← r - i3 to i0 - C

1 1 0 1 0 1 r1 r0 i3 i2 i1 i0 D40H to D7FH

Set if a borrow is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Subtracts the carry flag and immediate data i from the r-register.

SBC A,9 SBC MY,0DH A register 1000 1111 1111 Memory (MY) 1110 1110 0000 C flag 0 1 0 Z flag 0 0 1

Page 83 of the Epson 6200A user manual — SCF
Pagina 83 · clicca per ingrandire
Pagina 83

SBC r,q Subtract with carry q-register from r-register

SBC r,q

r ← r - q - C

1 0 1 0 1 0 1 1 r1 r0 q1 q0 AB0H to ABFH

Set if a borrow is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Subtracts the carry flag and the contents of the q-register from the r-register.

SBC A,B SBC MY,MX A register 1110 1011 1011 B register 0010 0010 0010 Memory (MX) 1001 1001 1001 Memory (MY) 0100 0100 1011 C flag 1 0 1 Z flag 0 0 0

SCF Set carry flag

SCF

C ← 1

1 0 1 0 1 F41H

Set Not affected Not affected Not affected

Sets the C (carry) flag.

SCF C flag 0 1

Page 84 of the Epson 6200A user manual — SCPY MY,r
Pagina 84 · clicca per ingrandire
Pagina 84

SCPX MX,r Subtract with carry r-register from M(X) and increment X by 1

SCPX MX,r

M(X) ← M(X) - r - C, X ← X + 1

1 0 0 1 1 1 0 r1 r0 F38H to F3BH

Set if a borrow is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Subtracts the carry flag and the contents of the r-register from the data memory location addressed by IX. X is incremented by 1. Incrementing X does not affect the flags.

SCPX MX,B X register 0101 0000 0101 0001 Memory (50H) 0110 0100 B register 0010 0010 C flag 0 0 Z flag 0 0

SCPY MY,r Subtract with carry r-register from M(Y) and increment Y by 1

SCPY MY,r

M(Y) ← M(Y) - r - C, Y ← Y + 1

1 0 0 1 r1 r0 F3CH to F3FH

Set if a borrow is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Subtracts the carry flag and the contents of the r-register from the data memory location addressed by IY. Y is incremented by 1. Incrementing Y does not affect the flags.

SCPY MY,A Y register 1111 1111 0000 0000 Memory (FFH) 0111 0100 A register 0010 0010 C flag 1 0 Z flag 1 0

Page 85 of the Epson 6200A user manual — SET F,i
Pagina 85 · clicca per ingrandire
Pagina 85

SDF Set decimal flag

SDF

D ← 1

1 0 1 0 0 0 1 0 0 F44H

Not affected Not affected Set Not affected

Sets the D (decimal) flag.

SDF D flag 0 1

SET F,i Set flags using immediate data i

SET F,i

F ← F ∨ i3 to i0

1 0 1 0 0 i3 i2 i1 i0 F40H to F4FH

Set if i0 is 1; otherwise, not affected. Set if i1 is 1; otherwise, not affected. Set if i2 is 1; otherwise, not affected. Set if i3 is 1; otherwise, not affected.

Performs a logical OR operation between immediate data i and the contents of the flags. The results are stored in each respective flag.

SET F,0DH Flags (C,Z,D,I) 0011 1111

Page 86 of the Epson 6200A user manual — SUB r,q
Pagina 86 · clicca per ingrandire
Pagina 86

SLP Sleep

SLP

Stop CPU and peripheral oscillator

1 0 0 1 FF9H

Stops the CPU and the peripheral oscillator. When an interrupt occurs PCP and PCS are pushed onto the stack as the return address and the interrupt service routine is executed.

Instruction State PCP PCS I flag RUN 0100 0011 0000 1 SLP 0100 0011 0001 1 SLEEP Interrupt →

NOP5 RUN

0001 0000 0001 0

SUB r,q Subtract q-register from r-register

SUB r,q

r ← r - q

1 0 1 0 1 0 1 0 r1 r0 q1 q0 AA0H to AAFH

Set if a borrow is generated; otherwise, reset. Set if the result is zero; otherwise, reset. Not affected Not affected

Subtracts the contents of the q-register from the r-register.

SUB A,B A register 1100 1001 B register 0011 0011 C flag 1 0 Z flag 0 0

Page 87 of the Epson 6200A user manual — XOR r,i
Pagina 87 · clicca per ingrandire
Pagina 87

SZF Set zero flag

SZF

Z ← 1

1 0 1 0 1 0 F42H

Not affected Set Not affected Not affected

Sets the Z (zero) flag.

SZF Z flag 0 1

XOR r,i Exclusive-OR immediate data i with r-register

XOR r,i

r ← r ∀ i3 to i0

1 1 0 1 0 0 r1 r0 i3 i2 i1 i0 D00H to D3FH

Not affected Set if the result is zero; otherwise, reset. Not affected Not affected

Performs an exclusive-OR operation between immediate data i and the contents of the r-register. The result is stored in the r-register.

XOR A,12 XOR MX,1 A register 0110 1010 1010 Memory (MX) 0001 0001 0000 Z flag 0 0 1

Page 88 of the Epson 6200A user manual — XOR r,q
Pagina 88 · clicca per ingrandire
Pagina 88

XOR r,q Exclusive-OR q-register with r-register

XOR r,q

r ← r ∀ q

1 0 1 0 1 1 1 0 r1 r0 q1 q0 AE0H to AEFH

Not affected Set if the result is zero; otherwise, reset. Not affected Not affected

Performs an exclusive-OR operation between the contents of the q-register and the contents of the r-register. The result is stored in the r-register.

XOR A,MY XOR MX,B A register 0100 1100 1100 B register 1111 1111 1111 Memory (MX) 0111 0111 1000 Memory (MY) 1000 1000 1000 Z flag 0 0 0

Page 89 of the Epson 6200A user manual — ABBREVIATIONS
Pagina 89 · clicca per ingrandire
Pagina 89

ABBREVIATIONS

A A register (4 bits) B B register (4 bits)

M(SP) Contents of the data memory location whose address is specified by stack pointer SP (4 bits) M(X) Contents of the data memory location whose address is specified by IX (4 bits)

M(Y) Contents of the data memory location whose address is specified by IY (4 bits) M(n3-0) Contents of the data memory location within the register area 00H to 0FH (4 bits)

MX Data memory location whose address is specified by IX MY Data memory location whose address is specified by IY

NBP New Bank Pointer (1 bit) NPP New Page Pointer (4 bits)

PCB Program Counter-Bank (1 bit) PCP Program Counter-Page (4 bits)

PCS Program Counter-Step (8 bits) PCSH Four high-order bits of PCS

PCSL Four low-order bits of PCS RP Register Pointer (4 bits)

SP Stack Pointer (8 bits) SPH Four high-order bits of SP

SPL Four low-order bits of SP X Eight low-order bits of IX, that is, XHL

XH Four high-order bits of X XL Four low-order bits of X

XP Four high-order bits of IX (page part) Y Eight low-order bits of IY, that is, YHL

YH Four high-order bits of Y YL Four low-order bits of Y

YP Four high-order bits of IY (page part) + Addition

– Subtraction ∧ Logical AND

∨ Logical OR ∀ Exclusive-OR

↓ Reset flag ↑ Set flag

↕ Set/reset flag ∗ Decimal addition/subtraction

Page 90 of the Epson 6200A user manual — PSET + JP
Pagina 90 · clicca per ingrandire
Pagina 90

APPENDIX A. S1C6200A (ADVANCED S1C6200) CORE CPU

APPENDIX A. S1C6200A (A DVANCED S1C6200) C ORE CPU

S1C6200A is an improved version of the S1C6200. In this section, S1C6200A is described only in terms of its differences with S1C6200. It is recommended that users of S1C6200A read this section.

S1C6200A is a Core CPU which has been made easier to integrate software by improving the parts of the S1C6200 CPU which are difficult to use. This section lists its differences with S1C6200; for items which are not included here, refer to the corre- sponding section in this manual.

A1 Outline of Differences

  • The D (decimal) flag is set to "0" during initial reset.
  • Modifications of the interrupt circuit - The interrupt timing has been shifted to 0.5 clock later. - <Reference> In the 1-chip micro controller which uses S1C6200A, writing on the interrupt mask register

and reading the interrupt factor flag during EI (enable interrupt flag) are possible. (However, consult the respective hardware manuals to find out whether these are possible with the CPU peripheral circuits.)

A2 Detailed Description of the Differences

A2.1 Initial reset

The D (decimal) flag will be set as follows through initial reset:

Table A2.1.1 D (decimal) flag initial setting

D (decimal) flag setting

Owing to this, bugs due to omission of D (decimal) flag setting during software development can now be easily prevented.

For the values of other registers and flags during initial reset, see Section 2.5.4, "Initial reset".

A2.2 Interrupt

Operation during interrupt issuance The time it takes to complete interrupt processing by hardware after the Core CPU receives the interrupt request has changed as follows:

Table A2.2.1 Required interrupt processing time

S1C6200A

S1C6200

a) During instruction execution

12.5 to 24.5

12.5 to 19.5

12.5 to 17.5

b) At HALT mode

c) During PSET instruction execution

PSET + CALL

12.5 to 24.5

PSET + JP

12.5 to 22.5

Figure A2.2.1 shows the timing chart of the S1C6200A interrupt.

Show 13 more labels / short text on this page
0 CPU Core · S1C6200 Undefined S1C6200A · Item · 12-cycle instruction execution · 13 to 25 · 7-cycle instruction execution · 13 to 20 · 5-cycle instruction execution · 13 to 18 · 14 to 15 · 14 to 15 · 13 to 25 · 13 to 23
Page 91 of the Epson 6200A user manual — PSET + CALL
Pagina 91 · clicca per ingrandire
Pagina 91

APPENDIX A. S1C6200A (ADVANCED S1C6200) CORE CPU

INT1 (*1) INT2 (*1) JP (*2)

Interrupt processing:

12-clock instruction 7-clock instruction 5-clock instruction

... 12.5 to 24.5 clock cycles ... 12.5 to 19.5 clock cycles ... 12.5 to 17.5 clock cycles

INT1 and INT2 are dummy instructions Branches to the top of the interrupt service routine Status:

Execute Note(*1) (*2)

a) During instruction execution

Instruction 5-clock Instrruction Interrupt

HALT

INT1 (*1) INT2 (*1) JP (*2)

Interrupt processing14 to 15 clock cycles

INT1 and INT2 are dummy instructions Branches to the top of the interrupt service routine Status:

Execute Note(*1) (*2)

b) At HALT mode

CALL

INT1 (*1) INT2 (*1) JP (*2)

... 12.5 to 24.5 clock cycles ... 12.5 to 22.5 clock cycles Interrupt processing:

PSET + CALL

PSET + JP

INT1 and INT2 are dummy instructions Branches to the top of the interrupt service routine Status:

Execute Note(*1) (*2)

c) During "PSET" instruction execution

Fig. A2.2.1 Timing chart of S1C6200A interrupt

Show 15 more labels / short text on this page
Clock · Status · Instruction 5-clock Instrruction · 12-clock Instrruction · Interrupt · Fetch · System clock · CPU clock · Status · Fetch · Clock · Status · Instruction PSET · Interrupt · Fetch
Page 92 of the Epson 6200A user manual — S1C6200A
Pagina 92 · clicca per ingrandire
Pagina 92

APPENDIX A. S1C6200A (ADVANCED S1C6200) CORE CPU

<Reference 1> Writing on the interrupt mask register during EI This section describes the operation for writing on the interrupt mask register during EI (enable interrupt flag) in the regular 1-chip micro controller which uses S1C6200 Core CPU and in the regular 1-chip micro controller which uses S1C6200A Core CPU. For information on accurate operation, see the respective hardware manuals of the S1C62 Family.

Table A2.2.2 Writing on the interrupt mask register at EI

S1C6200A

S1C6200

Writing on the interrupt mask register at EI

The operation during the instruction execution for writing "0" (i.e., to mask the interrupt factor) on the interrupt mask register at EI is shown in Figure A2.2.2. At this point, the interrupt is masked 0.5 clock before the start of the instruction execution through the 0.5 clock advance operation. Moreover, during the instruction execution for writing "1" (i.e., to cancel the interrupt mask) on the mask register at EI, it is the same as the ordinary interrupt timing as shown in Figure A2.2.2. In other words, if the interrupt factor flag value is set to "1", the interrupt processing by hardware will start in the next instruction execution cycle 0.5 clock before the completion of the instruction execution.

Fetch Execute Fetch Execute Fetch Execute Fetch

"0" is written to the interrupt mask register Execute next instruction INT1(interrupt processing)

"1" is written to the interrupt mask register

Corresponding interrupt factor flag

Fig. A2.2.2 Writing on the interrupt mask register and interrupt request generation

<Reference 2> Reading the interrupt factor flag during EI This section describes the operation for reading the interrupt factor flag during EI (enable interrupt flag) in the regular 1-chip micro controller which uses S1C6200 Core CPU and in the regular 1-chip micro control- ler which uses S1C6200A Core CPU. For information on accurate operation, see the respective hardware manuals of the S1C62 Family.

Table A2.2.3 Reading the interrupt factor flag at EI

S1C6200A

S1C6200

Reading the interrupt factor flag at EI

At EI, reading the interrupt factor flag is possible but caution must be observed in the following case: when the value of the interrupt mask register corresponding to the interrupt factor flag which is to be read is set to "1" (unmasked). In this case, interrupt request may be issued to the CPU due to the timing by which the interrupt factor flag is set to "1", or the interrupt factor flag may be cleared by reading it and hence inter- rupt request will not be issued. Particularly when there are multiple interrupt factor flags in the same address, extra caution is required.

Show 10 more labels / short text on this page
CPU Core · Possible · Not possible · Clock · Status · Instruction · Interrupt request · CPU Core · Possible · Not possible
Page 93 of the Epson 6200A user manual — J
Pagina 93 · clicca per ingrandire
Pagina 93

APPENDIX B. INSTRUCTION INDEX

APPENDIX B. I NSTRUCTION I NDEX

A

ACPX MX,r Add with carry r-register to M(X), increment X by 1 28 ACPY MY,r Add with carry r-register to M(Y), increment Y by 1 28

ADC r,i Add with carry immediate data i to r-register 29 ADC r,q Add with carry q-register to r-register 29

ADC XH,i Add with carry immediate data i to XH 30 ADC XL,i Add with carry immediate data i to XL 30

ADC YH,i Add with carry immediate data i to YH 31 ADC YL,i Add with carry immediate data i to YL 31

ADD r,i Add immediate data i to r-register 32 ADD r,q Add q-register to r-register 32

AND r,i Logical AND immediate data i with r-register 33 AND r,q Logical AND q-register with r-register 33

C CALL s Call subroutine 34

CALZ s Call subroutine at page zero 34 CP r,i Compare immediate data i with r-register 35

CP r,q Compare q-register with r-register 35 CP XH,i Compare immediate data i with XH 36

CP XL,i Compare immediate data i with XL 36 CP YH,i Compare immediate data i with YH 37

CP YL,i Compare immediate data i with YL 37

D DEC Mn Decrement memory 38 DEC SP Decrement stack pointer 38

DI Disable interrupts 39

EI Enable interrupts 39 E

FAN r,i Logical AND immediate data i with r-register for flag check 40 FAN r,q Logical AND q-register with r-register for flag check 40 F

HALT Halt 41 H

INC Mn Increment memory by 1 41

INC SP Increment stack pointer by 1 42 INC X Increment X-register by 1 42

INC Y Increment Y-register by 1 43

J

JPBA Indirect jump using registers A and B 43

JP C,s Jump if carry flag is set 44 JP NC,s Jump if not carry 44

JP NZ,s Jump if not zero 45 JP s Jump 45

JP Z,s Jump if zero 46

Page 94 of the Epson 6200A user manual — P POP F Pop stack data into flags ......................................................................63
Pagina 94 · clicca per ingrandire
Pagina 94

APPENDIX B. INSTRUCTION INDEX

LBPX MX,e Load immediate data e to memory, and increment X by 2 46

LD A,Mn Load memory into A-register 47 LD B,Mn Load memory into B-register 47

LD Mn,A Load A-register into memory 48 LD Mn,B Load B-register into memory 48

LDPX MX,i Load immediate data i into MX, increment X by 1 49 LDPX r,q Load q-register into r-register, increment X by 1 49

LDPY MY,i Load immediate data i into MY, increment Y by 1 50 LDPY r,q Load q-register into r-register, increment Y by 1 50

LD r,i Load immediate data i into r-register 51 LD r,q Load q-register into r-register 51

LD r,SPH Load SPH into r-register 52 LD r,SPL Load SPL into r-register 52

LD r,XH Load XH into r-register 53 LD r,XL Load XL into r-register 53

LD r,XP Load XP into r-register 54 LD r,YH Load YH into r-register 54

LD r,YL Load YL into r-register 55 LD r,YP Load YP into r-register 55

LD SPH,r Load r-register into SPH 56 LD SPL,r Load r-register into SPL 56

LD X,e Load immediate data e into X-register 57 LD XH,r Load r-register into XH 57

LD XL,r Load r-register into XL 58 LD XP,r Load r-register into XP 58

LD Y,e Load immediate data e into Y-register 59 LD YH,r Load r-register into YH 59

LD YL,r Load r-register into YL 60 LD YP,r Load r-register into YP 60

N NOP5 No operation for 5 clock cycles 61

NOP7 No operation for 7 clock cycles 61 NOT r NOT r-register (one's complement) 62

O OR r,i Logical OR immediate data i with r-register 62 OR r,q Logical OR q-register with r-register 63

P POP F Pop stack data into flags 63

POP r Pop stack data into r-register 64 POP XH Pop stack data into XH 64

POP XL Pop stack data into XL 65 POP XP Pop stack data into XP 65

POP YH Pop stack data into YH 66 POP YL Pop stack data into YL 66

POP YP Pop stack data into YP 67 PSET p Page set 67

PUSH F Push flag onto stack 68

Page 95 of the Epson 6200A user manual — R RCF Reset carry flag ....................................................................................72 RDF Reset decimal flag ................................................................................72
Pagina 95 · clicca per ingrandire
Pagina 95

APPENDIX B. INSTRUCTION INDEX

P

PUSH r Push r-register onto stack 68

PUSH XH Push XH onto stack 69 PUSH XL Push XL onto stack 69

PUSH XP Push XP onto stack 70 PUSH YH Push YH onto stack 70

PUSH YL Push YL onto stack 71 PUSH YP Push YP onto stack 71

R RCF Reset carry flag 72 RDF Reset decimal flag 72

RET Return from subroutine 73 RETD e Load immediate data e to memory, and increment X by 2, then return73

RETS Return then skip an instruction 74 RLC r Rotate r-register left with carry 74

RRC r Rotate r-register right with carry 75 RST F,i Reset flags using immediate data i 75

RZF Reset zero flag 76

S SBC r,i Subtract with carry immediate data i from r-register 76 SBC r,q Subtract with carry q-register from r-register 77

SCF Set carry flag 77 SCPX MX,r Subtract with carry r-register from M(X) and increment X by 1 78

SCPY MY,r Subtract with carry r-register from M(Y) and increment Y by 1 78 SDF Set decimal flag 79

SET F,i Set flags using immediate data i 79 SLP Sleep 80

SUB r,q Subtract q-register from r-register 80 SZF Set zero flag 81

X XOR r,i Exclusive-OR immediate data i with r-register 81 XOR r,q Exclusive-OR q-register with r-register 82

Page 96 of the Epson 6200A user manual — SEIKO EPSON CORPORATION ELECTRONIC DEVICES MARKETING DIVISION
Pagina 96 · clicca per ingrandire
Pagina 96

International Sales Operations

AMERICA

ASIA

EPSON ELECTRONICS AMERICA, INC.

EPSON (CHINA) CO., LTD. 23F, Beijing Silver Tower 2# North RD DongSanHuan ChaoYang District, Beijing, CHINA Phone: 64106655 Fax: 64107319

- HEADQUARTERS - 150 River Oaks Parkway San Jose, CA 95134, U.S.A. Phone: +1-408-922-0200 Fax: +1-408-922-0238

SHANGHAI BRANCH 4F, Bldg., 27, No. 69, Gui Qing Road Caohejing, Shanghai, CHINA Phone: 21-6485-5552 Fax: 21-6485-0775

- SALES OFFICES -

West 1960 E. Grand Avenue EI Segundo, CA 90245, U.S.A. Phone: +1-310-955-5300 Fax: +1-310-955-5400

EPSON HONG KONG LTD. 20/F., Harbour Centre, 25 Harbour Road Wanchai, Hong Kong Phone: +852-2585-4600 Fax: +852-2827-4346 Telex: 65542 EPSCO HX

Central 101 Virginia Street, Suite 290 Crystal Lake, IL 60014, U.S.A. Phone: +1-815-455-7630 Fax: +1-815-455-7633

EPSON TAIWAN TECHNOLOGY & TRADING LTD. 10F, No. 287, Nanking East Road, Sec. 3 Taipei Phone: 02-2717-7360 Fax: 02-2712-9164 Telex: 24444 EPSONTB

Northeast 301 Edgewater Place, Suite 120 Wakefield, MA 01880, U.S.A. Phone: +1-781-246-3600 Fax: +1-781-246-5443

HSINCHU OFFICE 13F-3, No. 295, Kuang-Fu Road, Sec. 2 HsinChu 300 Phone: 03-573-9900 Fax: 03-573-9169

Southeast 3010 Royal Blvd. South, Suite 170 Alpharetta, GA 30005, U.S.A. Phone: +1-877-EEA-0020 Fax: +1-770-777-2637

EPSON SINGAPORE PTE., LTD. No. 1 Temasek Avenue, #36-00 Millenia Tower, SINGAPORE 039192 Phone: +65-337-7911 Fax: +65-334-2716

EUROPE

EPSON EUROPE ELECTRONICS GmbH

SEIKO EPSON CORPORATION KOREA OFFICE 50F, KLI 63 Bldg., 60 Yoido-dong Youngdeungpo-Ku, Seoul, 150-763, KOREA Phone: 02-784-6027 Fax: 02-767-3677

- HEADQUARTERS - Riesstrasse 15 80992 Munich, GERMANY Phone: +49-(0)89-14005-0 Fax: +49-(0)89-14005-110

SALES OFFICE Altstadtstrasse 176 51379 Leverkusen, GERMANY Phone: +49-(0)2171-5045-0 Fax: +49-(0)2171-5045-10

SEIKO EPSON CORPORATION ELECTRONIC DEVICES MARKETING DIVISION

IC Marketing Department IC Marketing & Engineering Group 421-8, Hino, Hino-shi, Tokyo 191-8501, JAPAN Phone: +81-(0)42-587-5816 Fax: +81-(0)42-587-5624

UK BRANCH OFFICE Unit 2.4, Doncastle House, Doncastle Road Bracknell, Berkshire RG12 8PE, ENGLAND Phone: +44-(0)1344-381700 Fax: +44-(0)1344-381701

ED International Marketing Department Europe & U.S.A. 421-8, Hino, Hino-shi, Tokyo 191-8501, JAPAN Phone: +81-(0)42-587-5812 Fax: +81-(0)42-587-5564

FRENCH BRANCH OFFICE 1 Avenue de l' Atlantique, LP 915 Les Conquerants Z.A. de Courtaboeuf 2, F-91976 Les Ulis Cedex, FRANCE Phone: +33-(0)1-64862350 Fax: +33-(0)1-64862355

ED International Marketing Department Asia 421-8, Hino, Hino-shi, Tokyo 191-8501, JAPAN Phone: +81-(0)42-587-5814 Fax: +81-(0)42-587-5110

BARCELONA BRANCH OFFICE Barcelona Design Center Edificio Testa, Avda. Alcalde Barrils num. 64-68 E-08190 Sant Cugat del Vallès, SPAIN Phone: +34-93-544-2490 Fax: +34-93-544-2491

Page 97 of the Epson 6200A user manual — ELECTRONIC DEVICES MARKETING DIVISION
Pagina 97 · clicca per ingrandire
Pagina 97

Core CPU Manual S1C6200/6200A

ELECTRONIC DEVICES MARKETING DIVISION

EPSON Electronic Devices Website

http://www.epsondevice.com

First issue February, 1989 Printed February, 2001 in Japan A M

Fonti

Riferimenti e link

Pagine di riferimento in questo manuale: produttore, supporto e download.

Fai una domanda su Epson 6200A

I possessori del prodotto e il nostro team di solito rispondono entro 24 ore, e la tua domanda sarà utile anche ad altri.

Add your email to get notified when it’s answered — no spam, ever.

0 questions
Nessuna domanda ancora per il dispositivo Epson 6200A

Invia la prima domanda: risponderanno altri possessori o il nostro team.

Documento originale

Epson 6200A manuale in PDF

97 pagine·543 KB·Scheda di rete·PDF
Clicca su qualsiasi pagina in alto per aprirla qui
Pagina 1 / …
100%
Caricamento pagine…