Branch And Delayed Branch Instructions; Types Of Branch Instructions - Epson S1C17 Series Manual

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

Advertisement

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:
jr*
sign7
jpr
sign10
jpr
%rb
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).
The number of instruction steps to the jump address is specified for sign7/10 or rb. However, since the instruc-
tion length in the S1C17 Core is fixed to 16 bits, the value of sign7/10 is doubled to become a word address in
16-bit units. Therefore, the displacement actually added to the PC is a signed 8-bit/11-bit quantity derived by
doubling sign7/10 (least significant bit always 0). When the rb register is used to specify the displacement, the
register contents are added to the PC without doubling.
The specifiable displacement can be extended by the ext instruction, as shown below.
For branch instructions used singly
Functions as "jr* sign8" (sign8 = {sign7, 0})
jr*
sign7
For the jr* instructions that are used singly, a signed 7-bit displacement (sign7) can be specified.
sign8
PC
PC
The range of addresses to which jumped is (PC - 126) to (PC + 128).
Functions as "jpr sign11" (sign11 = {sign10, 0})
jpr
sign10
For the jpr instruction that is used singly, a signed 10-bit displacement (sign10) can be specified.
sign11
PC
PC
The range of addresses to which jumped is (PC - 2,046) to (PC + 2,048).
S1C17 CORE MANUAL
(Rev. 1.2)
23
S
S
S S S S S S S S S S S S S S
Current address
Branch destination address
23
S
S
S S S S S S S S S S S
Current address
Branch destination address
Seiko Epson Corporation
8 7
S
sign7
+
2
+
11 10
S
sign10
+
2
+
5 INSTRUCTION SET
1
0
0
0
0
1
0
0
0
0
5-17

Advertisement

Table of Contents
loading

Table of Contents