Files
2026-11-11 11:25:56 +01:00

35 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# libasm
- public link : https://gitea.hugulumu.com/42/42_EXT_02_libasm
- `apt install nasm build-essential`
## ressources
- luke's project : https://github.com/LuckyLaszlo/libasm
- **tutos intro :**
- [linuxdoc.org](https://www.linuxdoc.org/HOWTO/Assembly-HOWTO.html) (1461 words) : démarrage rapide : premiers pas concrets, outils (NASM/GAS, ld, gdb), syntaxes (Intel vs AT&T), appels système x86-64, premier programme et débogage.
- [LilSuperUser](https://github.com/LilSuperUser/x86_64-asm-tutorials/blob/main/README.md) (3471 words) : démarrage complet et progressif : d'abord la compréhension du CPU, de l'OS et de l'exécutable (ELF, linking, chargement). Puis la pratique avec syscalls, interop C, GDB/objdump/strace.
- [cs.lmu.edu](https://cs.lmu.edu/~ray/notes/nasmtutorial/) (6454 words) : une fois les bases acquises : tutoriel NASM complet, commandes détaillées, conventions d'appel, SIMD, frames de pile, multi-OS.
- **doc :**
- NASM : https://www.nasm.us/docs.html
- Intel SDM (Software Developer's Manual) : https://intel.github.io/SDM/sdm.html
- **aside - security training :**
- https://opensecuritytraining.info/Training.html
- https://ost2.fyi/
## instructions
- [ ] You must write 64-bit assembly. Beware of the "calling convention".
- [ ] You can’t do inline ASM, you must do ’.s’ files.
- [ ] You must compile your assembly code with nasm.
- [ ] You must use the Intel syntax, not the AT&T syntax.
- [ ] You must submit a main function that will test your functions and compile with your library to demonstrate that it is functional.
- [ ] You must check for errors during syscalls and handle them properly when needed.
- [ ] Your code must set the variable errno properly (you are allowed to call the extern \_\_\_error or errno_location).
- [ ] ft_strlen (man 3 strlen)
- [ ] ft_strcpy (man 3 strcpy)
- [ ] ft_strcmp (man 3 strcmp)
- [ ] ft_write (man 2 write)
- [ ] ft_read (man 2 read)
- [ ] ft_strdup (man 3 strdup, you can call to malloc)