[Cryptech Tech] Pascal indexing?

Rob Austein sra at hactrn.net
Tue May 5 13:07:25 UTC 2015


At Tue, 05 May 2015 08:53:02 +0200, Joachim Strömbergson wrote:
> 
> To me it makes more sence to have someting called _BIT be the index
> number of the bit. But hey, I'm the HW guy and also know the context. If
> the team thinks it would be easier to grokk for users (esp SW
> developers) to have _BIT mean the bitmask then I'm all for it.

Software generally wants it in mask form.  One can do this by defining
the constants as masks or by defining the constants as bit numbers and
using "<<".  Which makes sense depends on whether anything actually
needs the bit numbers: "<<" is easy, log2() is harder, but if nothing
needs the bit numbers, just using the mask is that much simpler.


More information about the Tech mailing list