Addressing Modes (Without Ext Extension); Immediate Addressing; Register Direct Addressing - Epson S1C17 Series Manual

Cmos 16-bit single chip microcontroller
Hide thumbs Also See for S1C17 Series:
Table of Contents

Advertisement

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
(4) Register indirect addressing with post-increment/post-decrement/pre-decrement
(5) Register indirect addressing with displacement
(6) Signed PC relative addressing
(7) PC absolute addressing
5.2.1 Immediate Addressing
The immediate included in the instruction code that is indicated as immX (unsigned immediate) or signX (signed
immediate) is used as the source data. The immediate size specifiable in each instruction is indicated by a numeral
in the symbol (e.g., imm7 = unsigned 7 bits; sign7 = signed 7 bits). For signed immediates such as sign7, the most
significant bit is the sign bit, which is extended to 16 or 24 bits when the instruction is executed.
Example: ld
%r0,0x70
Before execution
After execution
The immediate sign7 can represent values in the range of +63 to -64 (0b0111111 to 0b1000000).
Except in the case of shift-related instructions, immediate data can be extended to a maximum of 24 bits by a com-
bined use of the operand value and the ext instruction.
Example: ext
imm13
ext
imm13
ld.a
%r0,imm7
r0 after execution
23
r0
imm13
(1)
(3:0)
5.2.2 Register Direct Addressing
The content of a specified register is used directly as the source data. Furthermore, if this addressing mode is speci-
fied as the destination for an instruction that loads the result in a register, the result is loaded in this specified regis-
ter. The instructions that have the following symbols as the operand are executed in this addressing mode.
rs is a metasymbol indicating the general-purpose register that holds the source data to be operated on or
%rs
transferred. The register is actually written as %r0, %r1, ... or %r7.
rd is a metasymbol indicating the general-purpose register that is the destination for the result of operation.
%rd
The register is actually written as %r0, %r1, ... or %r7. Depending on the instruction, it will also be used
as the source data.
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.
S1C17 CORE MANUAL
(Rev. 1.2)
; Load 16-bit data
r0 = 0xXXXXXX
r0 = 0x00fff0
(1)
(2)
; Load 24-bit data
20 19
imm13 (2)
%sp
%pc
Seiko Epson Corporation
7
6
0
imm7
5 INSTRUCTION SET
5-5

Advertisement

Table of Contents
loading

Table of Contents