please dont rip this site

Atmel AVR Microcontroller
Basic Math Code Library
for Square Roots

by http://elm-chan.org

;-----------------------------------------------------------------------------:
; 16bit squareroot
;
; Register Variables
;  Call:  var[1:0] = Source (16bit)
;         var[6:2] = <work area>       * var4 and var6 must be high-regs.
;
;  Result:var[0]   = Result (8bit)
;         var[6:1] = <broken>
;
; Size  = 33 words
; Clock = 177..185 cycles (+ret)
; Stack = 0 byte

sqrt16:		clr	var2
		clr	var3
		ldi	var4,1
		clr	var5
		ldi	var6,8
sqrt16l:	lsl	var0
		rol	var1
		rol	var2
		rol	var3
		lsl	var0
		rol	var1
		rol	var2
		rol	var3
		brpl	PC+4
		add	var2,var4
		adc	var3,var5
		rjmp	PC+3
		sub	var2,var4
		sbc	var3,var5
		lsl	var4
		rol	var5
		andi	var4,0b11111000
		ori	var4,0b00000101
		sbrc	var3,7
		subi	var4,2
		dec	var6
		brne	sqrt16l
		lsr	var5
		ror	var4
		lsr	var5
		ror	var4
		mov	var0, var4
		ret




file: /Techref/atmel/avr/sqrt16b-ec.htm, 1KB, , updated: 2007/9/14 17:16, local time: 2024/11/22 09:34,
TOP NEW HELP FIND: 
3.148.108.192:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://massmind.org/Techref/atmel/avr/sqrt16b-ec.htm"> Atmel AVR Microcontroller Basic Math Code Library for Square Roots</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .