What are the best low-level programming books?

I had trouble to learn any assembler by books - was total incomprehendable gibberish to me.
There are many books of the kind you look at with expertise and say:"Wow! This guy really made an effort to explain the shit in detail absolutely fool proof comprehandable for even a total blank noob." While as a noob you're slaving over it and think:"...:oops:...?????????...😵‍💫 - 💩"

When I started to program 8bit Microcrontrollers it all became clear, made pretty much sense, was real fun actually.
As always: Do it practically! And start low.
Also why are they better than others?
Perhaps they aren't actually better books, but about smaller machines, so more basic. It's always better, often the only way, to start from a more basic level.

If you want to become a pilot, you don't start on a F-15, but on a small single propeller airplane, or even better a glider. First you need to learn the fundamental basic core principles.

With assembler you also better start on small "primitive" machines. My recommendation was 8bit.
With assembler you need to deal with binary, not just hex, but actual zeros and ones a lot - at least until you see in hex the binary and read it like you read decimal. It's way more easy to familiarize with tractable numbers as when you directly have to deal with 64 bit worms.
Also the amount of commands, and registers you have to deal with is less smaller, which makes the whole task a lot less complex. You can do anything on such machines, though - as long as time is of no importance, and you have enough memory. Example: To do any calculation all you need are two arithmetic functions, only: adding and complement - those you'll find in even the most primitive processor core. With these both you can 'create' functions doing the other three basic arithmetics. Having all those four you can do anything.
You may also learn a lot about floating point, e.g. how to do it even on a machine that does not come with it.
But you may not learn all that when you start on some today's multicore 64bit CPU which assembler commands reminds of an already higher language, plus it's way harder to get into it, when dealing with 64b binaries, several working registers etc.

First learn to fly, then how to do loopings. 🥸
Maybe that's why books about assembler on "lower" machines are better.😎
Enjoy! It was fun to me.
 
I had trouble to learn any assembler by books - was total incomprehendable gibberish to me.
Well, I guess I am autistic enough to prefer incomprehendable gibberish 🤣
What I would recommend is instead a course/tutorial on ASM.
It depends which architecture you are targeting (Arm, AMD64, X86 pure).
 
Learn By Doing.

Find a tutorial on the mechanics of creating an ASM executable for your platform.
I only write for the windows platform, and then only (so far) in Win32.
64-bit is yet a different animal with new register conventions.

Back in the 16-bit DOS days, I wrote entire programs entirely in ASM, just for the speed.
Modern hardware mostly does away with this need, especially in the bloated GUI environments.

The Intel ASM books are available in PDF format, and are the gold standard for instruction formats.
Unless you are simply writing for your own amazement, consider using Inline ASM statements inside a compiled program.
This gives you the benefit of a familiar debugger and allows you to single step through your ASM statements.
Find a profiler for your compiler, then use it to find the big slowdown in your code, and see if you can speed it up with ASM.

Also consider using your compiler to emit ASM code, so you can see how a given function operates.
ASM is a wonderful time sink for those who have too much free time on their hands.
 
When I started to program 8bit Microcrontrollers it all became clear, made pretty much sense, was real fun actually.
Yep. It really helped those of us who started back in the 1970s when things were much simpler. Microcontrollers are of that same ilk. The only reason I moved to C was cause my boss made me in 1987 or thereabouts. Assembly in current processors scares me but I haven't had to do any of that. The little I've read shows too many new things and I can't tell if I really need them, as if I'm going to start now.
 
51ubCippojL.jpg


 
People can point to books because they are an easily accessible source of information. I would recommend also having a working installation of Assembler that one can use to actually run the code and get a better handle on how Assembler language works. FreeBSD Ports collection offers up devel/nasm, for starters.
 
I recommend writing a simple simulator for an 8 bit processor (in C or some HLL). Even if you implement just a few instructions such as add, subtract, compare, conditional jump, call, return etc. you will gain a good understanding of simple processor architectures, how an instruction set allows access to registers, memory, various functions, IO, etc. You can start with the instruction set of an 8 bitter (which are much simpler but still hit many of the key points).
 
I agree with the sentiment that you learn by doing.

But, long before I ever got in front of a keyboard, I was taught logic (e.g. Karnaugh maps), numeric representations (characters, binary, BCD), number systems (binary, octal, decimal, hex etc.) floating point representations, and computer architectures.

These are sound building blocks on which to acquire a knowledge of how low-level programming actually works. If your college started you on Java, or an AI assisted programming course, you have no sound foundation to stand upon -- it's always going to wobble.

I'd get a project to execute, an emulator for your target architecture, a programmer's guide for that architecture, and look for well executed examples of code to study (system libraries are often a good starting point).

[Lions's Commentary on Unix is not a bad place to start for people with an interest in Unix, especially since PDP-11 emulators are readily available.]
 
If your college started you on Java,
My college did start me on Java. There were tools like IntelliJ to help with code completion, but back then there was still an emphasis on understanding the nature of recursion and how it helps with algorithm implementation.
 
At the end of part 1 of Nand2tetris you write a really simple assembler for the really simple (emulated) machine you built from NAND gates. You'll have just finished programming that same simple computer in machine language two modules earlier. Highly recommended.
 
Back
Top