7
DETAILS OF INSTRUCTIONS
S1C33 FAMILY C33 PE CORE MANUAL
EPSON
73
call
sign8
/ call.d
sign8
Function
Subroutine call
Standard)
sp
←
sp -
4
, W[sp]
←
pc +
2
, pc
←
pc +
sign8
×
2
Extension
1
) sp
←
sp -
4
, W[sp]
←
pc +
2
, pc
←
pc +
sign22
Extension
2
) sp
←
sp -
4
, W[sp]
←
pc +
2
, pc
←
pc +
sign32
Code
15
12
11
8
7
0
0
0
0
1
1
1
0
d
sign8
0x1C__, 0x1D__
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call
sign8
when d bit (bit
8
) =
0
call.d
sign8
when d bit (bit
8
) =
1
Flag
IE C V Z N
– – – – –
|
|
|
|
Mode
Signed PC relative
CLK
call
Four cycles
call.d
Three cycles
Description
(
1
) Standard
call
sign8
; = "call
sign9
",
sign8
=
sign9
(8:1),
sign9
(0) = 0
Stores the address of the following instruction into the stack, then doubles the signed
8
-bit
immediate
sign8
and adds it to the PC for calling the subroutine that starts from the address.
The
sign8
specifies a halfword address in
16
-bit units. When the
ret
instruction is executed in
the subroutine, the program flow returns to the instruction following the
call
instruction.
The
sign8
(
×
2
) allows branches within the range of PC -
0
x
100
to PC +
0
xFE.
(
2
) Extension
1
ext
imm13
; =
sign22
(21:9)
call
sign8
; = "call
sign22
",
sign8
=
sign22
(8:1),
sign22
(0) = 0
The
ext
instruction extends the displacement into
22
bits using its
13
-bit immediate
imm13
.
The
22
-bit displacement is sign-extended and added to the PC.
The
sign22
allows branches within the range of PC -
0
x
200000
to PC +
0
x
1
FFFFE.
(
3
) Extension
2
ext
imm13
;
imm13
(12:3)=
sign32
(31:22)
ext
imm13
; =
sign32
(21:9)
call
sign8
; = "call
sign32
",
sign8
=
sign32
(8:1),
sign32
(0) = 0
The
ext
instructions extend the displacement into
32
bits using their two
13
-bit immediates
(
imm13
×
2
). The displacement covers the entire address space.
(
4
) Delayed branch (d bit =
1
)
call.d
sign8
When
call.d
is specified, the d bit in the instruction code is set and the following instruction
becomes a delayed instruction. The delayed instruction is executed before branching to the
subroutine. Therefore the address (PC +
4
) of the instruction that follows the delayed instruction
is stored into the stack as the return address.
When the
call.d
instruction is executed, interrupts and exceptions cannot occur because traps
are masked between the
call.d
and delayed instructions.
Example
ext 0x1fff
call 0x0
; Calls the subroutine that starts from the
; address specified by PC - 0x200.
Caution
When the
call.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 instruction. If any other instruction
is executed, the program may operate indeterminately. For the usable instructions, refer to the
instruction list in the Appendix.
Содержание S1C33 Series
Страница 1: ...CMOS 32 BIT SINGLE CHIP MICROCOMPUTER Core Manual S1C33 Family C33 PE ...
Страница 4: ......