TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

AVR ASM Introduction

39 pointsby wollwover 13 years ago

7 comments

jevinskieover 13 years ago
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&#38;file=viewtopic&#38;t=37888" rel="nofollow">http://www.avrfreaks.net/index.php?name=PNphpBB2&#38;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&#38;file=index" rel="nofollow">http://www.avrfreaks.net/index.php?name=PNphpBB2&#38;file=in...</a>
评论 #3034193 未加载
msarnoffover 13 years ago
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.
regehrover 13 years ago
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.
评论 #3034361 未加载
ComputerGuruover 13 years ago
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.
评论 #3034455 未加载
memsetover 13 years ago
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!
natchover 13 years ago
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.
ryanmoldenover 13 years ago
&#62;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?
评论 #3033880 未加载