Save/restore rdi to r10 instead of stack in strcat(),puts()

This commit is contained in:
2025-06-24 15:06:21 +02:00
parent f4162ed21a
commit f10b2f3c88
2 changed files with 4 additions and 8 deletions

View File

@ -27,11 +27,9 @@ puts:
push rbp
mov rbp, rsp
push rdi
sub rsp, 8
mov r10, rdi
call print
add rsp, 8
pop rdi
mov rdi, r10
mov rax, 1
mov rdi, 1
mov rsi, NL

View File

@ -54,13 +54,11 @@ strcat:
push rbp
mov rbp, rsp
push rdi
sub rsp, 8
mov r10, rdi
call strlen
add rdi, rax
call strcpy
add rsp, 8
pop rax
mov rax, r10
leave
ret