home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-11 | 1.0 KB | 67 lines | [TEXT/KAHL] |
- /***
- *
- * Exceptions.c - Assembly language functions
- * Copyright © 1992-1995 by Christopher E. Hyde. All rights reserved.
- *
- * Version: 1.06 11/95
- *
- ***/
-
- //#include "Exceptions.h"
-
-
- typedef struct FailInfo FailInfo;
-
- struct FailInfo {
- long jumpBuf[12]; // old 68K: D2-D7,PC,A2-A4,A6,SP
- FailInfo* nextInfo; // Next in stack.
- };
-
- extern FailInfo* gTopHandler; // Pointer to the top level (most recent) handler
- extern short gFailE;
- extern long gFailM;
-
-
- #define savedRegs D2-D7/A0/A2-A4/A6/A7
- #define regA0 6 // Index of register A0
-
-
- #pragma options(!require_protos)
-
- int
- DoTry (/*FailInfo* fi*/)
- {
- asm {
- MOVE.L (A7)+,A0 // Get return address
- MOVE.L (A7),A1 // FailInfo*
- MOVEM.L savedRegs,(A1)
- MOVE.L gTopHandler,FailInfo.nextInfo(A1)
- MOVE.L A1,gTopHandler // Set new top handler
- MOVEQ #1,D0 // Return 1
- JMP (A0)
- }
- }
-
-
- #if 0
- void
- Testing ()
- {
- asm {
- MOVE.L 0x0130,D0
- SUB.L A7,D0
-
- MOVE.L A7,D0
- SUB.L 0x0130,D0
-
- TST.L d1
- BEQ.S @2
- @1 MOVE.B (a1)+,(a0)+
- SUBQ.L #1,d1
- BNE.S @1
-
- @2 RTS
- }
- }
- #endif
-