2019-03-23 22:26:46 +01:00
|
|
|
debug_init:
|
|
|
|
push bx
|
|
|
|
push dx
|
|
|
|
mov bx, 0x002E
|
|
|
|
mov dx, debug_reg_ir
|
|
|
|
call ivt_set
|
|
|
|
pop dx
|
|
|
|
pop bx
|
|
|
|
ret
|
|
|
|
|
2019-03-13 22:10:41 +01:00
|
|
|
; this kprints registers
|
2019-03-14 17:17:02 +01:00
|
|
|
; expect to be called as interrupt routine
|
|
|
|
debug_reg_ir:
|
2019-03-13 22:10:41 +01:00
|
|
|
push ss
|
|
|
|
push es
|
|
|
|
push ds
|
|
|
|
push di
|
|
|
|
push si
|
|
|
|
push bp
|
|
|
|
push sp
|
|
|
|
push dx
|
|
|
|
push cx
|
|
|
|
push bx
|
|
|
|
push ax
|
|
|
|
|
|
|
|
mov ax,cs
|
|
|
|
mov ds,ax
|
|
|
|
mov si,.fmt
|
|
|
|
call kprintf
|
|
|
|
|
|
|
|
pop ax
|
|
|
|
pop bx
|
|
|
|
pop cx
|
|
|
|
pop dx
|
|
|
|
pop sp
|
|
|
|
pop bp
|
|
|
|
pop si
|
|
|
|
pop di
|
|
|
|
pop ds
|
|
|
|
pop es
|
|
|
|
pop ss
|
|
|
|
iret
|
|
|
|
.fmt:
|
2019-03-14 17:17:02 +01:00
|
|
|
db "AX=%X BX=%X CX=%X DX=%X SP=%X BP=%X SI=%X DI=%X", 0x0A, 0x0D, "DS=%X ES=%X SS=%X IP=%X CS=%X FL=%X", 0
|