debug ISR: display flags

This commit is contained in:
Nero 2019-05-02 21:06:02 +00:00
parent 9b1c54f5d3
commit dab565ee41

View File

@ -14,8 +14,27 @@ isr_debug:
push ax push ax
call printf call printf
db "AX=%X BX=%X CX=%X DX=%X SP=%X BP=%X SI=%X DI=%X", 0x0A, 0x0D db "AX=%X BX=%X CX=%X DX=%X", 0x20
db "DS=%X ES=%X SS=%X IP=%X CS=%X FL=%X", 0x0A, 0x0D, 0 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 ax
pop bx pop bx
@ -28,4 +47,7 @@ isr_debug:
pop ds pop ds
pop es pop es
pop ss pop ss
iret iret
.flags:
; 16 letters for each bit in flags register
db "++++ODITSZ+A+P+C"