📄 except_fault.asm
字号:
gp_except_tx db "Exception "gp_except_txN db ".." db ", "gp_except_txS db "...." db ":"gp_except_txO db "........" db " code "gp_except_txC db "........" db 0except_bk dd 0x12345678Exception: push eax mov ax, kernel_data - _GDT mov ds, ax mov es, ax pop eax mov [except_bk], eax pop ax ; exception number pushad push es push fs push gs mov edi, gp_except_txN call PrintHexByte pop gs pop fs pop es popad pushad push es push fs push gs mov edi, gp_except_txC mov al, '#' mov ecx, 8 rep stosb pop gs pop fs pop es popad pop eax ; Offset pushad push es push fs push gs mov edi, gp_except_txO call PrintHexDword pop gs pop fs pop es popad pop ax ; Selector pushad push es push fs push gs mov edi, gp_except_txS call PrintHexWord pop gs pop fs pop es popad mov [gp_print_tx], DWORD gp_except_tx mov eax, [except_bk] jmp GP_FAULT;;;;ExceptionC: push eax mov ax, kernel_data - _GDT mov ds, ax mov es, ax pop eax mov [except_bk],eax pop ax ; exception number pushad push es push fs push gs mov edi, gp_except_txN call PrintHexByte pop gs pop fs pop es popad pop eax ; Exception code pushad push es push fs push gs mov edi, gp_except_txC call PrintHexDword pop gs pop fs pop es popad pop eax ; Offset pushad push es push fs push gs mov edi, gp_except_txO call PrintHexDword pop gs pop fs pop es popad pop ax ; Selector pushad push es push fs push gs mov edi, gp_except_txS call PrintHexWord pop gs pop fs pop es popad mov [gp_print_tx], DWORD gp_except_tx mov eax, [except_bk] jmp GP_FAULT;-------------------------------------------------------------------------------%macro except_body 2 cli push WORD %1 jmp %2%endmacroExcept_00: except_body 0x00, ExceptionExcept_01: except_body 0x01, ExceptionExcept_02: except_body 0x02, ExceptionExcept_03: except_body 0x03, ExceptionExcept_04: except_body 0x04, ExceptionExcept_05: except_body 0x05, ExceptionExcept_06: except_body 0x06, ExceptionExcept_07: except_body 0x07, ExceptionExcept_08: except_body 0x08, ExceptionCExcept_09: except_body 0x09, ExceptionExcept_0A: except_body 0x0A, ExceptionCExcept_0B: except_body 0x0B, ExceptionCExcept_0C: except_body 0x0C, ExceptionCExcept_0D: except_body 0x0D, ExceptionCExcept_0E: except_body 0x0E, ExceptionExcept_0F: except_body 0x0F, ExceptionExcept_10: except_body 0x10, ExceptionExcept_11: except_body 0x11, ExceptionExcept_12: except_body 0x12, ExceptionExcept_13: except_body 0x13, ExceptionExcept_14: except_body 0x14, ExceptionExcept_15: except_body 0x15, ExceptionExcept_16: except_body 0x16, ExceptionExcept_17: except_body 0x17, ExceptionExcept_18: except_body 0x18, ExceptionExcept_19: except_body 0x19, ExceptionExcept_1A: except_body 0x1A, ExceptionExcept_1B: except_body 0x1B, ExceptionExcept_1C: except_body 0x1C, ExceptionExcept_1D: except_body 0x1D, ExceptionExcept_1E: except_body 0x1E, ExceptionExcept_1F: except_body 0x1F, Exception
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -