45
AT86RF401
1424F–RKE–12/03
•Bit[4] – S: Sign Bit, S = N⊕
⊕⊕
⊕V
The S-bit is always an exclusive or between the negative flag N and the two’s comple-
ment overflow flag V. See Table 22 for detailed information.
•Bit[3] – V: Two’s Complement Overflow Flag
The two’s complement overflow flag V supports two’s complement arithmetics. See
Table 22 below for detailed information.
•Bit[2] – N: Negative Flag
The ne gativ e flag N indicate s a negative result after the different arithmetic and logic
operations. See Table 22 below for detailed information.
•Bit[1] – Z: Zero Flag
The z e r o flag Z i ndicates a zero r e s u lt after the different arithmetic and logic operations.
See Table 22 below for detail ed inf ormation.
•Bit[0] – C: Carry Flag
Th e ca rry flag C indi ca tes a carry in an ari thme tic o r logic oper ation. Se e T abl e 22 for
detailed informa tion.
Table 22. Instruc tion Set
Mnemonics
Operands Description Operation Flags #Clocks
Arithmetic and Logic Instructions
ADD Rd, Rr Add Two Registers Rd ← Rd + Rr Z,C,N,V,H
ADC Rd, Rr Add with Carry Two Registers Rd ← Rd + Rr + C Z,C,N,V, H 1
ADIW Rdl,K Add Immediate to Word Rdh:Rdl ← Rdh:Rdl + K Z,C,N,V,S 1
SUB Rd, Rr Sub tr act Two Registers Rd ← Rd - R r Z,C,N,V, H 2
SUBI Rd, K Subtr act Constant from Register Rd ← Rd - K Z,C, N,V,H 1
SBC Rd, Rr Subtract wi th Carry Two Registers Rd ← Rd - Rr - C Z,C,N,V,H 1
SBCI Rd, K Subtrac t with Carry Constan t from
Register Rd ← Rd - K - C Z,C,N,V, H 1
SBIW Rdl,K Subtract Immediate from Word R dh:Rdl ← Rdh:Rdl - K Z,C,N,V,S 1
AND Rd, Rr Logical AND Registers Rd ← Rd • Rr Z,N,V 2
ANDI Rd, K Logical AND Reg ister and
Constant Rd ← Rd • KZ,N,V1
OR Rd, Rr Logical OR Registers Rd ← Rd v Rr Z,N,V 1
ORI Rd, K Lo gical OR Register and Constant Rd ← Rd v K Z,N,V 1
EOR Rd, Rr Exclusive OR Registers Rd ← Rd ⊕ Rr Z,N,V 1
COM Rd One’s Co mplemen t R d ← $FF − Rd Z,C,N,V 1
NEG Rd Two’s Complemen t Rd ← $00 − Rd Z,C,N,V,H 1
SBR Rd,K Set Bit(s) in Register Rd ← Rd v K Z,N, V 1
CBR Rd,K Clear Bit(s) in Register R d ← Rd • ($FF - K) Z,N,V 1
INC Rd Increment Rd ← Rd + 1 Z,N, V 1
DEC Rd Decrement Rd ← Rd − 1 Z,N,V 1
TST Rd Test for Zero or Minus R d ← Rd • Rd Z,N,V 1