Cmos 32-bit single chip microcontroller (434 pages)
Summary of Contents for Epson S1C17 Series
Page 1
CMOS 16-BIT SINGLE CHIP MICROCONTROLLER S1C17 Family S1C17 Core Manual Rev. 1.2...
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 assume any liability...
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.
At an initial reset, the reset vector (address) written at the top of vector table indicated by TTBR is loaded into the PC, and the processor starts executing a program from the address indicated by the PC. Effective address Figure 2.2.1 Program Counter (PC) Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
(6) When a shift operation of the register in which bit 15 is 1 is executed using a left logical shift instruction (7) When a shift operation of the register in which bit 0 is 1 is executed using a right arithmetic shift instruction Seiko Epson Corporation S1C17 CORE MANUAL...
Page 12
This bit indicates a sign. More specifically, the most significant bit (bit 15) of the result of a logical operation, arithmetic operation, or shift instruction is copied to this N flag. Note that 16-bit arithmetic operation instructions can set the N flag, but 24-bit arithmetic operation instructions cannot. Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
Figure 2.4.4.2 SP and Stack (6) In addition to the instructions shown above, some other load instructions have been provided for operating the stack. Refer to Chapter 7, “Details of Instructions,” for more information on those instructions. Seiko Epson Corporation S1C17 CORE MANUAL (REV. 1.2)
The special registers that can be directly specified in the S1C17 Core instructions are the SP (Stack Pointer) and PC (Program Counter) only. The register is actually written as %sp, [%sp], -[%sp], [%sp]+, [%sp]-, [%sp+imm7], or %pc. Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
3.1.2 Signed 8-Bit Transfer (Register → Register) Example: ld.b %rd,%rs Byte 16 15 Byte Figure 3.1.2.1 Signed 8-Bit Transfer (Register → Register) Bits 15–8 in the destination register are sign-extended and bits 23–16 are set to 0x00. Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
However, the eight high-order bits are effective as the PSR value only in the stack operation when an interrupt occurs. The data transfer sizes and types are described below. Seiko Epson Corporation S1C17 CORE MANUAL (REV. 1.2)
0xff fbff 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. Seiko Epson Corporation S1C17 CORE MANUAL (Rev.
Refer to the Technical Manual of each model for the address stored in this register. * In addition to the above registers, the reserved core I/O area contains some registers for debugging. For the debug registers, refer to Section 6.5, “Debug Circuit.” Seiko Epson Corporation S1C17 CORE MANUAL (REV. 1.2)
[imm7],%rs SP → general-purpose register %rd,%sp PC → general-purpose register %rd,%pc Stack (32 bits) → general-purpose register * %rd,[%sp] Stack pointer post-increment, post-decrement, and pre-decrement functions can %rd,[%sp]+ be used. %rd,[%sp]- %rd,-[%sp] Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
Page 24
Logical inversion between general-purpose registers (1's complement) %rd,%rs Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0). not/c not/nc Logical inversion of general-purpose register and immediate (1's complement) %rd,sign7 Seiko Epson Corporation S1C17 CORE MANUAL (REV. 1.2)
Page 25
32-bit data in which the eight high-order bits are set to 0 is written to the memory. During reading from a memo- ry, the eight high-order bits of the read data are ignored. Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
Page 26
Stack pointer Stack [%sp],[%sp+imm7] Stack with address post-incremented [%sp]+ Stack with address post-decremented [%sp]- Stack with address pre-decremented -[%sp] Unsigned immediate (numerals indicating bit length) imm3,imm5,imm7,imm13 Signed immediate (numerals indicating bit length) sign7,sign10 Seiko Epson Corporation S1C17 CORE MANUAL (REV. 1.2)
Special register names are written as follows: Stack pointer Program counter The register names are always prefixed by “%” to discriminate them from symbol names, label names, and the like. Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
The base address is decremented before a data transfer starts. This addressing mode is specified by enclosing the register name in brackets “[],” which is prefixed by “-.” The register name is actually written as -[%r0], -[%r1], ... -[%r7], or -[%sp]. Seiko Epson Corporation S1C17 CORE MANUAL (REV. 1.2)
PC. Also this addressing mode is used for the int and intl instructions that execute interrupt handler routines. Example: int Executes the interrupt handler of vector No. 3 (TTBR + 0xc). 0x03 Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
When extended by two ext instructions, rd = rs + imm16 X X X X X X X X Data 13 12 Immediate imm13 (2) imm13 (2:0) 0 0 0 0 0 0 0 0 Data + imm16 Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
The most significant bit “S” in the immediate that has been extended by the ext instruction is the sign, with which bits 23–21 are extended to become signed 21-bit data. The most significant bit in sign7 is handled as the MSB data of 7-bit data, and not as the sign. Seiko Epson Corporation S1C17 CORE MANUAL 5-11...
Unsigned byte data transfer 16 15 Byte data 16-bit data transfer 16 15 16-bit data 24/32-bit data transfer 24-bit data Refer to Chapter 3, “Data Formats,” for the data layout in the memory. Seiko Epson Corporation S1C17 CORE MANUAL 5-13 (Rev. 1.2)
Instructions executable under NC condition (op = and, or, xor, not) op/nc %rd,%rs The instruction with the /nc switch will be executed only when the C flag has been cleared to 0. Example: xor/nc %rd,%rs Seiko Epson Corporation 5-14 S1C17 CORE MANUAL (REV. 1.2)
(op = add, add.a, adc, sub, sub.a, sbc, cmp, cmp.a, cmc) op/nc %rd,%rs The instruction with the /nc switch will be executed only when the C flag has been cleared to 0. Example: cmp/nc %rd,%rs Seiko Epson Corporation S1C17 CORE MANUAL 5-15 (Rev. 1.2)
Logical shift left sa Arithmetic shift right Sign bit The swap instruction replaces the contents of general-purpose registers with each other, as shown below. Byte 1 Byte 0 Byte 0 Byte 1 Seiko Epson Corporation 5-16 S1C17 CORE MANUAL (REV. 1.2)
S S S S S S S S S S S sign10 Current address Branch destination address The range of addresses to which jumped is (PC - 2,046) to (PC + 2,048). Seiko Epson Corporation S1C17 CORE MANUAL 5-17 (Rev. 1.2)
Page 40
The range of addresses to which jumped is (PC - 8,388,606) to (PC + 8,388,608). The above range of addresses to which jumped is a theoretical value, and is actually limited by the range of memory areas used. Seiko Epson Corporation 5-18 S1C17 CORE MANUAL...
Page 41
When the content of the rb register or the immediate is loaded into the PC, its least significant bit is always made 0. jpa %rb D(23:1) Branch destination address Seiko Epson Corporation S1C17 CORE MANUAL 5-19 (Rev. 1.2)
Page 42
Since these instructions are basically provided for the debug firmware, please do not use them in applica- tion programs. For details on the functionality of these instructions, refer to Section 6.5, “Debug Circuit.” Seiko Epson Corporation 5-20 S1C17 CORE MANUAL...
For details on HALT and SLEEP modes, refer to Section 6.4, “Power-Down Mode,” and the Technical Manual for each S1C17 model. For details on the interrupt control, refer to Section 6.3, “Interrupts.” Seiko Epson Corporation 5-22 S1C17 CORE MANUAL (REV. 1.2)
16 15 8 bits 8 bits cv.ls %rd,%rs Extends the sign to convert 16-bit data into 32-bit data. 16 15 Word 16 15 S S S S S S S S S Seiko Epson Corporation S1C17 CORE MANUAL 5-23 (Rev. 1.2)
The ld.ca and ld.cf instructions input the flag status from the coprocessor and set it to the PSR (C, V, Z, and N flags). The concrete commands and status of the coprocessor vary with each coprocessor connected to the chip. Refer to the user’s manual for the coprocessor used. Seiko Epson Corporation 5-24 S1C17 CORE MANUAL (REV. 1.2)
The processor is placed in HALT or SLEEP mode to reduce power consumption by executing the halt or slp instruction in the software (see Section 6.4). Normally the processor can be taken out of HALT or SLEEP mode by NMI or an external interrupt as well as initial reset. Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
Note: The pipelined operation shown above uses the internal memory. If external memory or low-speed external devices are used, one or more wait cycles may be inserted depending on the devices used, with the E stage kept waiting. Seiko Epson Corporation S1C17 CORE MANUAL (REV. 1.2)
R0 save area (DBRAM: See Section 4.2.3) During debug interrupt handling, neither other interrupts nor multiple debug interrupts are accepted. They are kept pending until the debug interrupt handling currently underway finishes. Seiko Epson Corporation S1C17 CORE MANUAL (REV. 1.2)
PC. The processor thereby branches to the user’s initialization routine, in which it starts executing the program. The reset sequence has priority over all other processing. Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
In the interrupt handler routine, the reti instruction should be executed at the end of processing. In the reti instruction, the saved data is restored from the stack in order of the PC and PSR, and the processing returns to the suspended instructions. Seiko Epson Corporation S1C17 CORE MANUAL (REV. 1.2)
Interrupt masked state still continues, so the next instruction will be executed before interrupts can be generated. Interrupt mask is released. Next instruction *2 The debug interrupt may occur even in the conditions (4) to (6). Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
When the interrupt has been disabled, the processor restarts the program from the instruction next to halt or slp after the processor is taken out of HALT or SLEEP mode. Seiko Epson Corporation 6-10 S1C17 CORE MANUAL...
Debugging is performed by connecting a serial ICE to the debug pins of the S1C17 Core and entering debug commands from the debugger being run on a personal computer. The tools listed below are required for debugging. • S1C17 Family Serial ICE (S5U1C17001H) • S1C17 Family C Compiler Package Seiko Epson Corporation S1C17 CORE MANUAL 6-11 (Rev. 1.2)
1 (R/W): Enable 0 (R/W): Disable (default) DM: Debug Mode Bit Indicates the current operation mode of the processor (debug mode or user mode). 1 (R): Debug mode 0 (R): User mode (default) Seiko Epson Corporation 6-12 S1C17 CORE MANUAL (REV. 1.2)
Page 59
D[7:0] TXRXD[7:0]: Transmit/Receive Data This is the transmit/receive data register of the serial interface for the on-chip debug monitor used to set transmit data and to store received data. (Default: 0x00) Seiko Epson Corporation S1C17 CORE MANUAL 6-13 (Rev. 1.2)
Register number (R0 = 0 ... R7 = 7) Delayed bit (0: Standard branch instruction, 1: Delayed branch instruction) Functions ←: Indicates that the right item is loaded or set to the left item. Addition Subtraction &: Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
Page 61
7 DETAILS OF INSTRUCTIONS Flags Interrupt level Interrupt enable flag Carry flag Overflow flag Zero flag Negative flag –: Not changed ↔: Set (1) or reset (0) Set (1) Reset (0) Seiko Epson Corporation S1C17 CORE MANUAL (REV. 1.2)
(2) Addition of 32-bit data, data 1 = {r2, r1}, data 2 = {r4, r3}, result = {r2, r1} %r1,%r3 ; Addition of the low-order word %r2,%r4 ; Addition of the high-order word Seiko Epson Corporation S1C17 CORE MANUAL (Rev. 1.2)
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example (1) adc %r0,0x7f ; r0 = r0 + 0x7f + C (2) ext 0x1ff %r1,0x7f ; r1 = r1 + 0xffff + C Seiko Epson Corporation S1C17 CORE MANUAL (REV. 1.2)
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example (1) and %r0,%r0 ; r0 = r0 & r0 (2) ext 0x1fff %r1,%r2 ; r1 = r2 & 0x3fff Seiko Epson Corporation S1C17 CORE MANUAL 7-11 (Rev. 1.2)
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example (1) and %r0,0x7e ; r0 = r0 & 0xfffe (2) ext 0x3f %r1,0x7f ; r1 = r1 & 0x1fff Seiko Epson Corporation 7-12 S1C17 CORE MANUAL (REV. 1.2)
The retd instruction must be used for return from the debug-handler routine. This instruction is provided for debug firmware. Do not use it in the user program. Example ; Executes the debug-handler routine Seiko Epson Corporation S1C17 CORE MANUAL 7-13 (Rev. 1.2)
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation 7-14 S1C17 CORE MANUAL...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation S1C17 CORE MANUAL 7-15...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation 7-16 S1C17 CORE MANUAL...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation S1C17 CORE MANUAL 7-17...
In this case, the ext instruction can be used to extend the operand. The conditional execution instruction above sets/resets the flags (V, Z and N) according to the results if it is executed. Seiko Epson Corporation 7-18 S1C17 CORE MANUAL...
Page 78
%r0,%r1 ; Changes the flags according to the results of ; r0 - r1 - C. (2) ext 0x1fff %r1,%r2 ; Changes the flags according to the results of ; r2 - 0x1fff - C. Seiko Epson Corporation S1C17 CORE MANUAL 7-19 (Rev. 1.2)
%r0,0x7f ; Changes the flags according to the results of ; r0 - 0x7f - C. (2) ext 0x1ff %r1,0x7f ; Changes the flags according to the results of ; r1 - 0xffff - C. Seiko Epson Corporation 7-20 S1C17 CORE MANUAL (REV. 1.2)
In this case, the ext instruction can be used to extend the operand. The conditional execution instruction above sets/resets the flags (V, Z and N) according to the results if it is executed. Seiko Epson Corporation S1C17 CORE MANUAL 7-21...
Page 81
%r0,%r1 ; Changes the flags according to the results of ; r0 - r1. (2) ext 0x1fff ; Changes the flags according to the results of %r1,%r2 ; r2 - 0x3fff. Seiko Epson Corporation 7-22 S1C17 CORE MANUAL (REV. 1.2)
%r0,0x3f ; Changes the flags according to the results of ; r0 - 0x3f. (2) ext 0x1ff %r1,0x7f ; Changes the flags according to the results of ; r1 - 0xffff. Seiko Epson Corporation S1C17 CORE MANUAL 7-23 (Rev. 1.2)
In this case, the ext instruction can be used to extend the operand. The conditional execution instruction above sets/resets the flags (V and Z) according to the results if it is executed. Seiko Epson Corporation 7-24 S1C17 CORE MANUAL (REV. 1.2)
Page 84
; Changes the flags according to the results of ; r0 - r1. (2) ext 0x1fff cmp.a %r1,%r2 ; Changes the flags according to the results of ; r2 - 0x3fff. Seiko Epson Corporation S1C17 CORE MANUAL 7-25 (Rev. 1.2)
%r0,0x7f ; Changes the flags according to the results of ; r0 - 0x7f. (2) ext 0x1fff cmp.a %r1,0x7f ; Changes the flags according to the results of ; r1 - 0xffffff. Seiko Epson Corporation 7-26 S1C17 CORE MANUAL (REV. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. Example When the R1 register contains 0x80 cv.ab %r0,%r1 ; r0 = 0xffff80 Seiko Epson Corporation S1C17 CORE MANUAL 7-27 (Rev. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. Example When the R1 register contains 0xff and the R0 register contains 0x0 cv.al %r0,%r1 ; r0 = 0xff0000 Seiko Epson Corporation 7-28 S1C17 CORE MANUAL (REV. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. Example When the R1 register contains 0x8000 cv.as %r0,%r1 ; r0 = 0xff8000 Seiko Epson Corporation S1C17 CORE MANUAL 7-29 (Rev. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. Example When the R1 register contains 0x800000 cv.la %r0,%r1 ; r0 = 0x000080 Seiko Epson Corporation 7-30 S1C17 CORE MANUAL (REV. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. Example When the R1 register contains 0x008000 cv.ls %r0,%r1 ; r0 = 0x00ffff Seiko Epson Corporation S1C17 CORE MANUAL 7-31 (Rev. 1.2)
If the interrupt handler routine is returned by simply executing the reti instruction, the previous ext instruction is invalidated. Therefore, it is necessary to modify the return address in that case. Seiko Epson Corporation 7-34 S1C17 CORE MANUAL...
HALT mode. Refer to the technical manual of each model for details of HALT mode. Example halt ; Sets the processor in HALT mode. Seiko Epson Corporation S1C17 CORE MANUAL 7-35 (Rev. 1.2)
TTBR + 0x7c External maskable interrupt 0x1f The TTBR is the vector table base address. The reti instruction should be used for return from the handler routine. Example ; Generates an NMI. Seiko Epson Corporation 7-36 S1C17 CORE MANUAL (REV. 1.2)
The altered IL bits are restored to the value before the intl instruction is executed when the interrupt handler routine is terminated by the reti instruction. Example intl 0x3,0x2 ; Generates an external maskable interrupt 0x3 ; and set the IL bits to 0x2. Seiko Epson Corporation S1C17 CORE MANUAL 7-37 (Rev. 1.2)
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation 7-38 S1C17 CORE MANUAL...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation S1C17 CORE MANUAL 7-39...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation 7-40 S1C17 CORE MANUAL...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation S1C17 CORE MANUAL 7-41...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation 7-42 S1C17 CORE MANUAL...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation S1C17 CORE MANUAL 7-43...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation 7-44 S1C17 CORE MANUAL...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation S1C17 CORE MANUAL 7-45...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation 7-46 S1C17 CORE MANUAL...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation S1C17 CORE MANUAL 7-47...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation 7-48 S1C17 CORE MANUAL...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation S1C17 CORE MANUAL 7-49...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation 7-50 S1C17 CORE MANUAL...
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation S1C17 CORE MANUAL 7-51...
(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” bit. ; r0 ← r1(15:0) Example %r0,%r1 Seiko Epson Corporation 7-52 S1C17 CORE MANUAL (REV. 1.2)
The rb register and the displacement must specify a 16-bit boundary address (least significant bit = 0). Specifying an odd address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the least significant bit of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-53...
The address increment/decrement sizes are listed below. When no ext is used (standard): 2 (16-bit size) When one ext is used (extension 1): imm13 When two ext are used (extension 2): imm24 Seiko Epson Corporation 7-54 S1C17 CORE MANUAL (REV. 1.2)
Page 114
The rb register and the immediate value must specify a 16-bit boundary address (least significant bit = 0). Specifying an odd address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the least significant bit of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-55...
The SP and the displacement must specify a 16-bit boundary address (least significant bit = 0). Specifying an odd address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the least significant bit of the address to 0. Seiko Epson Corporation 7-56 S1C17 CORE MANUAL...
The imm7 must specify a 16-bit boundary address (least significant bit = 0). Specifying an odd address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the least significant bit of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-57...
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. ; r0 ← 0xffff (r0 = 0x00ffff) Example %r0,0x7f Seiko Epson Corporation 7-58 S1C17 CORE MANUAL (REV. 1.2)
The rb register and the displacement must specify a 16-bit boundary address (least significant bit = 0). Specifying an odd address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the least significant bit of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-59...
The address increment/decrement sizes are listed below. When no ext is used (standard): 2 (16-bit size) When one ext is used (extension 1): imm13 When two ext are used (extension 2): imm24 Seiko Epson Corporation 7-60 S1C17 CORE MANUAL (REV. 1.2)
Page 120
The rb register and the immediate value must specify a 16-bit boundary address (least significant bit = 0). Specifying an odd address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the least significant bit of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-61...
The SP and the displacement must specify a 16-bit boundary address (least significant bit = 0). Specifying an odd address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the least significant bit of the address to 0. Seiko Epson Corporation 7-62 S1C17 CORE MANUAL...
The imm7 must specify a 16-bit boundary address (least significant bit = 0). Specifying an odd address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the least significant bit of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-63...
PC value that is loaded into the rd register may not be the next instruction address to the ld.a instruction. • This instruction must be used as a delayed slot instruction for jr*.d, jpr.d or jpa.d. Seiko Epson Corporation 7-64 S1C17 CORE MANUAL...
(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” bit. ; r0 ← r1 Example ld.a %r0,%r1 Seiko Epson Corporation S1C17 CORE MANUAL 7-65 (Rev. 1.2)
Dst: Register direct %rd = %r0 to %r7 One cycle Description The content of the SP (24-bit data) is transferred to the rd register. ; r0 ← sp Example ld.a %r0,%sp Seiko Epson Corporation 7-66 S1C17 CORE MANUAL (REV. 1.2)
The rb register and the displacement must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-67...
The address increment/decrement sizes are listed below. When no ext is used (standard): 4 (32-bit size) When one ext is used (extension 1): imm13 When two ext are used (extension 2): imm24 Seiko Epson Corporation 7-68 S1C17 CORE MANUAL (REV. 1.2)
Page 128
The rb register and the immediate value must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-69...
The displacement must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation 7-70 S1C17 CORE MANUAL...
The address increment/decrement sizes are listed below. When no ext is used (standard): 4 (32-bit size) When one ext is used (extension 1): imm13 When two ext are used (extension 2): imm24 Seiko Epson Corporation S1C17 CORE MANUAL 7-71 (Rev. 1.2)
Page 131
The immediate must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation 7-72 S1C17 CORE MANUAL...
The SP and the displacement must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-73...
The imm7 must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation 7-74 S1C17 CORE MANUAL...
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. ; r0 ← 0x00003f Example ld.a %r0,0x3f Seiko Epson Corporation S1C17 CORE MANUAL 7-75 (Rev. 1.2)
The content of the rs register is transferred to the SP. ; sp ← r0 Example ld.a %sp,%r0 Caution In data transfer to the SP, the low-order two bits of the source data are always handled as 0. Seiko Epson Corporation 7-76 S1C17 CORE MANUAL (REV. 1.2)
Example ; sp ← 0x400 ld.a %sp,0x0 Caution In data transfer to the SP, the low-order two bits of the source data are always handled as 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-77 (Rev. 1.2)
The rb register and the displacement must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation 7-78 S1C17 CORE MANUAL...
The address increment/decrement sizes are listed below. When no ext is used (standard): 4 (32-bit size) When one ext is used (extension 1): imm13 When two ext are used (extension 2): imm24 Seiko Epson Corporation S1C17 CORE MANUAL 7-79 (Rev. 1.2)
Page 139
The rb register and the immediate value must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation 7-80 S1C17 CORE MANUAL...
The SP and the displacement must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-81...
The address increment/decrement sizes are listed below. When no ext is used (standard): 4 (32-bit size) When one ext is used (extension 1): imm13 When two ext are used (extension 2): imm24 Seiko Epson Corporation 7-82 S1C17 CORE MANUAL (REV. 1.2)
Page 142
The SP and the immediate value must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-83...
The SP and the displacement must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation 7-84 S1C17 CORE MANUAL...
The imm7 must specify a 32-bit boundary address (two least significant bits = 0). Specifying other address causes an address misaligned interrupt. Note, however, that the data transfer is performed by setting the two least significant bits of the address to 0. Seiko Epson Corporation S1C17 CORE MANUAL 7-85...
(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” bit. ; r0 ← r1(7:0) sign-extended Example ld.b %r0,%r1 Seiko Epson Corporation 7-86 S1C17 CORE MANUAL (REV. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation S1C17 CORE MANUAL 7-87...
The address increment/decrement sizes are listed below. When no ext is used (standard): 1 (byte size) When one ext is used (extension 1): imm13 When two ext are used (extension 2): imm24 Seiko Epson Corporation 7-88 S1C17 CORE MANUAL (REV. 1.2)
Page 148
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation S1C17 CORE MANUAL 7-89...
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example ; r0 ← [sp + 0x81] sign-extended ld.b %r0,[%sp + 0x1] Seiko Epson Corporation 7-90 S1C17 CORE MANUAL (REV. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example %r0,[0x1] ; r0 ← [0x81] sign-extended ld.b Seiko Epson Corporation S1C17 CORE MANUAL 7-91 (Rev. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation 7-92 S1C17 CORE MANUAL...
The address increment/decrement sizes are listed below. When no ext is used (standard): 1 (byte size) When one ext is used (extension 1): imm13 When two ext are used (extension 2): imm24 Seiko Epson Corporation S1C17 CORE MANUAL 7-93 (Rev. 1.2)
Page 153
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation 7-94 S1C17 CORE MANUAL...
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example ; B[sp + 0x81] ← 8 low-order bits of r0 ld.b [%sp + 0x1],%r0 Seiko Epson Corporation S1C17 CORE MANUAL 7-95 (Rev. 1.2)
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example ; B[0x81] ← 8 low-order bits of r0 ld.b [0x1],%r0 Seiko Epson Corporation 7-96 S1C17 CORE MANUAL (REV. 1.2)
The results are loaded to the rd register and the C, V, Z, and N flags in the PSR. (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” bit. Seiko Epson Corporation S1C17 CORE MANUAL 7-97 (Rev. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation 7-98 S1C17 CORE MANUAL...
C, V, Z, and N flags in the PSR. (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” bit. Seiko Epson Corporation S1C17 CORE MANUAL 7-99 (Rev. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation 7-100 S1C17 CORE MANUAL...
N flags in the PSR are not altered. (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” bit. Seiko Epson Corporation S1C17 CORE MANUAL 7-101 (Rev. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation 7-102 S1C17 CORE MANUAL...
(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” bit. ; r0 ← r1(7:0) zero-extended Example ld.ub %r0,%r1 Seiko Epson Corporation S1C17 CORE MANUAL 7-103 (Rev. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation 7-104 S1C17 CORE MANUAL...
The address increment/decrement sizes are listed below. When no ext is used (standard): 1 (byte size) When one ext is used (extension 1): imm13 When two ext are used (extension 2): imm24 Seiko Epson Corporation S1C17 CORE MANUAL 7-105 (Rev. 1.2)
Page 165
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation 7-106 S1C17 CORE MANUAL...
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example %r0,[%sp + 0x1] ; r0 ← [sp + 0x81] zero-extended ld.ub Seiko Epson Corporation S1C17 CORE MANUAL 7-107 (Rev. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example %r0,[0x1] ; r0 ← [0x81] zero-extended ld.ub Seiko Epson Corporation 7-108 S1C17 CORE MANUAL (REV. 1.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” bit. Example ; Waits 2 cycles Seiko Epson Corporation S1C17 CORE MANUAL 7-109 (Rev. 1.2)
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example When r1 = 0x555555 %r0,%r1 ; r0 = 0x00aaaa Seiko Epson Corporation 7-110 S1C17 CORE MANUAL (REV. 1.2)
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example (1) not %r0,0x3f ; r0 = 0x00ffc0 (2) ext 0x1ff %r1,0x7f ; r1 = 0x000000 Seiko Epson Corporation S1C17 CORE MANUAL 7-111 (Rev. 1.2)
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example (1) or %r0,%r0 ; r0 = r0 | r0 (2) ext 0x1fff %r1,%r2 ; r1 = r2 | 0x3fff Seiko Epson Corporation 7-112 S1C17 CORE MANUAL (REV. 1.2)
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example (1) or %r0,0x7e ; r0 = r0 | 0xfffe (2) ext 0xff %r1,0x7f ; r1 = r1 | 0x7fff Seiko Epson Corporation S1C17 CORE MANUAL 7-113 (Rev. 1.2)
If any other instruction is executed, the program may operate indeterminately. For the usable instructions, refer to the instruction list in the Appendix. Seiko Epson Corporation 7-114 S1C17 CORE MANUAL...
Page 174
(DBRAM) when an debug interrupt occurred to the respective registers, and return from the debug interrupt handler routine. This instruction is provided for debug firmware. Do not use it in the user program. Example retd ; Return from a debug interrupt handler routine Seiko Epson Corporation S1C17 CORE MANUAL 7-115 (Rev. 1.2)
Interrupts are masked in intervals between the reti.d instruction and the next instruction, so no interrupts occur. Example reti ; Return from a interrupt handler routine Seiko Epson Corporation 7-116 S1C17 CORE MANUAL (REV. 1.2)
(after execution) S ... S (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” bit included. Seiko Epson Corporation S1C17 CORE MANUAL 7-117 (Rev. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit included. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation 7-118 S1C17 CORE MANUAL...
(2) Subtraction of 32-bit data data 1 = {r2, r1}, data2 = {r4, r3}, result = {r2, r1} %r1,%r3 ; Subtraction of the low-order word %r2,%r4 ; Subtraction of the high-order word Seiko Epson Corporation S1C17 CORE MANUAL 7-119 (Rev. 1.2)
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example (1) sbc %r0,0x7f ; r0 = r0 - 0x7f - C (2) ext 0x1ff %r1,0x7f ; r1 = r1 - 0xffff - C Seiko Epson Corporation 7-120 S1C17 CORE MANUAL (REV. 1.2)
(after execution) (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” bit included. Seiko Epson Corporation S1C17 CORE MANUAL 7-121 (Rev. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit included. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation 7-122 S1C17 CORE MANUAL...
SLEEP mode. Refer to the technical manual of each model for details of SLEEP mode. Example ; The processor is placed in SLEEP mode. Seiko Epson Corporation S1C17 CORE MANUAL 7-123 (Rev. 1.2)
(after execution) (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” bit included. Seiko Epson Corporation 7-124 S1C17 CORE MANUAL (REV. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit included. In this case, extension of the immediate by the ext instruction cannot be performed. Seiko Epson Corporation S1C17 CORE MANUAL 7-125...
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example (1) sub %r0,%r0 ; r0 = r0 - r0 (2) ext 0x1fff %r1,%r2 ; r1 = r2 - 0x3fff Seiko Epson Corporation 7-126 S1C17 CORE MANUAL (REV. 1.2)
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example (1) sub %r0,0x3f ; r0 = r0 - 0x3f (2) ext 0x1ff %r1,0x7f ; r1 = r1 - 0xffff Seiko Epson Corporation S1C17 CORE MANUAL 7-127 (Rev. 1.2)
This instruction may be executed as a delayed slot instruction by writing it directly after a branch instruction with the “d” bit. Example When r1 = 0x123456 ; 0x005634 → r2 swap %r2,%r1 Seiko Epson Corporation 7-132 S1C17 CORE MANUAL (REV. 1.2)
“d” bit. In this case, extension of the immediate by the ext instruction cannot be performed. Example (1) xor %r0,0x7e ; r0 = r0 ^ 0xfffe (2) ext 0x1ff %r1,0x7f ; r1 = r1 ^ 0xffff Seiko Epson Corporation 7-134 S1C17 CORE MANUAL (REV. 1.2)
Page 194
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...
Page 202
REVISION HISTORY Revision History Code No. Page Contents 410905900 New establishment 410905901 Made an overall revision. 410905902 6-10 Corrected the description in “Canceling HALT or SLEEP mode.” 7-32, 7-33 Added “Caution” to the di and ei instruction pages.