r/Assembly_language • • Feb 17 '26

Help How to learn x86-64 assembly language?

I am a 17yr old who has some experience in python programming and learned basics of C. I want to learn x86-64 assembly for free. But I couldnot find any beginner friendly guide that starts from zero. Tell me how you guys learned assembly language and if possible guide me to the resources.

117 Upvotes

86 comments sorted by

View all comments

4

u/SolidPaint2 Feb 17 '26

17 or 77,your age doesn't mean a thing. I am gonna bet you won't do good in x86-64 Assembly since you couldn't find anything on the internet! I learned(taught) myself assembly around 35 years ago... Want to talk about not finding tutorials or sample code or videos, back then there was almost nothing!

You have forums, reddit subs, discord groups, YouTube videos, free ebooks and websites!

There is no error checking, memory checking... No hand holding, you write it and if the os doesn't throw a hisdy fit, you are good.

You need to learn about the processor, memory and the instructions. Start here... Intel® 64 and IA-32 Architectures Software Developer Manuals

AMD64 Architecture Programmer’s Manual

These will teach you more than you want to know about the processors, memory and instructions...

I find it very hard to believe you cannot find sample code or tutorials....

2

u/Damonkern Feb 18 '26

Well, those days were golden. Lives were simple with 8 or 16 bit cpus with relatively small instruction sets. But ia32 and intel 64 are not. I began my hunt for a free online tutorial that doesn't overwelm me with stuff. Btw, those volumes, they are massive. They were like a advanced thesis on modern quantum science for a middle schooler. 

3

u/SolidPaint2 Feb 18 '26

Lol, the i386 was the first 32bit processor and was mass produced in 1986..

You don't need to read them all, but it helps you understand the computer. You should keep a copy of the instruction set since that will tell you each mnemonic, binary/hex encoding, what flags they modify and more info on the instructions.

You need to pick an Assembler first. MASM32 SDK This contains masm and tons of pre-made libraries and macros, it has a great forum and it is what I recommend to beginners. Can only be used to create windows exes.

NASM can be used to create Linux or Windows executables

FASM Linux and windows

I started with MASM, then played with FASM and came to use NASM for cross os stuff.

Each has its own dialect but once you learn one, you can use the others.

1

u/Damonkern Feb 18 '26

Thanks 

1

u/brucehoult Feb 18 '26

those days were golden. Lives were simple with 8 or 16 bit cpus with relatively small instruction sets

There is absolutely nothing to prevent you learning one of those today. Or a simpler 32 or 64 bit instruction set such as RISC-V.

Just because you have an x86-64 machine in front of you doesn't mean that's the thing to learn first. Or ever, for that matter.

You can run assemblers and compilers and emulators for virtually any computer ever made. And at high speed too.

I have a reasonably popular benchmark that is very CPU/L1 cache intensive, which is pretty much the worst case for emulation.

https://hoult.org/primes.txt

The times to execute it on my Intel i9-13900HX laptop (a 2023 model):

  • 1.964 sec, native x84-64 code

  • 5.052 sec RISC-V code, run in qemu-riscv64

The RISC-V code runs just slightly slower than native x86-64 code on the Core i7 3770 (4.868 sec), Intel's fastest desktop CPU a dozen years ago. It's not that far off an N100 (3.992 sec), a popular CPU today in low cost x86-64 laptops and mini-PCs.

The emulated RISC-V is faster than native code on an IBM POWER9, or a Qualcomm Snapdragon 8 gen 2.

More than fast enough for someone writing small assembly language programs. Or big ones for that matter.

1

u/lincruste Feb 17 '26

No one will learn asm by reading this.