Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libasm

A 42 project: rewriting standard C library functions in 64-bit assembly.

Supported Platforms

Arch OS Format Assembler
AMD macOS macho64 nasm
AMD Linux elf64 nasm
ARM macOS macho64 clang/as
ARM Linux elf64 clang/as

The Makefile auto-detects architecture (uname -m) and OS (uname -s).

Build

make        # build libasm.a
make bonus  # build with bonus functions
make test   # build and link test binary
make clean  # remove object files
make fclean # remove objects + library + test binary
make re     # fclean + all

Run Tests

make test
./tests/test.exe            # run all tests
./tests/test.exe ft_strlen  # run a single test

Mandatory Functions

Function Description
ft_strlen String length
ft_strcpy String copy
ft_strcmp String compare
ft_write Write syscall with errno handling
ft_read Read syscall with errno handling
ft_strdup String duplicate (calls malloc)

Bonus Functions

Function Description
ft_atoi_base String to int in arbitrary base
ft_list_push_front Push node to front of linked list
ft_list_size Count linked list elements
ft_list_sort Sort linked list (bubble sort)
ft_list_remove_if Remove matching nodes from list

Project Structure

srcs/
├── amd/
│   ├── elf64/      # x86_64 Linux (nasm, Intel syntax)
│   └── macho64/    # x86_64 macOS (nasm, Intel syntax)
└── arm/
    ├── elf64/      # ARM64 Linux  (GNU as)
    └── macho64/    # ARM64 macOS  (Apple as)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages