Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • DSA
  • Practice Problems
  • C
  • C++
  • Java
  • Python
  • JavaScript
  • Data Science
  • Machine Learning
  • Courses
  • Linux
  • DevOps
  • SQL
  • Web Development
  • System Design
  • Aptitude
  • GfG Premium
Open In App
Next Article:
Arithmetic instructions in AVR microcontroller
Next article icon

Arithmetic instructions in AVR microcontroller

Last Updated : 07 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

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 resultMUL D, S
MULSSigned nos.R1= Higher byte of the result R0= Lower byte of the resultMULS D, S
MULSUSigned nos. and Unsigned nos.R1= Higher byte of the result R0= Lower byte of the resultMULSU D, S
INCDD= D+1INC D
DECDD= D-1DEC D

Features of the arithmetic instructions in AVR microcontrollers:

Arithmetic operations: AVR microcontrollers support a variety of arithmetic operations, including addition, subtraction, multiplication, and division. These operations can be performed on data stored in registers, and can also involve immediate values or data stored in memory.

Data types: AVR microcontrollers support both 8-bit and 16-bit data types, allowing for arithmetic operations to be performed on both bytes and words of data.

Overflow detection: AVR microcontrollers provide flags to detect arithmetic overflow, which occurs when the result of an arithmetic operation exceeds the maximum or minimum value that can be stored in a register. This allows for error handling and can be used to prevent unexpected behavior in the program.

Conditional instructions: AVR microcontrollers also provide conditional arithmetic instructions, which allow for arithmetic operations to be performed only if certain conditions are met. For example, the branch instructions can be used to jump to a different part of the program depending on the result of a previous arithmetic operation.

Bit manipulation: AVR microcontrollers support a variety of instructions for manipulating individual bits within a register, including bitwise AND, OR, and XOR operations. These instructions can be used for tasks such as setting or clearing individual flags in a register.

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


Next Article
Arithmetic instructions in AVR microcontroller

K

kunalsg18elec
Improve
Article Tags :
  • Electronics Engineering
  • microprocessor

Similar Reads

    Branch Instructions in AVR Microcontroller
    In this article, we will be discussing looping in AVR and branch instructions, both Conditional and Unconditional. Looping in AVR : A repeated operation or a set of instructions is known as a loop in programming. It is one of the most fundamental techniques which comes in very handy in writing code.
    3 min read
    Logical Instructions in AVR Microcontroller
    Logical Instructions are the instructions which perform basic arithmetic operations such as AND, OR, XOR, etc. In AVR micro-controller, the destination operand is always a register. The following table shows the logical instructions : Instruction Operand Explanation Example AND D, S D = D AND S Perf
    2 min read
    Arithmetic instructions in 8086 microprocessor
    Arithmetic Instructions are the instructions which perform basic arithmetic operations such as addition, subtraction and a few more. Unlike in 8085 microprocessor, in 8086 microprocessor the destination operand need not be the accumulator. Following is the table showing the list of arithmetic instru
    2 min read
    Arithmetic instructions in 8085 microprocessor
    Arithmetic Instructions are the instructions which perform basic arithmetic operations such as addition, subtraction and a few more. In 8085 microprocessor, the destination operand is generally the accumulator. Following is the table showing the list of arithmetic instructions: OpcodeOperandExplanat
    4 min read
    Arithmetic Instructions in 80386 Microprocessor
    A Microprocessor is an important part of a computer architecture without which you will not be able to perform anything on your computer. The 80386 offers a large number of directions that take into consideration more effective and flexible processing. Thus, we should make a plunge and investigate t
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences