home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 4 / AACD04.ISO / AACD / Programming / powerd / lib / startup.ass < prev    next >
Encoding:
Text File  |  1999-09-22  |  1.1 KB  |  59 lines

  1. _START    move.l    a0,_arg
  2.     movea.l    $4.w,a6
  3.     lea    (DOSName,pc),a1
  4.     moveq    #37,d0
  5.     jsr    (-552,a6)        ; OpenLibrary()
  6.     move.l    d0,_DOSBase
  7.     beq.s    .FINISH
  8.  
  9.     movea.l    d0,a6
  10.     jsr    (-60,a6)        ; Output()
  11.     move.l    d0,_stdout
  12.     jsr    (-54,a6)        ; Input()
  13.     move.l    d0,_stdin
  14.  
  15.     movea.l    $4.w,a6
  16.     lea    (IntName,pc),a1
  17.     moveq    #37,d0
  18.     jsr    (-552,a6)        ; OpenLibrary()
  19.     move.l    d0,_IntuitionBase
  20.     beq.s    .CLOSEDOS
  21.  
  22.     lea    (GfxName,pc),a1
  23.     moveq    #37,d0
  24.     jsr    (-552,a6)        ; OpenLibrary()
  25.     move.l    d0,_GfxBase
  26.     beq.s    .CLOSEINT
  27.  
  28.  
  29.     xref    _main
  30.     bsr    _main        ; a6 is stored
  31.     move.l    d0,d2
  32.  
  33.     movea.l    _GfxBase,a1
  34.     jsr    (-414,a6)        ; CloseLibrary()
  35. .CLOSEINT    movea.l    _IntuitionBase,a1
  36.     jsr    (-414,a6)        ; CloseLibrary()
  37. .CLOSEDOS    movea.l    _DOSBase,a1
  38.     jsr    (-414,a6)        ; CloseLibrary()
  39. .FINISH    move.l    d2,d0
  40.     rts
  41. ****************************************
  42.     xdef    _DOSBase
  43.     xdef    _IntuitionBase
  44.     xdef    _GfxBase
  45.     xdef    _arg
  46.     xdef    _stdout
  47.     xdef    _stdin
  48. ****************************************
  49. _DOSBase        dc.l    0
  50. _IntuitionBase    dc.l    0
  51. _GfxBase        dc.l    0
  52. _arg        dc.l    0
  53. _stdout        dc.l    0
  54. _stdin        dc.l    0
  55. ****************************************
  56. DOSName    dc.b    'dos.library',0
  57. IntName    dc.b    'intuition.library',0
  58. GfxName    dc.b    'graphics.library',0
  59.