Re:x86 assembly doesn’t have to be scary (2018)
by secondcoming on Thursday October 07, 2021 @09:15AM
(#28785784)
Compiler Explorer [0] is a godsend for seeing what the compiler is generating.
For example, the codegen for some C++ that was discussed a few days ago [1]
Re:x86 assembly doesn’t have to be scary (2018)
by BeeOnRope on Thursday October 07, 2021 @11:05AM
(#28787274)
Looks interesting, can you share what post it was discussed in?
Re:x86 assembly doesn’t have to be scary (2018)
by rajeevk on Thursday October 07, 2021 @01:10PM
(#28789256)
Here is my article that explains how C code can be understood in terms of assembly: https://www.avabodh.com/cin/cin.html
I also wrote another article which explain how C++ code can be understood in terms of C code: https://www.avabodh.com/cxxin/cxx.html
Re:x86 assembly doesn’t have to be scary (2018)
by nvarsj on Thursday October 07, 2021 @10:03AM
(#28786388)
Doing CTFs is also a way to get intimately familiar with x86 assembly, and they are pretty fun too.
Re:x86 assembly doesn’t have to be scary (2018)
by iota8 on Thursday October 07, 2021 @01:05PM
(#28789166)
Here is an article that explains how C code is translated into assembly:
https://www.avabodh.com/cin/cin.html
This website also has another article which explains how a C++ code can be understood in terms of C code. https://www.avabodh.com/cxxin/cxx.html
I think it's fairly common to recommend beginners to write a compiler but I think it's less common to actually recommend trying to emulate parts of x86. I think it's a particularly easy way to get started just because it's the architecture you already know or because its the architecture that all compiler tutorials use (if they don't use LLVM). And if you are a programmer you probably incidentally have gcc, gdb, and objdump on your system ready to help you out.
Doing both compilers _and_ emulators really helped my understanding of x86 and C (even if I wasn't writing C).
My background is in web development and my reason for doing these projects/writing is purely educational.
[0] https://notes.eatonphil.com/compiler-basics-lisp-to-assembly...
[1] https://notes.eatonphil.com/compiler-basics-an-x86-upgrade.h...
[2] https://notes.eatonphil.com/emulating-amd64-starting-with-el...
[3] https://notes.eatonphil.com/emulator-basics-a-stack-and-regi...