Thread: Bcd

  1. #1
    Registered User
    Join Date
    Jan 2005

    Question Bcd

    The other day I was discussing my project with one of my relatives. I was telling him how I am being extravagant with memory and speed because I created a structure to represent and work with angles in degrees minutes seconds format. Basically it gets rid of some conversion errors and that annoying thing with binary representation not operating exactly how we'd think about things in base 10. Well anyway, I told him that my system work similarly to BCD, Binary Coded Decimal, and that I probably would have used BCD instead except the code for it would have been more complex. Later he mentioned how long ago he did some work for a bank or something and he discovered that the processor had provisions to work directly in BCD.

    He mentioned something about loading AX and 32 bits, so I assumed it was for a 80386 based system. My question is:

    Do you folks know anything of this? Is it just a fading memory that is not entirely correct?

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    The x86 architecture does indeed support BCDs directly. I don't know how well, though, and I especially don't know if x86-64 still does it. Probably does (backwards compatibility and all that), but I doubt anyone really cares about the functionality.
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary to BCD conversion
    By Andy_P in forum C Programming
    Replies: 4
    Last Post: 11-18-2005, 11:16 AM
  2. C Serial Communication BCD
    By ZoomCities in forum C Programming
    Replies: 1
    Last Post: 10-13-2005, 07:00 PM
  3. Floating-Point (BCD)
    By zx-1 in forum C Programming
    Replies: 1
    Last Post: 10-15-2004, 01:11 AM
  4. HEX and BCD coded file READING !!
    By mehuldoshi in forum C Programming
    Replies: 2
    Last Post: 07-31-2002, 07:23 AM
  5. Utility to see the file content in HEX Format.
    By mehuldoshi in forum C Programming
    Replies: 7
    Last Post: 07-30-2002, 10:42 PM