Operations:

Syntax:

Operation:

Operands:

Program Counter:

Opcode

Comment

Stack

SBRS Rr,b

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

0 <= r <= 31, 0 <= b <= 7

PC = PC + 1, Condition false - no skip

PC = PC + 2, Skip a one word instruction

PC = PC + 3, Skip a two word instruction

1111111rrrrr0bbb

Description

This instruction tests a single bit in a register and skips the next instruction if the bit is set.

Status Register (SREG) and Boolean Formula

I

T

H

S

V

N

Z

C

Example:

      sub   r0,r1  ; Subtract r1 from r0
      sbrs  r0,7   ; Skip if bit 7 in r0 set
      neg   r0     ; Only executed if bit 7 in r0 not set
      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.