please dont rip this site

Atmel AVR Microcontroller
Basic Math Code Library
for Square Roots

by http://elm-chan.org

;-----------------------------------------------------------------------------:
; 32bit squareroot
;
; Register Variables
;  Call:  var[03:00] = Source (32bit)
;         var[12:04] = <work area>       *var08 and var12 must be high-regs.
;
;  Result:var[01:00] = Result (16bit)
;         var[12:02] = <broken>
;
; Size  = 53 words
; Clock = 528..544 cycles (+ret)
; Stack = 0 byte

sqrt32:		clr	var04
		clr	var05
		clr	var06
		clr	var07
		ldi	var08,1
		clr	var09
		clr	var10
		clr	var11
		ldi	var12,16
sqrt32l:	lsl	var00
		rol	var01
		rol	var02
		rol	var03
		rol	var04
		rol	var05
		rol	var06
		rol	var07
		lsl	var00
		rol	var01
		rol	var02
		rol	var03
		rol	var04
		rol	var05
		rol	var06
		rol	var07
		brpl	PC+6
		add	var04,var08
		adc	var05,var09
		adc	var06,var10
		adc	var07,var11
		rjmp	PC+5
		sub	var04,var08
		sbc	var05,var09
		sbc	var06,var10
		sbc	var07,var11
		lsl	var08
		rol	var09
		rol	var10
		andi	var08,0b11111000
		ori	var08,0b00000101
		sbrc	var07,7
		subi	var08,2
		dec	var12
		brne	sqrt32l
		lsr	var10
		ror	var09
		ror	var08
		lsr	var10
		ror	var09
		ror	var08
		mov	var00,var08
		mov	var01,var09
		ret






file: /Techref/atmel/avr/sqrt32b-ec.htm, 1KB, , updated: 2007/9/14 17:17, local time: 2024/11/25 10:05,
TOP NEW HELP FIND: 
3.145.81.252: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/sqrt32b-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!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .