home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Sound / Player / hip200.lha / Support / TerminateHiP.s < prev    next >
Encoding:
Text File  |  1995-03-18  |  1.0 KB  |  63 lines

  1. *************************
  2. * Terminate HippoPlayer *
  3. *************************
  4. * If HippoPlayer's port exists, send there a message telling HiP to terminate.
  5.  
  6.      incdir    include:
  7.     include    exec/exec_lib.i
  8.     include    exec/ports.i
  9.  
  10.     move.l    4.w,a6            
  11.     lea    portname(pc),a1    
  12.     jsr    _LVOFindPort(a6)
  13.     tst.l    d0
  14.     beq.b    exit
  15.     move.l    d0,a3
  16.  
  17.     sub.l    a1,a1
  18.     jsr    _LVOFindTask(a6)
  19.     move.l    d0,owntask
  20.  
  21.     bsr.b    createport
  22.  
  23.     lea    message(pc),a0    
  24.     NEWLIST    a0
  25.     move.l    a3,a0        
  26.     lea    message(pc),a1
  27.     move.l    #port,MN_REPLYPORT(a1)
  28.     jsr    _LVOPutMsg(a6)
  29.  
  30.     lea    port(pc),a0    
  31.     jsr    _LVOWaitPort(a6)
  32.  
  33.     bsr.b    deleteport
  34.  
  35. exit
  36.     moveq    #0,d0
  37.     rts
  38.  
  39.     
  40. createport    lea    port(pc),a2
  41.         moveq    #-1,d0
  42.         jsr    _LVOAllocSignal(a6)
  43.         move.b    d0,MP_SIGBIT(a2)
  44.         move.l    owntask(pc),MP_SIGTASK(a2)
  45.         move.b    #NT_MSGPORT,LN_TYPE(a2)
  46.         clr.b    MP_FLAGS(a2)
  47.         move.l    a2,a1
  48.         jmp    _LVOAddPort(a6)
  49.  
  50. deleteport    lea    port(pc),a2
  51.         move.l    a2,a1
  52.         jsr    _LVORemPort(a6)
  53.         moveq    #0,d0
  54.         move.b    MP_SIGBIT(a2),d0
  55.         jmp    _LVOFreeSignal(a6)
  56.  
  57. owntask        dc.l    0
  58. port        ds.b    MP_SIZE
  59. message        ds.b    MN_SIZE
  60.         dc.l    "KILL"        * Killer-message
  61.     
  62. portname    dc.b    "HiP-Port",0
  63.