I’d like to write a script that takes x86 assembly language code as input and generates comments to explain what each statement in the program does. Do tools like this already exist? Also, would this be a relatively simple program to write (since the syntax of each assembly language statement is relatively straightforward?)
Share
I’ve never heard of one. And I think there’s a good reason for that.
If you look at the description of, say, the
intoriretinstruction in the CPU documentation, you will see pages of text and pseudo-code.Most of the regular instruction like
movhave some tricks up their sleeves too. First, they may have some non-trivial behavior details. Second, they can cause exceptions and fully documenting what happens after an exception takes place is impractical because that depends a lot on the OS and other parts of your program.So, such a tool would really have a very limited application.
In any case, the best way to learn what every instruction does is to combine reading the CPU documentation with playing with the debugger.