home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / prog-asm / asm.lzh / ASM / INCLUDE / EXEC / LIBRARIES.I next >
Encoding:
Text File  |  1991-08-16  |  1.4 KB  |  74 lines

  1. ;    File:    libraries.i
  2. ;    asm(1.0) macro package - Various defines/macros that
  3. ;    may be found useful.
  4. ;
  5. ;    This macro package has been written and placed in the
  6. ;    public domain by Douglas J Leavitt, 1986.  This macro
  7. ;    package is based on Commodore-Amiga header files printed
  8. ;    In The ROM Kernel Manuals, published and printed by
  9. ;    Commodore-Amiga, and Addison-Wesley publishing.
  10. ;
  11. ;    The goal of this macro file is to be upwardly compatible
  12. ;    with the include file of the same name.
  13. ;
  14.  
  15.     ifnd    EXEC_LIBRARIES_I
  16.     EXEC_LIBRARIES = 1
  17.  
  18.     ifnd    ASM_COMMON
  19.     include    "common/asmcom.i"
  20.     endc
  21.     ifnd    EXEC_TYPES_I
  22.     include    "exec/types.i"
  23.     endc
  24.     ifnd    EXEC_NODES_I
  25.     include    "exec/nodes.i"
  26.     endc
  27.  
  28.     LIB_VECTSIZE = 6
  29.     LIB_RESERVED = 4
  30.     LIB_BASE     = -LIB_VECTSIZE
  31.     LIB_USERDEF  = LIB_BASE-(LIB_RESERVED*LIB_VECTSIZE)
  32.     LIB_NONSTD   = LIB_USERDEF
  33.  
  34. ;    Set the base offset for function defs
  35. LIBINIT    macro
  36.     ___argchk=narg
  37.     ARGCHK    0,1
  38.     ifeq    narg
  39.     COUNT_LIB = LIB_USERDEF
  40.     endc
  41.     ifne    narg
  42.     COUNT_LIB = \1
  43.     endc
  44.     endm
  45.  
  46. ;    Define an entry
  47. LIBDEF    macro
  48.     ___argchk=narg
  49.     ARGCHK    1,1
  50.     LIBDEF = COUNT_LIB
  51.     COUNT_LIB = COUNTLIB - LIB_VECTSIZE
  52.     endm
  53.  
  54. ;    Invoke a library finction
  55. CALLIB    macro
  56.     ___argchk=narg
  57.     ARGCHK    1,1
  58.     jsr    \1(a6)
  59.     endm
  60.  
  61. ;    Invoke a library function when a6 is NOT set
  62. LINKLIB    macro
  63.     ___argchk=narg
  64.     ARGCHK    2,2
  65.     move.l    a6,-(sp)
  66.     move.l    \2,a6
  67.     jsr    \1(a6)
  68.     move.l    (sp)+,a6
  69.     endm
  70.  
  71. ;    Set up any default functions/variables/bitflags
  72.  
  73.     endc            ; EXEC_LIBRARIES_I
  74.