r/Assembly_language • u/Stock_Test2326 • 15d ago
Help Looking for resources to learn Assembly Language from absolute zero (Books, YouTube tutorials, tools/emulators)
I'm interested in learning assembly language purely out of curiosity and for the love of understanding how computers actually work beneath the software layer.
I have some basic Python programming knowledge, but I don't know C, C++ (learnt bare basic CPP recently to read a book but I won't consider it), or any assembly. I'm not looking to rush into systems programming or make this a career requirement. I want to explore it as a long-term learning hobby, understand how CPUs execute instructions, how memory and registers work, and eventually get comfortable reading and writing assembly.
I'm using an Apple Silicon Mac (M4 Pro), so I'm particularly interested in learning ARM64/AArch64 assembly, although I'm open to understanding x86-64 as well if there's a good reason to learn it.
I'd appreciate recommendations in three categories:
1. YouTube tutorials / video courses
- Good beginner-friendly video series that start from absolute zero.
- Courses that explain registers, memory, stack, instructions, addressing modes, calling conventions, etc.
- Ideally, tutorials that explain what's happening inside the processor rather than just teaching syntax.
2. Books
- Beginner-friendly books that don't assume prior knowledge of C or assembly.
- Books that progressively introduce computer architecture, machine code, and assembly programming.
- More advanced books worth keeping for the long term.
3. Tools, emulators and development environments
- What assemblers, debuggers, simulators or emulators should I install on macOS?
- Are there safe ways to experiment with assembly without directly interacting with or modifying actual hardware?
- Would QEMU, CPU simulators, or virtual machines be useful?
- What tools would you recommend for inspecting registers, memory, and instruction execution step by step?
I'm particularly interested in experimenting in an isolated environment. I don't want to accidentally damage my Mac or mess with its operating system while learning.
One more thing: Would you recommend learning some C before starting assembly, or is it perfectly reasonable to learn assembly directly and pick up C concepts along the way?
I'm not looking for a shortcut. I want to understand the machine from the ground up.
Any recommendations, learning paths, books, channels or personal experiences would be greatly appreciated.
Thanks 🫡
UPDATE: Does anyone have a roadmap to this.
UPDATE 2: Other Posts & replies in this sub reg same which I find interesting. ay update with more links as I find them
[If your memory was WIPED, how would you re-learn x86 assembly?](https://www.reddit.com/r/Assembly_language/comments/1rlq6ux/if_your_memory_was_wiped_how_would_you_relearn/)
https://www.reddit.com/r/Assembly_language/comments/1rx5cyi/where_can_i_learn_x8664_assembly/
Try Jeff Duntemann's Assembly Language Step by Step.
I learned from Ray Seyfarth's book on Windows/Linux assembly. It's pretty good, but you'll need the install the ebe IDE if you want to get the most out of it
[For those starting to learn Assembly - step-by-step, how to create a flight simulator for DOS](https://www.reddit.com/r/Assembly_language/comments/1wxda05/for_those_starting_to_learn_assembly/)
I recommend Usborne's children's book: Machine Code for Beginners, which teaches you 6502 and Z80 machine code. These are simple 8-bit CPUs used in most of the micro computers of the 80's.
This is how most people have learned machine code, when you understand the simple principles here, you can move on to your desired architecture.
Machine Code for Beginners
____
https://learnxinyminutes.com/docs/mips/
https://uweb.engr.arizona.edu/~ece369/Resources/spim/QtSPIM_examples.pdf
____
https://github.com/mschwartz/assembly-tutorial
___
https://www.felixcloutier.com/x86/
____
[I'm looking for a high level overview as to how Object Oriented Programming is "implemented"](https://www.reddit.com/r/Assembly_language/comments/1x5f916/im_looking_for_a_high_level_overview_as_to_how/)
____________
GPT Suggested books resources
3. These are tools worth investigating eventually:
| Tool | Purpose |
|---|---|
| GNU Assembler (GAS) | Assemble programs |
| LLDB | Inspect registers, memory and execution |
| QEMU | Emulate different architectures |
| Ghidra | Disassemble and analyse binaries |
| Compiler Explorer | See how C/C++ becomes assembly |
| Ripes | Visually understand CPU execution |
B. Reverse engineering and binary analysis
| Order | Book | Purpose and when to study |
|---|---|---|
| 6 | Practical Reverse Engineering | Connect assembly, debugging, operating systems and reverse-engineering workflows. |
| 7 | Reverse Engineering for Beginners | Free online resource for assembly, compilers, calling conventions and program behaviour across architectures. |
| 8 | Practical Binary Analysis | Executable formats, binary instrumentation, analysis tools and program behaviour at the binary level. |
C. Malware analysis and exploitation
| Order | Book | Purpose and when to study |
|---|---|---|
| 9 | Practical Malware Analysis | Malware-analysis methods and practical investigation in an isolated lab. Some examples and tools are dated. |
| 10 | The Shellcoder's Handbook | Advanced exploitation concepts. Study after memory, assembly and operating systems. Older techniques need comparison with modern mitigations. |
6
u/thondat 15d ago •
if you're willing to start at an even lower level than assembly and build a virtual computer using logical gates in a hardware definition language, and eventually write a cross-assembler (and assembly code) for it, check out nand2tetris. it suits the purpose of exploring how computers actually work very well.
4
u/Dog-Mad 14d ago •
In my previous comment I was being really lazy and shitty with my answers because a gazillion people ask for advice on how to get started and you should do your own research to avoid posting the same thread over and over again. You were a bit too nice so i feel bad about my responses so I will answer your questions properly. This is just with respect to coding in x86_64, but a lot of this stuff will carry over to ARM.
An instruction typically follows this pattern,
[instruction name] [destination register/memory region], [source register/memory region/immediate]
destination is where the value is ending up, source is where it is coming from.
For like 99% of instructions you can only have at most 1 memory region. An immediate, commonly referred to as imm, or I, is a constant value. Max size 99% of the time is 32-bits. If you don't want to store something in memory and its not that big (and allowed) then using an immediate is ideal for that occasion.
A system call is a function that is built into the operating system and is called using the syscall instruction.
(I don't know what mac os does for syscalls.)
A system function is just what I call the bullshit Windows makes you do.
A syscall is basically "syscall + number" each number corresponds to a specific function, and because of backwards compatibility, it must ALWAYS correspond to that specific function. Windows didn't like that so they make you call the function directly instead of through syscalls iirc.
There are two types of calling conventions for syscalls and system functions.
You put something into a specific register, then you call a function, it takes the information in the register and does something. You allocate a memory region in advance, then you put the address of this memory region into a specific register. Then you call a function, the function will read the address you put into the register, and then it will paste a bunch of information into that memory region or it will use the information stored in that memory region to do something.
The print function for example, you put the memory address of the string you want to print into a register, and the size of said string into a different register. and then choose if you want to print it into the terminal or somewhere else, you put that choice into another register. call the function and viola.
9."Ideally, tutorials that explain what's happening inside the processor rather than just teaching syntax." You don't want to know what the processor is doing. You seriously do not want to know what the processor is doing. Just focus on what the instructions do.
10."What books should I use." The problem with books and general 10 billion hour long videos or whatever on assembly, it's just too much information to keep track of. No amount of easing you into assembly will work because you can only absorb that information by doing and not by remembering.
Example: "I want to do X thing, let me look for an instruction or something that will let me do that."
... After reading the description for a bunch of instructions. "Ok I found something that lets me do what I want." Or "I wasn't able to find a way to do the thing exactly as I wanted but I figured out another way to do it."
11."Should I use QEMU." QEMU is a cpu emulator so if you want to practice with a assembly language that is different from your cpu's architecture then you would use QEMU. So use it if you want to use x86_64 otherwise don't.
12. "What tools would you recommend for inspecting registers, memory, and instruction execution step by step?" This is called a debugger just pick one that has a gui.
13. "I don't want to accidentally damage my Mac or mess with its operating system while learning." Unless you accidentally create malware you are at zero risk of damaging your Mac and making malware is not something you do accidentally.
14. Memory for real this time.
An assembly file will have multiple sections. The two of note are .data and .bss
in NASM if you want to store a string
you would use .data
section .data
hello: db "Hello World", 0x00
db indicates that everything is a byte and that it needs to tally up all the bytes and store all the information.
If you want to have a variable that is in memory, think infinite registers basically. You use .bss
section .bss
x resb 8
resb or reserve byte tells it to reserve 8 bytes for x
if you want to access x later
do something like
inc [x]
You need to put your code in the section .text
So basically
section .data
hello: db "Hello World", 0x00
section .bss
x resb 8
section .text
inc [x]
2
u/Dog-Mad 15d ago •
https://cdrdv2.intel.com/v1/dl/getContent/671200 https://www.felixcloutier.com/x86/
2
u/maidenwave 15d ago •
The oscar teledo nanochess book is good, and pairs with dosbox. I recommend playing early levels of tis-100 to get your head into the asm mode before attempting that. Also, you could ask claude/gemini to teach you using the socratic method. You can transfer to arm easily enough once you have basics down.
2
u/Right-Beginning2651 13d ago
At first, everyone says this
7
u/Recycled5000 15d ago •
Suggest to try one of the educational assembly languages, like LC-3. Can learn most everything about how assembly works without getting bogged down in the historical aspects of x86 or arm.
5
u/DaveX64 15d ago •
I found the book 'x64 Assembly Language - Step by Step' by Jeff Duntemann was a pretty good place to start assembly under Linux with NASM assembler. Get the 4th edition.
3
u/Dannycuk1 14d ago •
Assembly language is a fantastic way of learning how a processor functions at the hardware level. You're working with registers and carry bits and will quickly learn why all the opcode instructions were developed in the first place.
Start slow with simple tasks before slowly developing sub-routines that can be called over and over again by the main program thread.
It really is a fascinating way to learn coding and once mastered it's by far the most efficient way to save clock cycles and optimise your code.
The down-side is you'll need to write a lot of code to achieve even basics tasks so it's very time consuming which is exactly why high-level code like C was developed. It's much faster to write C-code but the efficiency depends on the compiler and will never be as good as well written assembler.
An interesting challenge compare implementing a 16bit x 16bit multiple using positive integers using both assembler and C, if you want to make it more fun use an old 8-bit microprocessor architecture rather than a modern 16-bit or 32-bit machine.
Good luck.
2
u/gpit2286 15d ago •
armasm.com is good for 32-bit ARM assembly. 64 is a slightly different op codes, but would be a good first step.
2
u/Mediocre-Pumpkin6522 15d ago •
https://blog.smittytone.net/2022/06/19/get-started-with-arm-assembly-on-the-pi-pico/
One approach is to use a Raspberry Pi Pico. The 2040 is a Cortex-M MCU rather than a Cortex-A general purpose. Apple confuses things but I believe the M series would be labeled Cortex-A in the rest of the Arm world.
An advantage is you're not doing anything directly on the host, and the Pico allows you to blink LEDs and so forth for immediate gratification. At the bottom of the page there is a link to setting up the build system on a Mac.
As far as opcode mnemonics, ADD is fairly uniform but others may differ. Back in the day the Zilog Z80 was an improved Intel 8080 that was compatible. Intel had a copyright on their assembler, so Zilog had to come up with their own. like LD instead of MOV.
The link only hits on the basics but there is more detailed documentation and videos on the web.
2
u/StrikeTechnical9429 15d ago •
I can recommend to play with godbolt: enter some C code, like
for (int i = 0, S = 0; i < 10; i++) { S += i; }and then inspect assembly code produced.Yes, some knowledge of C is necessary.
2
u/myopinionisrubbish 15d ago •
The MicroChip AVR processors are pretty easy to learn. You can download a free IDE called Studio to assemble the code. The data sheet tells you how everything works. All the AVRs use the same instruction set, only difference is the amount of memory, the number of ports and the mix of peripherals available.
Print out the list of instructions and register map for easy reference. There are usually three or four registers which need to be set up to use peripherals, like timers and UARTs.
Microchip also has a lot of documentation with example code available.
I learned assembly coding on my own with these resources before YouTube was a thing. No tutorials at all. That was like 20 years ago. How time flys.
Buy an Arduino UNO board and a third party programmer like the OLIMEX AVR-ISP-MK2 so you have some hardware to test programs on. You can then also use the Arduino IDE for C++ programming. The UNO uses the ATMEGA 328P chip, so start with that data sheet.
2
u/SteveWyntontje 14d ago •
80386 programmer's reference manual is a useful piece to read.