Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tutorials / books on understanding assembly output [closed]

Tags:

c++

c

assembly

There are times when understanding disassemblies from higher languages such as C or C++ are useful. Reading a book on assembly is obviously a necessary part of understanding compiler output, but in my experience writing assembly code from scratch is quite a different thing than reading and understanding the opcodes a compiler produces. The books i know on assembly don't cover that part very well, altough I believe if you ever get in touch with assembly then mostly by trying to understand compiler output.

Do you know good in-depth tutorials (or maybe books) on how to interpret compiler output?

What I have in mind would be a presentation of common high language idioms and how they are translated to assembly by common compilers (msvc and gcc).

like image 721
WolfgangP Avatar asked Dec 01 '10 12:12

WolfgangP


2 Answers

Many similar questions here on SO:

  • Learning Assembly
  • Resources for learning ARM assembly
  • Good x86 assembly book

Most posters aim to the same thing as you, that is read assembly code and not write new one.

like image 111
kgiannakakis Avatar answered Nov 07 '22 12:11

kgiannakakis


Everything[*] I know about reading x86 assembly, I learned by single-stepping in a debugger in disassembly view. It's useful to have an opcode reference open at the same time, but to be honest you can live without most of the time, because as long as the compiler isn't optimizing too much, you know what it's actually doing from the C source, contents of variables, etc.

[*] Well, most things.

like image 32
Steve Jessop Avatar answered Nov 07 '22 11:11

Steve Jessop