Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nyuuuukie/asm-library
Reproduction of some C standard functions used for working with C-style strings and lists in assembler (nasm)
https://github.com/nyuuuukie/asm-library
42ecole 42projects libasm
Last synced: 5 days ago
JSON representation
Reproduction of some C standard functions used for working with C-style strings and lists in assembler (nasm)
- Host: GitHub
- URL: https://github.com/nyuuuukie/asm-library
- Owner: nyuuuukie
- Created: 2021-01-12T18:53:24.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-06-03T13:04:25.000Z (over 3 years ago)
- Last Synced: 2023-09-17T19:35:49.794Z (about 1 year ago)
- Topics: 42ecole, 42projects, libasm
- Language: Assembly
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Asm-library
### _Reproduction of some C standard functions used for working with C-style strings and lists in assembler (NASM)_## Description:
Basic part of the lib contains the following functions:```c
size_t ft_strlen(const char *str);char *ft_strdup(const char *str);
char *ft_strcpy(char *dst, const char *src);
ssize_t ft_read(int fd, void *buffer, size_t length);
int ft_strcmp(const char *str1, const char *str2);
ssize_t ft_write(int fd, const void *buffer, size_t length);
```
Additional part uses the following struct:
```c
typedef struct s_list
{
void *data;
struct s_list *next;
} t_list;
```
* Field `data` can store any type
* Field `next` refers to the next element of the listIt also contain these functions to work with the list:
```c
int ft_atoi_base(char *str, char *base);int ft_list_size(t_list *begin_list);
void ft_list_push_front(t_list **begin_list, void *data);
void ft_list_sort(t_list **begin_list, int (*cmp)());
void ft_list_remove_if(t_list **begin_list, void *data, int (*cmp)(), void (*free_ctl)(void *));
```
## Creation:
Use **`make`** or **`make -C `** to compile basic part of a lib.
If you want create library with additional part, you should use **`make bonus`**## Using examles:
Compiling with .c/.o/.s files:
* `gcc test.c -L -lasm -I `* `gcc test.o /libasm.a`
## Run test:
Use **`make run`** or **`make runb`** to compile library with test main function.
To run test type **`./a.out`** and pass them 2 or 3 args:
* `./a.out "hello"` will test all basic functions except strcmp* `./a.out "hello" "world"` will test all basic functions including strcmp