Prerequisite for learning assembly

4 points by pencil ↗ HN
can someone tell me what's the prerequisite to learn x86 assembly language.

6 comments

[ 2.6 ms ] story [ 40.6 ms ] thread
I'd start by buying a reference manual somewhere.

Then go and implement some algorithm that you can follow completely in C, and use whatever flag your compiler uses to spit out the assembly code.

Then take that reference manual and go through the instructions one by one to see how a stack frame is built up under the hood and how your algorithm was translated from the high level 'readable' representation to the lego blocks of assembler.

That should give you a bit of a start, after that when you think you have a good enough understanding of how all that works try making that code faster.

For best understanding of the generated code and a fair chance at achieving some optimization you should probably do all this with your compiler optimizations off.

Good luck and have lots of fun, you will definitely benefit from learning assembler.

edit: Make sure you take lots of time for this, learning assembler is not like learning other languages, there are no friendly error messages, most of the time what you write will produce an executable but it will crash horribly in the beginning.

Single stepping through your code and watching the registers and flags change is an invaluable tool.

I wished I had a half decent debugger when I first learned assembler, it would have probably saved me a year.

thank you so much for all your advice .i'am curious to know if companies like microsoft and a couple of hardware companies still use it.