How to get started with x86 assembly programming

From ArticleWorld


Although many consider it a dead practice already, assembly programming is a valuable asset, especially if you are doing system programming. Assembly programming means you work directly with the hardware and gives you a great amount of freedom. Here is how to get started:

  1. Get a good book. The Art of Assembly Language is an excellent starting point. It is freely available online, on http://maven.smith.edu/~thiebaut/ArtOfAssembly/artofasm.html , but can also be found in most bookstores and libraries.
  2. Get an assembler. Nasm and Fasm are currently the most widely used. A good text editor is also nice to have.
  3. Get an emulator. It is always better to have an x86 emulator at disposal to run your code on, since it allows you to get some more debug options. Bochs is a good option, but you can also have a go at a didactic emulator (one that puts an accent on visualizing and simulation rather than accuracy and speed).
  4. Get some documentation. The Norton guides ( http://www.davep.org/norton-guides/ )or Ralph Brown's interrupt guides ( http://www.ctyme.com/rbrown.htm ) are must have-s.
  5. Learn to see where you can optimize code. "Write first, optimize later" does not apply to assembly programming: the only part you should delay is pipeline optimization.
  6. Read code. There is a very large repository of assembly code available, anything from operating systems to graphic hacks. Read and learn.