1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-07-23 03:00:19 +10:00
collapseos/apps/lib/util.asm
Virgil Dupras 8d46895dd3 lib/parse: decimal ending with a whitespace are now valid
Also, make empty strings be parsed as invalid by parseDecimal.
2019-11-13 22:10:06 -05:00

29 lines
420 B
NASM

; Sets Z is A is ' ' or '\t'
isSep:
cp ' '
ret z
cp 0x09
ret
; 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