Ecole 42 project — reimplementing standard C library functions in x86-64 Assembly.
The goal is to understand how the machine works at the lowest level: registers,
the System V AMD64 ABI calling convention, memory addressing, and how everyday
C functions are actually built without any C allowed. Pure .s files compiled
with NASM into a static library. Syscall errors must be properly handled and
errno must be set accordingly.
| Function | Reimplements |
|---|---|
ft_strlen |
strlen(3) |
ft_strcpy |
strcpy(3) |
ft_strcmp |
strcmp(3) |
ft_write |
write(2) |
ft_read |
read(2) |
ft_strdup |
strdup(3) |
ft_calloc |
calloc(3) |
# Compile the library
make
# Run test suite
make test
./test_libasm
# Clean objects only
make clean
# Clean everything (objects + library + tests)
make fclean
# Rebuild everything
make relibasm/
├── Makefile
├── main.c
├── include/
│ └── libasm.h
└── src/
├── ft_strlen.s
├── ft_strcpy.s
├── ft_strcmp.s
├── ft_write.s
├── ft_read.s
├── ft_strdup.s
└── ft_calloc.s
- Assembler: NASM
- Syntax: Intel
- Format: ELF64 (Linux x86-64)
- Inline ASM: not allowed — only
.sfiles - Flag:
-no-pieis forbidden - Calling convention: System V AMD64 ABI