mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-20 22:28:05 +11:00
22 lines
354 B
NASM
22 lines
354 B
NASM
|
; Copy string from (HL) in (DE), that is, copy bytes until a null char is
|
||
|
; encountered. The null char is also copied.
|
||
|
; HL and DE point to the char right after the null char.
|
||
|
strcpyM:
|
||
|
ld a, (hl)
|
||
|
ld (de), a
|
||
|
inc hl
|
||
|
inc de
|
||
|
or a
|
||
|
jr nz, strcpyM
|
||
|
ret
|
||
|
|
||
|
; Like strcpyM, but preserve HL and DE
|
||
|
strcpy:
|
||
|
push hl
|
||
|
push de
|
||
|
call strcpyM
|
||
|
pop de
|
||
|
pop hl
|
||
|
ret
|
||
|
|