How can I get the square root of a number without using FPU ? Does anyone know some efficient algo ?

Thanks
Posted on 2005-01-22 14:19:15 by Marginais
:) e ae ?
vc eh do brasil neh kra ....
ai vai seu algo pra tirar raiz :


Raiz proc Valor:DWORD
LOCAL Resultado:DWORD
mov ecx,Valor

.while ecx
push ecx
mov ebx,ecx
mov edx,ecx
dec ebx
.while ebx
add ecx,edx
.if ecx == Valor
mov Resultado,edx
.endif
dec ebx
.endw
pop ecx
.break .if ecx == 0
dec ecx
.endw
mov eax,Resultado
ret
Raiz endp

espero que seja de ajuda :-D
Posted on 2005-01-22 15:15:36 by GR33d
You should search the forum...

http://www.asmcommunity.net/board/viewtopic.php?t=14863&start=0
Posted on 2005-01-22 18:49:13 by roticv
E ae, blz GR33d ?
Ow valeu pelo c?digo, ajudou bastante. At? q enfim achei alguem 'normal' nesse f?rum cheio d loko. hehehe valeu.
Posted on 2005-01-24 17:35:36 by Marginais
os gringo aki saum meio doido mesmo ehehe
mas ai , qualquer coisa eh soh postar ai que eu to sempre aki :-D

falow ae
Posted on 2005-01-25 09:09:38 by GR33d
Eh bom ter conterraneos no forum :lol:
Posted on 2005-01-25 10:38:47 by Cthulhu
Marginais,
Take a look at the link below. Ratch

http://www.bmath.net/bmath/index.html
Posted on 2005-01-26 05:30:26 by Ratch
Ow Ratch, thanks. That's a very interesting and helpful page. :-D

Blz, agora a gente vai encontrando os camaradas no forum .. :lol:
Posted on 2005-01-26 20:40:46 by Marginais