Chapter 2
eSL/eSLS Series (+ eSLZ000) User’s Manual
Architecture
••••
35
2.5.6 Control Instructions
The instructions in this group are used for the program control flow. CALL,
RET and RETI instructions provided subroutine and interrupt execution.
Unconditional overhead free program loop constructs are supported using the
RPT and LOOP instructions.
CALL:
Before jumping to target address, the 16-bit return address (PC+1) is
pushed into the stack.
RET:
Pop the return address to PC then return from subroutine.
RETI:
Pop the return address to PC then return from interrupt service
routine.
RPT:
Repeat the next instruction
LOOP:
Zero-overhead LOOP (must include at least 3 instruction; but the
last instruction cannot be JMP, CALL, RETURN or RPT
instruction. See Section 2.5.6.2 below).
The Repeat (RPT) function may be tied in with such instructions as
Multiply/Accumulate (MAC) and Block Moves (MOV) to increase execution
speed of RPT instruction. These multicycle instructions effectively become
single-cycle instructions after the first iteration of a repeat instruction.
2.5.6.1 Operating Instruction Example Syntax
Mnemonic
Example Syntax
Original Cycle
*
MOV
[R5] = P[R7++]
2
MUL.UU
D = R2 * P[R3++] (UU)
2
MUL.US
D = R5 * P[R7++] (US)
2
MUL.SU
D = R3 * [R5 ++] (SU)
1
MUL.SS
D = R4 * P[R3++] (SS)
2
MAC
D = D + R2 * P[R1++]
2
MAS
D = D – R2 * P[R6++]
2
ADD
R1 = [R2] + R3
1
SUB
R3 = [R2] - R1
1
*
Number of cycles when instruction is not repeated
2.5.6.2 RPT and LOOP Instructions Limitations
Some instructions cannot be repeated with RPT instruction and cannot be the
last instruction in a LOOP. These instructions are as below.
Mnemonic
Description
CALL
Unconditional call
JMP Instructions
Branch instruction
(Include unconditional or condition brach)
RET
Return from subroutine
RETI
Return from interrupt
RPT
Repeat next instruction
Summary of Contents for eSL Series
Page 8: ...Contents viii Contents eSL eSLS Series eSLZ000 User s Manual...
Page 11: ...Contents eSL eSLS Series eSLZ000 User s Manual Contents xi...
Page 12: ......
Page 28: ......
Page 110: ...Chapter 3 98 Peripheral Control eSL eSLS Series eSLZ000 User s Manual BC IO INTF1 ADIF RETI...
Page 115: ...Chapter 3 eSL eSLS Series eSLZ000 User s Manual Peripheral Control 103...
Page 148: ......
Page 154: ...Chapter 4 142 Electrical Characteristics eSL eSLS Series eSLZ000 User s Manual...