Skip to content

x86-64 assembly implementation of common C standard library functions

Notifications You must be signed in to change notification settings

MrMsnawi/libasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libasm

A library of standard C functions re-implemented in x86-64 assembly (NASM).

Functions

Function Prototype Description
ft_strlen size_t ft_strlen(const char *s) Returns the length of a string
ft_strcpy char *ft_strcpy(char *dst, const char *src) Copies a string to a destination buffer
ft_strcmp int ft_strcmp(const char *s1, const char *s2) Compares two strings lexicographically
ft_write ssize_t ft_write(int fd, const void *buf, size_t count) Writes to a file descriptor (sets errno on error)
ft_read ssize_t ft_read(int fd, void *buf, size_t count) Reads from a file descriptor (sets errno on error)
ft_strdup char *ft_strdup(const char *s) Allocates and returns a duplicate of a string

Build

make        # builds libasm.a
make clean  # removes object files
make fclean # removes object files and library
make re     # full rebuild

Usage

Include the header and link against the library:

#include "libasm.h"
cc main.c -L. -lasm -o main

Requirements

  • NASM (Netwide Assembler)
  • GCC or compatible C compiler
  • Linux x86-64

About

x86-64 assembly implementation of common C standard library functions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published