Operations:

Syntax:

Operation:

Operands:

Program Counter:

Opcode

Comment

Stack

SWAP Rd

R(7:4) ↔ Rd(3:0)

0 <= d <= 31

PC = PC + 1

1001010ddddd0010

Description

Swaps high and low nibbles in a register.

Status Register (SREG) and Boolean Formula

I

T

H

S

V

N

Z

C

R (Result)

R (Result) equals Rd after the operation.

Example:

      inc   r1      ; Increment r1
      swap  r1      ; Swap high and low nibble of r1
      inc   r1      ; Increment high nibble of r1
      swap  r1      ; Swap back

Words

1 (2 bytes)

Table Cycles

Name

Cycles

AVRe

1

AVRxm

1

AVRxt

1

AVRrc

1