Page 1
CMOS 16 - BIT SINGLE CHIP MICROCOMPUTER S1C17 Family S1C17 Core Manual...
Page 2
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...
CONTENTS – Contents – 1 Summary ........................1-1 1.1 Features ...........................1-1 2 Registers ........................2-1 2.1 General-Purpose Registers (R0–R7) ................2-1 2.2 Program Counter (PC) .....................2-1 2.3 Processor Status Register (PSR)..................2-2 2.4 Stack Pointer (SP)......................2-4 2.4.1 About the Stack Area ..................2-4 2.4.2 SP Operation at Subroutine Call/Return............2-4 2.4.3 SP Operation when an Interrupt Occurs............2-5 2.4.4 Saving/Restoring Register Data Using a Load Instruction ........2-6 2.5 Register Notation and Register Numbers ................2-7...
Page 6
CONTENTS 5.3 Addressing Modes with ext.....................5-8 5.3.1 Extension of Immediate Addressing ..............5-8 5.3.2 Extension of Register Direct Addressing ............5-9 5.3.3 Extension of Register Indirect Addressing ............5-10 5.3.4 Extension of Register Indirect Addressing with Displacement......5-11 5.3.5 Extension of Signed PC Relative Addressing ...........5-11 5.3.6 Extension of PC Absolute Addressing ..............5-12 5.4 Data Transfer Instructions ....................5-13 5.5 Logical Operation Instructions..................5-14...
The S1C17 Core incorporates a coprocessor interface allowing implementation of additional computing features. Furthermore, Seiko Epson provides a software development environment similar to the S1C33 Family that includes an IDE work bench, a C compiler, a serial ICE and a debugger, for supporting the developer to develop application software.
Page 12
1 SUMMARY THIS PAGE IS BLANK. EPSON S1C17 FAMILY S1C17 CORE MANUAL...
2 REGISTERS 2 Registers The S1C17 Core contains eight general-purpose registers and three special registers. Special registers General-purpose registers bit 23 bit 0 bit 23 bit 0 IL[2:0] Figure 2.1 Registers 2.1 General-Purpose Registers (R0–R7) Symbol Register name Size Initial value R0–R7 General-Purpose Register 24 bits...
2 REGISTERS 2.3 Processor Status Register (PSR) Symbol Register name Size Initial value Processor Status Register 8 bits 0x00 The Processor Status Register (hereinafter referred to as the “PSR”) is an 8-bit register for storing the internal status of the processor. The PSR stores the internal status of the processor when the status has been changed by instruction execution.
Page 15
2 REGISTERS The V flag is set under the following conditions: (1) When negative integers are added together, the operation produced a 0 (positive) in the sign bit (most sig- nificant bit of the result) (2) When positive integers are added together, the operation resulted in a 1 (negative) in the sign bit (most sig- nificant bit of the result) (3) When a negative integer is subtracted from a positive integer, the operation resulted in producing a 1 (nega- tive) in the sign bit (most significant bit of the result)
2 REGISTERS 2.4 Stack Pointer (SP) Symbol Register name Size Initial value Stack Pointer 24 bits 0x000000 The Stack Pointer (hereinafter referred to as the “SP”) is a 24-bit register for holding the start address of the stack. The stack is an area locatable at any place in the system RAM, the start address of which is set in the SP during the initialization process.
2 REGISTERS SP operation by the ret instruction (1) [SP] → PC (2) SP = SP + 4 0xffffff 0xffffff SP = SP + 4 0x00 0x00 PC[23:16] PC[23:16] PC[15:8] PC[15:8] PC[7:0] PC[7:0] 0x000000 0x000000 Figure 2.4.2.2 SP and Stack (2) 2.4.3 SP Operation when an Interrupt Occurs If an interrupt or a software interrupt resulting from the int/intl instruction occurs, the processor enters an inter- rupt handling process.
2 REGISTERS 2.4.4 Saving/Restoring Register Data Using a Load Instruction The S1C17 Core provides load instructions to save and restore register data to/from the stack instead of push/pop instructions. Saving register data into the stack Example: ld.a -[%sp],%r0 (1) SP = SP - 4 (2) R0 →...
2 REGISTERS 2.5 Register Notation and Register Numbers The following describes the register notation and register numbers in the S1C17 Core instruction set. 2.5.1 General-Purpose Registers In the instruction code, a general-purpose register is specified using a 3-bit field, with the register number entered in that field.
Page 20
2 REGISTERS THIS PAGE IS BLANK. EPSON S1C17 FAMILY S1C17 CORE MANUAL...
3 DATA FORMATS 3 Data Formats 3.1 Data Formats Handled in Operations Between Registers The S1C17 Core can handle 8-, 16-, and 24-bit data in register operations. In this manual, data sizes are expressed as follows: Byte, B, or b 8-bit data Word, W, or w 16-bit data...
3 DATA FORMATS 3.1.3 16-Bit Transfer (Register → Register) Example: ld %rd,%rs 16 15 16-bit data 16 15 16-bit data Figure 3.1.3.1 16-Bit Transfer (Register → Register) Bits 23–16 in the destination register are set to 0x00. 3.1.4 24-Bit Transfer (Register → Register) Example: ld.a %rd,%rs 24-bit data...
3 DATA FORMATS 3.2.1 Unsigned 8-Bit Transfer (Memory → Register) Example: ld.ub %rd,[%rb] Byte [%rb] 16 15 Byte Figure 3.2.1.1 Unsigned 8-Bit Transfer (Memory → Register) Bits 23–8 in the destination register are set to 0x0000. 3.2.2 Signed 8-Bit Transfer (Memory → Register) Example: ld.b %rd,[%rb] Byte...
0xff fdff 0x00 0000 Figure 4.1.1 Address Space of the S1C17 Core The boot address and debug RAM address depend on the specifications of each the S1C17 Series models. Refer to the Technical Manual of each model. EPSON S1C17 FAMILY S1C17 CORE MANUAL...
4 ADDRESS MAP 4.2 Processor Information in the Core I/O Area The reserved core I/O area contains the processor information described below. 4.2.1 Trap Table Base Register (TTBR, 0xffff80) Register name Address Name Function Setting Init. R/W Remarks Trap table FFFF80 D31–24 –...
5 INSTRUCTION SET 5 Instruction Set The S1C17 Core instruction codes are all fixed to 16 bits in length which, combined with pipelined processing, al- lows most important instructions to be executed in one cycle. For details, refer to the description of each instruction in the latter sections of this manual.
Page 28
5 INSTRUCTION SET Classification Mnemonic Function General-purpose register (32 bits, zero-extended) → stack * Data transfer ld.a [%sp],%rs Stack pointer post-increment, post-decrement, and pre-decrement functions can [%sp]+,%rs be used. [%sp]-,%rs -[%sp],%rs General-purpose register (24 bits) → SP %sp,%rs Immediate → SP %sp,imm7 Integer arithmetic 16-bit addition between general-purpose registers...
Page 29
5 INSTRUCTION SET Classification Mnemonic Function Shift and swap Logical shift to the right with the number of bits specified by the register %rd,%rs Logical shift to the right with the number of bits specified by immediate %rd,imm7 Arithmetic shift to the right with the number of bits specified by the register %rd,%rs Arithmetic shift to the right with the number of bits specified by immediate %rd,imm7...
Page 30
5 INSTRUCTION SET The symbols in the above table each have the meanings specified below. Table 5.1.2 Symbol Meanings Symbol Description General-purpose register, source General-purpose register, destination Memory addressed by general-purpose register [%rb] Memory addressed by general-purpose register with address post-incremented [%rb]+ Memory addressed by general-purpose register with address post-decremented [%rb]-...
5 INSTRUCTION SET 5.2 Addressing Modes (without ext extension) The instruction set of the S1C17 Core has seven discrete addressing modes, as described below. The processor de- termines the addressing mode according to the operand in each instruction before it accesses data. (1) Immediate addressing (2) Register direct addressing (3) Register indirect addressing...
5 INSTRUCTION SET 5.2.3 Register Indirect Addressing In this mode, memory is accessed indirectly by specifying a general-purpose register or the stack pointer that holds the address needed. This addressing mode is used only for load instructions that have [%rb] or [%sp] as the op- erand.
5 INSTRUCTION SET 5.2.5 Register Indirect Addressing with Displacement In this mode, memory is accessed beginning with the address that is derived by adding a specified immediate (dis- placement) to the register content. Unless ext instructions are used, this addressing mode can only be used for load instructions that have [%sp+imm7] as the operand.
5 INSTRUCTION SET 5.3 Addressing Modes with ext The immediate specifiable in 16-bit, fixed-length instruction code is specified in a bit field of a 7- or 10-bit length, depending on the instruction used. The ext instructions are used to extend the size of this immediate. The ext instructions are used in combination with data transfer, arithmetic/logic, or branch instructions, and is placed directly before the instruction whose immediate needs to be extended.
5 INSTRUCTION SET Extension of sign7 The sign7 immediate is extended to a 16-bit immediate. Extending to a 16-bit immediate To extend the immediate to 16-bit quantity, enter one ext instruction directly before the target instruction. Example: ext imm13 %rd,sign7 Extended immediate imm13 sign7...
5 INSTRUCTION SET operation instructions) Extending to rs + imm24 (24-bit To extend to rs + imm24, enter two ext instructions directly before the target instruction. Example: ext imm13 imm13 add.a %rd,%rs If not extended, rd = rd + rs When extended by two ext instructions, rd = rs + imm24 Data 13 12...
5 INSTRUCTION SET 5.3.4 Extension of Register Indirect Addressing with Displacement Extending [%sp+imm7] displacement The immediate (imm7) in displacement-added register indirect addressing instructions is extended. The extended data and the SP are added to comprise the source or destination address of transfer. Extending to a 20-bit immediate To extend the immediate to 20-bit quantity, enter one ext instruction directly before the target instruction.
5 INSTRUCTION SET Extending to a 24-bit immediate To extend the sign7 immediate to a 24-bit immediate, enter two ext instructions directly before the target in- struction. Example: ext imm13 imm13 jrgt sign7 ; = jrgt sign24 21 20 Immediate S (1) imm13 (2) sign7...
5 INSTRUCTION SET 5.4 Data Transfer Instructions The transfer instructions in the S1C17 Core support data transfer between one register and another, as well as be- tween a register and memory. A transfer data size and data extension format can be specified in the instruction code. In mnemonics, this specification is classified as follows: Signed byte data transfer ld.b...
5 INSTRUCTION SET 5.5 Logical Operation Instructions Four discrete logical operation instructions are available for use with the S1C17 Core. Logical AND Logical OR Exclusive-OR Logical NOT All logical operations are performed in a specified general-purpose register (R0–R7). The source is one of two, ei- ther 16-bit data in a specified general-purpose register or immediate data (7, 13, or 16 bits).
5 INSTRUCTION SET 5.6 Arithmetic Operation Instructions The instruction set of the S1C17 Core supports add/subtract, and compare instructions for arithmetic operations. 16-bit addition 24-bit addition add.a 16-bit addition with carry 16-bit subtraction 24-bit subtraction sub.a 16-bit subtraction with borrow 16-bit comparison 24-bit comparison cmp.a...
5 INSTRUCTION SET 5.7 Shift and Swap Instructions The S1C17 Core supports instructions to shift or swap the register data. Logical shift right Logical shift left (= Arithmetic shift left) Arithmetic shift right Swap upper and lower bytes swap The shift operation is effective for bits 15 to 0 in the specified register and bits 23 to 16 are set to 0. The number of bits to be shifted can be specified to 0–3 bits, 4 bits, or 8 bits using the operand imm5 or the rs reg- ister.
5 INSTRUCTION SET 5.8 Branch and Delayed Branch Instructions 5.8.1 Types of Branch Instructions (1) PC relative jump instructions PC relative jump instructions include the following: sign7 sign10 PC relative jump instructions are provided for relocatable programming, so that the program branches to the ad- dress calculated as PC + 2 (the next address of the branch instruction) + signed displacement (specified by the operand).
Page 44
5 INSTRUCTION SET When extended by one ext instruction imm13 Functions as “jr* sign21” (sign21 = {imm13, sign7, 0}) sign7 The imm13 specified by the ext instruction is extended as the 13 high-order bits of sign21. sign21 S S S imm13 sign7 Current address...
Page 45
5 INSTRUCTION SET For jpr %rb A signed 24-bit relative value is specified for rb. The jump address is configured as follows: {rb(23:1), 0} D(23:1) Current address Branch destination address The least significant bit in the rb register is always handled as 0. The range of addresses to which jumped is (PC - 8,388,606) to (PC + 8,388,608).
Page 46
5 INSTRUCTION SET jpa imm7 20 19 imm7 with no ext 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 imm7 imm7 with one ext imm13 imm7 imm7 with two ext imm13 imm13' imm7 (3:0) Branch destination address (3) PC relative call instructions...
5 INSTRUCTION SET 5.8.2 Delayed Branch Instructions The S1C17 Core uses pipelined instruction processing, in which instructions are executed while other instructions are being fetched. In a branch instruction, because the instruction that follows it has already been fetched when it is executed, the execution cycles of the branch instruction can be reduced by one cycle by executing the prefetched in- struction before the program branches.
5 INSTRUCTION SET 5.9 System Control Instructions The following five instructions are used to control the system. Only increments the PC, with no other operations performed Places the processor in HALT mode halt Places the processor in SLEEP mode Enables interrupts Disables interrupts For details on HALT and SLEEP modes, refer to Section 6.4, “Power-Down Mode,”...
5 INSTRUCTION SET 5.10 Conversion Instructions The 8/16/24/32 data conversion instructions listed below are provided for supporting C compiler. cv.ab %rd,%rs Converts Byte data (8 bits) into 24-bit data with sign extended. Byte 8 bits cv.as %rd,%rs Converts 16-bit data into 24-bit data with sign extended. 16 15 Word 16 15...
5 INSTRUCTION SET 5.11 Coprocessor Instructions The S1C17 Core incorporates a coprocessor interface and provides the dedicated coprocessor instructions listed be- low. Transfer data to the coprocessor ld.cw Transfer data and input the results and flag status to/from the coprocessor ld.ca Input flag status from the coprocessor ld.cf...
6 FUNCTIONS 6 Functions This chapter describes the processing status of the S1C17 Core and outlines the operation. 6.1 Transition of the Processor Status The diagram below shows the transition of the operating status in the S1C17 Core. Reset state Interrupt instruction Interrupt...
6 FUNCTIONS 6.2 Program Execution Following initial reset, the processor loads the reset vector (address of the reset handler routine) into the PC and starts executing instructions beginning with the address. As the instructions in the S1C17 Core are fixed to 16 bits in length, the PC is incremented by 2 each time an instruction is fetched from the address indicated by the PC.
6 FUNCTIONS 6.2.2 Execution Cycles and Flags The following shows the number of cycles required for executing each instruction in a 1-cycle accessible memory connected to the Harvard bus and the flag change status. Depending on the model, clock cycles spent by the external bus arbiter and wait cycles inherent in the external devices may be added.
Page 54
6 FUNCTIONS Flag Classification Mnemonic Cycle Remark ∗1 ∗1: 1 cycle when ext is not Data transfer 1–2 – – – – – – ld.a [%sp],%rs used – – – – – – [%sp]+,%rs – – – – – – 2 cycles when ext is [%sp]-,%rs used...
6 FUNCTIONS 6.3 Interrupts When an interrupt occurs during program execution, the processor enters an interrupt handling state. The interrupt handling state is a process by which the processor branches to the corresponding user’s service routine for the interrupt that occurred. The processor returns after branching and starts executing the program from where it left off.
6 FUNCTIONS 6.3.2 Vector Table Vector table in the S1C17 Core The table below lists the interrupts for which the vector table is referenced during interrupt handling. Table 6.3.2.1 Vector List Vector No. Interrupt Vector address Software interrupt No. 0 (0x00) Reset TTBR + 0x00 1 (0x01)
6 FUNCTIONS 6.3.5 Address Misaligned Interrupt The load instructions that access memory or I/O areas are characteristic in that the data size to be transferred is predetermined for each instruction used, and that the accessed addresses must be aligned with the respective data- size boundaries.
6 FUNCTIONS 6.3.8 Software Interrupts The S1C17 Core provides the int imm5 and intl imm5,imm3 instructions allowing the software to generate any interrupts. The operand imm5 specifies a vector number (0–31) in the vector table. In addition to this, the intl instruction has the operand imm3 to specify an interrupt level (0–7) to be set to the IL field in the PSR.
6 FUNCTIONS 6.4 Power-Down Mode The S1C17 Core supports two power-down modes: HALT and SLEEP modes. HALT mode Program execution is halted at the same time that the S1C17 Core executes the halt instruction, and the processor enters HALT mode. HALT mode commonly turns off only the S1C17 Core operation, note, however that modules to be turned off depend on the implementation of the clock control circuit outside the core.
6 FUNCTIONS 6.5 Debug Circuit The S1C17 Core has a debug circuit to assist in software development by the user. 6.5.1 Debugging Functions The debug circuit provides the following functions: • Instruction break A debug interrupt is generated before the set instruction address is executed. An instruction break can be set at two addresses.
6 FUNCTIONS 6.5.3 Registers for Debugging The reserved core I/O area contains the debug registers described below. 0xFFFF90: Debug RAM Base Register (DBRAM) Register name Address Name Function Setting Init. R/W Remarks Debug RAM FFFF90 D31–24 – Unused (fixed at 0) ∗...
Page 63
6 FUNCTIONS 0xFFFFB0: Instruction Break Address Register 0 (IBAR0) Register name Address Name Function Setting Init. R/W Remarks Instruction FFFFB0 – D31–24 Unused (fixed at 0) break address IBAR023 Instruction break address #0 0x0–0xFFFDE register 0 IBAR00 is fixed at 0. IBAR00 D[23:0] IBAR0[23:0]: Instruction Break Address #0...
Page 64
6 FUNCTIONS THIS PAGE IS BLANK. EPSON 6-14 S1C17 FAMILY S1C17 CORE MANUAL...
7 DETAILS OF INSTRUCTIONS 7 Details of Instructions This section explains all the instructions in alphabetical order. Symbols in the instruction reference %rd, rd General-purpose registers (R0–R7) or their contents used as the destination %rs, rs General-purpose registers (R0–R7) or their contents used as the source %rb, rb General-purpose registers (R0–R7) or their contents that hold the base address to be accessed in register indirect addressing...
7 DETAILS OF INSTRUCTIONS cv.ls %rd, %rs Function Data conversion from 16 bits to 32 bits rd(23:16) ← 0, rd(15:0) ← rs(15) Standard) Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code Flag – – – –...
Page 92
7 DETAILS OF INSTRUCTIONS Function Disable interrupts psr(IE) ← 0 Standard) Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code Flag – – – – – Mode – One cycle Description (1) Standard Resets the IE bit in the PSR to disable external maskable interrupts. The reset interrupt, address misaligned interrupt, and NMI will be accepted even if the IE bit is set to 0.
Page 93
7 DETAILS OF INSTRUCTIONS Function Enable interrupts psr(IE) ← 1 Standard) Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code Flag – – – – – Mode – One cycle Description (1) Standard Sets the IE bit in the PSR to enable external maskable interrupts. (2) Delayed slot instruction This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d”...
7 DETAILS OF INSTRUCTIONS halt Function HALT Standard) Sets the processor to HALT mode Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code Flag – – – – – – Mode – Six cycles Description Sets the processor to HALT mode for power saving. Program execution is halted at the same time that the S1C17 Core executes the halt instruction, and the processor enters HALT mode.
7 DETAILS OF INSTRUCTIONS jreq sign7 jreq.d sign7 Function Conditional PC relative jump pc ← pc + 2 + sign7 × 2 if Z is true Standard) Extension 1) pc ← pc + 2 + sign21 if Z is true Extension 2) pc ←...
7 DETAILS OF INSTRUCTIONS jrge sign7 jrge.d sign7 Function Conditional PC relative jump (for judgment of signed operation results) pc ← pc + 2 + sign7 × 2 if !(N^V) is true Standard) Extension 1) pc ← pc + 2 + sign21 if !(N^V) is true Extension 2) pc ←...
7 DETAILS OF INSTRUCTIONS jrgt sign7 jrgt.d sign7 Function Conditional PC relative jump (for judgment of signed operation results) pc ← pc + 2 + sign7 × 2 if !Z&!(N^V) is true Standard) Extension 1) pc ← pc + 2 + sign21 if !Z&!(N^V) is true Extension 2) pc ←...
7 DETAILS OF INSTRUCTIONS jrle sign7 jrle.d sign7 Function Conditional PC relative jump (for judgment of signed operation results) pc ← pc + 2 + sign7 × 2 if Z | (N^V) is true Standard) Extension 1) pc ← pc + 2 + sign21 if Z | (N^V) is true Extension 2) pc ←...
7 DETAILS OF INSTRUCTIONS jrlt sign7 jrlt.d sign7 Function Conditional PC relative jump (for judgment of signed operation results) pc ← pc + 2 + sign7 × 2 if N^V is true Standard) Extension 1) pc ← pc + 2 + sign21 if N^V is true Extension 2) pc ←...
7 DETAILS OF INSTRUCTIONS jrne sign7 jrne.d sign7 Function Conditional PC relative jump pc ← pc + 2 + sign7 × 2 if !Z is true Standard) Extension 1) pc ← pc + 2 + sign21 if !Z is true Extension 2) pc ←...
7 DETAILS OF INSTRUCTIONS jruge sign7 jruge.d sign7 Function Conditional PC relative jump (for judgment of unsigned operation results) pc ← pc + 2 + sign7 × 2 if !C is true Standard) Extension 1) pc ← pc + 2 + sign21 if !C is true Extension 2) pc ←...
7 DETAILS OF INSTRUCTIONS jrugt sign7 jrugt.d sign7 Function Conditional PC relative jump (for judgment of unsigned operation results) pc ← pc + 2 + sign7 × 2 if !Z&!C is true Standard) Extension 1) pc ← pc + 2 + sign21 if !Z&!C is true Extension 2) pc ←...
7 DETAILS OF INSTRUCTIONS jrule sign7 jrule.d sign7 Function Conditional PC relative jump (for judgment of unsigned operation results) pc ← pc + 2 + sign7 × 2 if Z | C is true Standard) Extension 1) pc ← pc + 2 + sign21 if Z | C is true Extension 2) pc ←...
7 DETAILS OF INSTRUCTIONS jrult sign7 jrult.d sign7 Function Conditional PC relative jump (for judgment of unsigned operation results) pc ← pc + 2 + sign7 × 2 if C is true Standard) Extension 1) pc ← pc + 2 + sign21 if C is true Extension 2) pc ←...
Page 114
7 DETAILS OF INSTRUCTIONS (3) Extension 2 imm13 ; imm13(10:0) = imm24(23:13) imm13 ; = imm24(12:0) %rd,[%rb] ; memory address = rb + imm24 The addressing mode changes to register indirect addressing with displacement, so the content of the rb register with the 24-bit immediate imm24 added comprises the memory address, the 16-bit data in which is transferred to the rd register.
Page 119
7 DETAILS OF INSTRUCTIONS (3) Extension 2 imm13 ; imm13(10:0) = imm24(23:13) imm13 ; = imm24(12:0) [%rb],%rs ; memory address = rb + imm24 The addressing mode changes to register indirect addressing with displacement, so the 16 low- order bits of the rs register are transferred to the address indicated by the content of the rb register with the 24-bit immediate imm24 added.
Page 126
7 DETAILS OF INSTRUCTIONS (2) Extension 1 imm13 ld.a %rd,[%rb] ; memory address = rb + imm13 The e x t instruction changes the addressing mode to register indirect addressing with displacement. As a result, the content of the rb register with the 13-bit immediate imm13 added comprises the memory address, the 32-bit data (the eight high-order bits are ignored) in which is transferred to the rd register.
Page 128
7 DETAILS OF INSTRUCTIONS (2) Extension 1 imm13 ld.a %rd,[%sp] ; memory address = sp + imm13 The e x t instruction changes the addressing mode to register indirect addressing with displacement. As a result, the content of the SP with the 13-bit immediate imm13 added comprises the memory address, the 32-bit data (the eight high-order bits are ignored) in which is transferred to the rd register.
Page 135
7 DETAILS OF INSTRUCTIONS (3) Extension 2 imm13 ; imm13(10:0) = imm24(23:13) imm13 ; = imm24(12:0) ld.a [%rb],%rs ; memory address = rb + imm24 The addressing mode changes to register indirect addressing with displacement, so the content of the rs register is transferred to the address indicated by the content of the rb register with the 24-bit immediate imm24 added.
Page 137
7 DETAILS OF INSTRUCTIONS (3) Extension 2 imm13 ; imm13(10:0) = imm24(23:13) imm13 ; = imm24(12:0) ld.a [%sp],%rs ; memory address = sp + imm24 The addressing mode changes to register indirect addressing with displacement, so the content of the rs register is transferred to the address indicated by the content of the SP with the 24-bit immediate imm24 added.
7 DETAILS OF INSTRUCTIONS (2) Extension 1 imm13 ld.b %rd,[%rb] ; memory address = rb + imm13 The e x t instruction changes the addressing mode to register indirect addressing with displacement. As a result, the content of the rb register with the 13-bit immediate imm13 added comprises the memory address, the byte data in which is transferred to the rd register after being sign-extended to 16 bits.
7 DETAILS OF INSTRUCTIONS ld.b [%rb], %rs ld.b [%rb]+, %rs ld.b [%rb]-, %rs ld.b -[%rb], %rs Signed byte data transfer Function ld.b [%rb], %rs B[rb] ← rs(7:0) Standard) Extension 1) B[rb + imm13] ← rs(7:0) Extension 2) B[rb + imm24] ← rs(7:0) ld.b [%rb]+, %rs (with post-increment option) B[rb] ←...
Page 146
7 DETAILS OF INSTRUCTIONS (3) Extension 2 imm13 ; = imm24(23:13) imm13 ; = imm24(12:0) ld.b [%rb],%rs ; memory address = rb + imm24 The addressing mode changes to register indirect addressing with displacement, so the eight low-order bits of the rs register are transferred to the address indicated by the content of the rb register with the 24-bit immediate imm24 added.
7 DETAILS OF INSTRUCTIONS ld.ca %rd, %rs Function Transfer data to the coprocessor and get the results co_dout0 ← rd, co_dout1 ← rs, rd ← co_din, psr(C, V, Z, N) ← co_cvzn Standard) Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code Flag –...
7 DETAILS OF INSTRUCTIONS ld.cf %rd, %rs Function Transfer data to the coprocessor and get the flag status co_dout0 ← rd, co_dout1 ← rs, psr(C, V, Z, N) ← co_cvzn Standard) Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code Flag –...
7 DETAILS OF INSTRUCTIONS ld.cf %rd, imm7 Function Transfer data to the coprocessor and get the flag status co_dout0 ← rd, co_dout1 ← imm7, psr(C, V, Z, N) ← co_cvzn Standard) Extension 1) co_dout0 ← rd, co_dout1 ← imm20, psr(C, V, Z, N) ← co_cvzn Extension 2) co_dout0 ←...
7 DETAILS OF INSTRUCTIONS ld.cw %rd, %rs Function Transfer data to the coprocessor co_dout0 ← rd, co_dout1 ← rs Standard) Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code Flag – – – – – – Mode Src:Register direct %rs = %r0 to %r7 Dst:Register direct %rd = %r0 to %r7...
Page 157
7 DETAILS OF INSTRUCTIONS (3) Extension 2 imm13 ; imm13(10:0) = imm24(23:13) imm13 ; = imm24(12:0) ld.ub %rd,[%rb] ; memory address = rb + imm24 The addressing mode changes to register indirect addressing with displacement, so the content of the rb register with the 24-bit immediate imm24 added comprises the memory address, the byte data in which is transferred to the rd register after being zero-extended to 16 bits.
7 DETAILS OF INSTRUCTIONS Function No operation Standard) No operation Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code Flag – – – – – – Mode – One cycle Description (1) Standard The nop instruction just takes one cycle and no operation results. The PC is incremented (+2). (2) Delayed slot instruction This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d”...
7 DETAILS OF INSTRUCTIONS sa %rd, %rs Function Arithmetic shift to the right Standard) Shift the content of rd to right as many bits as specified by rs (0–3, 4, or 8 bits), MSB ← MSB (sign bit) Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code...
7 DETAILS OF INSTRUCTIONS sa %rd, imm7 Function Arithmetic shift to the right Standard) Shift the content of rd to right as many bits as specified by imm7 (0–3, 4, or 8 bits), MSB ← MSB (sign bit) Extension 1) imm7 is extended to imm20 Extension 2) imm7 is extended to imm24 15 14 13 12 11 10 Code...
7 DETAILS OF INSTRUCTIONS sl %rd, %rs Function Logical shift to the left Standard) Shift the content of rd to left as many bits as specified by rs (0–3, 4, or 8 bits), LSB ← 0 Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code Flag...
7 DETAILS OF INSTRUCTIONS sl %rd, imm7 Function Logical shift to the left Standard) Shift the content of rd to left as many bits as specified by imm7 (0–3, 4, or 8 bits), LSB ← 0 Extension 1) imm7 is extended to imm20 Extension 2) imm7 is extended to imm24 15 14 13 12 11 10 Code...
7 DETAILS OF INSTRUCTIONS Function SLEEP Standard) Place the processor in SLEEP mode Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code Flag – – – – – – Mode – Six cycles Description Places the processor in SLEEP mode for power saving. Program execution is halted at the same time that the S1C17 Core executes the slp instruction, and the processor enters SLEEP mode.
7 DETAILS OF INSTRUCTIONS sr %rd, %rs Function Logical shift to the right Standard) Shift the content of rd to right as many bits as specified by rs (0–3, 4, or 8 bits), MSB ← 0 Extension 1) Unusable Extension 2) Unusable 15 14 13 12 11 10 Code Flag...
7 DETAILS OF INSTRUCTIONS sr %rd, imm7 Function Logical shift to the right Standard) Shift the content of rd to right as many bits as specified by imm7 (0–3, 4, or 8 bits), MSB ← 0 Extension 1) imm7 is extended to imm20 Extension 2) imm7 is extended to imm24 15 14 13 12 11 10 Code...
Page 186
7 DETAILS OF INSTRUCTIONS THIS PAGE IS BLANK. EPSON 7-122 S1C17 FAMILY S1C17 CORE MANUAL...
Page 187
Appendix List of S1C17 Core Instructions Symbols in the Instruction List S1C17 Core Instruction Set Registers/Register Data Flags %rd, rd: A general-purpose register (R0–R7) used as the destination register or its contents Interrupt level %rs, rs: A general-purpose register (R0–R7) used as the source register or its contents Interrupt enable flag %rb, rb: A general-purpose register (R0–R7) that has stored a base address to be accessed in...
Need help?
Do you have a question about the S1C17 Series and is the answer not in the manual?
Questions and answers