home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 1: Collection A / 17Bit_Collection_A.iso / files / 1036.dms / 1036.adf / Dec_ln03 / init.asm < prev    next >
Assembly Source File  |  1977-12-31  |  3KB  |  132 lines

  1. ;**************************************************************************
  2. ;           This routine is stock standard from RKM
  3. ;                         B.R.M 1/2/88
  4. ;
  5. ;**************************************************************************
  6.         section printer
  7.  
  8. ;       included files
  9.  
  10.         include "exec/types.i"
  11.         include "exec/nodes.i"
  12.         include "exec/lists.i"
  13.         include "exec/memory.i"
  14.         include "exec/ports.i"
  15.         include "exec/libraries.i"
  16.  
  17.         include "macros.i"
  18.  
  19. ;       imported functions
  20.  
  21.         XREF_EXE        CloseLibrary
  22.         XREF_EXE        OpenLibrary
  23.         XREF            _AbsExecBase
  24.  
  25.         XREF            _PEDData
  26.  
  27. ;       exported globals
  28.  
  29.         XDEF    _Init
  30.         XDEF    _Expunge
  31.         XDEF    _Open
  32.         XDEF    _Close
  33.         XDEF    _PD
  34.         XDEF    _PED
  35.         XDEF    _SysBase
  36.         XDEF    _DOSBase
  37.         XDEF    _GfxBase
  38.         XDEF    _IntuitionBase
  39.  
  40. ;***********************************************
  41.         section printer,data
  42. _PD             DC.L    0
  43. _PED            DC.L    0
  44. _SysBase        DC.L    0
  45. _DOSBase        DC.L    0
  46. _GfxBase        DC.L    0
  47. _IntuitionBase  DC.L    0
  48. ;***********************************************
  49.         section printer,code
  50. _Init:
  51.         move.l  4(a7),_PD
  52.         lea     _PEDData(pc),a0
  53.         move.l  a0,_PED
  54.         move.l  a6,-(a7)
  55.         move.l  _AbsExecBase,a6
  56.         move.l  a6,_SysBase
  57.  
  58. ;       open the dos library
  59.         lea     DLName(pc),a1
  60.         moveq   #0,d0
  61.         CALLEXE OpenLibrary
  62.         move.l  d0,_DOSBase
  63.         beq.l   initDLErr
  64.  
  65. ;       open the graphics library
  66.         lea     GLName(pc),a1
  67.         moveq   #0,d0
  68.         CALLEXE OpenLibrary
  69.         move.l  d0,_GfxBase
  70.         beq.l   initGLErr
  71.  
  72. ;       open the intuition library
  73.         lea     ILName(pc),a1
  74.         moveq   #0,d0
  75.         CALLEXE OpenLibrary
  76.         move.l  d0,_IntuitionBase
  77.         beq.l   initILErr
  78.  
  79.         moveq   #0,d0
  80.  
  81. pdiRTS:
  82.         move.l  (a7)+,a6
  83.         rts
  84.  
  85. initPAErr:
  86.         move.l  _IntuitionBase,a1
  87.         LINKEXE CloseLibrary
  88.  
  89. initILErr:
  90.         move.l  _GfxBase,a1
  91.         LINKEXE CloseLibrary
  92.  
  93. initGLErr:
  94.         move.l  _DOSBase,a1
  95.         LINKEXE CloseLibrary
  96.  
  97. initDLErr:
  98.         moveq   #-1,d0
  99.         bra.s   pdiRTS
  100.  
  101. ILName:
  102.         dc.b    'intuition.library'
  103.         dc.b    0
  104. DLName:
  105.         dc.b    'dos.library'
  106.         dc.b    0
  107. GLName:
  108.         dc.b    'graphics.library'
  109.         dc.b    0
  110.         ds.w    0
  111.  
  112.  
  113. _Expunge:
  114.         move.l  _IntuitionBase,a1
  115.         LINKEXE CloseLibrary
  116.  
  117.         move.l  _GfxBase,a1
  118.         LINKEXE CloseLibrary
  119.  
  120.         move.l  _DOSBase,a1
  121.         LINKEXE CloseLibrary
  122.  
  123. _Open:
  124.         moveq   #0,d0
  125.         rts
  126.  
  127. _Close:
  128.         moveq   #0,d0
  129.         rts
  130.  
  131.         end
  132.