Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!ames!ucbcad!ucbvax!sdcsvax!nosc!marlin!aburto From: aburto@marlin.UUCP (Alfred A. Aburto) Newsgroups: comp.sys.amiga Subject: 68881 to C interface Message-ID: <846@marlin.UUCP> Date: Thu, 20-Nov-86 14:38:50 EST Article-I.D.: marlin.846 Posted: Thu Nov 20 14:38:50 1986 Date-Received: Thu, 20-Nov-86 23:39:50 EST Reply-To: aburto@marlin.UUCP (Alfred A. Aburto) Distribution: net Organization: Naval Ocean Systems Center, San Diego Lines: 52 Keywords: 68020, 68881, Turbo-Amiga Organizs: 68020, 68881, Turbo-Amiga, Lattice C, San Diego Several people have asked me how one could talk to the 68020/68881 via Lattice C. The best solution of course would be an Amiga Lattice C compiler version that supports the 68020/68881. Next would be a software library such as the mathffp.library and mathtrans.library which one could call from C. Finally one could write an assembly program which does 68020/68881 things that would be compiled and linked to work with a target C program. Its this latter approach that I can help with. What I have is a bit of a kludge but it does work. A sample C test program is shown below and I'll upload the Assembly program in a follow up message. The sample C program : /**************************************/ /* 68020/68881 test program */ /**************************************/ extern float FPCP(); /* 68020/68881 Assembly program */ main() { float ua, ub, uc, ud; int mc; mc = 1; ua = 0.5; ub = 1.75; uc = FPCP(mc, &ua, &ub); /* uc = ua + ub */ printf(" ua + ub = %f\n",uc); uc = FPCP(2, &ua, &ub); /* uc = ua - ub */ printf(" ua - ub = %f\n",uc); uc = FPCP(3, &ua, &ub); /* uc = ua * ub */ printf(" ua * ub = %f\n",uc); uc = FPCP(4, &ua, &ub); /* uc = ua / ub */ printf(" ua / ub = %f\n",uc); uc = FPCP(5, &ua); /* uc = sin(ua) */ printf(" sin(ua) = %f\n",uc); uc = FPCP(6, &ua); /* uc = cos(ua) */ printf(" cos(ua) = %f\n",uc); uc = FPCP(7, &ua, &ud); /* uc = sin(ua) */ /* ud = cos(ua) */ } __________________________ end of program ____________________________ I'll upload the assembly program shortly........ Al Aburto