User Tools

Site Tools


base:fast_sqrt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
base:fast_sqrt [2019-08-04 02:03]
verz
base:fast_sqrt [2019-08-18 20:28]
verz
Line 397: Line 397:
  
 This is the code for a 32bit integer Sqrt. Provides the result and the remainder: This is the code for a 32bit integer Sqrt. Provides the result and the remainder:
-<​code>​+<​code ​6502acme>
 ;​******************************************** ;​********************************************
 ;*    sqrt32 ;*    sqrt32
 ;* ;*
 ;*   ​computes Sqrt of a 32bit number ;*   ​computes Sqrt of a 32bit number
 +;​********************************************
 +;*   by Verz - Jul2019
 +;​********************************************
 ;* ;*
-;*      input: ​ square, ​the 4-byte ​source number +;*  input: ​ square, ​32bit source number 
-;*      output: sqrt, 16bit value +;*  output: sqrt,   ​16bit value 
-;*              remnd, 17bit value +;*          remnd, ​ 17bit value 
-;*+;********************************************
  
 sqrt32 ​ lda #0 sqrt32 ​ lda #0
Line 414: Line 417:
         ;sta T+1        ; (T+1) is zero until last iteration; (T+0) is always 0         ;sta T+1        ; (T+1) is zero until last iteration; (T+0) is always 0
  
 +        clc
         ldy #14         ; 15 iterations (14-->0) + last iteration         ldy #14         ; 15 iterations (14-->0) + last iteration
 loopsq  ​ loopsq  ​
base/fast_sqrt.txt · Last modified: 2019-08-18 20:28 by verz