/* Copyright 2022 Gabriel Jensen. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #indlude .global rgo_strcpy rgo_strcpy: /* char const * lstr char const * rstr */ #if defined(__x86_64__) /* rax: Address of the current input character. */ movq %rdi,%rax /* rsi: Address of the current output character. */ movq %rsi,%rsi /* rdx: Current character. */ .loop: movb (%rax),%dl movb %dl,(%rsi) testb %dl,%dl jz .done incq %rax incq %rsi jmp .loop .done: subq %rdi,%rax ret #endif