while(r1 > 0){
r1 = dato ^ polin;
r1 = 0x1 >> dato;
}
Your while loop never exits because the value of r1
never changes after the first iteration. The result of the first line is never used and the second line returns the same result every time because the loop doesn't modify the value of dato
.