On Fri, 11 Feb 2000, James Newton wrote: > Doh! adding A2 twice does not multiply by 2! Thanks for spotting that one. > > >-92 = 0xa4 > > and 0xa4 << 1 is 0x48 > yes, but 0x48 or (72 + x) mod 256 is (x-184) mod 256 or in other words, > adding 72 and wrapping around 256 is the same as subtracting 184. I think > I'm right on that one. True but, there's also that carry bit. A two's complement can be written in terms of a one's complement: two's complement of x = 1 + one's complement of x. So, taking this snippet from your web page: > >>> rlf Tens,f ;B1 = 2*(4A2+A1-92) = 8A2+2A1-184 > >>> rlf Ones,f ;B0 = 2*(A3+A2+A1+4) = 2A3+2A2+2A1+8 > comf Ones,f ;B0 = -2A3-2A2-2A1-8 > rlf Ones,f ;B0 = 2*(-2A3-2A2-2A1-8) = -4A3-4A2-4A1-16 rlf Tens,f ;B1 = 2*(4A2+A1-92) = 8A2+2A1-184 (I'll leave this) rlf Ones,f ;B0 = 2*(A3+A2+A1+4) = 2A3+2A2+2A1+9 comf Ones,f ;B0 = ~(2A3+2A2+2A1+9) = -2A3-2A2-2A1-8 rlf Ones,f ;B0 = 2*(-2A3-2A2-2A1-8) = -4A3-4A2-4A1-16 The comf's comment is still the same... So now that I think about it, Payson new what he was doing (ah, should I have ever doubted...) Scott