Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned long long ADC(unsigned long long * a, unsigned long long * b, bool * carry)
- {
- unsigned long long result;
- unsigned char * pr = (unsigned char *) &result;
- unsigned char * pa = (unsigned char *) a;
- unsigned char * pb = (unsigned char *) b;
- unsigned short temp = (carry) ? 1 : 0;
- for (int i = 0; i < 8; i++)
- {
- temp += *pa++;
- temp += *pb++;
- *pr++ = (unsigned char) temp;
- temp >>= 8;
- }
- *carry = (temp != 0);
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement