4 ms·
What a nice set of tutorials. I want to thank the author for putting it together. I rarely write or look at assembly language anymore because of three factors:
by todd8 5y ago
What a nice set of tutorials. I want to thank the author for putting it together.
I rarely write or look at assembly language anymore because of three factors:
* Hardware is so fast that I don't need register level control of my code.
* Compilers are so good that I don't optimize the actual machine instruction use any better than the compilers produce.
* I'm now using Intel/AMD architecture machines almost exclusively. (But I am typing this on a M1 based system right now!) Our PC instruction sets have become more and more complex, full of features that may or may not be present on machines that are the intended target for execution. Programming at the assembly level is less tractable than it was in the past.
However, like vitamins, understanding assembly language is good for you, and many software developers will find assembly language useful as their careers develop. OS kernels, security and vulnerability work, high performance programming, device drivers, and the ubiquitous IOT all use into assembly language at least some of the time. These are generally not areas where new CS majors will be working professionally, but those with the goal of becoming a senior developer should learn assembly language.
I find that after a bit of practice with the instruction set, assembly language programming is fun because with only a (relatively) small set of atomic building blocks, the registers and the instructions, the programmer builds a solution. No scouring StackOverflow, no reading the latest Pragmatic Press book on a new framework, and no searching through packages and standard libraries for the proper use of some zipped iterators.
I have a few tips for autodidacts setting out to learn assembly language. First, take a look at the article. It's a very nice introduction to assembly language. Second, pick some simple projects. Don't sit down to write a chess program in ASM. Third, learn how to use a good debugger like GDB or DDD; being able to single step through your assembly language and seeing what is going on is essential.
My forth tip is the best. Read and do exercises from R. Bryant and D. O'Hallaron's book Computer Systems: A Programmer's Perspective 3rd Edition, see [1].This is on my short list of best books for CS students. Unfortunately, this book is $150 new, but you should be able to buy a good condition used copy from a university bookstore. I would never sell my own copy, it is just great. This book, and the required course for CS and ECS majors at CMU it was written for, is the inspiration for the notorious and wonderful Binary Bomb Lab exercise.
To be clear, R. Bryant and D. O'Hallaron is not a book about assembly language programming. It is a book about computer systems from the programmer's perspective and specifically from a C system programmers perspective. This requires a realistic understanding of assembly language. If there was just one book that I would like my hires to be familiar with it would be this book. The book covers so many important systems programming concepts that it is hard to summarize (unfortunately, I'm not at home with my copy) but some of the the subjects are bit representations, hardware architecture, assemblers, compilers and linkers, buffer overflow vulnerabilities, calling conventions, network programming, concurrency, shells (fork, signals, process control), the impact of hardware memory hierarchy on performance, and virtual memory implementations.
[1] https://www.amazon.com/Computer-Systems-Programmers-Perspective-3rd-dp-013409266X/dp/013409266X/ref=dp_ob_title_bk https://www.amazon.com/Computer-Systems-Programmers-Perspect...?
- blame-troi 5y agoI’m a long time mainframe assembly language programmer and I appreciate good instruction set architecture. Intel is ubiquitous but it’s a messy architecture these days. There’s little need for doing assembly anymore beyond personal enrichment and enjoyment, and for that I recommend ARM.