Ver código fonte

Move print(n)str from core to shell

These routines had hardcoded references to ACIA and didn't belong to the
core.
pull/10/head
Virgil Dupras 5 anos atrás
pai
commit
fc0cdede55
2 arquivos alterados com 35 adições e 35 exclusões
  1. +0
    -35
      parts/core.asm
  2. +35
    -0
      parts/shell.asm

+ 0
- 35
parts/core.asm Ver arquivo

@@ -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:


+ 35
- 0
parts/shell.asm Ver arquivo

@@ -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


Carregando…
Cancelar
Salvar