signextend
M = signextend((((short)(s1->m_tolerance & 0xC0)) << 2) + s1->m, 10);
B = signextend((((short)(s1->b_accuracy & 0xC0)) << 2) + s1->b, 10);
K1 = signextend(s1->rbexp & 0xF, 4);
K2 = signextend(s1->rbexp >> 4, 4);
static long signextend(unsigned long, int);