The aim of this project is to get familiar with assembly language.
-
The project is written in
64 bits
ASM, compiled with NASM -
It follows the
Intel
syntax -
The following functions are rewritten in assembly:
ft_strlen
: calculate the length of a stringft_strcpy
: copy a stringft_strcmp
: compare two stringsft_write
: write to a file descriptorft_read
: read from a file descriptorft_strdup
: duplicate a string
-
Errors
during syscalls need to be checked andErrno
to be set properly
- You can check my learnings on assembly on this wiki page
Disclaimer: This repo provides two versions (Linux & MacOS), due to differences between these two operation systems. Choose the version to test based on your OS.
Run the following commands to test:
$ cd Desktop && git clone https://github.com/qingqingqingli/libasm.git
# for linux
$ cd libasm/linux_libasm
$ make && gcc -no-pie main.c libasm.a && ./a.out
# for macOS
$ cd libasm/mac_libasm
$ make && gcc main.c libasm && ./a.out