home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
util
/
crashsav.sit
/
CrashSaver.Asm
< prev
next >
Wrap
Assembly Source File
|
1985-10-12
|
2KB
|
58 lines
; Crash Saver
; ⌐1985 by DailSoft
; You may distribute CrashSaver to others as long as orginal credit is
; givin to Macazine. Also, you must include the entire contents the
; folders labeled ╥Crash Saver╙ and ╥Ordering╙ from this issue.
; Macazine can be ordered from:
; DailSoft
; P.O. Box 2861
; Newport News, VA 23602
; The cost of Macazine is $15.95/issue or $60.00/year (6 issues).
; This program is designed to allow for a return to the Finder when a
; system error occurs. By pressing the Interrupt button (not the Reset
; button) on the programmers switch during a system error, an
; ExitToShell trap will be executed. This will return you to the
; Finder (or to the Switcher). One reason for doing this is to preserve
; your RamDisk.
; Warning, this method will usually work, but in some cases, ExitToShell
; will produced a repeated System Error.
; This application should be made your startup application.
; Note: By modifying the interrupt vectors, MacsBug will not work when this
; utility has been installed.
Include MacTraps.D ; Use System and ToolBox traps
autoInt4 EQU $70
autoInt5 EQU $74
autoInt6 EQU $78
autoInt7 EQU $7C
Install
; Allocate space on the system heap for the crash saver.
MOVE.L #(Exit-CrashSaver),D0 ; Length of block.
_NewPtr ,SYS ; Allocate in system heap.
; Make interrupt vectors point to crash saver.
MOVE.L A0,autoInt4
MOVE.L A0,autoInt5
MOVE.L A0,autoInt6
MOVE.L A0,autoInt7
; Copy local copy of crash saver to the system heap.
MOVE.L A0,A1 ; A1 points to destination.
LEA CrashSaver,A0 ; A0 points to source.
MOVE.L #(Exit-CrashSaver),D0 ; D0 is length of copy.
_BlockMove ; Execute move.
RTS ; Return to the Finder.
CrashSaver
AND #$F8FF,(SP) ; Force all interupts to be enabled.
; set return to ExitToShell call.
LEA ETS,A0
MOVE.L A0,2(SP)
RTE
ETS
NOP ; Make sure interrupt button is released before exit
_ExitToShell
Exit
END