1
0
mirror of https://gitlab.os-k.eu/os-k-team/kvisc.git synced 2023-08-25 14:05:46 +02:00
kvisc/ka/crt/str/strlen.k

22 lines
334 B
Plaintext
Raw Normal View History

2019-05-30 12:44:56 +02:00
; The OS/K Team licenses this file to you under the MIT license.
2019-05-29 19:05:06 +02:00
; See the LICENSE file in the project root for more information.
2019-05-22 18:39:46 +02:00
2019-05-29 18:26:28 +02:00
;
2019-05-30 18:31:50 +02:00
; int strnlen(char *, int)
2019-05-29 18:26:28 +02:00
;
2019-05-30 18:31:50 +02:00
strnlen:
2019-05-30 12:19:38 +02:00
mov rcx, ax1
2019-06-13 22:20:35 +02:00
rep.nz scasb ax0, 0
mov rax, ax1
sub rax, rcx
ret
2019-05-30 18:31:50 +02:00
2019-06-13 22:20:35 +02:00
;
; int strlen(char *)
;
strlen:
mov ax1, STRLEN_MAX
jmp strnlen
2019-05-29 18:26:28 +02:00