From 7054061734f4ef2333b2db77825e67657d8458a2 Mon Sep 17 00:00:00 2001 From: Kwarde Date: Wed, 25 Jun 2025 11:42:44 +0200 Subject: [PATCH] Working '%s' for printf() (args in stack yet untested) --- console.asm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/console.asm b/console.asm index 9492b34..7d1250b 100644 --- a/console.asm +++ b/console.asm @@ -55,7 +55,7 @@ printf: xor r10, r10 lea r11, [rel printfBuff] .makeStr: - cmp byte [rdi], 0 + cmp byte [rdi], 0x0 je .finish cmp byte [rdi], '%' je .replaceArg @@ -63,8 +63,8 @@ printf: mov byte [r11], r12b jmp .continue .replaceArg: - cmp byte [rdi+1], 0 - je .finish + cmp byte [rdi+1], 0x0 + je .continue cmp byte [rdi+1], 'd' je .rep_d cmp byte [rdi+1], 's' @@ -114,7 +114,8 @@ printf: .s0f: inc r10 pop rdi - inc rdi + add rdi, 2 + jmp .makeStr .continue: inc rdi inc r11