
Provides information on how computer systems operate, how compilers work, and writing source code.
- Applied Embedded Electronics: Design Essentials for Robust Systems by J. Twomey. It goes over the whole process making a device and what knowledge would be required for each. Making Embedded Systems, 2nd Edition by E. White is a nice complement.
- Embedded System Interfacing by M. Wolf describes the signals and protocols behind everything. It's not necessary as a book, but can help understand the datasheets and standards
- But you want to start with something like Computer Architecture by C. Fox or Write Great Code - Volume 1 - Understanding the Machine, 2nd Edition by R. Hyde. There are better textbooks out there, but those are nice introductions to the binary world.
The gist is that you don't have a lot of memory and CPU power (If you do, adapting Linux is a more practical option unless it's not suited for another reason). So all the nice abstractions provided by an OS is a no go, so you need to take care of the hardware and those are really finicky,
1. https://www.amazon.com/Write-Great-Code-2nd-Understanding/dp...
2. https://www.amazon.com/Write-Great-Code-Low-Level-High-Level...
3. https://www.amazon.com/Computer-Organization-Design-RISC-V-A...
4. https://www.amazon.com/Computer-Architecture-Quantitative-Ap...
5. https://www.amazon.com/Computer-Organization-Design-MIPS-Arc...
6. https://www.amazon.com/Computer-Organization-Design-ARM-Arch...
7. https://www.amazon.com/Models-Computation-Introduction-Compu...
But in real world, that's not something that works. Programming for old platforms is fun and has historical value, but there are a lot of problems that don't make sense today. It's not particularly educative to write lots of lookup tables, or to know optimized (that is, fast enough) 16-bit additions, let alone divisions (and problems like these are typical once one writes something that it's not just a "hello world"). Heck, even programming (optimizing) for a 286 is significantly different from how one would program assembly today.
Having said that, I'm definitely not against learning the lower level, but just to focus on a relevant low level. There are different approaches, but a good starting point to understand modern computers from the bottom up is the series "Write great code" by R.Hyde, volumes 1 and 2.
If one wants to program on 6502 for the sake of programming on 6502, there are plenty of books on archive.org to learn from. It's not easy to find good ones, and they're somewhat hard to read because they're bad scans, but some are very valuable in terms of learning assembly by writing non-trivial, real-world routines.
Interestingly, there is a footnote explaining that "Computer Architecture: A Quantitative Approach provided a good chapter on I/O devices and buses; sadly, as it covered very old peripheral devices, the authors dropped the chapter rather than updating it in subsequent revisions."
Some of the other books I didn't find helpful. For example, Learn Java the Easy Way seems to be too slow for anyone with any programming experience but not enough coverage of fundamentals for beginners.
The Unix Programming Environment was published in 1984. I read it over 20 years later and was astonished at how well it had aged. For a technical book from the 80's, it is amazingly lucid and well-written. It pre-dates modern unix, so things have changed but much that goes unstated in newer books (for brevity) is explicit in UPE. (Plus, the history itself is illuminating.) It gave me a much deeper understanding of how programs actually run over computer hardware. Examples in C are old-school and take a bit of close reading but oh so rewarding. https://www.amazon.com/Unix-Programming-Environment-Prentice...
Mastering Algorithms in C. Another fantastically well-written book that shows (with practical examples) how to implement common algorithms. This is just such a great book! https://www.amazon.com/Mastering-Algorithms-Techniques-Sorti...
Also:
Code (Petzold). This one is truly language-agnostic. Others have mentioned it already. Can't recommend enough if you're iffy on the internals of computers and programming. https://www.amazon.com/Code-Language-Computer-Hardware-Softw...
Write Great Code (Volumes I and II). Randall Hyde's books are fantastic explications of the underlying computer operations. Examples are in assembly or pseudo-code but easy to understand. https://www.amazon.com/Write-Great-Code-Understanding-Machin...