Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/22/11 13:48
Read: times


 
#182707 - SDCC might add pBCD type of numbers
Responding to: ???'s previous message
SDCC could provide a BCD type of variables, using packed BCD structure.
This way the XCHD instruction of 8051 core would be most valuable. Of course DA A also is very useful for the decimal numbering system.

Using pBCD type in 1 byte can be stored a number 0 - 99 decimal.
This type of numbering system together with libraries for BCD calculus
give the most accurate system for decimals as known. In conjuction with
fractions, math is accurate even for 1/3.

In C# there is a class of numbers that occupies 128bits to store financial
data in decimal system with many digits after the decimal point. Such a number type uses part of its storage for sign, NaN, +Infinite, -Infinite, +0, -0.
A lightweight method for packedBCD in 8051 could be provided as addon
feature with SDCC.



List of 12 messages in thread
TopicAuthorDate
XCHD use            01/01/70 00:00      
   XCHG usage            01/01/70 00:00      
   Search...            01/01/70 00:00      
   Re: XCHD use            01/01/70 00:00      
   not generated            01/01/70 00:00      
      SDCC might add pBCD type of numbers            01/01/70 00:00      
         Not a good idea            01/01/70 00:00      
            Depends            01/01/70 00:00      
               You're right            01/01/70 00:00      
   another possibility ...            01/01/70 00:00      
      both: 8048 legacy + (packed) BCD            01/01/70 00:00      
         simple example            01/01/70 00:00      

Back to Subject List