3 ms·
For those who are interested to hone their skills in translating C to assembly language just for the sake of grokking a C compiler, you might want to read this
by e19293001 6y ago
For those who are interested to hone their skills in translating C to assembly language just for the sake of grokking a C compiler, you might want to read this book:
Assembly language and computer architecture using C++ and Java
Book by Anthony J. Dos Reis
From book's description:
Students learn best by doing, and this book supplies much to do with various examples and projects to facilitate learning. For example, students not only use assemblers and linkers, they also write their own. Students study and use instruction sets to implement their own. The result is a book that is easy to read, engaging, and substantial.
I'm not affiliated with the author though. This book helped a lot in my career as a hardware and firmware engineer.
It talks about not only C language but C++. You'll be able to translate a C++ class into assembly language by hand. The drawback is that you'll learn a hypothetical CPU but the concepts are still the same with the real world CPU. C internals could supplement it as well.
- rrmm 6y agoImplementing a compiler for some language at some point in your life is a great project. It will really teach you a lot of deep down information on what's going on under the hood. I took a compilers course in grad school and it was a lot of fun. Especially the sort of frankenstein moment when you got it working and it actually did something, and its output would itself run. (Another fun thing is to design an instruction set and implement a simulator and asm for it. I have a lot of fond memories).
- thr0w__4w4y 6y agoI can’t improve upon your recommendation, but I’ll second it, from the point of a firmware / security / reverse engineer-er.
- jart 6y agohttps://gist.github.com/jart/fe8d104ef93149b5ba9b72912820282c https://gist.github.com/jart/fe8d104ef93149b5ba9b72912820282...
- porknubbins 6y agoThis sounds similar to Computer Systems: A Programmer’s Perspective which was great and taught basically x86 but was a little light on linkers. Any idea how these compare?