The libasm project is an introduction to assembly language programming. The goal is to write a library of basic functions in x86-64 assembly and understand how low-level programming works. This project will challenge you to think differently about how code is executed at the hardware level and how high-level languages like C interact with assembly.
- Write a library of functions in x86-64 assembly.
- Learn the basics of assembly language, including registers, instructions, and memory management.
- Understand how to call assembly functions from C programs.
- Implement common functions like
strlen
,strcpy
,strcmp
, and more in assembly. - Gain a deeper understanding of how low-level programming works.
- NASM: Netwide Assembler for compiling assembly code.
- GCC: GNU Compiler Collection for compiling C code.
- Make: For automating the build process.
- Basic knowledge of C programming and low-level concepts (registers, stack, etc.).
The project consists of implementing a set of functions in assembly and creating a static library (libasm.a
) that can be linked with C programs. The functions to implement are:
- ft_strlen: Calculate the length of a string.
- ft_strcpy: Copy a string from source to destination.
- ft_strcmp: Compare two strings.
- ft_write: Write to a file descriptor (similar to the
write
system call). - ft_read: Read from a file descriptor (similar to the
read
system call). - ft_strdup: Duplicate a string (similar to the
strdup
function).
- ft_atoi_base: Convert a string to an integer with a given base.
- ft_list_push_front: Add an element to the beginning of a linked list.
- ft_list_size: Calculate the size of a linked list.
- ft_list_sort: Sort a linked list.
- ft_list_remove_if: Remove elements from a linked list based on a condition.