Operations:

Syntax:

Operation:

Operands:

Program Counter:

Opcode

Comment:

Stack:

RET

PC(15:0) = STACK

None

See Operation

1001010100001000

Devices with 16-bit PC, 128 KB program memory maximum.

SP = SP + 2, (2 bytes,16 bits)

RET

PC(21:0) = STACK

None

See Operation

1001010100001000

Devices with 22-bit PC, 8 MB program memory maximum.

SP = SP + 3, (3 bytes,22 bits)

Description

Returns from the subroutine. The return address is loaded from the STACK. The Stack Pointer uses a pre-increment scheme during RET.

Operation:

Status Register (SREG) and Boolean Formula

I

T

H

S

V

N

Z

C

Example:

      call  routine  ; Call subroutine
      ...
routine: 
      push  r14      ; Save r14 on the Stack
      ...
      pop   r14      ; Restore r14
      ret            ; Return from subroutine

Words

1 (2 bytes)

Table Cycles

Name

Cycles

9/16-bit PC

22-bit PC

AVRe

4(1)

5(1)

AVRxm

4(1)

5(1)

AVRxt

4

5

AVRrc

6

N/A

Note:

1.

Cycle times for data memory access assume internal RAM access and are not valid for accessing external RAM.