;********************************************************************** ;SMALL 8 BIT SQUARE ROOT ; ;Author: Nikolai Golovchenko <golovchenko at mail.ru> ;Idea: Scott Dattalo <www.dattalo.com> ;"Hint: n^2 = sum of the first n odd integers.(e.g 9 = 3*3 = 1 + 3 + 5)" ;Date: February 16, 2000 ; ;Input and output in ACCB0 ;ROM - 9 ;RAM - 1 ;Timing - 12..87 cycles including call and return ;********************************************************************** Sqrt8s movlw -1 Sqrt8s1 addlw 2 subwf ACCB0, f skpnc goto Sqrt8s1 movwf ACCB0 ; decf ACCB0, f ;Dmitry Kiryashov says: Since W is always holding odd value this decf ; isn't required I guess. ... W is always 1,3,5,7,9,.. right? ;and Scott Dattalo aggrees. rrf ACCB0, f return ;**********************************************************************
file: /Techref/microchip/math/sqrt/sqrt8ngsd.htm, 1KB, , updated: 2000/2/17 10:49, local time: 2024/11/8 15:41,
3.142.252.100:LOG IN ©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!
|
©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://www.piclist.com/techref/microchip/math/sqrt/sqrt8ngsd.htm"> PIC Microcontoller Math Method </A> |
Did you find what you needed? |
PICList 2024 contributors:
o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.