home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Basic / MAXONB32.DMS / in.adf / Includes.lha / BH / BLib / TaskHookEntry.s < prev    next >
Encoding:
Text File  |  1994-03-16  |  703 b   |  33 lines

  1. **
  2. ** $Id: TaskHookEntry.s,v 1.2 1994/03/07 17:26:26 alex Rel $
  3. **
  4. ** BASIC task entry glue
  5. **
  6. ** (c) Copyright 1994 HiSoft
  7. **
  8.     INCLUDE    'exec/tasks.i'
  9.     INCLUDE    'utility/hooks.i'
  10.  
  11.     INCLUDE    'lvos/exec_lib.i'    ; you may have this called differently
  12.  
  13. CALLSYS    MACRO
  14.     jsr    _LVO\1(a6)
  15.     ENDM
  16.  
  17.     SECTION    CODE,CODE
  18.  
  19.     XDEF    TaskHookEntry
  20.  
  21. TaskHookEntry:
  22.     movea.l    (4).w,a6        ; connect to Exec
  23.     suba.l    a1,a1        ; find this task
  24.     CALLSYS    FindTask        ; go find the task
  25.     movea.l    d0,a6        ; the task control block pointer
  26.     lea    TC_Userdata(a6),a6    ; where we stashed the Hook
  27.     movea.l    (a6),a0        ; pointer to the Hook
  28.     move.l    a2,(a6)        ; clear out user data
  29.     move.l    h_Entry(a0),-(sp)    ; the Hook entry point
  30.     rts            ; run the hook
  31.  
  32.     END
  33.