home *** CD-ROM | disk | FTP | other *** search
- ;=================================
- ; Coroner, by Matt Pietrek, 1992
- ; File: TH_ASM.ASM
- ;=================================
-
- .model small
- .286
-
- PUBLIC EXCEPTIONHANDLER ; Make EXCEPTIONHANDLER public
-
- extrn _C_ExceptionHandler: NEAR
-
- .code
-
- ; The EXCEPTIONHANDLER proc is called directly from TOOLHELP. It sets up a
- ; stackframe, and calls the 'C' function C_ExceptionHandler.
- ; On entry, the stack looks like this:
-
- ; ------------
- ;BP---->| Old BP | [BP + 00h]
- ; | Ret IP | [BP + 02h]
- ; | Ret CS | [BP + 04h]
- ; | AX | [BP + 06h]
- ; |Exception#| [BP + 08h]
- ; | Handle | [BP + 0Ah]
- ; | IP | [BP + 0Ch]
- ; | CS | [BP + 0Eh]
- ; | Flags | [BP + 10h]
- ; ------------
-
- EXCEPTIONHANDLER proc far
-
- push bp ;Make a stack frame
- mov bp,sp
- pusha ;Save all registers
- push ds
- push es
-
- mov ax, @data ; There's only one instance of the CORONER running, so
- mov ds, ax ; we save work by loading DS directly, like a DLL does.
-
- call _C_ExceptionHandler
-
- pop es ;Chain on to next fault handler
- pop ds
- popa
- pop bp
- retf
-
- EXCEPTIONHANDLER endp
-
- END
-