2 ms·
Definitely worth the experience, but not really too useful for most practical programming projects. The big advantages of writing assembler come from understan
by idanb 15y ago
Definitely worth the experience, but not really too useful for most practical programming projects. The big advantages of writing assembler come from understanding the real time nature of a processor (at least for me). Writing code in assembler is truly an art since at that level you can actually interweave code in such a way where blocks of code are both functional in scope as well as globally (such as using a block of code as a delay for a different action, caching the result until later using it, used often in video code). Great assembly will generally beat a compiler significantly especially on embedded systems.
In my experience learning assembly language is not so much an action but more of a process. Build yourself a nice little cheapo MCU circuit (AVR, PIC, ARM) , or get your hands on an emulator, and try to actually program it using assembly language. I'd highly recommend doing this using either a RISC instruction set over making an attempt at a CISC one like x86. Not hating on x86, but my experiences with it did not really teach me much about computers, rather taught me about x86 (if that makes any sense). I'm not a massive fan of how they always teach MIPS in academia, but it's a good place to start since most RISC architectures are very similar if not based on MIPS.
Also, understanding assembler will help you in understanding how CUDA works under the hood. CUDA is C based, but underneath its implementing some interesting SIMD stuff, so at least a basic feel for how instructions are fed into a processor could legitimately aid in optimizing code for CUDA where a 1% difference could be very significant.