Hacker News new | ask | show | jobs
Ask HN: If you wanted to learn assembly how would you?
1 points by 0x01030307 2892 days ago
I have a strong background in higher level languages (Java, Php, Python, etc). A little background in C.

The way I self-taught programming was to just build shit.

What is the best way to learn assembly?

Thanks

3 comments

• Jeff Duntemann wrote a book some years ago, Assembly Language Step By Step, that covers Linux assembly language programming: http://www.duntemann.com/assembly.html

• Just typing "gnu assembly language" in a search engine will bring up lots of tutorials, mostly produced by colleges.

• Stack Overflow on your exact question: https://stackoverflow.com/questions/721583/what-is-the-best-...

• The Linux Assembly HOWTO http://www.tldp.org/HOWTO/html_single/Assembly-HOWTO/ referenced by the Linux Assembly site at http://asm.sourceforge.net/

http://www.int80h.org/ covers the differences between Linux and UNIX/BSD programming and how to write portable code; definitely worth studying.

Assembly language is mostly mnemonics for the individual instructions available in the hardware of a microprocessor. So you need to pick a microprocessor family, study the hardware (registers, different memories), and what each instruction does. The popular microprocessor architectures are: ARM, X86 (Intel, AMD), and the new open source RISC-V. Start with "Computer Architecture" by Hennessy and Patterson. Modern architectures overlap many instructions, this is part of the cause for Specter and Meltdown. Add a number to a register, the result won't be there immediately. A branch tests true, the branch will not complete for a couple of cycles.
I learned assembly by reading two books, the first was "hacking , the art of exploitation " and the second is the Z80 book