/* This program is the TURBO C (ver. 1.0) implementation of the transcendental functions. The official implementation used by SCHEME was done under the Lattice C version. This purpose of this program is to show you what is needed to communicate with XLI via TURBO C. The lines containing comments that start out with @@ designate lines that will need to be modified by you when you use this template program for your own purpose. Note: In order to compile this program you will need to have a path set up to get to the Macro Assembler. The command line to compile is: TCC -ID:\TURBOC\INCLUDE -LD:\TURBOC\LIB -B -c TRIG_TC The command line to link this program is: TLINK d:\turboc\lib\c0new.obj TRIG_TC,,,d:\turboc\lib\emu d:\turboc\lib\maths d:\turboc\lib\cs All pathnames will need to be changed to reflect your directories. The command for the link needs to be on one line only. The file C0NEW.OBJ was my changed copy of the C0S.OBJ file; the changes you need to make to it are described below. */ #include "dos.h" #include "math.h" #include "stdlib.h" #define F_NEAR 0x0001 /* Set model flag to near. USED */ #define F_INT 0x0002 /* Set integer flag to 16 bits. NOT-USED */ #define F_REL 0x0004 /* Set release env block by extern pgm flag. N-U */ #define F_PAD 0x0008 /* Set parm blocking flag to unblocked. USED */ #define RT_INTEGER 0 /* Set return type to be an integer. NOT-USED */ #define RT_BOOLEAN 1 /* Set return type to be boolean. NOT-USED */ #define RT_STRING 2 /* Set return type to be a string. NOT-USED */ #define RT_DOUBLE 3 /* Set the return type to be a float num. USED */ typedef unsigned short WORD; /* 16-bit unsigned value */ /* _tsize is set to the size of the program from within the Start Up Code file called C0.ASM. You need to modify this file in order for this variable to be set. The file C0.ASM is supplied to you on the TURBO C diskette. It is in assembly source form so that you can modify the Start Up Code to do what you need it to do. In this case we will make the following changes to capture the in-memory size of this file in paragrahps. The following two pieces of code are extracted out of the file C0.ASM. They show you where the changes need to be made so that _tsize will contain the size of this, or your, program. Only two lines need to be added to the C0.ASM file. You will then need to execute the batch file that TURBO provides you, called BUILD-C0, in order to build a new C0x.OBJ file, where the 'x' represents the model. To create a new small model after making the changes shown below you would execute the batch stream by typing BUILD-C0 SMALL. ExcessOfMemory label near mov bx, di add bx, dx mov word ptr _heapbase@ + 2, bx mov word ptr _brklvl@ + 2, bx mov ax, _psp@ sub bx, ax ; BX = Number of paragraphs to keep mov _tsize@, bx ; 1st change *** Line added for XLI *****. mov es, ax ; ES = Program Segment Prefix address mov ah, 04Ah int 021h . . . PubSym@ _envLng, , __CDECL__ PubSym@ _envseg, , __CDECL__ PubSym@ _envSize,, __CDECL__ PubSym@ _psp, , __CDECL__ PubSym@ _tsize, , __CDECL__ ; 2nd change *** line added ***. PubSym@ _version,