mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 16:28:06 +11:00
stdio: little tweaks
This commit is contained in:
parent
e01ee170cb
commit
921a109749
@ -59,12 +59,10 @@ printstr:
|
|||||||
pop af
|
pop af
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; print A characters from string that HL points to
|
; print B characters from string that HL points to
|
||||||
printnstr:
|
printnstr:
|
||||||
push bc
|
push bc
|
||||||
push hl
|
push hl
|
||||||
|
|
||||||
ld b, a
|
|
||||||
.loop:
|
.loop:
|
||||||
ld a, (hl) ; load character to send
|
ld a, (hl) ; load character to send
|
||||||
call stdioPutC
|
call stdioPutC
|
||||||
@ -77,22 +75,24 @@ printnstr:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
printcrlf:
|
printcrlf:
|
||||||
|
push af
|
||||||
ld a, ASCII_CR
|
ld a, ASCII_CR
|
||||||
call stdioPutC
|
call stdioPutC
|
||||||
ld a, ASCII_LF
|
ld a, ASCII_LF
|
||||||
call stdioPutC
|
call stdioPutC
|
||||||
|
pop af
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; Print the hex char in A
|
; Print the hex char in A
|
||||||
printHex:
|
printHex:
|
||||||
push af
|
push bc
|
||||||
push hl
|
push hl
|
||||||
ld hl, STDIO_HEX_FMT
|
ld hl, STDIO_HEX_FMT
|
||||||
call fmtHexPair
|
call fmtHexPair
|
||||||
ld a, 2
|
ld b, 2
|
||||||
call printnstr
|
call printnstr
|
||||||
pop hl
|
pop hl
|
||||||
pop af
|
pop bc
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; Print the hex pair in HL
|
; Print the hex pair in HL
|
||||||
|
Loading…
Reference in New Issue
Block a user