home *** CD-ROM | disk | FTP | other *** search
- IFND EXEC_LIBRARIES_I@
- EXEC_LIBRARIES_I@ = 1
- ;*********************************************************************
- ;
- ; Commodore Amiga -- ROM Operating System Executive Include File
- ;
- ;*********************************************************************
- ;
- ; Source Control:
- ;
- ; $Header: libraries.i,v 1.0 85/08/28 15:11:09 carl Exp $
- ;
- ; $Locker: $
- ;
- ;*********************************************************************
-
- IFND EXEC_NODES_I@
- INCLUDE "exec/nodes.i"
- ENDIF
-
-
- ;------ Special Constants ---------------------------------------
-
- LIB_VECTSIZE EQU 6
- LIB_RESERVED EQU 4
- LIB_BASE EQU $FFFFFFFA ; (-LIB_VECTSIZE)
- LIB_USERDEF EQU LIB_BASE-(LIB_RESERVED*LIB_VECTSIZE)
- LIB_NONSTD EQU LIB_USERDEF
-
- ;----------------------------------------------------------------
- ;
- ; Library Definition Macros
- ;
- ;----------------------------------------------------------------
-
- ;------ LIBINIT sets base offset for library function definitions:
-
- LIBINIT MACRO $\1 ; [baseOffset]
- IFND \1
- COUNT_LIB@ = LIB_USERDEF
- ELSE
- COUNT_LIB@ = \1
- ENDIF
- ENDM
-
-
- ;------ LIBDEF is used to define each library function entry:
-
- LIBDEF MACRO $\1 ; libraryFunctionSymbol
- $\1 EQU COUNT_LIB@
- COUNT_LIB@ = COUNT_LIB@-LIB_VECTSIZE
- ENDM
-
-
- ;----------------------------------------------------------------
- ;
- ; Standard Library Functions
- ;
- ;----------------------------------------------------------------
-
- LIBINIT LIB_BASE
-
- LIBDEF LIB_OPEN
- LIBDEF LIB_CLOSE
- LIBDEF LIB_EXPUNGE
- LIBDEF LIB_EXTFUNC ; reserved ;
-
-
- ;----------------------------------------------------------------
- ;
- ; Standard Library Data Structure
- ;
- ;----------------------------------------------------------------
-
- STRUCTURE LIB,LN_SIZE
- UBYTE LIB_FLAGS
- UBYTE LIB_pad
- UWORD LIB_NEGSIZE ; number of bytes before LIB
- UWORD LIB_POSSIZE ; number of bytes after LIB
- UWORD LIB_VERSION ; major
- UWORD LIB_REVISION ; minor
- APTR LIB_IDSTRING ; identification
- ULONG LIB_SUM ; the checksum itself
- UWORD LIB_OPENCNT ; number of current opens
- LABEL LIB_SIZE
-
-
- ;------ LIB_FLAGS bit definitions:
-
- ; BITDEF LIB,SUMMING,0 ; we are currently checksumming
- LIBB_SUMMING = 0 ; we are currently checksumming
- LIBF_SUMMING = 1<<0 ; we are currently checksumming
- ; BITDEF LIB,CHANGED,1 ; we have just changed the lib
- LIBB_CHANGED = 1 ; we have just changed the lib
- LIBF_CHANGED = 1<<1 ; we have just changed the lib
- ; BITDEF LIB,SUMUSED,2 ; set if we should bother to sum
- LIBB_SUMUSED = 2 ; set if we should bother to sum
- LIBF_SUMUSED = 1<<2 ; set if we should bother to sum
- ; BITDEF LIB,DELEXP,3 ; delayed expunge
- LIBB_DELEXP = 3 ; delayed expunge
- LIBF_DELEXP = 1<<3 ; delayed expunge
-
-
- ;----------------------------------------------------------------
- ;
- ; Function Invocation Macros
- ;
- ;----------------------------------------------------------------
-
- ;------ CALLLIB for calling functions where A6 is already correct:
-
- CALLLIB MACRO $\1 ; functionOffset
- JSR \1(A6)
- ENDM
-
-
- ;------ LINKLIB for calling functions where A6 is incorrect:
-
- LINKLIB MACRO $\1,$\2 ; functionOffset,libraryBase
- MOVE.L A6,-(SP)
- MOVE.L \2,A6
- CALLLIB \1
- MOVE.L (SP)+,A6
- ENDM
-
- ENDIF
- END
-