home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC6.DMS / in.adf / libsrc.lha / LIBSRC / atexit.asm < prev    next >
Encoding:
Assembly Source File  |  1994-04-08  |  666 b   |  43 lines

  1.  
  2. * Maxon C++ Library:
  3. * Modul "atexit"
  4. * Jens "Himpelsoft" Gelhar 02.01.91, 08.04.94
  5.  
  6.     xdef    _atexit,atexit__PFvp
  7.     xdef    _EXIT_9_Call_tHe_f_ing_AtExit_Functions
  8.  
  9.     xref    malloc__Ui,exit__i
  10.  
  11. _atexit:
  12. atexit__PFvp:
  13.     ; Stackparameter: Zeiger auf Function
  14.     pea    8.w
  15.     jsr    malloc__Ui
  16.     addq.l    #4,a7
  17.     tst.l    d0
  18.     beq.b    .panik
  19.     move.l    d0,a0
  20.     move.l    ExitList,(a0)
  21.     move.l    a0,ExitList
  22.     move.l    4(a7),4(a0)
  23.     rts
  24.  
  25. .panik    move.l #1002,-(a7)
  26.     jsr exit__i
  27.  
  28. _EXIT_9_Call_tHe_f_ing_AtExit_Functions:
  29.     move.l    ExitList,d0
  30.     beq.b    .end
  31.     move.l    d0,a0
  32.     move.l    4(a0),a6
  33.     move.l    (a0),ExitList
  34.     jsr    (a6)
  35.     bra.b    _EXIT_9_Call_tHe_f_ing_AtExit_Functions
  36. .end    rts
  37.  
  38.     section    d,data
  39.  
  40. ExitList:    dc.l 0
  41.  
  42.     end
  43.