home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994 Marc Parmet.
- * This file is part of the Macintosh port of GNU Emacs.
- *
- * GNU Emacs is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
- #if defined(THINK_C)
- #include <MacHeaders>
- #else
- #include <Types.h>
- #include <Memory.h>
- #endif
-
- /* This next function is included in its 68k version in both the 68k and PPC versions
- of Emacs. In the PPC version it comes as a code resource. */
-
- void
- #if defined(__MWERKS__)
- asm
- #endif
- #if defined(emacs)
- execute_68k_trap
- #else
- main
- #endif
- (int (*code)(),char *stack_data,int stack_size,struct regs_for_68k_trap *regs)
- {
- #define code 8(a6)
- #define stack_data 12(a6)
- #define stack_size 16(a6)
- #define regs 20(a6)
-
- #if defined(THINK_C)
- asm {
- #endif
- #if defined(__MWERKS__)
- link a6,#0
- #endif
- move.l a2,-(a7)
- pea @epilog
- move.l stack_size,d0
- move.l stack_data,a1
- add.l d0,a1
- asr.l #1,d0
- bra.s @test
- top: move.w -(a1),-(a7)
- test: dbf d0,@top
- move.l regs,a2
- movem.l (a2),d0-d2/a0-a1
- move.l code,a2
- jmp (a2)
- epilog: move.l regs,a2
- movem.l d0-d2/a0-a1,(a2)
- move.l (a7)+,a2
- #if defined(__MWERKS__)
- unlk a6
- #endif
- #if defined(THINK_C)
- }
- #endif
- }
-