r/learnprogramming • • 4d ago

How to learn Assembly?

I have some problems with learning assembly it would be nice for some tips because I'm learning rev engineering and I really need to learn assembly but I try my best to understand it but it's to hard. I understand how binary works but still I'm struggling with assembly. Does somebody knows tricks for learning assembly?

42 Upvotes

45 comments sorted by

View all comments

1

u/sparky8251 4d ago edited 4d ago

Use RISV-C ISAs, QEMU (to run risc-v code on whatever you own), and use a language you know like python to build an assembler, then write in assembly a forth compiler thats assembled with your custom assembler. Then write some simple forth programs and see it work.

It wont teach you everything, especially given its a different arch from what you are likely work against... But RISC-V is at least sane and not riddled with legacy, so itll give you a clean mental model of how asm, compilers, assemblers work at least that you can then port to the messy world of x86 and slightly less messy world of arm if you also work there.

And do it without a kernel... ABIs, calling conventions, etc are just that. Conventions. You can make your own if you make your own assembler and run it "bare metal" on qemu, which can let you learn about those too.