tag:blogger.com,1999:blog-4757118446768919900.post5210181148328590119..comments2023-03-30T01:53:44.203-07:00Comments on Retro Programming: A Fast Z80 Integer Square RootJohn Metcalfhttp://www.blogger.com/profile/09108374348083307900noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-4757118446768919900.post-9754522272818676112020-12-27T15:45:34.862-08:002020-12-27T15:45:34.862-08:00The sample code in the 'First Make It Work'...The sample code in the 'First Make It Work' section shows <br /><br /> ld bc,08000h<br /><br />Should this be <br /><br /> ld bc,04000h<br /><br />To match the psudo code?<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4757118446768919900.post-11083652986632714692017-09-11T02:49:12.165-07:002017-09-11T02:49:12.165-07:00Really very well written and executed.Really very well written and executed.Sergio Sainzhttp://trivaltech.comnoreply@blogger.comtag:blogger.com,1999:blog-4757118446768919900.post-46484114786638281532017-09-07T06:31:41.187-07:002017-09-07T06:31:41.187-07:00This is clever and elegant! It was bothering me al...This is clever and elegant! It was bothering me all night, so I'm glad I stumbled upon this-- it's easily 30% faster than my fastest. When I actually get some time, I plan to dissect this to extend the precision by 8 bits. I'm using a 16→8.8 square root routine as a first approximation for 80-bit floats, then an iteration of Newton's method with 32-bit result, then a final iteration with 64-bit result to obtain the mantissa. Currently it's roughly 28000cc.<br /><br />I can't believe I never thought to use a conditional jump to skip over the SBC instructions like that! I've abused tricks like that before in division to skip parts of an iteration (and I didn't miss that CP, either-- that's snazzy).Zedahttps://www.blogger.com/profile/16721586697747551289noreply@blogger.com