Syntax: |
Operation: |
Operands: |
Program Counter: |
Opcode |
Comment: |
Stack: |
RCALL k |
PC = PC + k + 1 |
-2K <= k < 2K |
PC = PC + k + 1 |
1101kkkkkkkkkkkk |
Devices with 16-bit PC, 128 KB program memory maximum. |
STACK = PC + 1 SP = SP - 2 (2 bytes, 16 bits) |
RCALL k |
PC = PC + k + 1 |
-2K <= k < 2K |
PC = PC + k + 1 |
1101kkkkkkkkkkkk |
Devices with 22-bit PC, 8 MB program memory maximum. |
STACK = PC + 1 SP = SP - 3 (3 bytes, 22 bits) |
Relative call to an address within PC - 2K + 1 and PC + 2K (words). The return address (the instruction after the RCALL) is stored onto the Stack. See also CALL. For AVR microcontrollers with program memory not exceeding 4K words (8 KB), this instruction can address the entire memory from every address location. The Stack Pointer uses a post-decrement scheme during RCALL.
I |
– |
||
T |
– |
||
H |
– |
||
S |
– |
||
V |
– |
||
N |
– |
||
Z |
– |
||
C |
– |
rcall routine ; Call subroutine ... routine: push r14 ; Save r14 on the Stack ... pop r14 ; Restore r14 ret ; Return from subroutine
1 (2 bytes)
Name |
Cycles 9/16-bit PC |
22-bit PC |
AVRe |
3(1) |
4(1) |
AVRxm |
2(1) |
3(1) |
AVRxt |
2 |
3 |
AVRrc |
3 |
N/A |
Note:
1.
Cycle times for data memory access assume internal RAM access and are not valid for accessing external RAM.