debug: Add stub for instruction decoding

This commit is contained in:
Nero 2020-05-19 18:26:22 +02:00
parent a31e574b3a
commit e60e49735c
7 changed files with 49 additions and 5 deletions

View file

@ -28,7 +28,20 @@ crlf: mov al, 0x0A
mov al, 0x0D
jmp putc
print16:
print_dl:
mov cl, 4
; repeat 2 times
call .c
.c: mov al, dl
shl dx, cl
shr al, cl
add al, 0x30
cmp al, 0x3a
jl putc
add al, 7
jmp putc
print_dx:
mov cl, 4
; this double-call is essentially a 4 times repeating loop
call .c1
@ -48,6 +61,19 @@ print16:
add al, 7
jmp putc
print_esbx:
push cx
push dx
mov dx, es
call print_dx
mov al, ':'
call putc
mov dx, bx
call print_dx
pop dx
pop cx
ret
; Read character
getc: xor ax, ax
int 0x16