21.08.2013 Views

AVR Instruction Set Nomenclature: Status Register (SREG ...

AVR Instruction Set Nomenclature: Status Register (SREG ...

AVR Instruction Set Nomenclature: Status Register (SREG ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SBRC - Skip if Bit in <strong>Register</strong> is Cleared<br />

Description:<br />

This instruction tests a single bit in a register and skips the next instruction if the bit is cleared.<br />

Operation:<br />

(i) If Rr(b) = 0 then PC ← PC + 2 (or 3) else PC ← PC + 1<br />

Syntax: Operands: Program Counter:<br />

(i) SBRC Rr,b 0 ≤ r ≤ 31, 0 ≤ b ≤ 7 PC ← PC + 1, Condition false - no skip<br />

PC ← PC + 2, Skip a one word instruction<br />

PC ← PC + 3, Skip a two word instruction<br />

108<br />

16-bit Opcode:<br />

<strong>Status</strong> <strong>Register</strong> (<strong>SREG</strong>) and Boolean Formula:<br />

Example:<br />

1111 110r rrrr 0bbb<br />

I T H S V N Z C<br />

- - - - - - - -<br />

sub r0,r1 ; Subtract r1 from r0<br />

sbrc r0,7 ; Skip if bit 7 in r0 cleared<br />

sub r0,r1 ; Only executed if bit 7 in r0 not cleared<br />

nop ; Continue (do nothing)<br />

Words: 1 (2 bytes)<br />

Cycles: 1 if condition is false (no skip)<br />

2 if condition is true (skip is executed) and the instruction skipped is 1 word<br />

3 if condition is true (skip is executed) and the instruction skipped is 2 words<br />

<strong>Instruction</strong> <strong>Set</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!