i still dont know what im doing

This commit is contained in:
Nero 2020-03-01 16:43:23 +00:00
parent 4847eb4d88
commit bc238a3bf9
19 changed files with 203 additions and 1099 deletions

53
lib/dump.asm Normal file
View file

@ -0,0 +1,53 @@
dump:
push ax
push cx
push dx
push bx
mov al, 0x0A
call putc
mov al, 0x0D
call putc
mov cx, 4
.loop_line:
push cx
push bx
mov ax, bx
call print16
mov al, ':'
call putc
mov al, ' '
call putc
mov cx, 0x8
.loop_bin:
mov ax, [bx]
xchg al, ah
inc bx
inc bx
call print16
mov dl, ' '
call CONOUT
loop .loop_bin
pop bx
mov cx, 0x10
.loop_ascii:
mov dl, '.'
cmp byte [bx], 0x20
jc .print
cmp byte [bx], 0x80
jnc .print
mov dl, [bx]
.print:
inc bx
call CONOUT
loop .loop_ascii
pop cx
mov dl, 0x0A
call CONOUT
mov dl, 0x0D
call CONOUT
loop .loop_line
pop bx
pop dx
pop cx
pop ax
ret