Just a FYI, the author of this tutorial got ousted out of AVRFreaks for bad behavior and plagiarism (<i>especially</i> tutorial plagiarism!). [0] Another tutorial of his had several errors. [1] I would personally recommend either [2] or [3] as a beginner's tutorial for AVR assembly and [4] for all your other questions.<p>[0] <a href="http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=37888" rel="nofollow">http://www.avrfreaks.net/index.php?name=PNphpBB2&file=vi...</a><p>[1] <a href="http://www.reddit.com/r/programming/comments/aqkt2/dirty_math_tricks_optimizing_divisionby10_on_an/" rel="nofollow">http://www.reddit.com/r/programming/comments/aqkt2/dirty_mat...</a><p>[2] <a href="http://www.avr-asm-tutorial.net/avr_en/beginner/index.html" rel="nofollow">http://www.avr-asm-tutorial.net/avr_en/beginner/index.html</a><p>[3] <a href="http://www.avrbeginners.net/" rel="nofollow">http://www.avrbeginners.net/</a><p>[4] <a href="http://www.avrfreaks.net/index.php?name=PNphpBB2&file=index" rel="nofollow">http://www.avrfreaks.net/index.php?name=PNphpBB2&file=in...</a>
AVR assembly is one of my favorites. Compared to 6502, Z80, and x86, there is a relative plethora of registers (32 of them!) and, if your application is simple enough, you can write code that doesn't use any RAM at all. In fact, some of the smaller AVRs don't have any RAM aside from the registers.<p>The instruction set is organized quite nicely and most non-memory instructions (even the multiply instructions) take one cycle. Ah, the joys of RISC.
It's a nice ISA but has some painful aspects. 8-bit registers aren't big enough for many purposes. Shift instructions are one bit position at a time. Explicit stack pointer manipulation isn't atomic.<p>The best thing about AVR is avr-gcc.
The best thing about AVR is the stack - and that's why you don't really need the ASM.<p>AVR is the cheapest kit that fully support the GCC toolchain. It comes with its own stripped-down glibc, and installs a GCC cross-compiler and is <i>amazing</i> for that reason alone.
This is really great!<p>Lots of people are saying that you can just use avr-gcc. Which is technically true, but it still requires knowledge and bitwise manipulation of AVR registers.<p>For example, you can't really use timers without understanding the time-related registers and interrupts, so the C code for managing that looks almost identical to the assembly. Nice to have a guide that goes through those register operations line-by-line so I can understand what is happening.<p>Awesome!
To the author of this page, you should consider spelling out the meaning of AVR somewhere near the top of the page, so readers don't have to Google it. Also tell us a bit more about what it is before launching into an introduction that seems to assume we already know.
>Practically all languages convert their programs to assembly because assembly is close to what the hardware understands<p>It has been a long time since I did any sort of dabbling/reading in the area but is that even true? Afaik very few languages that compile to executable machine code 'convert their programs to assembly'. They go directly from their internal AST/DFG/CFG representation to machine code, an intermediary stop at the ASM level would be unnecessary no?