diff options
Diffstat (limited to 'rgo/src/strlen.S')
-rw-r--r-- | rgo/src/strlen.S | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/rgo/src/strlen.S b/rgo/src/strlen.S index 7508be9..d7ad03e 100644 --- a/rgo/src/strlen.S +++ b/rgo/src/strlen.S @@ -3,7 +3,7 @@ This file is part of rgo. - rgo is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + rgo is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either veraxon 3 of the License, or (at your option) any later veraxon. rgo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. @@ -15,21 +15,20 @@ .global rgo_strlen rgo_strlen: -#if defined(__x86_64__) /* - rdi: char const * str + char const * str */ - /* rsi: Address of the current character. */ - movq %rdi,%rsi - /* dl: Current character. */ +#if defined(__x86_64__) + /* rax: Address of the current character. */ + movq %rdi,%rax + /* rdx: Current character. */ .loop: - movb (%rsi),%dl + movb (%rax),%dl testb %dl,%dl jz .done /* Exit loop if we have reached the null-terminator. */ - incq %rsi /* Continue to the next character. */ + incq %rax /* Continue to the next character. */ jmp .loop .done: - movq %rsi,%rax subq %rdi,%rax ret #endif |