281
ATmega328P [DATASHEET]
7810D–AVR–01/15
31. 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,VH 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 K Z,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
MUL Rd, Rr Multiply unsigned R1:R0 Rd Rr Z,C 2
MULS Rd, Rr Multiply signed R1:R0 Rd Rr Z,C 2
MULSU Rd, Rr Multiply signed with unsigned R1:R0 Rd Rr Z,C 2
FMUL Rd, Rr Fractional multiply unsigned R1:R0 (Rd Rr) << 1 Z,C 2
FMULS Rd, Rr Fractional multiply signed R1:R0 (Rd Rr) << 1 Z,C 2
FMULSU Rd, Rr
Fractional multiply signed with
unsigned
R1:R0 (Rd Rr) << 1 Z,C 2
Branch Instructions
RJMP k Relative jump PC PC + k + 1 None 2
IJMP Indirect jump to (Z) PC Z None 2
JMP k Direct jump PC k None 3
RCALL k Relative subroutine call PC PC + k + 1 None 3
ICALL Indirect call to (Z) PC Z None 3
CALL k Direct subroutine call PC k None 4
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