185
ATA5771C/73C/74C [DATASHEET]
9137J–RKE–10/14
9.2 Instruction Set Summary
Mnemonics Operands Description Operation Flags #Clocks
Arithmetic and Logic Instructions
ADD Rd, Rr Add two registers Rd ← Rd + Rr Z,C,N,V,H 1
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 2
SUB Rd, Rr Subtract two registers Rd ← Rd – Rr Z,C,N,V,H 1
SUBI Rd, K Subtract constant from register Rd ← Rd – K Z,C,N,V,H 1
SBC Rd, Rr Subtract with carry two registers Rd ← Rd – Rr – C Z,C,N,V,H 1
SBCI Rd, K Subtract with carry constant from reg. Rd ← Rd – K – C Z,C,N,V,H 1
SBIW Rdl,K Subtract immediate from word Rdh:Rdl ← Rdh:Rdl – K Z,C,N,V,S 2
AND Rd, Rr Logical AND registers Rd ← Rd × Rr Z,N,V 1
ANDI Rd, K Logical AND register and constant Rd ← Rd × KZ,N,V 1
OR Rd, Rr Logical OR registers Rd ← Rd v Rr Z,N,V 1
ORI Rd, K Logical 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 complement Rd ← 0xFF – Rd Z,C,N,V 1
NEG Rd Two’s complement Rd ← 0x00 – 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 Rd ← Rd × (0xFF - 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 Rd ← Rd × Rd Z,N,V 1
CLR Rd Clear register Rd ← Rd ⊕ Rd Z,N,V 1
SER Rd Set register Rd ← 0xFF None 1
Branch Instructions
RJMP kRelative jump PC ← PC + k + 1 None 2
IJMP Indirect jump to (Z) PC ← Z None 2
RCALL kRelative subroutine call PC ← PC + k + 1 None 3
ICALL Indirect call to (Z) PC ← Z None 3
RET Subroutine return PC ← STACK None 4
RETI Interrupt return PC ← STACK I 4
CPSE Rd,Rr Compare, skip if equal if (Rd = Rr) PC ← PC + 2 or 3 None 1/2/3
CP Rd,Rr Compare Rd − Rr Z, N,V,C,H 1
CPC Rd,Rr Compare with carry Rd − Rr − C Z, N,V,C,H 1
CPI Rd,K Compare register with immediate Rd − K Z, N,V,C,H 1
SBRC Rr, b Skip if bit in register cleared if (Rr(b)=0) PC ← PC + 2 or 3 None 1/2/3
SBRS Rr, b Skip if bit in register is set if (Rr(b)=1) PC ← PC + 2 or 3 None 1/2/3
SBIC P, b Skip if bit in I/O register cleared if (P(b)=0) PC ← PC + 2 or 3 None 1/2/3
SBIS P, b Skip if bit in I/O register is set if (P(b)=1) PC ← PC + 2 or 3 None 1/2/3
BRBS s, k Branch if status flag set if (SREG(s) = 1) then PC ←
PC + k + 1 None 1/2
BRBC s, k Branch if status flag cleared if (SREG(s) = 0) then PC ←
PC + k + 1 None 1/2
BREQ k Branch if equal if (Z = 1) then PC ← PC + k + 1 None 1/2
BRNE k Branch if not equal if (Z = 0) then PC ← PC + k + 1 None 1/2
BRCS k Branch if carry set if (C = 1) then PC ← PC + k + 1 None 1/2