void f(short int last, short int first, short int myNr){
//construct mask for last bits
short int mask=0;
for(int i=0;i>1;}
aux=myNr;
aux&=mask;
aux>>last; // only first bits are left and shifted
}
you can add parameters to get the values out or something