<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Mon, 18 Jul 1994 10:25:24 EST
From   : Stephen Quan <quan@...>
Subject: Re: more on ADC lookup tables [correction].

> For BCD addition, I have
> 
>     A2 = lo_bcd_ADC[sum = (A & 15) + (M & 15) + get_C()] ^
>            hi_bcd_ADC[sum = (A >> 4) + (M >> 4) + lo_bcd_ADC_carry[sum]];

I just tried the above.  It does not work!  This is because it actually
evaluted the hi_bcd_ADC[] bit first before the lo_bcd_ADC, which meant
it is using the wrong value of sum.  I had to change it to

      sum = (A & 15) + (M & 15) + get_C()
      A2 = lo_bcd_ADC[sum] ^
             hi_bcd_ADC[sum = (A >> 4) + (M >> 4) + lo_bcd_ADC_carry[sum]];

Sorry about that, guys.
-- 
Stephen Quan (quan@...                 ), SysAdmin, Analyst/Programmer.
Centre for Spatial Information Studies, University of Tasmania, Hobart.
GPO BOX 252C, Australia, 7001.  Local Tel: (002) 202898 Fax: (002) 240282
International Callers use +6102 instead of (002).
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>