In this comprehensive tutorial, you will learn the fundamentals of writing 64-bit assembly language, an essential skill for understanding low-level programming and computer architecture. While the primary focus is on 64-bit assembly, much of the knowledge and techniques discussed here can also be applied to 32-bit systems, making this tutorial versatile for various use cases.
This tutorial is specifically tailored for Linux-based environments, ensuring you gain hands-on experience with tools and practices common to this platform. However, if you are using Windows, you can follow along by setting up a Linux-like environment through WSL (Windows Subsystem for Linux) or Cygwin.
To get the most out of this tutorial, you should already have a basic understanding of a compiled programming language such as C, C++, or Rust. These languages will provide a foundation for grasping the concepts and syntax of assembly language, as they share many underlying principles. By the end of this tutorial, you will have a solid understanding of 64-bit assembly and be able to apply it effectively in your projects.
- Installation
- The
exit
system call - Hello world
- Calling from C
- Registers
- Machine code β
- Basic Arithmetic β
- Labels and Unconditional Jumps β
- Flags, Comparisons and Conditional Jumps β
- Logical and Bitwise Operations β
- Data Types, Memory Addressing and the
.data
Section β - The Stack β
- The
call
instruction β - Calling External Functions β
- Using the Heap β
- Special
mov
instructions β - Arithmetics part 2 β
- Manipulating Strings β
- Floating point arithmetic β
- NASM local labels β