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.

BRTS - Branch if the T Flag is <strong>Set</strong><br />

Description:<br />

Conditional relative branch. Tests the T flag and branches relatively to PC if T is set. This instruction branches relatively to<br />

PC in either direction (PC - 63 ≤ destination ≤ PC + 64). The parameter k is the offset from PC and is represented in two’s<br />

complement form. (Equivalent to instruction BRBS 6,k).<br />

Operation:<br />

(i) If T = 1 then PC ← PC + k + 1, else PC ← PC + 1<br />

Syntax: Operands: Program Counter:<br />

(i) BRTS k -64 ≤ k ≤ +63 PC ← PC + k + 1<br />

PC ← PC + 1, if condition is false<br />

34<br />

16-bit Opcode:<br />

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

Example:<br />

1111 00kk kkkk k110<br />

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

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

bst r3,5 ; Store bit 5 of r3 in T flag<br />

brts<br />

...<br />

tset ; Branch if this bit was set<br />

tset: nop ; Branch destination (do nothing)<br />

Words: 1 (2 bytes)<br />

Cycles: 1 if condition is false<br />

2 if condition is true<br />

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

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

Saved successfully!

Ooh no, something went wrong!