c80eb0b21dFix stack alignment in printf; flushing buffer would have unaligned stack if format specifier wasn't %d (only .convertInt aligned the stack)
development
Kwarde2025-07-01 11:36:12 +02:00
9ea889dd12printf(): Fetch args smarter (fetch from memory, slower, but also less opcodes/compares, and convenient for future;less repeatability)Kwarde2025-06-29 12:08:19 +02:00
9982eabe7cprintf(): Always print full string instead of throwing an error; print printfBuff when full and start at index 0 againKwarde2025-06-27 18:57:54 +02:00
e49c203c34Prevent errors in make, use -p with mkdirKwarde2025-06-26 11:04:07 +02:00
61a1cb50d1printf() optimization: Use syscall and mov r14 to rax rather than calling print and strlen -- r14 used to contain wrong length: mistakenly increased r14 (and performed checks) for printfNBuffKwarde2025-06-25 21:57:01 +02:00
45a62dff93Remove fopen mode/open flags table comment in file.asm (was only there for convenience while creating fopen base)Kwarde2025-06-25 21:40:19 +02:00
c40ac31c1fDon't push/pop r11 in printf(), idk why I did that anymore but it's not neededKwarde2025-06-25 21:19:33 +02:00
9794c64cd5printf(): Don't push and pop rsi before/after itoa (rsi is modified anyway)Kwarde2025-06-25 20:52:52 +02:00
9d904555ebImprove printf() : Less jumps (cmovX), removal of finish_L/rbx modKwarde2025-06-25 20:48:53 +02:00
cef713db14Minor optimizations in printf() (stop using rbx and r13, use smarter checks instead + pop r11 correctly (prevent stack corruption))Kwarde2025-06-25 20:40:35 +02:00
d3b801a97bMerge branch 'development' of git.kwarde.com:Kwarde/klibc into developmentKwarde2025-06-25 16:24:37 +02:00
01e14d418aFIX: No longer allow exceeding printf buffer, instead print an error to stdout. Temporary fixKwarde2025-06-25 16:23:59 +02:00
e020fb15c1FIX: itoa() not saving rbxKwarde2025-06-25 16:23:02 +02:00
6bf73eb5edUpdate README (C lib -> C-like lib, since it doesn't mimic the true C library anymore)Kwarde2025-06-25 15:06:12 +02:00
3e8bcdeb01Get rid of gcc, adds exit()Kwarde2025-06-25 14:58:02 +02:00
36d21ca18bIgnore invalid specifiers in printf()Kwarde2025-06-25 14:40:01 +02:00
5ead6ebdb1Add support for '%%' in printf()Kwarde2025-06-25 14:21:46 +02:00
1e095bec77Add printf() comment, return length of printed messageKwarde2025-06-25 13:56:30 +02:00
d0769f6ffcAdd support for %c in printf()Kwarde2025-06-25 13:49:30 +02:00
74178a6a2dFIX: Loading arg from stack to wrong register (rsi->rdi) for %dKwarde2025-06-25 13:43:06 +02:00
266cb57d1cProper SYS V ABI use (don't restore rsi in itoa)Kwarde2025-06-25 13:31:48 +02:00
f5e1143138Fix issue in printf() with %d --needed to push+pop several registers before/after itoa() callKwarde2025-06-25 13:29:26 +02:00
4438abda11Dump current state of printf() (adding %d support), adds itoa()Kwarde2025-06-25 13:07:18 +02:00
1969294f02Use direct value for mode in fopen() instead of pointer -- mode is always 1 char so no need to store mode letters in memoryKwarde2025-06-25 10:15:21 +02:00
692c96512eReturn -22 (EINVAL) in fopen() if incorrect mode was suppliedKwarde2025-06-25 10:09:23 +02:00
06fef96cf4Fix return value comment for fwrite()Kwarde2025-06-25 10:03:57 +02:00
c4ce3212e7Assure fwrite() and fclose() only work if FD>=3, exit with -9 (EBADF) otherwiseKwarde2025-06-25 10:02:59 +02:00
3cbf9e8ce0Fix file.asm return value commentsKwarde2025-06-25 09:56:40 +02:00