Skip to content

AJamesGuy/Assembly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assembly Language Tutorial

A comprehensive, progressive guide to learning x86-64 assembly language from fundamentals to advanced topics, featuring theory, practical examples, exercises, and a quick reference guide.

Overview

This tutorial provides a complete learning system for assembly language with multiple learning modalities:

  • Theory – Detailed explanations of CPU architecture, registers, memory, and instruction sets
  • Working Examples – 5 complete, compilable programs with C test harnesses
  • Practice Exercises – 23 tiered exercises from beginner to advanced with solutions
  • Quick Reference – Cheat sheet for common instructions, patterns, and tools

Getting Started

Start Here: Read 00_TABLE_OF_CONTENTS.md for the full learning pathway and structure.

Quick Navigation

  1. New to assembly? Start with 01_Introduction.md
  2. Want examples immediately? See 20_Assembly_Examples.md or 22_Example_Programs.md
  3. Learning a specific topic? Refer to 00_TABLE_OF_CONTENTS.md for the file index
  4. Need a quick lookup? Use 24_Quick_Reference.md

What's Included

Foundation (7 files)

  • Introduction, CPU architecture, registers, number systems, memory, data types, addressing modes

Instruction Reference (5 files)

  • Instruction format, arithmetic, logical, comparison/jumps, and move instructions

Control Flow & Functions (3 files)

  • Loops, functions/procedures, and calling conventions (System V & Microsoft x64)

Advanced Topics (3 files)

  • Interrupts & system calls, advanced techniques (SIMD, optimization), debugging

Practical Content (2 files)

  • Common patterns and 9 detailed example programs

Exercises & Practice (4 files)

  • 23 exercises by difficulty, 5 complete working programs with test harnesses, detailed solutions, quick reference

Tools Required

To compile and run the examples, you'll need:

  • NASM (Netwide Assembler) – Assemble .asm files
  • GCC – Compile C test harnesses and link with assembly
  • GDB (optional) – Debug assembly code
  • Linux/Unix or WSL for Windows

Quick Setup (Linux/WSL)

sudo apt-get install nasm gcc gdb

Running Examples

All example programs in 22_Example_Programs.md include complete source code and compilation instructions. Typical workflow:

nasm -felf64 example.asm -o example.o
gcc example.o test_example.c -o test_example
./test_example

See the example files for specific compilation commands for each program.

Learning Pathway

Follow these steps for optimal learning:

  1. Learn theory – Study Part 1-4 files (01-07) for fundamentals
  2. Study instructions – Read Part 4-5 files (08-12) to understand instruction sets
  3. Understand control flow – Review Part 6 files (13-15) for practical code structure
  4. Learn with examples – Study Part 6-7 examples alongside theoretical content
  5. Practice – Work through exercises in 21_Exercises.md
  6. Check solutions – Review 23_Solutions.md for detailed explanations
  7. Experiment – Modify examples, create your own functions, test edge cases

File Index

File Topic Focus
00 TABLE OF CONTENTS Navigation & learning pathway
01 Introduction Overview & tools
02 CPU Architecture Fetch-execute, cache, privilege levels
03 Registers All register types & usage
04 Number Systems Binary, hex, conversion
05 Memory Model Stack, heap, segments
06 Data Types Byte through quadword
07 Addressing Modes All 7 modes with examples
08 Instruction Basics Format & encoding
09 Arithmetic Instructions ADD, SUB, MUL, DIV
10 Logical Instructions AND, OR, XOR, NOT, shifts
11 Comparison & Jumps CMP, TEST, conditional/unconditional
12 Move Instructions MOV, LEA, MOVSX/MOVZX, CMOV
13 Loops LOOP, manual loops, optimization
14 Functions & Procedures Stack frames, CALL/RET, recursion
15 Calling Conventions System V vs Microsoft x64
16 Interrupts & Syscalls SYSCALL, Linux system calls
17 Advanced Techniques SIMD, optimization, prefetch
18 Debugging GDB, tools, strategies
19 Common Patterns Useful code snippets
20 Assembly Examples 9 complete programs
21 Exercises 23 practice problems by difficulty
22 Example Programs 5 working programs with test harnesses
23 Solutions Detailed solutions with execution traces
24 Quick Reference Instruction tables, patterns, tools

Key Resources

Tips for Success

  • Type along – Don't just read; type out the code examples
  • Modify & test – Change the examples and observe the results
  • Use GDB – Debug your code to understand execution flow
  • Check disassembly – Use objdump -d to see compiled machine code
  • Do the exercises – Practice is essential for learning

About This Tutorial

This tutorial focuses on:

  • x86-64 architecture (64-bit Intel/AMD processors)
  • NASM assembler syntax (widely available, readable)
  • System V AMD64 ABI (Linux/Unix standard calling convention)
  • Practical, working code (all examples are compilable and testable)
  • Progressive difficulty (theory → examples → exercises → reference)

Next Steps

  1. Open 00_TABLE_OF_CONTENTS.md to see the complete structure
  2. Start with 01_Introduction.md or jump to a topic of interest
  3. Compile and run examples from 22_Example_Programs.md
  4. Work through the exercises in 21_Exercises.md
  5. Use 24_Quick_Reference.md as your coding reference

Happy learning! Assembly language is challenging but rewarding. Take your time with fundamentals, practice with examples, and don't be afraid to experiment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors