Operations:

Syntax:

Operation:

Operands:

Program Counter:

Opcode

Comment

Stack

CPSE Rd,Rr

If Rd == Rr then PC = PC + 2 (or 3) else PC = PC + 1

0 <= d <= 31, 0 <= r <= 31

PC = PC + 1, Condition false - no skip

PC = PC + 2, Skip a one word instruction

PC = PC + 3, Skip a two word instruction

000100rdddddrrrr

Description

This instruction performs a compare between two registers Rd and Rr and skips the next instruction if Rd == Rr.

Status Register (SREG) and Boolean Formula

I

T

H

S

V

N

Z

C

Example:

      inc   r4     ; Increase r4
      cpse  r4,r0  ; Compare r4 to r0
      neg   r4     ; Only executed if r4<>r0
      nop          ; Continue (do nothing)

Words

1 (2 bytes)

Table Cycles

Name

Cycles

i

ii

iii

AVRe

1

2

3

AVRxm

1

2

3

AVRxt

1

2

3

AVRrc

1

2

N/A

i) If the condition is false (no skip).

ii) If the condition is true (skip is executed) and the instruction skipped is one word.

iii) If the condition is true (skip is executed) and the instruction skipped is two words.