From 7d559d61da502be8e8b89ee38f2b3af974b8c284 Mon Sep 17 00:00:00 2001 From: Kwarde Date: Thu, 10 Jul 2025 00:01:26 +0200 Subject: [PATCH] Fix strcmp() behaviour (ret=-1 --> ret=0) --- src/string.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/string.asm b/src/string.asm index 6f27b48..b5ba02a 100644 --- a/src/string.asm +++ b/src/string.asm @@ -118,7 +118,7 @@ strclr: ; rdx* Length of str1 ; r8* Backup for rdi strcmp: - mov rax, -1 + xor rax, rax cmp byte [rdi], EOS je .equal cmp byte [rsi], EOS @@ -139,7 +139,7 @@ strcmp: .equal: cmp byte [rsi], EOS jne .quit - mov rax, -1 + xor rax, rax .quit: ret