Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/osvegn/asm_mini_libc
https://github.com/osvegn/asm_mini_libc
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/osvegn/asm_mini_libc
- Owner: osvegn
- Created: 2023-12-04T02:53:49.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-12-04T23:49:15.000Z (12 months ago)
- Last Synced: 2023-12-05T00:36:07.413Z (12 months ago)
- Language: Assembly
- Size: 465 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Assembly mini libc
## Objectives
- Learn assembly language
- Create basic libc functions in assembly## Functions to create
- [x] strlen
- [x] strchr
- [x] memset
- [x] memcpy
- [x] strcmp
- [x] memmove
- [x] strncmp
- [ ] strcasecmp
- [x] rindex
- [x] strstr
- [ ] strpbrk
- [ ] strcspn## Documentation
### Registers
| 64-bit | 32-bit | 16-bit | 8-bit | USAGE |
|--------|--------|--------|-------|-------|
| RAX | EAX | AX | AH-AL | return value
| RBX | EBX | BX | BH-BL |
| RCX | ECX | CX | CH-CL | arg4
| RDX | EDX | DX | DH-DL | arg3
| RSI | ESI | SI | SIL | arg2
| RDI | EDI | DI | DIL | arg1
| RBP | EBP | BP | BPL |
| RSP | ESP | SP | SPL | stack pointer
| R8 | R8D | R8W | R8B | arg5
| R9 | R9D | R9W | R9B | arg6
| R10 | R10D | R10W | R10B |
| R11 | R11D | R11W | R11B |
| R12 | R12D | R12W | R12B |
| R13 | R13D | R13W | R13B |
| R14 | R14D | R14W | R14B |
| R15 | R15D | R15W | R15B |### Instructions
#### Data movement
- mov DEST, SRC
move SRC to DEST#### Condition
- cmp ELEM1, ELEM2
compare ELEM1 to ELEM2. Use a jmp condition to compare the result.#### Arithmetic
- inc VAR
increment variable by 1