Calla %Rb; Calla.d %Rb - Epson S1C17 Series Manual

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

Advertisement

7 DETAILS OF INSTRUCTIONS
calla
%rb

calla.d %rb

Function
PC absolute subroutine call
Standard)
Extension 1) Unusable
Extension 2) Unusable
15 14 13 12 11 10
Code
0
0
0
|
|
0
0
0
|
|
IL
IE
C
Flag
|
|
Mode
PC absolute
CLK
calla
calla.d
Description
(1) Standard
calla
Stores the address of the following instruction into the stack, then sets the contents of the rb
register to the PC for calling the subroutine that starts from the address set to the PC. The LSB
of the rb register is invalid and is always handled as 0. When the ret instruction is executed in
the subroutine, the program flow returns to the instruction following the calla instruction.
(2) Delayed branch (d bit (bit 7) = 1)
calla.d
When calla.d is specified, the d bit (bit 7) in the instruction code is set and the following
instruction becomes a delayed slot instruction.
The delayed slot instruction is executed before branching to the subroutine. Therefore the
address (PC + 4) of the instruction that follows the delayed slot instruction is stored into the
stack as the return address.
When the calla.d instruction is executed, interrupts cannot occur because they are masked
between the calla.d and delayed slot instructions.
Example
calla
Caution
When the calla.d instruction (delayed branch) is used, be careful to ensure that the next
instruction is limited to those that can be used as a delayed slot instruction. If any other instruction
is executed, the program may operate indeterminately. For the usable instructions, refer to the
instruction list in the Appendix.
7-16
sp ← sp - 4, A[sp] ← pc + 2, pc ← rb
calla:
calla.d: sp ← sp - 4, A[sp] ← pc + 4, pc ← rb
9
8
7
|
0
0
0
0
1
0
|
|
|
|
|
|
|
0
0
0
0
1
1
|
|
|
|
|
|
V
Z
N
|
|
|
Four cycles
Three cycles (when a one-cycle delayed slot instruction follows), Four cycles (other)
%rb
%rb
%r0
; Calls the subroutine that starts from the
; address stored in the r0 register.
Seiko Epson Corporation
6
5
4
3
2
1
0
|
0
0
0
1
r b
|
|
|
|
|
|
0
0
0
1
r b
|
|
|
|
|
calla
calla.d
S1C17 CORE MANUAL
(REV. 1.2)

Advertisement

Table of Contents
loading

Table of Contents