Skip to content
Related Articles
Open in App
Not now

Related Articles

Arithmetic instructions in AVR microcontroller

Improve Article
Save Article
  • Last Updated : 18 Sep, 2020
Improve Article
Save Article

Arithmetic Instructions are the instructions which perform basic arithmetic operations such as addition, subtraction, multiplication, etc. AVR micro-controller has 2 operands which are actually registers that hold the data. The left register is the source register while the right one is the source register.



The following table shows the arithmetic instructions :

InstructionOperandExplanationExample
ADDD, SD = D+ SADD D, S
ADCD, SD = D+ S+ carryADC D, K
SUBD, SD = D- SSUB D, S
SBCD, SD = D- S- carrySBC D, S
MULUnsigned nos.R1= Higher byte of the result

R0= Lower byte of the result

MUL D, S
MULSSigned nos.R1= Higher byte of the result

R0= Lower byte of the result

MULS D, S
MULSUSigned nos. and Unsigned nos.R1= Higher byte of the result

R0= Lower byte of the result

MULSU D, S
INCDD= D+1INC D
DECDD= D-1DEC D

Note : Here D and S stand for Destination and Source respectively.
D and S are registers. There is no instruction for division in AVR.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!