I'm an idiot.  Oh well.

BTW, There's some nice assembly routines for the msp430 for 32-bit
integers here:

http://toledo.inf.pucrs.br/~eduardob/disciplinas/microprocessadores/MSP/Application%20Book/chp5.pdf

Just a thought.

-Joe

On 11/16/05, Harri Siirtola <[EMAIL PROTECTED]> wrote:
>
>  From a quick look, shouldn't you do the rrc and rlc the other way round
> when subtracting, compared to adding?
>
> Regards,
>
>          Harri
>
> At 05:30 PM 11/16/2005 +0100, Andrea Pacini wrote:
> >I am going crazy about why this assembly code works :
> >
> >/* SUM BETWEEN LARGE INTEGERS */
> >
> >  for (i = 0; i < digits; i++) {
> >       asm volatile ("rrc %1 \n\t"
> >                                "addc %3, %2 \n\t"
> >                                "mov %2, %0 \n\t"
> >                                "rlc %1 \n\t"
> >
> >                                 :"=r"(a[i]),"+r"(carry)
> >                                 :"r"(b[i]), "r"(c[i])
> >                     );
> >    }
> >
> >
> >and this other doesn't work :
> >
> >/* DIFFERENCE BETWEEN LARGE INTEGERS */
> >  for (i = 0; i < digits; i++) {
> >       asm volatile ( "rrc %1 \n\t"
> >                                 "subc %3, %2 \n\t"
> >                                 "mov %2,%0 \n\t"
> >                                 "rlc %1 \n\t"
> >
> >                                 :"=r"(a[i]), "+r"(borrow)
> >                                 :"r"(b[i]), "r"(c[i])
> >                     );
> >    }
> >
> >The first does sum between two large integer (array),  b and c, and result
> >is stored in a , and it works fine
> >The second does difference but it doesnt' work !!!
> >The only difference is that in the second I use subc instead of addc.
> >
> >_______________________________________________
> >Tinyos-help mailing list
> >[email protected]
> >https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to