Just another programming blog

Factual accuracy is not guaranteed

How to learn assembly


  1. The 0th step is to set your expectations carefully.
    Anyone can learn assembly, but you should be aware of what you’re getting yourself into.
    Assembly is hard to learn, hard to debug, hard to debug and doesn’t guarantee performance. Assembly will be a challenge for people of most backgrounds and will require lots of time and attention to make small progressions. You will have to learn several concepts and many run into several pitfalls before you write your first hello world program. I don’t say this out of negativity, I say it so you can pace yourself realistically, exercise self-compassion and ultimately set you up for success.
    It is also extremely beneficial (but not a hard requirement) to know C or another low level language. A lot of the concepts in low level languages still apply to assembly. You will benefit from plenty of practice reading documentation. Perhaps most importantly, you will benefit most from a community to ask your questions and exchange knowledge about the topic – there really is no substitute for asking people questions especially in extremely complex and nuanced topics like this.
  2. Be aware there are multiple flavours of assembly. Assembly is not a single language, it’s a language family. It doesn’t particularly matter which type of assembly you choose, but you do need to be aware of it because it fundamentally impacts how the concepts that you’ll learn are expressed. You should begin with one resource and be aware of what type of assembly it is, and specify that type whenever you search up questions, pose questions to your community and consider resources. You aren’t expected to know what any of these mean when you start off, think of them like a model number to assist in describing your setup to others. If you are most comfortable with windows and you have a modern desktop computer, you will most likely use the assembly with the following features:`
    • MASM assembler
    • Microsoft visual studio Linker
    • Windows api calls (also called Windows NT api calls)
    • Microsoft x64 calling convention
    • CPU architecture named x86_64 (also called x64, AMD64)
    I personally started with writing assembly in linux because I am most familiar with it at a lower level and I found more resources for it:
    NASM assembler
    – The GNU linker ld
    Linux syscalls
    cdecl
    – CPU architecture x86 (also called 8086, x86_32. NOT the same as above)
    I then moved on to:
    FASM assembler
    – GNU Linker ld (when required)
    Linux syscalls
    System V ABI syscalls
    – CPU architecture x86_64 If a resource does not clarify it’s probably using one of the above setups.
  3. Find resources, practice religiously and make notes liberally
    A lot of assembly requires rote memorization of boilerplate and magic numbers. You cannot remember all of them and should make friends with note taking, especially where you fail to recall things. It’s also the case that assembly resources are hard to find and you will waste countless hours if you do not note down information that you keep using. To start learning, find a tutorial that works with your learning style and slowly work through it. It is important to consider that tutorials alone will not teach you all of assembly, but they can be a great starting point to introduce you to ideas and will make you ask yourself questions which you should explore. Good tutorials start with something basic like teaching you how to exit correctly and what happens if you don’t – it sound stupid but that foundational knowledge is an important prerequisite to writing assembly that behaves correctly. Be aware that tutorials often contain flaws because people as a whole are bad at assembly which is why it’s become very unpopular to learn. Practice unfamiliar things over and over again until they become second nature. If you have made it this far and you’re still unsure, then try these out, and see which (if any) play to your learning style, knowledge background and so on. There’s no shame in trying some out until you find a resource that plays to your strengths.
    “Assembly Programming tutorial” – Tutorialspoint
    “You Can Learn Assembly in 10 Minutes (it’s easy)” – Low level learning
    “Fasm 0 – Introduction” – Phillip Bohun
    “The Art of 64-Bit Assembly, Volume 1” – Randall Hyde
    “To-Do App in Assembly” – Tsoding
    “x86 Assembly Guide” – University of Virginia
    “You Can Learn Assembly in 60 Seconds (its easy) #shorts” – Low level learning
  4. Find a community
    Whether it be Stack Overflow, discord communities, mailing lists, or anything at all, it’s important you find a group of people who you can go to when you’ve been unable to solve a problem for a prolonged period of time. The first thing I mentioned in this article is assembly is hard and you will have a miserable time if you go it alone and don’t occasionally ask for help. Being in a community who you can exchange this knowledge with is a benefit to you, others there and anyone else who happens to find the discussions in future. Assembly is a human invention which only makes sense in the context of human computing history, human design choices and human collaboration to solve human problems. To understand assembly, is in a small part to understand people, you mustn’t forget the human side.

Leave a Reply

Your email address will not be published. Required fields are marked *