diff --git a/string.asm b/string.asm index eba96bc..488be1f 100644 --- a/string.asm +++ b/string.asm @@ -25,23 +25,24 @@ strcpy: push rbp mov rbp, rsp + mov r11, rdi xor rax, rax xor rcx, rcx .loop: cmp byte [rsi], 0x0 je .0f mov r10b, byte [rsi] - mov byte [rdi], r10b + mov byte [r11], r10b inc rsi - inc rdi + inc r11 inc rcx jmp .loop .0f: - mov byte [rdi], 0x0 + mov byte [r11], 0x0 cmp rcx, 0 - jne .quit - xor rax, rax + je .quit + mov rax, rdi .quit: leave