os-z80/libs/strings.z80

12 lines
150 B
Z80 Assembly
Raw Normal View History

2023-11-05 10:33:57 -06:00
; Get the length of the string pointed to by HL in BC
.global strlen
strlen:
ld bc, 0
strlen_loop:
ld a, (hl)
cp 0
ret z
inc bc
inc hl
jp strlen_loop