![Epson S1C17 Series Manual Download Page 27](http://html.mh-extra.com/html/epson/s1c17-series/s1c17-series_manual_107781027.webp)
S1C17 CORE MANUAL
Seiko Epson Corporation
5-5
(Rev. 1.2)
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
; Load 16-bit data
Before execution r0 = 0x
XXXXXX
After execution
r0 = 0x00fff0
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
(1)
ext imm13
(2)
ld.a %r0,imm7
; Load 24-bit data
r0 after execution
imm13
(3:0)
(1)
r0
23
20 19
imm13 (2)
7
imm7
6
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
rs
is a metasymbol indicating the general-purpose register that holds the source data to be operated on or
transferred. The register is actually written as
%r0
,
%r1
, ... or
%r7
.
%rd
rd
is a metasymbol indicating the general-purpose register that is the destination for the result of operation.
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
%sp
Program counter
%pc
The register names are always prefixed by “
%
” to discriminate them from symbol names, label names, and the like.