EasyManuals Logo

Atmel AVR User Manual

Atmel AVR
191 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #157 background imageLoading...
Page #157 background image
104. SBRC – Skip if Bit in Register is Cleared
104.1. Description
This instruction tests a single bit in a register and skips the next instruction if the bit is cleared.
Operation:
Operation:
(i) If Rr(b) = 0 then PC ← PC + 2 (or 3) else PC ← PC + 1
Syntax: Operands: Program Counter:
(i) SBRC Rr,b 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
16-bit Opcode:
1111 110r rrrr 0bbb
104.2. Status Register (SREG) and Boolean Formula
I T H S V N Z C
Example:
sub r0,r1 ; Subtract r1 from r0
sbrc r0,7 ; Skip if bit 7 in r0 cleared
sub r0,r1 ; Only executed if bit 7 in r0 not cleared
nop ; Continue (do nothing)
Words 1 (2 bytes)
Cycles 1 if condition is false (no skip)
2 if condition is true (skip is executed) and the instruction skipped is 1 word
3 if condition is true (skip is executed) and the instruction skipped is 2 words
Atmel AVR Instruction Set Manual [OTHER]
Atmel-0856L-AVR-Instruction-Set-Manual_Other-11/2016
157

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atmel AVR and is the answer not in the manual?

Atmel AVR Specifications

General IconGeneral
Architecture8-bit RISC
SRAMUp to 16 KB
Clock SpeedUp to 20 MHz
Operating Voltage1.8V to 5.5V
ADC10-bit ADC
Communication InterfacesSPI, I2C, USB
PackagesDIP, SOIC, QFN
Special FeaturesWatchdog Timer
Flash Memory1KB to 256KB
EEPROM64B to 4KB

Related product manuals