;-----------------------------------------------------------------------------: ; 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/12/27 16:32,
3.139.234.68: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? <A HREF="http://sxlist.com/techref/atmel/avr/sqrt16b-ec.htm"> Atmel AVR Microcontroller Basic Math Code Library for Square Roots</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.