<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.cpcwiki.eu/index.php?action=history&amp;feed=atom&amp;title=Programming%3AFast_16_bit_Square_Root</id>
	<title>Programming:Fast 16 bit Square Root - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.cpcwiki.eu/index.php?action=history&amp;feed=atom&amp;title=Programming%3AFast_16_bit_Square_Root"/>
	<link rel="alternate" type="text/html" href="https://www.cpcwiki.eu/index.php?title=Programming:Fast_16_bit_Square_Root&amp;action=history"/>
	<updated>2026-08-30T22:21:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://www.cpcwiki.eu/index.php?title=Programming:Fast_16_bit_Square_Root&amp;diff=90908&amp;oldid=prev</id>
		<title>Ygdrazil at 08:43, 1 September 2014</title>
		<link rel="alternate" type="text/html" href="https://www.cpcwiki.eu/index.php?title=Programming:Fast_16_bit_Square_Root&amp;diff=90908&amp;oldid=prev"/>
		<updated>2014-09-01T08:43:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:43, 1 September 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l118&quot;&gt;Line 118:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 118:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	ret&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	ret&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Programming]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:1.41:old-18788:rev-90908:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Ygdrazil</name></author>
	</entry>
	<entry>
		<id>https://www.cpcwiki.eu/index.php?title=Programming:Fast_16_bit_Square_Root&amp;diff=18788&amp;oldid=prev</id>
		<title>Executioner: Fixed last unroll</title>
		<link rel="alternate" type="text/html" href="https://www.cpcwiki.eu/index.php?title=Programming:Fast_16_bit_Square_Root&amp;diff=18788&amp;oldid=prev"/>
		<updated>2007-09-19T05:22:31Z</updated>

		<summary type="html">&lt;p&gt;Fixed last unroll&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:22, 19 September 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l109&quot;&gt;Line 109:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 109:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	ld a,d&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	ld a,d&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	cp (hl)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	cp (hl)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	jr nz,$ + &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;6&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	jr nz,$ + &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;5&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	dec h&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	dec h&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	ld a,e&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	ld a,e&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:1.41:old-18787:rev-18788:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Executioner</name></author>
	</entry>
	<entry>
		<id>https://www.cpcwiki.eu/index.php?title=Programming:Fast_16_bit_Square_Root&amp;diff=18787&amp;oldid=prev</id>
		<title>Executioner: New page</title>
		<link rel="alternate" type="text/html" href="https://www.cpcwiki.eu/index.php?title=Programming:Fast_16_bit_Square_Root&amp;diff=18787&amp;oldid=prev"/>
		<updated>2007-09-19T05:20:41Z</updated>

		<summary type="html">&lt;p&gt;New page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This routine was written by [[User:Executioner|The Executioner]] based on the fast pre-calculated square routine and an algorithm by Milos &amp;quot;baze&amp;quot; Bazelides, with 16 bit arithmetic removed for faster performance.&lt;br /&gt;
&lt;br /&gt;
The initialisation routine, used to build the squares table (same as for the Pre-calculated Square table (my version)).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	ld de,1&lt;br /&gt;
	ld hl,0&lt;br /&gt;
	ld ix,sqtab&lt;br /&gt;
sqloop:	ld (ix + 0),l&lt;br /&gt;
	inc hx&lt;br /&gt;
	ld (ix + 0),h&lt;br /&gt;
	dec hx&lt;br /&gt;
	add hl,de&lt;br /&gt;
	inc de&lt;br /&gt;
	inc de&lt;br /&gt;
	inc lx&lt;br /&gt;
	jr nz,sqloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The actual 16 bit square root routine.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Input:&amp;#039;&amp;#039;&amp;#039; DE = &amp;#039;&amp;#039;The number you want to find the square root of&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Output:&amp;#039;&amp;#039;&amp;#039; A = &amp;#039;&amp;#039;Square root of the number supplied in DE&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Destroys:&amp;#039;&amp;#039;&amp;#039; HL&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Call:&amp;#039;&amp;#039;&amp;#039; CALL SqrtDE&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SqrtDE:	ld hl,sqtab + #180&lt;br /&gt;
	ld a,d&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	jr nz,$ + 6&lt;br /&gt;
	dec h&lt;br /&gt;
	ld a,e&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	inc h&lt;br /&gt;
	set 6,l&lt;br /&gt;
	jr nc,$ + 4&lt;br /&gt;
	res 7,l&lt;br /&gt;
&lt;br /&gt;
	ld a,d&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	jr nz,$ + 6&lt;br /&gt;
	dec h&lt;br /&gt;
	ld a,e&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	inc h&lt;br /&gt;
	set 5,l&lt;br /&gt;
	jr nc,$ + 4&lt;br /&gt;
	res 6,l&lt;br /&gt;
&lt;br /&gt;
	ld a,d&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	jr nz,$ + 6&lt;br /&gt;
	dec h&lt;br /&gt;
	ld a,e&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	inc h&lt;br /&gt;
	set 4,l&lt;br /&gt;
	jr nc,$ + 4&lt;br /&gt;
	res 5,l&lt;br /&gt;
&lt;br /&gt;
	ld a,d&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	jr nz,$ + 6&lt;br /&gt;
	dec h&lt;br /&gt;
	ld a,e&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	inc h&lt;br /&gt;
	set 3,l&lt;br /&gt;
	jr nc,$ + 4&lt;br /&gt;
	res 4,l&lt;br /&gt;
&lt;br /&gt;
	ld a,d&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	jr nz,$ + 6&lt;br /&gt;
	dec h&lt;br /&gt;
	ld a,e&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	inc h&lt;br /&gt;
	set 2,l&lt;br /&gt;
	jr nc,$ + 4&lt;br /&gt;
	res 3,l&lt;br /&gt;
&lt;br /&gt;
	ld a,d&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	jr nz,$ + 6&lt;br /&gt;
	dec h&lt;br /&gt;
	ld a,e&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	inc h&lt;br /&gt;
	set 1,l&lt;br /&gt;
	jr nc,$ + 4&lt;br /&gt;
	res 2,l&lt;br /&gt;
&lt;br /&gt;
	ld a,d&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	jr nz,$ + 6&lt;br /&gt;
	dec h&lt;br /&gt;
	ld a,e&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	inc h&lt;br /&gt;
	inc l&lt;br /&gt;
	jr nc,$ + 4&lt;br /&gt;
	res 1,l&lt;br /&gt;
&lt;br /&gt;
	ld a,d&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	jr nz,$ + 6&lt;br /&gt;
	dec h&lt;br /&gt;
	ld a,e&lt;br /&gt;
	cp (hl)&lt;br /&gt;
	ld a,l&lt;br /&gt;
	ret nc&lt;br /&gt;
	dec a&lt;br /&gt;
	ret&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Executioner</name></author>
	</entry>
</feed>