A minimalist implementation of the standard C library functions in x86-64 assembly language. This project provides low-level implementations of common string and memory manipulation functions.
| Category | Functions |
|---|---|
| String Operations | strlen, strchr, strrchr, strcmp, strncmp, strcasecmp, strstr, strpbrk, strcspn, strfry |
| Memory Operations | memset, memcpy, memmove, memfrob |
| Other Utilities | ffs (find first set bit) |
- strlen: Calculate the length of a string
- strchr/strrchr: Locate character in string (first/last occurrence)
- strcmp/strncmp: Compare strings (full/n characters)
- strcasecmp: Case-insensitive string comparison
- strstr: Locate a substring
- strpbrk: Search a string for any of a set of characters
- strcspn: Get span until character in string
- strfry: Randomize a string
- memset: Fill memory with a constant byte
- memcpy: Copy memory area
- memmove: Copy memory area with overlap handling
- memfrob: Frobnicate (encrypt) a memory area
- ffs: Find first bit set in a word
# Build the shared library
make
# Clean object files
make clean
# Full clean (remove objects and binary)
make fclean
# Rebuild from scratch
make re
# Run tests
make testOnce compiled, you can use the library by preloading it:
LD_PRELOAD=./libasm.so your_programOr link it directly during compilation:
gcc -o your_program your_source.c -L. -lasm- NASM assembler
- GCC compiler
- Linux environment (x86-64)
All functions are written in x86-64 assembly language following the System V AMD64 ABI calling convention, where:
- First integer/pointer argument: RDI
- Second integer/pointer argument: RSI
- Third integer/pointer argument: RDX
- Return value: RAX
This project is part of an EPITECH school assignment.