rdos/lib/print.asm
Nero dc5e437c2d Revert "Remove unused stuff"
debug rom still uses printf

This reverts commit a9fa3d355e.
2020-04-04 11:41:01 +00:00

33 lines
431 B
NASM

; important functions in this file: kprintf
; print a word
; in: ax
print16:
xchg ah,al
call print8
xchg ah,al
; print a byte
; in: al
print8:
push ax ; avoid destroying ah
push bx
xor bx, bx
aam 16 ; high nibble moved into ah, low nibble into al
add ax, 0x3030
push ax
xchg al, ah
call .nib
pop ax
call .nib
pop bx
pop ax
ret
.nib:
cmp al, 0x3a
jl .out
add al, 0x07
.out:
call putc
ret