AVR Instruction Set Nomenclature: Status Register (SREG ...
AVR Instruction Set Nomenclature: Status Register (SREG ...
AVR Instruction Set Nomenclature: Status Register (SREG ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
BRLT - Branch if Less Than (Signed)<br />
Description:<br />
Conditional relative branch. Tests the Signed flag (S) and branches relatively to PC if S is set. If the instruction is executed<br />
immediately after any of the instructions CP, CPI, SUB or SUBI, the branch will occur if and only if the signed binary number<br />
represented in Rd was less than the signed binary number represented in Rr. This instruction branches relatively to PC<br />
in either direction (PC - 63 ≤ destination ≤ PC + 64). The parameter k is the offset from PC and is represented in two’s complement<br />
form. (Equivalent to instruction BRBS 4,k).<br />
Operation:<br />
(i) If Rd < Rr (N ⊕ V = 1) then PC ← PC + k + 1, else PC ← PC + 1<br />
Syntax: Operands: Program Counter:<br />
(i) BRLT k -64 ≤ k ≤ +63 PC ← PC + k + 1<br />
PC ← PC + 1, if condition is false<br />
28<br />
16-bit Opcode:<br />
<strong>Status</strong> <strong>Register</strong> (<strong>SREG</strong>) and Boolean Formulae:<br />
Example:<br />
1111 00kk kkkk k100<br />
I T H S V N Z C<br />
- - - - - - - -<br />
cp r16,r1 ; Compare r16 to r1<br />
brlt<br />
...<br />
less ; Branch if r16 < r1 (signed)<br />
less: 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>