flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
pool 12 Mar 2008, 11:41
..
Last edited by pool on 17 Mar 2013, 11:44; edited 1 time in total |
|||
![]() |
|
bitRAKE 12 Mar 2008, 12:20
square root is more complicated:
Code: Sqrt: xor ecx,ecx xor eax,eax bsr edx,[esp+4] je .x and edx,-2 ; even bts ecx,edx .0: add eax,ecx sub [esp+4],eax jnc .1 add [esp+4],eax sub eax,ecx jmp .2 .1: add eax,ecx .2: shr eax,1 shr ecx,2 jne .0 .x: retn 4 ; EAX = square root _________________ ¯\(°_o)/¯ The hardcore cynic mistakes good for guile. |
|||
![]() |
|
pool 24 Mar 2008, 03:59
..
Last edited by pool on 17 Mar 2013, 11:44; edited 1 time in total |
|||
![]() |
|
edfed 24 Mar 2008, 11:37
for that, don't try square root.
the square is enough to know the distance. and in 3D, the principle is to simplify the equation, then, the algo will be little. x2D = k (x/z) y2D = k (y/z) |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.