Skip to content

Latest commit

 

History

History
85 lines (73 loc) · 1.86 KB

README.md

File metadata and controls

85 lines (73 loc) · 1.86 KB

libasm

Kendrick Lamar

libasm is a project to implement standard library functions in C on Assembly x64/x86. As for may 2024 I've implemented only these functions:
strlen, strcpy, strcmp, strdup, read, write

Contents

Installation

MacOS

make

Testing

make test

Use as library

Before including this dynamic lib to your C file, please make sure that in Makefile you added new target for compilation.

#include "libasm.h"

int main(){
    char *str = "Hello!";
    size_t sz = ft_strlen(str);
    printf("%zu\n", sz);
    return 0;
}

Linux

Not working now. Because Linux-typed OS has another asm syntax. Will add asm later for Linux
Everything is the same as in MacOS, because Makefile does it for you.

make

Testing on Linux

make test

Use as library on Linux

Before including this dynamic lib to your C file, please make sure that in Makefile you added new target for compilation.

#include "libasm.h"

int main(){
    char *str = "Hello!";
    size_t sz = ft_strlen(str);
    printf("%zu\n", sz);
    return 0;
}

Docker

Not working now. Because Linux-typed OS has another asm syntax. Will add asm later for Linux
By default container's image is ubuntu:latest

make containerized

Introduction to Assembly x64/x86

Sections

Registers

Instructions

Opcodes

nasm