From a05124885e0901e5a4f5fb4ce332ea1c49b85098 Mon Sep 17 00:00:00 2001 From: starnakin Date: Tue, 3 Sep 2024 10:44:54 +0200 Subject: [PATCH] opti: use xor instead mov 0 --- src/ft_strcmp.asm | 2 +- src/ft_strcpy.asm | 2 +- src/ft_strlen.asm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ft_strcmp.asm b/src/ft_strcmp.asm index 5f4ae56..63805f1 100644 --- a/src/ft_strcmp.asm +++ b/src/ft_strcmp.asm @@ -2,7 +2,7 @@ section .text global ft_strcmp ft_strcmp: - mov rcx, 0 + xor rcx, rcx loop: mov dl, [rsi + rcx] diff --git a/src/ft_strcpy.asm b/src/ft_strcpy.asm index b3d164e..fa2b42a 100644 --- a/src/ft_strcpy.asm +++ b/src/ft_strcpy.asm @@ -2,7 +2,7 @@ section .text global ft_strcpy ft_strcpy: - mov rcx, 0 + xor rcx, rcx loop: mov al, [rsi + rcx] diff --git a/src/ft_strlen.asm b/src/ft_strlen.asm index 82bef0b..891e933 100644 --- a/src/ft_strlen.asm +++ b/src/ft_strlen.asm @@ -2,7 +2,7 @@ section .text global ft_strlen ft_strlen: - mov rcx, 0 + xor rcx, rcx loop: cmp BYTE [rdi + rcx], 0 je out