[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] RC5, last test



> > 	So my question is easy ;-) How can I do a test on each chunk to find the
> > one that is null ?
> For a quick test whether *any* of the chunks of <register> is zero, use
> one of these:
>
> 	scmple.32 r0, <register>, r1
> 	scmpli.32 $1, <register>, r1
>
> After that, you can use lsb1/msb1 to find the first/last chunk.
> Another option is to tear the chunks apart and test them separately,
> e.g. via and, mix/expand or shift instructions, whatever fits your needs.
Ok, that ok to quickly detect if in the key that I have tested I have the 
solution. But I want to know wich key is the right. For that I must add the 
number of 32 bits chunk that contain a register to the current position of 
the chunk that is null in the second register.

For example, in the FC0, I know that I have only 2 chunks of 32 bits, then I 
must only add 2 to the base key to know it's value.

A+
  Cedric
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/