Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vihlancevk/printf
Implementation of the standard print function in assembly language (nasm)
https://github.com/vihlancevk/printf
Last synced: 10 days ago
JSON representation
Implementation of the standard print function in assembly language (nasm)
- Host: GitHub
- URL: https://github.com/vihlancevk/printf
- Owner: vihlancevk
- Created: 2022-03-09T18:40:49.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-15T13:43:38.000Z (almost 3 years ago)
- Last Synced: 2023-09-04T18:25:21.883Z (over 1 year ago)
- Language: Assembly
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# printf
The function outputs a message with specifiers.
## Entry:
- message with specifiers (required parameter):
1) *%c* - outputs a character;
2) *%s* - outputs a string;
3) *%d* - outputs a decimal representation of a number;
4) *%b* - outputs a binary representation of a number;
5) *%o* - outputs an octal representation of a number;
6) *%x* - outputs the hexadecimal representation of a number;
7) *%%* - outputs a percentage.
- other parameters that are optional
## Note:
- parameters are passed through the stack from right to left
- the program does not clear the stack of arguments after its completion
- if the number of specifiers (except %) in the message is less than the number of optional parameters then the behavior of the function is undefined
## Exit:
the results of the function are transmitted via the RAX register
- RAX = the number of parameters recorded in the message - the function ended without errors
- RAX = -1 - the function ended with errors