Skip to content

Romulo-Moraes/Assembly-Toolkit

Repository files navigation

A repository to support the learning on Low-level programming using the Assembly language

The Assembly Toolkit is a compilation of knowledge and ideas related to Assembly language, designed to help anyone to learn the fundamentals of this low-level technology. This repository covers various topics, including opcodes, memory segments, Assembly-C interoperability, and much more.

Repository structure

The contents of this repository are organized by topics related to Assembly language. Each topic is identified by a number and a name in the source tree. Below each topic, you will find descriptions, each accompanied by a button that redirects you to its content.

Opcodes

In the opcode section, we discuss the smallest unit of a computer program, which, when combined with other units, forms a complete program that can be executed directly by the CPU of our computer.


You can click here to be redirected to the Opcodes section.

Registers

Here, we will explore in detail what registers are and how they work. The register bank is a key component in modern CPU designs, enabling us to manage data, make system calls, operate in memory segments, and more.


You can click here to be redirected to the Registers section.

Memory segments

The memory segments are a virtual division that every program running on a machine must have. The segments have their own roles, such as storing read-only data, storing uninitialized data, storing the program instructions and so on.


You can click here to be redirected to the Memory segments section.

System calls

System calls are interfaces established by the operating system that enable user-space programs to request and manipulate resources that are exclusively accessible by the kernel. In this section, we will explore how these calls work and how to execute them using registers.

You can click here to be redirected to the System calls section.

Jumps

Jumps are essential components of modern computers. Instructions that perform jumps enable programs to create conditional structures, such as loops, if/else statements, and switches. These jumps are typically based on the values of the RFLAGS register. This section will explain everything you need to know about this important register and how to execute jumps effectively.


You can click here to be redirected to the Jumps section.

Arithmetic

The primary function of a computer is to perform calculations. This section will cover the basics of arithmetic operations in low-level programming, including addition, multiplication, division, and subtraction.


You can click here to be redirected to the Arithmetic section.

Stack

The stack is the most frequently used memory segment during program execution. In languages such as C, all variables declared within a function are stored in this segment. Additionally, the stack manages function calls, arguments, and other related operations.


You can click here to be redirected to the Stack section.

Functions

In this section, we will explore how to create and utilize functions and procedures in low-level programming. By mastering these concepts, you will gain a deeper understanding of their implementation in languages like C and other compiled languages.


You can click here to be redirected to the Functions section.

Arrays

The arrays section provides information on creating and manipulating arrays in low-level programming. It explains memory allocation and the calculations required to access array indices. As fundamental data structures, arrays are essential for software development.


You can click here to be redirected to the Arrays section.

Macros

Macros are a set of instructions that affect the assembler's preprocessor. With macros, you can assign values to symbols, create blocks of instructions, and invoke them like functions in C, among other capabilities.


You can click here to be redirected to the Macros section.

Solutions

The solutions section consists of assembly source code files for the NASM assembler, which replicate functionalities from C programming language functions. This provides insight into how software is constructed from a low-level perspective. Examples of functions created include strlen(), strcmp(), and atoi(), among others.


You can click here to be redirected to the Solutions section.

Useful opcodes

This section is basically a list of opcodes that have not been introduced by any section of the repository, however, they can make a difference while we are writing some bits.

This section lists opcodes that have not been introduced elsewhere in the repository, yet they can significantly impact our bit writing process.


You can click here to be redirected to the Useful opcodes section.

Assembly-C interoperability

Despite being two distinct languages, Assembly and C can collaborate effectively, leveraging their unique strengths to address tasks that benefit from both technologies.


You can click here to be redirected to the Assembly-C interoperability section.

PIC

Position Independent Code (PIC) is advantageous because it does not rely on fixed memory addresses for reading, writing data, or jumping to procedures. In contrast, Position Dependent software can cause issues during loading or linking with a C program.


You can click here to be redirected to the PIC section.

Callbacks

Like C, JavaScript, and Python, Assembly language also supports a form of callbacks that can help create more flexible programs. By moving a memory address into a register, this address can be used for jumping to or calling its associated function.


You can click here to be redirected to the Callbacks section.

About

Assembly toolkit for Nasm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published