EasyManuals Logo

Atmel AVR User Manual

Atmel AVR
191 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #63 background imageLoading...
Page #63 background image
36. CALL – Long Call to a Subroutine
36.1. Description
Calls to a subroutine within the entire Program memory. The return address (to the instruction after the
CALL) will be stored onto the Stack. (See also RCALL). The Stack Pointer uses a post-decrement
scheme during CALL.
This instruction is not available in all devices. Refer to the device specific instruction set summary.
Operation:
(i) PC ← k Devices with 16-bit PC, 128KB Program memory maximum.
(ii) PC ← k Devices with 22-bit PC, 8MB Program memory maximum.
Syntax: Operands: Program Counter: Stack:
(i) CALL k 0 ≤ k < 64K PC ← k STACK ← PC+2
SP ← SP-2, (2 bytes,
16 bits)
(ii) CALL k 0 ≤ k < 4M PC ← k STACK ← PC+2
SP ← SP-3 (3 bytes,
22 bits)
32-bit Opcode:
1001 010k kkkk 111k
kkkk kkkk kkkk kkkk
36.2. Status Register (SREG) and Boolean Formula
I T H S V N Z C
Example:
mov r16,r0 ; Copy r0 to r16
call check ; Call subroutine
nop ; Continue (do nothing)
...
check: cpi r16,$42 ; Check if r16 has a special value
breq error ; Branch if equal
ret ; Return from subroutine
...
error: rjmp error ; Infinite loop
Words 2 (4 bytes)
Cycles 4 devices with 16-bit PC
Atmel AVR Instruction Set Manual [OTHER]
Atmel-0856L-AVR-Instruction-Set-Manual_Other-11/2016
63

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atmel AVR and is the answer not in the manual?

Atmel AVR Specifications

General IconGeneral
Architecture8-bit RISC
SRAMUp to 16 KB
Clock SpeedUp to 20 MHz
Operating Voltage1.8V to 5.5V
ADC10-bit ADC
Communication InterfacesSPI, I2C, USB
PackagesDIP, SOIC, QFN
Special FeaturesWatchdog Timer
Flash Memory1KB to 256KB
EEPROM64B to 4KB

Related product manuals