Register Notation And Register Numbers; General-Purpose Registers; Special Registers - Epson S1C17 Series Manual

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

Advertisement

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. In the mnemonic, a register is specified by prefixing the register name with "%."
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 in which the result of op-
%rd
eration is to be stored or data is to be loaded. The register is actually written as %r0, %r1, ... or %r7.
rb is a metasymbol indicating the general-purpose register that holds the base address of memory to be ac-
%rb
cessed. In this case, the general-purpose registers serve as an index register. The register is actually written
as [%r0], [%r1], ... or [%r7], with each register name enclosed in brackets "[]" to denote register indi-
rect addressing.
In register indirect addressing, the post-increment/decrement and pre-decrement functions provided for
continuous memory addresses can be used.
Post-increment function
Example: ld %rd,[%rb]+
The base address is incremented by an amount equal to the accessed size after the memory has been ac-
cessed.
Post-decrement function
Example: ld.a %rd,[%rb]-
The base address is decremented by an amount equal to the accessed size after the memory has been ac-
cessed.
Pre-decrement function
Example: ld.b -[%rb],%rs
The base address is decremented by an amount equal to the access size before accessing the memory.
Also any desired value can be specified as the address increment/decrement value using the ext instruc-
tion.
rb is also used as a symbol indicating the register that contains the jump address for the call or jump in-
structions. In this case, the brackets "[]" are unnecessary, and the register is written as %r0, %r1, ... or
%r7.
The bit field that specifies a register in the instruction code contains the code corresponding to a given register
number. The relationship between the general-purpose registers and the register numbers is listed in the table below.
General-purpose register

2.5.2 Special Registers

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.
S1C17 CORE MANUAL
(Rev. 1.2)
; (1)ld %rd,[%rb]
; (1)ld.a %rd,[%rb]
; (1)%rb = %rb - 1
Table 2.5.1.1 General-Purpose Registers
Register number
R0
0
R1
1
R2
2
R3
3
R4
4
R5
5
R6
6
R7
7
Seiko Epson Corporation
(2)%rb = %rb + 2
(2)%rb = %rb - 4
(2)ld.b [%rb],%rs
Register notation
%r0
%r1
%r2
%r3
%r4
%r5
%r6
%r7
2 REGISTERS
2-7

Advertisement

Table of Contents
loading

Table of Contents