utoa/printf: Support octal (%o)

This commit is contained in:
2025-07-15 08:18:57 +02:00
parent 9f33e36883
commit dc49e29019
3 changed files with 31 additions and 2 deletions

View File

@@ -246,6 +246,8 @@ printf:
je .rep_x
cmp byte [rdi + 1], 'b'
je .rep_b
cmp byte [rdi + 1], 'o'
je .rep_o
cmp byte [rdi + 1], 's'
je .rep_s
@@ -323,6 +325,20 @@ printf:
pop_regs
jmp .insertString
;--- '%o' ---;
.rep_o:
load_arg rsi
push_regs
mov rdi, rsi
mov rsi, 8
mov rdx, r12
mov rcx, r13
mov r8, 0
call utoa
mov rsi, rax
pop_regs
jmp .insertString
;--- '%s' ---;
.rep_s:
load_arg rsi