exception_isr.s

来自「一个操作系统的源代码」· S 代码 · 共 197 行

S
197
字号
;/** exception_isr.s; **; ** Original Author: Guido de Jong; ** Date: 10/18/99; **; ** Description:; ** Exception Interrupt Service Routines.; ** Errorcode 0 is pushed onto stack if not done by hardware.; ** Then the exception number is pushed onto the stack. From that; ** point all exceptions are handled identically.; ** ; ** Segment registers are set up and general exception service; ** routine is called.; **; ** This program is free software, you can redistribute it and/or; ** modify it under the terms of the GNU General Public License; ** as published by the Free Software Foundation; either version; ** 2 of the License, or (at your option) any later version.; **; ** This program is distributed in the hope that it will be; ** useful, but WITHOUT ANY WARRANTY; without even the implied; ** warranty or MERCHANTABILITY or FITNESS FOR A PARTICULAR; ** PURPOSE.  See the GNU General Public License for more; ** details.; **; ** You should have received a copy of the GNU General Public; ** License along with this program; if not, write to the; ** Free Software Foundation, Inc., 59 Temple Place, Suite 330,; ** Boston, MA 02111-1307 USA; **; *********************************************************Apostle OS**/	SECTION	.text	GLOBAL	__DivideError	GLOBAL	__DebugException	GLOBAL	__NonMaskableInterrupt	GLOBAL	__Breakpoint	GLOBAL	__Overflow	GLOBAL	__BoundsCheck	GLOBAL	__InvalidOpcode	GLOBAL	__CoprocessorNotAvailable	GLOBAL	__DoubleFault	GLOBAL	__CoprocessorSegmentOverrun	GLOBAL	__InvalidTSS	GLOBAL	__SegmentNotPresent	GLOBAL	__StackException	GLOBAL	__GeneralProtection	GLOBAL	__PageFault		GLOBAL	__Reserved	GLOBAL	__CoprocessorError	GLOBAL	__AlignmentCheck	EXTERN	exceptionHandler	ALIGN	4__DivideError:	push	dword 0	push	dword 0	jmp	__all_exceptions	ALIGN	4__DebugException:	push	dword 0	push	dword 1	jmp	__all_exceptions	ALIGN	4__NonMaskableInterrupt:	push	dword 0	push	dword 2	jmp	__all_exceptions	ALIGN	4__Breakpoint:	push	dword 0	push	dword 3	jmp	__all_exceptions	ALIGN	4__Overflow:	push	dword 0	push	dword 4	jmp	__all_exceptions	ALIGN	4__BoundsCheck:	push	dword 0	push	dword 5	jmp	__all_exceptions	ALIGN	4__InvalidOpcode:	push	dword 0	push	dword 6	jmp	__all_exceptions	ALIGN	4__CoprocessorNotAvailable:	push	dword 0	push	dword 7	jmp	__all_exceptions	ALIGN	4__DoubleFault:	push	dword 8	jmp	__all_exceptions	ALIGN	4__CoprocessorSegmentOverrun:	push	dword 0	push	dword 9	jmp	__all_exceptions	ALIGN	4__InvalidTSS:	push	dword 10	jmp	__all_exceptions	ALIGN	4__SegmentNotPresent:	push	dword 11	jmp	__all_exceptions	ALIGN	4__StackException:	push	dword 12	jmp	__all_exceptions	ALIGN	4__GeneralProtection:		push	dword 13	jmp	__all_exceptions	ALIGN	4__PageFault:		push	dword 14	jmp	__all_exceptions	ALIGN	4__Reserved:	push	dword 0	push	dword 15	jmp	__all_exceptions		ALIGN	4__CoprocessorError:	push	dword 0	push	dword 16	jmp	__all_exceptions	ALIGN	4__AlignmentCheck:	push	dword 0	push	dword 17	jmp	__all_exceptions__all_exceptions:	push	ds	push	es	push	fs	push	gs	pusha	mov	ax,0x23		; reset ds to default	mov	ds,ax	call	exceptionHandler	popa	pop	gs	pop	fs	pop	es	pop	ds	add	esp, byte 8		iret

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?