*/
Want to see what people are talking about? See the latest forum posts.
*/

Floating point kit for PIC

*/

Floating point kit for PIC

Submitted By: WEBMASTER
Rating: starstarstarstarstar (Rate It)



NOTE: Some downloads must be obtained through publishers´s site.
Do you want to get your software listed on this site? Go to our submissions area.

Screenshot

No Image

Details

File Name:
MATH.ZIP
Product homepage:
Order page:
Languages:
Unknown
Platforms:
PIC
Release date:
1/1/1990
License:
Unknown
Size:
68 KB
Price/Fee (US$):
Unknown
Number of downloads:
5964

Comments (1)

Excellent - only one bug found, easily fixed starstarstarstarstar   Posted by: mechie on Thursday, April 15, 2004

Using FP32_12.A16 v1.12 originally on a PIC16F84 but now ported to 16F870 - needed extra memory (for my bloated application code)!, I found it easy to port and easy to understand - Very well commented !!

There is a bug in the float -to- integer routine, INT32, if the de-biassed exponent is an integer multiple of 8 the routine does a 'RRF' 255 times, trashing the number to zero.
The following snippet shows the 'simple fix' add 4 lines to beginning of SHIFT32

SHIFT32 MOVF EXP, W
SUBLW 0 ; check for zero remaining
BTFSC _Z
GOTO SHIFT32OK ; if zero already

BCF _C
RRF ACC+B0 ; right shift by EXP
RRF ACC+B1
RRF ACC+B2
DECFSZ EXP
GOTO SHIFT32

SHIFT32OK BTFSC FPFLAGS,RND

Add Your Rating

(Not published)
star
starstar
starstarstar
starstarstarstar
starstarstarstarstar

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.