rdos/lib/dump.asm

54 lines
668 B
NASM

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