Example #1
0
void MrfData_LCD::assemble()
{
    clearDataStream();
    setNumWords(_text.length());
    for ( uint i = 0; i < _text.length(); i++ ) {
        // fill the data word
        setStreamItemValue( "LCDpos", pos2LCD(i), i );
        setStreamItemValue( "LCDchar", char2LCD(_text.at(i)), i );
    }
}
Example #2
0
// Multiply by an integer factor and add an integer increment.  The addition is essentially free,
//  use this with a zero second argument for basic multiplication.
void BigInteger::multAndIncrementBy(int32 factor, int32 addition)
{
    uint64_t opResult;

    // perform mult op, moving carry forward.
    uint64_t carry = addition; // init cary with first addition
    int x;
    for(x=0; x < numWords; x++)
    {
        opResult = (uint64_t)wordBuffer[x] * (uint64_t)factor + carry;
        carry = opResult >> 32;
        wordBuffer[x] = (uint32)(opResult & 0xffffffff);
    }

    // if carry goes over the existing top, may need to expand wordBuffer
    if (carry)
    {
        setNumWords(numWords+1);
        wordBuffer[x] = (uint32)carry;
    }

}