I am very new in assembly and I want to find all pythagorean triples in a range from 1 to 100. I'm generating all the numbers in C and all the other calculations should be done in assembly SSE. I was trying to do this by using sqrt command (I've tried all of them) but I couldn't make it work.. Can someone tell me how it should be done?
That's what I've got so far:
int main(){
for (int i = 1; i <= 100; i++)
{
a++;
if (a > 100)
a = 0;
for (int j = 1; j <= 100; j++)
{
b++;
if (b > 100)
b = a;
_asm //tricky part begins here:
{
movups xmm0, a
movups xmm1, b
pmuludq xmm0, xmm0
pmuludq xmm1, xmm1
//movups xmm2, 0
//paddd xmm2, xmm0
//paddd xmm2, xmm1
movups z, xmm0
}
printf("%d\n", z);
}
}
}