SHARE
TWEET

Untitled

a guest Oct 3rd, 2014 265 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. unsigned long long ADC(unsigned long long * a, unsigned long long * b, bool * carry)
  2. {
  3.     unsigned long long result;
  4.     unsigned char * pr = (unsigned char *) &result;
  5.     unsigned char * pa = (unsigned char *) a;
  6.     unsigned char * pb = (unsigned char *) b;
  7.     unsigned short temp = (carry) ? 1 : 0;
  8.     for (int i = 0; i < 8; i++)
  9.     {        
  10.         temp += *pa++;
  11.         temp += *pb++;
  12.         *pr++ = (unsigned char) temp;
  13.         temp >>= 8;
  14.     }
  15.    
  16.     *carry = (temp != 0);
  17.     return result;
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top