Let's Make Robots!

Programming AVR in Assembly or Machine Language

The question I'm going to ask you is a very simple one- How can I program (AVR in general) my Atmega 328P in Machine or Assembly Language? I know it is possible as all microcontrollers, no matter which language they are running convert high level language to low level languages and utimately Machine language. That's the job of the compiler. I want to run assembly or machine language because-

  1. It is relatively new for me. I have done programming in C and hope it repeat my success in Arduino language as well but I also want to learn assembly or machine in my quest to get a deeper understanding of computer systems and what better medium to learn it for than my favorite microprocessor.
  2. I have heard that it is tad faster. However, that applies to computers but maybe I may find something to make my code faster in this domain. For example- say the person who coded a for loop for AVR would have done his coding in machine or assembly. If I am able to get that coding and I know either machine or assembly, I may be able to find bugs in his code and make it faster. This is what hacking was in its original form and this is what I want to do.
  3. The outcomes of this job are relatively infinte and out of my scope to mention them here.

That's why I request the LMR community to help me and bombard me with information please!! :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Good luck with your assembly language programming Vishu.

I spent 12 years once working in assembly on a project.  When you first start, you thing that you MUST be doing something wrong, because it seems to take a lot more lines of code.  In general I think its about 10 lines of assembly to every 1 line of a higher level language.  Programmers seem to average about 1 mistake every 10 lines of code ...so.... you usually make 10x more mistakes in assembly language.

That said it can be a bit faster, but is well worth learning, since you come away with a much better understanding of what the computer and the compiler are doing.

Good luck and have fun, let us know what you think of assembly language.

a simple search will tell you as much as any of us can.