Operations:

Syntax:

Operation:

Operands:

Program Counter:

Opcode

Comment

Stack

CLR Rd

Rd = Rd XOR Rd

0 <= d <= 31

PC = PC + 1

001001dddddddddd

Description

Clears a register. This instruction performs an Exclusive OR between a register and itself. This will clear all bits in the register. (Equivalent to instruction EOR Rd,Rd.)

Status Register (SREG) and Boolean Formula

I

T

H

S

0

0

Cleared.

V

0

0

Cleared.

N

0

0

Cleared.

Z

1

1

Set.

C

R (Result)

R (Result) equals Rd after the operation.

Example:

      clr   r18       ; clear r18
loop: inc   r18       ; increase r18
      ...
      cpi   r18,0x50  ; Compare r18 to 0x50
      brne  loop

Words

1 (2 bytes)

Table Cycles

Name

Cycles

AVRe

1

AVRxm

1

AVRxt

1

AVRrc

1