Kuninoto / 42_libasm

Introduction to ASM. Some libc functions implemented in x86_64 ASM with Intel Syntax

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libasm (42Porto - 42Cursus) ASM Logo 

Grade: 100/100

Overview

A few string manipulation functions and libc system call wrappers written in Assembly x86_64 with the Intel syntax

Installing and running the project:

1- Clone this repository

git clone https://github.com/Kuninoto/42_libasm

2- Navigate to libasm and run make

cd 42_libasm/libasm && make

3- make clean so that you don't keep those object files that you won't need anymore

make clean

4- Compile your programs with your new libasm.a

Example (C): cc -Wall -Wextra -Werror main.c libasm.a

Subject (v5): libasm en_subject

Makefile Available Targets:

make or make all - Makes libasm.a
make clean - Deletes all the resulting object files
make fclean - Deletes libasm.a and all the resulting object files
make re - Deletes everything (object files and libasm.a) and rebuilds libasm.a

Adding new functions to this library:

  • Add their prototypes to libasm.h
  • Add their source files to /libasm
  • Add their source file names to the "GENERAL" variable inside the Makefile
  • Rebuild the library with make re
To keep track of what's inside your resulting libasm.a run ar -t libasm.a

Useful links

You Can Learn Assembly in 10 Minutes (it’s easy)
How do I know what registers function parameters will be mapped on?
Syscalls(2) man page
Linux System Call Table for x86_64
x64 ASM Cheat Sheet
NASM tutorial
How does push and pop work in assembly
CPU Registers x86
Godbolt


Made by Nuno Carvalho (Kuninoto) | kuninoto@proton.me

About

Introduction to ASM. Some libc functions implemented in x86_64 ASM with Intel Syntax

License:GNU General Public License v3.0


Languages

Language:C 92.1%Language:Assembly 5.7%Language:Makefile 1.3%Language:Meson 0.8%Language:Emacs Lisp 0.1%