home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 3 / CD_Magazyn_EXEC_nr_3.iso / Recent / game / wb / Klotz.lha / Klotz / src / mymacros.i < prev    next >
Text File  |  1998-02-18  |  2KB  |  154 lines

  1. *
  2. * $VER: MyMacros.i  2.3 (6.10.94)
  3. *            2.1 (6.3.94)
  4. *
  5.  
  6. MYMVERSION   equ    23
  7.  
  8. * Macros für Libraryaufrufe (small.lib)
  9. *         Reentrantfähige Programme
  10. *
  11. ExecBase     equ    4
  12.  
  13. CALL MACRO
  14.      xref    _LVO\1
  15.      jsr     _LVO\1(a6)
  16.      ENDM
  17.  
  18. CSYS MACRO
  19.      copy.l SysBase,a6
  20.      CALL    \1
  21.      ENDM
  22.  
  23. CGFX MACRO
  24.      copy.l GfxBase,a6
  25.      CALL    \1
  26.      ENDM
  27.  
  28. CINT MACRO
  29.      copy.l IntBase,a6
  30.      CALL    \1
  31.      ENDM
  32.  
  33. CDOS MACRO
  34.      copy.l DOSBase,a6
  35.      CALL    \1
  36.      ENDM
  37.  
  38. *
  39. * Stackmanagement
  40. *
  41. push MACRO
  42.      IFC     '\1','all'
  43.      movem.l D0-D7/A0-A6,-(SP)
  44.      ENDC
  45.      IFNC    '\1','all'
  46.      movem.l \1,-(SP)
  47.      ENDC
  48.      ENDM
  49. pop  MACRO
  50.      IFC     '\1','all'
  51.      movem.l (SP)+,D0-D7/A0-A6
  52.      ENDC
  53.      IFNC    '\1','all'
  54.      movem.l (SP)+,\1
  55.      ENDC
  56.      ENDM
  57. *
  58. * Globale Variablenspeicherung
  59. *
  60. reloc MACRO
  61.      move.\0 \1,\2(a4)
  62.      ENDM
  63.  
  64. copy MACRO
  65.      move.\0  \1(a4),\2
  66.      ENDM
  67.  
  68. on   MACRO
  69.      IFC    '\0','B'
  70.      st     \1(a4)
  71.      ENDC
  72.      IFNC    '\0','B'
  73.      move.\0 #-1,\1(a4)
  74.      ENDC
  75.      ENDM
  76.  
  77. off  MACRO
  78.      IFC    '\0','B'
  79.      sf     \1(a4)
  80.      ENDC
  81.      IFNC    '\0','B'
  82.      clr.\0  \1(a4)
  83.      ENDC
  84.      ENDM
  85.  
  86. loc  MACRO
  87. \1   equ    LOCATIONCOUNT
  88.      IFC    '\0','L'
  89. LOCATIONCOUNT    set    LOCATIONCOUNT+4
  90.      ENDC
  91.      IFC   '\0','W'
  92. LOCATIONCOUNT    set    LOCATIONCOUNT+2
  93.      ENDC
  94.      IFC   '\0','B'
  95. LOCATIONCOUNT    set    LOCATIONCOUNT+1
  96.      ENDC
  97.      ENDM
  98. bloc MACRO
  99. \1   equ    LOCATIONCOUNT
  100. LOCATIONCOUNT    set    LOCATIONCOUNT+\2
  101.      ENDM
  102. locinit MACRO
  103. LOCATIONCOUNT    set    0
  104.     ENDM
  105.  
  106. locend    MACRO
  107. LOCLEN    equ LOCATIONCOUNT
  108.     ENDM
  109.  
  110. *
  111. *  Ministartup
  112. *  [ ohne CLI-Parse oder WBStartupMsg ]
  113. *
  114. MINISTART   macro
  115.     locinit
  116.     loc.l   SysBase
  117. Start
  118.     move.l  ExecBase,a6
  119.     move.l  #LOCLEN,d0
  120.     moveq   #1,d1
  121.     swap    d1
  122.     addq.b  #1,d1
  123.     CALL    AllocVec
  124.     tst.l   d0
  125.     bne     .ok
  126.     moveq   #20,d0
  127.     rts
  128. .ok
  129.     move.l  d0,a4
  130.     reloc.l a6,SysBase
  131.     bsr     .main
  132.     move.l  a4,a1
  133.     CSYS    FreeVec
  134.     moveq   #0,d0
  135.     rts
  136. .main
  137.     ENDM
  138.  
  139. PRGSTART    macro
  140.     MINISTART
  141.     endm
  142.  
  143. PRGEND        macro
  144.     locend
  145.  
  146.     ENDM
  147.  
  148. * Anderes
  149. *
  150. clra MACRO
  151.      suba.\0 \1,\1
  152.      ENDM
  153.  
  154.