/************************************************************************** Simple.c A set of C routines to be turned into a library called "simple.library". We use LibTool to make our lib startup asm code (-m option) to be linked with this module. This creates a library. We also use LibTool to create glue code for a C application which expects to call C library functions (-c option). Note that this module should NOT be compiled with small code/data because we do not bother setting up and restoring a4 (which is what you would have to do at the start and end of each callable function). Manx 3.6 cc +pb Simple.c LibTool -cmo glue.asm SimpleC.fd as -cd -o LibStart.o SimpleC.src ln -o libs:simple.library LibStart.o Simple.o -lcl32 Lattice 5.0 lc -b0 Simple.c LibTool -cmo glue.asm SimpleC.fd assemble SimpleC.src as LibStart.o blink LibStart.o Simple.o LIB lib:lcnb.lib TO libs:simple.library ***************************************************************************/ extern struct LibBase; /* this library's base */ #ifdef AZTEC_C #define NARGS #define NO_PRAGMAS #endif #include "exec/types.h" #ifdef AZTEC_C #include "functions.h" #else #include "proto/all.h" #endif /************************************************************************** These are the 3 functions which add, subtract, and multuply 2 passed values. ***************************************************************************/ Add2Numbers(x, y) ULONG x, y; { return(x + y); } Sub2Numbers(x, y) ULONG x, y; { return(x - y); } Mult2Numbers(x, y) ULONG x, y; { return(x * y); }