What can i do to get results like book?
Just use the same version of the compiler and compile the code for the same architecture as the Author. Usually, there is explicitly stated which compiler version was used to get a particular assembly. For example:
So, there are several different versions of compiler used and if you want to get the same results, you have to use the version described at each listing.
or if getting results like author's is not the point
It's definitely not the point. The point is that you learn as much as possible when reading this book.
I would even say it may be better to get different results than these in the book. There are several reasons for it:
- You will learn how the newer versions of the GCC compiler deal with the same C code, so for example what are new optimization methods.
- You will see different assembly performing the same task as the previous one - when you'll see big differences, you will probably want to think or search for more information about it and this way you'll remember it better.
- It encourages you to understand the resulting assembly so you can compare it with the one presented by the Author - it's far more creative and productive work than just copying what you have already presented.
how can i get the most out of this lovely book?
I would say, by practice. If you don't practice what you have just learned, you will forget it very quickly. You can even omit some programs written there and just experiment on your own (like the Author suggested) - just write some code and try to find its fragments in disassembly.