1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 09:48:05 +11:00

Move print(n)str from core to shell

These routines had hardcoded references to ACIA and didn't belong to the
core.
This commit is contained in:
Virgil Dupras 2019-04-16 19:45:05 -04:00
parent 453cf3d74a
commit fc0cdede55
2 changed files with 35 additions and 35 deletions

View File

@ -176,41 +176,6 @@ parseHexPair:
pop bc
ret
; print null-terminated string pointed to by HL
printstr:
push af
push hl
.loop:
ld a, (hl) ; load character to send
or a ; is it zero?
jr z, .end ; if yes, we're finished
call aciaPutC
inc hl
jr .loop
.end:
pop hl
pop af
ret
; print A characters from string that HL points to
printnstr:
push bc
push hl
ld b, a
.loop:
ld a, (hl) ; load character to send
call aciaPutC
inc hl
djnz .loop
.end:
pop hl
pop bc
ret
; Compares strings pointed to by HL and DE up to A count of characters. If
; equal, Z is set. If not equal, Z is reset.
strncmp:

View File

@ -123,6 +123,41 @@ shellLoop:
.prompt:
.db "> ", 0
; print null-terminated string pointed to by HL
printstr:
push af
push hl
.loop:
ld a, (hl) ; load character to send
or a ; is it zero?
jr z, .end ; if yes, we're finished
SHELL_PUTC
inc hl
jr .loop
.end:
pop hl
pop af
ret
; print A characters from string that HL points to
printnstr:
push bc
push hl
ld b, a
.loop:
ld a, (hl) ; load character to send
SHELL_PUTC
inc hl
djnz .loop
.end:
pop hl
pop bc
ret
printcrlf:
ld a, ASCII_CR
SHELL_PUTC