home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / misc / vcb10a.lha / hookentrygeta4.asm < prev    next >
Encoding:
Assembly Source File  |  1992-10-24  |  1.0 KB  |  41 lines

  1. ;:ts=8
  2. ;    hookentrygeta4.asm
  3. ;
  4. ;    Custom support module for Manx/Aztec small memory model
  5. ;
  6. ;    Function: Exactly the same as HookEntry() from amiga.lib
  7. ;    However, this function will save the a4 register and call
  8. ;    _geta4() before passing control to the h_SubEntry code.
  9. ;    After the hook function returns, a4 is restored.
  10. ;    Using this function instead of HookEntry() rids us of
  11. ;    dubious things (probably unportable to other compilers)
  12. ;    we had to do inside the h_SubEntry code otherwise.
  13. ;
  14. ;    Usage: if you want to use this function instead of the
  15. ;    HookEntry(), create a C pre-processor symbol (probably
  16. ;    using the -d option of Aztec C compiler)
  17. ;
  18. ;        _HOOKENTRY_ = HookEntryGetA4
  19. ;
  20. ;    To use the amiga.lib function, leave the symbol undefined.
  21.  
  22.             include    <utility/hooks.i>
  23.  
  24.             xref    _geta4
  25.  
  26.             public    _HookEntryGetA4
  27.  
  28. _HookEntryGetA4        move.l        a4,-(sp)
  29.             move.l        a1,-(sp)
  30.             move.l        a2,-(sp)
  31.             move.l        a0,-(sp)
  32.             jsr        _geta4
  33.             move.l        (sp),a0
  34.             movea.l        h_SubEntry(a0),a0
  35.             jsr        (a0)
  36.             lea        12(sp),sp
  37.             move.l        (sp)+,a4
  38.             rts
  39.  
  40.             end
  41.