Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
tiny-pf: tiny printf function for x86_64 about: this is a small implementation of printf function from libc but for x86_64 so i do not have to use any other library for my x86_64 projects :). It is pretty simple to use: 1. provide fd via rdi 2. provide format string via rsi 3. provide arguments via stack (reverse order) features: formats: %d for integers %c for characters %s for null terminated strings %b for boolean %% literal % alignment: %<sizeFORMAT left-align %>sizeFORMAT right-align size can be a literal like %<10d (left 10 padding integer) or a variable padding given via argument on the stack %<#d notes: - no thread safe - 4096 b buffer (do not worry about overflow tho) - depends on xvargs library - the caller is responsable for adding $N to rsp after calling - if TINY_PF_LONG_BOOL_FMT macro is defined, then the boolean values will be 'true' and 'false', 'T' or 'F' will be used otherwise