![]() ![]() I just need to know, what features the uC has, SFR names, some details about clock, interrupts, peripherals, sleep and watchdog. I don’t need to know intimate details of code execution, ALU operations, nor other minutia. For example I program microcontrollers, and I really don’t need to know a particular assembly language to write code in C. Most programmers don’t debug or reverse engineer unknown code, but write their own. If it is impossible for some idiotic reason to include asm code in the high level source, then I would recommend writing placeholder code, compiling and grabbing the assembly intermediary from that compiler, and then modifying relevant parts by hand before recompiling it to machine code.Īgreed, but these are specific use cases. Seriously, the only reason to learn assembly in modern times is to write snippets of time/performance critical code, and only when high-level language compiler can’t do that. IIRC, it did that for all function calls, so paid version of XC8 would offer faster execution. Which I actually did once for free version of XC8 to show someone, how the compiler added some unnecessary nested jumps to make it execute more slowly. ![]() This is easy to test by ordering the compiler to save assembly intermediary. From a particular perspective a high level language is nothing more than a collection of assembly subroutines that are put together by replacing keywords with them (albeit with some additional work to optimize everything). Writing complex pieces of software in it is just tedious – that’s why we invented higher level languages. Unless you need absolutely every clock cycle and perfect timing, there is no reason to use assembly at all. For 99% of our readers, I’d say the answer is right now. ’s original question was when you should learn an assembly language: before or after a higher-level language. If you treat it like a fun puzzle to solve, you’ll probably even enjoy the experience. And that is, after all, the point of learning an assembly language: learning to think like the silicon. You’ll find the instruction sets small enough that you have to do most of the work yourself. Or maybe even the new hotness – a RISC-V. So if you want to dip your toes in that water, pick up an AVR or an MSP430. I have only written assembly language for a handful of CPUs, and not much of it at that, but I’ve found the microcontrollers to be the friendliest. Just as learning a set of solid algorithms will help you no matter which higher-level language you use, learning the concepts behind crafting loops and simple memory structures out of raw assembly language will serve you no matter which CPU you choose. And once you start talking about memory access, direct or indirect, the individual architectures of the chips demand different assembly languages.īut still, although the particular ways that CPUs do what they do can be incompatible from a strictly language perspective, they are a lot more similar in terms of the programming idioms that you’ll pick up along the way. Of course there are similarities: every CPU has an add function, right? But almost no CPU has just one add – there are variants with and without carry, storing and reading from working registers or RAM. Of course, it’s a Hackaday crowd, but I still didn’t expect the outpouring of love for the most primitive of languages.Īssembly language isn’t really one language, though. The comments overflowed, and we’re surprised that so many people basically agree with us: yes. ![]() This week, wrote a great thought piece about whether or not it was worth learning an assembly language at all anymore, and when. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |