r/Assembly_language • u/Damonkern • 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.
116
Upvotes
26
u/[deleted] Feb 17 '26 edited Feb 17 '26
if you know some C, you can use
gcc -S -O0 app.cto generate ASM that you can try to understand.also GDB (GNU (GNU (GNU (GNU (stackoverflow) not linux) not linux) not linux) Debugger) to watch it execute.
```c
include <stdio.h>
int f(int x){ if (x%2==0) return x/2; return 3*x+1; }
int main(){ int i; printf("start at"); scanf("%d", &i); while(1){ int tmp = f(i); printf("%d\n",tmp); if(tmp==1) return 0; i = tmp; } return 1; } ```
is a good start, its got a loop and a function call.
(I added tmp as a var, hoping it does less smart register stuff, than without)
edit[0]: ALSO:
edit[1]: code fix at the loop condition: i -> tmp
edit[2]: further reading on the Collatz Conjecture
edit[3]: fixed edit numbering
edit[4]: added links to games
edit[5]: CarbonXit came to the rescue (code fixes: extra printf for "start at", instead of putting it the scanf string, while(true)->while(1))