Path: utzoo!utgpu!watmath!att!ucbvax!tut.cis.ohio-state.edu!pt.cs.cmu.edu!fas.ri.cmu.edu!schmitz From: schmitz@fas.ri.cmu.edu (Donald Schmitz) Newsgroups: comp.sys.m68k Subject: Re: Need help with 68881 Message-ID: <5894@pt.cs.cmu.edu> Date: 17 Aug 89 20:25:14 GMT References: <1135@kuling.UUCP> Organization: Carnegie-Mellon University, CS/RI Lines: 27 In article <1135@kuling.UUCP> jonasf@kuling.UUCP (Jonas Flygare) writes: >I am writing some programs using the 68881, and have a small problem.. >I have tried to get documentation on the 68881, and so far the best one >is the technical summary BRE265R3. On the front page it states that >the FPU have 22 constants available in the on-chip ROM. >"How nice I thought, _just_ what I need.." However, I cannot find any >reference to HOW I access those available constants.. ;-) There is an entire user's manual available from Motorola, the only publication information on mine is MC68881UM/AD, "MC68881 Floating-Point Coprocessor User's Manual". There is a newer edition that covers both the '881 and '882. If you have a choice, get the 2nd generation '882. It is software compatible, usually 2x as fast on C code, about the same price, but generates more state on an fsave, so it may break some OS context switch software. To get the constants, you need the fmovecr instruction, the syntax is: fmovecr #N,fpN Where #N is the constant to look up, and fpN is the floating point register to put it in. #0 is pi, #11 is log(2), #12 is e, #13 is log2(e), #14 is log(e), #15 is 0, #48 is ln(2), #49 is ln(10), and the rest are 10 raised to assorted binary powers. Also, there are lots more entries in the table than 22, but they are used by the microcode and probably aren't useful to user code or maybe even consistent between chip revisions. Don