2019-03-30 00:48:18 +01:00
|
|
|
; important functions in this file: kprintf
|
|
|
|
|
2019-03-31 14:22:42 +02:00
|
|
|
; print a byte
|
2019-03-30 00:48:18 +01:00
|
|
|
; in: al
|
2019-03-31 14:22:42 +02:00
|
|
|
print8:
|
|
|
|
push ax ; avoid destroying ah
|
2019-03-30 00:48:18 +01:00
|
|
|
push bx
|
|
|
|
mov bx, 0x0000
|
2019-03-31 14:22:42 +02:00
|
|
|
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
|
2019-03-30 00:48:18 +01:00
|
|
|
pop bx
|
|
|
|
pop ax
|
|
|
|
ret
|
2019-03-31 14:22:42 +02:00
|
|
|
.nib:
|
2019-03-30 00:48:18 +01:00
|
|
|
cmp al, 0x3a
|
2019-03-31 14:22:42 +02:00
|
|
|
jl .out
|
2019-03-30 00:48:18 +01:00
|
|
|
add al, 0x07
|
2019-03-31 14:22:42 +02:00
|
|
|
.out:
|
|
|
|
mov ah, 0x0e
|
|
|
|
int 0x10
|
2019-03-30 00:48:18 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
; print a word
|
|
|
|
; in: ax
|
|
|
|
print16:
|
|
|
|
xchg ah,al
|
|
|
|
call print8
|
|
|
|
xchg ah,al
|
|
|
|
call print8
|
|
|
|
ret
|