sheel
I love Asm
Ach so, das ist Big Endian.
Schaut nicht besonders schön aus, aber:
Schaut nicht besonders schön aus, aber:
C:
void addShort(void *destBE, void *src1BE, void *src2LE)
{
((unsigned char *)destBE)[0] = ((unsigned char *)src1BE)[0] + ((unsigned char *)src2LE)[1];
if((((unsigned char *)src1BE)[1] + ((unsigned char *)src2LE)[0]) < ((unsigned char *)src1BE)[1])
((unsigned char *)destBE)[0]++;
((unsigned char *)destBE)[1] = ((unsigned char *)src1BE)[1] + ((unsigned char *)src2LE)[0];
}
...
addShort(SendData, ReceiveData, &pin);