home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / docs / misc / amigafaq / programmer / hookentry.asm < prev    next >
Assembly Source File  |  1994-07-28  |  533b  |  20 lines

  1.         xdef    _HookEntry
  2.  
  3. _HookEntry:
  4.         movem.l d2-d7/a2-a6,-(sp)   ;   Preserve regs
  5.                         ;    amiga.lib/HookEntry doesn't
  6.                         ;    do this, but experience has
  7.                         ;    proved that it would better
  8.                         ;    do, as most called functions
  9.                         ;    will initialize the a4
  10.                         ;    register
  11.  
  12.         move.l    a1,-(a7)            ;   Put args on the stack
  13.         move.l    a2,-(a7)
  14.         move.l    a0,-(a7)
  15.         move.l    12(a0),a0           ;   Call hook
  16.         jsr    (a0)
  17.         lea    12(sp),sp           ;   Restore stack
  18.         movem.l (sp)+,d2-d7/a2-a6   ;   Restore regs
  19.         rts
  20.