diff --git a/kernel/debug.asm b/kernel/debug.asm index 76fa22c..703e948 100644 --- a/kernel/debug.asm +++ b/kernel/debug.asm @@ -14,8 +14,27 @@ isr_debug: push ax call printf - db "AX=%X BX=%X CX=%X DX=%X SP=%X BP=%X SI=%X DI=%X", 0x0A, 0x0D - db "DS=%X ES=%X SS=%X IP=%X CS=%X FL=%X", 0x0A, 0x0D, 0 + db "AX=%X BX=%X CX=%X DX=%X", 0x20 + db "SP=%X BP=%X SI=%X DI=%X", 0x0A, 0x0D + db "DS=%X ES=%X SS=%X IP=%X CS=%X", 0x20, 0 + + mov bp, sp + mov bx, [ss:bp+26] + mov si, .flags + mov cx, 0x0010 +.loop: + mov al, [cs:si] + inc si + test bx, 0x8000 + jnz .write + mov al, '-' +.write: + sal bx, 1 + call putc + loop .loop + + call printf + db 0x0A, 0x0D, 0 pop ax pop bx @@ -28,4 +47,7 @@ isr_debug: pop ds pop es pop ss - iret \ No newline at end of file + iret +.flags: + ; 16 letters for each bit in flags register + db "++++ODITSZ+A+P+C" \ No newline at end of file