Most people seem happier with higher level languages because you can do all the above with a few lines of code and let the compiler do the rest. So if you want to go beyond simple tasks like the above then maybe consider learning to program in c or basic and skip over the assembly language option. Well, you can do that in C with an array of voids, too. Tail calls don't exist (i.e., return by way of a different function), but that's usually only a special case for recursion semantics and you can call it from the head at the cost of only one additional stack level. (Of course if you're doing recursion, it adds up, but you probably shouldn't be doing semantic recursion on the AVR with what little RAM it has, anyway iterate over an array instead. There's no recursion problem that can't be solved in this way.) Dynamic linking comes to mind as another one of those "high tech" approaches (so to speak not that it's anything new at all). But, since you're limited to what's loaded in PROGMEM anyway, it doesn't make much difference. The best example of loading external functions would simply be a bootloader. Other reasons: Even if you don't have a single care in the world to ever write a single opcode, You should still know assembly so that you understand the compiler output. Understand that, on -O0, it simply translates statements into blocks of instructions. Nothing in common is saved between blocks, they fully stand alone. On -O3 or so, many extraneous instructions are culled, and others are grouped for time/size savings. But the translation process is still pretty straightforward, and it's easy to see what's going on. Because inevitably, you will find a problem, where what you thought you were writing is not what you get. Which leads to a deeper truth: you are not writing C code for any high level purpose. ![]() SIMPLY FORTRAN AUTOCOMPLETE FUNCTIONS CODE You are ultimately writing it to produce assembly (well, machine code). ![]() ![]() There are some semantics that C simply does not simplify.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |