Xref: utzoo comp.arch:3811 comp.sys.m68k:802 comp.misc:2050 sci.crypt:922 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!tektronix!tekcrl!tekfdi!videovax!stever From: stever@videovax.Tek.COM (Steven E. Rice, P.E.) Newsgroups: comp.arch,comp.sys.m68k,comp.misc,sci.crypt Subject: Re: conversion algorithm, floating pt formats Message-ID: <4877@videovax.Tek.COM> Date: 5 Mar 88 08:18:32 GMT References: <3910@batcomputer.tn.cornell.edu> Reply-To: stever@videovax.Tek.COM (Steven E. Rice, P.E.) Distribution: comp Organization: Tektronix Television Systems, Beaverton, Oregon Lines: 21 Keywords: IEEE format to BCD format, 68881,C Summary: The 68881 will do it; the 68020 helps. In article <3910@batcomputer.tn.cornell.edu>, Padma Krishnaswamy (padama@batcomputer.tn.cornell.edu) writes: > I'm posting the following for a friend who does not have access to the net: > > Does anyone know of an algorithm for converting IEEE format floating point > numbers to bcd floating point? Is there a commercially available program > in 'C' or 68881 assembler to do this? Please respond to the net or to my > mail id. The 68881 fmove instruction will do this. Storing a value as a BCD result will convert it to a packed decimal string (2 digits per byte) with an exponent, as appropriate. The 68020 has an unpack instruction which allows unpacking the result as one digit per byte, with an appropriate value (hex '3' is useful) in the upper 4 bits of each byte. Steve Rice ----------------------------------------------------------------------------- * Every knee shall bow, and every tongue confess that Jesus Christ is Lord! * new: stever@videovax.tv.Tek.com old: {decvax | hplabs | ihnp4 | uw-beaver}!tektronix!videovax!stever