home *** CD-ROM | disk | FTP | other *** search
- ;:ts=8
- ; hookentrygeta4.asm
- ;
- ; Custom support module for Manx/Aztec small memory model
- ;
- ; Function: Exactly the same as HookEntry() from amiga.lib
- ; However, this function will save the a4 register and call
- ; _geta4() before passing control to the h_SubEntry code.
- ; After the hook function returns, a4 is restored.
- ; Using this function instead of HookEntry() rids us of
- ; dubious things (probably unportable to other compilers)
- ; we had to do inside the h_SubEntry code otherwise.
- ;
- ; Usage: if you want to use this function instead of the
- ; HookEntry(), create a C pre-processor symbol (probably
- ; using the -d option of Aztec C compiler)
- ;
- ; _HOOKENTRY_ = HookEntryGetA4
- ;
- ; To use the amiga.lib function, leave the symbol undefined.
-
- include <utility/hooks.i>
-
- xref _geta4
-
- public _HookEntryGetA4
-
- _HookEntryGetA4 move.l a4,-(sp)
- move.l a1,-(sp)
- move.l a2,-(sp)
- move.l a0,-(sp)
- jsr _geta4
- move.l (sp),a0
- movea.l h_SubEntry(a0),a0
- jsr (a0)
- lea 12(sp),sp
- move.l (sp)+,a4
- rts
-
- end
-