rdos/kernel/debug.asm

53 lines
792 B
NASM
Raw Normal View History

2019-05-02 22:12:45 +02:00
; this prints registers
; expect to be called as interrupt routine
2019-05-02 22:12:45 +02:00
isr_debug:
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
2019-05-02 22:12:45 +02:00
call printf
2019-05-02 23:06:02 +02:00
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
2019-03-13 22:10:41 +01:00
pop ax
pop bx
pop cx
pop dx
pop sp
pop bp
pop si
pop di
pop ds
pop es
pop ss
2019-05-02 23:06:02 +02:00
iret
.flags:
; 16 letters for each bit in flags register
db "++++ODITSZ+A+P+C"