Re: A83: DAA and BCD.
[Prev][Next][Index][Thread]
Re: A83: DAA and BCD.
Icarus Software (http://icarus.ganymed.org/) has a z80 tutorial which
somewhat explains bcd and how to add/subtract
-Dan
----- Original Message -----
From: James Matthews <matthews@tkb.att.ne.jp>
To: <assembly-83@lists.ticalc.org>
Sent: Sunday, December 20, 1998 12:59 AM
Subject: Re: A83: DAA and BCD.
>
>This is a followup to the post I made on the 10th...
>
>Ok, so how would I create two numbers in BCD, add them, and put the result
>in A?
>
>Thanks, James.
>
>==========================================
>E-mail matthews@tkb.att.ne.jp ICQ: 7413754
>http://home.att.ne.jp/gold/tomcat21/index.html
>http://hyperion.advanced.org/18242/
>==========================================
>-----Original Message-----
>From: John Kugelman <kugelman@mnsinc.com>
>To: assembly-83@lists.ticalc.org <assembly-83@lists.ticalc.org>
>Date: Thursday, December 10, 1998 9:12 PM
>Subject: Re: A83: DAA and BCD.
>
>
>>
>>James Matthews wrote:
>>>
>>> Ok, can someone explain to me what is BCD format, and what does DAA do?!
>>
>>BCD means Binary Coded Decimal (there abouts). It's a numerical format
>>used to express decimal numbers more conveniently in a binary system.
>>Typically, a number will be represented as 1 or 2 decimal digits per
>>byte. 1 digit per byte is very inefficient spacewise, but it's very
>>easy to work with decimal numbers in this form. 2 digits per byte
>>(packed BCD) is more efficient, but more difficult to work with.
>>
>>In either case, BCD is less efficient spacewise than storing the number
>>in native binary, but this is the trade off for ease of use.
>>
>>The floating point format used in the TI-83 is similar to BCD format
>>because it stores decimal digits individually, similarly to packed BCD.
>>
>>DAA, interpreting the instruction set list I'm reading, converts a into
>>BCD after a BCD operation performed on a. Adding or subtracting BCD
>>numbers isn't as simple as an add or sub instruction - I'm guessing that
>>one must add the two numbers and then use DAA to convert the result back
>>to BCD format.
>>
>>--
>>John Kugelman. kugelman@mnsinc.com
>>
>>I believe we can change anything.
>>I believe in my dream.
>> - Joe Satriani
>>
>