<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.intellivision.us/index.php?action=history&amp;feed=atom&amp;title=Fastdivu.asm</id>
		<title>Fastdivu.asm - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.intellivision.us/index.php?action=history&amp;feed=atom&amp;title=Fastdivu.asm"/>
		<link rel="alternate" type="text/html" href="http://wiki.intellivision.us/index.php?title=Fastdivu.asm&amp;action=history"/>
		<updated>2026-08-20T21:35:10Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wiki.intellivision.us/index.php?title=Fastdivu.asm&amp;diff=14786&amp;oldid=prev</id>
		<title>Mr z: Protected &quot;Fastdivu.asm&quot; ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite))</title>
		<link rel="alternate" type="text/html" href="http://wiki.intellivision.us/index.php?title=Fastdivu.asm&amp;diff=14786&amp;oldid=prev"/>
				<updated>2010-12-04T08:21:02Z</updated>
		
		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/index.php/Fastdivu.asm&quot; title=&quot;Fastdivu.asm&quot;&gt;Fastdivu.asm&lt;/a&gt;&amp;quot; ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite))&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 08:21, 4 December 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Mr z</name></author>	</entry>

	<entry>
		<id>http://wiki.intellivision.us/index.php?title=Fastdivu.asm&amp;diff=2947&amp;oldid=prev</id>
		<title>Mr z: /* Functions Provided */</title>
		<link rel="alternate" type="text/html" href="http://wiki.intellivision.us/index.php?title=Fastdivu.asm&amp;diff=2947&amp;oldid=prev"/>
				<updated>2008-09-06T20:51:00Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Functions Provided&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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 style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:51, 6 September 2008&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-l4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;CENTER&amp;gt;&amp;lt;TABLE BORDER&amp;gt;&amp;lt;TR&amp;gt;&amp;lt;TH&amp;gt;Entry point&amp;lt;/TH&amp;gt;&amp;lt;TH&amp;gt;Function provided&amp;lt;/TH&amp;gt;&amp;lt;TH&amp;gt;Notes&amp;lt;/TH&amp;gt;&amp;lt;/TR&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;CENTER&amp;gt;&amp;lt;TABLE BORDER&amp;gt;&amp;lt;TR&amp;gt;&amp;lt;TH&amp;gt;Entry point&amp;lt;/TH&amp;gt;&amp;lt;TH&amp;gt;Function provided&amp;lt;/TH&amp;gt;&amp;lt;TH&amp;gt;Notes&amp;lt;/TH&amp;gt;&amp;lt;/TR&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;FASTDIVU&amp;lt;/TD&amp;gt;&amp;lt;TD ROWSPAN=3&amp;gt;Divide two unsigned integers / fixed-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pt &lt;/del&gt;numbers&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Numerator in register, denominator and fractional point fixed in ROM.&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;FASTDIVU&amp;lt;/TD&amp;gt;&amp;lt;TD ROWSPAN=3&amp;gt;Divide two unsigned integers / &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Fixed Point Arithmetic|&lt;/ins&gt;fixed-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;point]] &lt;/ins&gt;numbers&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Numerator in register, denominator and fractional point fixed in ROM.&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;FASTDIVU.1&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Numerator and denominator in registers, fractional point fixed in ROM.&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;FASTDIVU.1&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Numerator and denominator in registers, fractional point fixed in ROM.&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;FASTDIVU.2&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Numerator, denominator and fractional point in registers.&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&amp;lt;/TABLE&amp;gt;&amp;lt;/CENTER&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;FASTDIVU.2&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Numerator, denominator and fractional point in registers.&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&amp;lt;/TABLE&amp;gt;&amp;lt;/CENTER&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mr z</name></author>	</entry>

	<entry>
		<id>http://wiki.intellivision.us/index.php?title=Fastdivu.asm&amp;diff=2941&amp;oldid=prev</id>
		<title>Mr z: /* Notes */</title>
		<link rel="alternate" type="text/html" href="http://wiki.intellivision.us/index.php?title=Fastdivu.asm&amp;diff=2941&amp;oldid=prev"/>
				<updated>2008-09-06T20:28:57Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Notes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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 style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:28, 6 September 2008&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-l17&quot; &gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function requires both numerator and denominator to be positive and less than 0x8000.&amp;#160; If you need more general divide functionality, please use [[dividivu.asm]] instead.&amp;lt;br \&amp;gt;&amp;lt;br \&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function requires both numerator and denominator to be positive and less than 0x8000.&amp;#160; If you need more general divide functionality, please use [[dividivu.asm]] instead.&amp;lt;br \&amp;gt;&amp;lt;br \&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;If you are dividing by a power of 2, consider [[Introducing_the_Instruction_Set_Part_4#Using_Shifts_for_Division_by_Powers_of_Two|using shifts instead]].&amp;lt;br \&amp;gt;&amp;lt;br \&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Source Code =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Source Code =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mr z</name></author>	</entry>

	<entry>
		<id>http://wiki.intellivision.us/index.php?title=Fastdivu.asm&amp;diff=2940&amp;oldid=prev</id>
		<title>Mr z: /* Notes */</title>
		<link rel="alternate" type="text/html" href="http://wiki.intellivision.us/index.php?title=Fastdivu.asm&amp;diff=2940&amp;oldid=prev"/>
				<updated>2008-09-06T20:26:47Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Notes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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 style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:26, 6 September 2008&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-l16&quot; &gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Notes =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Notes =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;If you need more general divide functionality, please use [[dividivu.asm]] instead.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;This function requires both numerator and denominator to be positive and less than 0x8000.&amp;#160; &lt;/ins&gt;If you need more general divide functionality, please use [[dividivu.asm]] instead.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;br \&amp;gt;&amp;lt;br \&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Source Code =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Source Code =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mr z</name></author>	</entry>

	<entry>
		<id>http://wiki.intellivision.us/index.php?title=Fastdivu.asm&amp;diff=2939&amp;oldid=prev</id>
		<title>Mr z at 20:25, 6 September 2008</title>
		<link rel="alternate" type="text/html" href="http://wiki.intellivision.us/index.php?title=Fastdivu.asm&amp;diff=2939&amp;oldid=prev"/>
				<updated>2008-09-06T20:25:19Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Programming]] [[Category:Library]]&lt;br /&gt;
&lt;br /&gt;
= Functions Provided =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CENTER&amp;gt;&amp;lt;TABLE BORDER&amp;gt;&amp;lt;TR&amp;gt;&amp;lt;TH&amp;gt;Entry point&amp;lt;/TH&amp;gt;&amp;lt;TH&amp;gt;Function provided&amp;lt;/TH&amp;gt;&amp;lt;TH&amp;gt;Notes&amp;lt;/TH&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;FASTDIVU&amp;lt;/TD&amp;gt;&amp;lt;TD ROWSPAN=3&amp;gt;Divide two unsigned integers / fixed-pt numbers&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Numerator in register, denominator and fractional point fixed in ROM.&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;FASTDIVU.1&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Numerator and denominator in registers, fractional point fixed in ROM.&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;FASTDIVU.2&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Numerator, denominator and fractional point in registers.&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&amp;lt;/TABLE&amp;gt;&amp;lt;/CENTER&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
See source code below for calling convention.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
(todo... please contribute!)&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
&lt;br /&gt;
If you need more general divide functionality, please use [[dividivu.asm]] instead.&lt;br /&gt;
&lt;br /&gt;
= Source Code =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;* ======================================================================== *;&lt;br /&gt;
;*  These routines are placed into the public domain by their author.  All  *;&lt;br /&gt;
;*  copyright rights are hereby relinquished on the routines and data in    *;&lt;br /&gt;
;*  this file.  -- Joseph Zbiciak, 2008                                     *;&lt;br /&gt;
;* ======================================================================== *;&lt;br /&gt;
&lt;br /&gt;
;; ======================================================================== ;;&lt;br /&gt;
;;  FASTDIVU      Divide two unsigned integers / fixed-pt numbers           ;;&lt;br /&gt;
;;  FASTDIVU.1    Alternate entry point:  denominator in register           ;;&lt;br /&gt;
;;  FASTDIVU.2    Alternate entry point:  all parameters in registers       ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;  AUTHOR                                                                  ;;&lt;br /&gt;
;;      Joseph Zbiciak &amp;lt;intvnut AT gmail.com&amp;gt;                               ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;  REVISION HISTORY                                                        ;;&lt;br /&gt;
;;      27-Sep-2001 Wrote fast version, shaving another ~200 cycles.        ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;  INPUTS for FASTDIVU                                                     ;;&lt;br /&gt;
;;      R0    Numerator                                                     ;;&lt;br /&gt;
;;      R5    Pointer to invocation record, followed by return address.     ;;&lt;br /&gt;
;;            Denominator                  1 DECLE                          ;;&lt;br /&gt;
;;            Fractional point             1 DECLE                          ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;  INPUTS for FASTDIVU.1                                                   ;;&lt;br /&gt;
;;      R0    Numerator                                                     ;;&lt;br /&gt;
;;      R1    Denominator                                                   ;;&lt;br /&gt;
;;      R5    Pointer to invocation record, followed by return address.     ;;&lt;br /&gt;
;;            Fractional point             1 DECLE                          ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;  INPUTS for FASTDIVU.2                                                   ;;&lt;br /&gt;
;;      R0    Numerator                                                     ;;&lt;br /&gt;
;;      R1    Denominator                                                   ;;&lt;br /&gt;
;;      R2    Fraction                                                      ;;&lt;br /&gt;
;;      R5    Return address                                                ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;  OUTPUTS                                                                 ;;&lt;br /&gt;
;;      R0    Remainder, left-shifted                                       ;;&lt;br /&gt;
;;      R1    Clobbered                                                     ;;&lt;br /&gt;
;;      R2    Clobbered                                                     ;;&lt;br /&gt;
;;      R3    Quotient                                                      ;;&lt;br /&gt;
;;      R4    Unmodified                                                    ;;&lt;br /&gt;
;;      R5    Return address                                                ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;  NOTES                                                                   ;;&lt;br /&gt;
;;      Both numerator and denominator MUST be positive, and less than      ;;&lt;br /&gt;
;;      0x8000.  This code may loop indefinitely if this is not heeded.     ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;      The remainder returned in R0 isn't directly usable.  This code      ;;&lt;br /&gt;
;;      can be modified to return a proper remainder by recording the       ;;&lt;br /&gt;
;;      number of left-shifts applied to the denominator in the norm        ;;&lt;br /&gt;
;;      loop, and applying that number of right-shifts to the remainder.    ;;&lt;br /&gt;
;;      Storing R2 after the normalization loop works for integer           ;;&lt;br /&gt;
;;      division (fractional point == 0) only.                              ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;      This code can perform fixed-point divide between two fixed point    ;;&lt;br /&gt;
;;      numbers, yielding a fixed-point result.  Given the numerator's      ;;&lt;br /&gt;
;;      fractional point X, the denominator's fractional point Y, and       ;;&lt;br /&gt;
;;      the desired fractional point Z, the required argument F for         ;;&lt;br /&gt;
;;      this divide is:  F = Z + Y - X.                                     ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;      This divide rounds towards zero.  All remainders are rounded down.  ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;  TECHNIQUES                                                              ;;&lt;br /&gt;
;;      Left-shifting method on numerator allows calculating fractional     ;;&lt;br /&gt;
;;      quotients as well as integer quotients.                             ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;  CODESIZE                                                                ;;&lt;br /&gt;
;;      28 words                                                            ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;  CYCLES                                                                  ;;&lt;br /&gt;
;;      Worst case analysis:                                                ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;      For FASTDIVU, cycles = 456 + 46*k, where k is # of quotient bits.   ;;&lt;br /&gt;
;;      The number of quotient bits 'k' is given by this equation:          ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;          k = ceil(log2(num)) - floor(log2(den)) + fractional_bits.       ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;      Subtract  8 cycles for FASTDIVU.1.                                  ;;&lt;br /&gt;
;;      Subtract 16 cycles for FASTDIVU.2.                                  ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;;      A worst-case divide with 15 quotient bits should take no more       ;;&lt;br /&gt;
;;      than 1146 cycles.  (The actual cycle count will depend on the       ;;&lt;br /&gt;
;;      relative magnitude of the numbers being divided.)                   ;;&lt;br /&gt;
;;                                                                          ;;&lt;br /&gt;
;; ======================================================================== ;;&lt;br /&gt;
FASTDIVU    PROC         &lt;br /&gt;
&lt;br /&gt;
            MVI@    R5,     R1      ;   8   Denominator&lt;br /&gt;
@@1:        MVI@    R5,     R2      ;   8   Fractional point&lt;br /&gt;
@@2:                                ;       Alt. entry: All args in regs &lt;br /&gt;
            CLRR    R3              ;   6   Start w/ quotient == 0.&lt;br /&gt;
                                    ;----&lt;br /&gt;
                                    ;  22&lt;br /&gt;
&lt;br /&gt;
            ;; ------------------------------------------------------------ ;;&lt;br /&gt;
            ;;  Normalize the divisor relative to the dividend.  We want    ;;&lt;br /&gt;
            ;;  to shift the denominator left as far as we can without      ;;&lt;br /&gt;
            ;;  making it larger than the numerator.  We achieve this by    ;;&lt;br /&gt;
            ;;  shifting it one position too far, then backing off.         ;;&lt;br /&gt;
            ;; ------------------------------------------------------------ ;;&lt;br /&gt;
&lt;br /&gt;
@@norm:     INCR    R2              ;   6   \&lt;br /&gt;
            SLL     R1,     1       ;   6    |-- General normalize:  Shift&lt;br /&gt;
            CMPR    R1,     R0      ;   6   /    until denom &amp;gt; numer.&lt;br /&gt;
            BC      @@norm          ;   9/7&lt;br /&gt;
                                    ;------&lt;br /&gt;
                                    ;  27*k - 2&lt;br /&gt;
                                    ;  22        &lt;br /&gt;
                                    ;------&lt;br /&gt;
                                    ;  27*k + 20&lt;br /&gt;
                                    ;======      Assume max K of 15&lt;br /&gt;
                                    ; 425        (worst case)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
@@over:     SLR     R1,     1       ;   6   Back off by one. &lt;br /&gt;
            CMPR    R3,     R2      ;   6   Is our divide loop iter count&lt;br /&gt;
                                    ;       at least 1?   (Note R3==0)&lt;br /&gt;
            BLE     @@zero          ;   7/9 NO:  Return zero.&lt;br /&gt;
            INCR    PC              ;   7   Do first iter of divide&lt;br /&gt;
                                    ;------&lt;br /&gt;
                                    ;  26        (worst case)&lt;br /&gt;
                                    ; 425        (worst case)&lt;br /&gt;
                                    ;======      &lt;br /&gt;
                                    ; 451        (worst case)&lt;br /&gt;
&lt;br /&gt;
            ;; ------------------------------------------------------------ ;;&lt;br /&gt;
            ;;  Perform the divide.  We iteratively subtract off our        ;;&lt;br /&gt;
            ;;  divisor from the dividend *IF* the dividend is greater or   ;;&lt;br /&gt;
            ;;  or equal to the divisor, and set the corresponding bit in   ;;&lt;br /&gt;
            ;;  the quotient.  If the dividend is smaller than the divisor, ;;&lt;br /&gt;
            ;;  we clear the corresponding quotient bit.  Next, we left-    ;;&lt;br /&gt;
            ;;  shift the dividend and calculate the next quotient bit.     ;;&lt;br /&gt;
            ;; ------------------------------------------------------------ ;;&lt;br /&gt;
&lt;br /&gt;
@@div:      SLL     R0,     1       ;   6   Shift numerator left 1&lt;br /&gt;
@@div1st:   CMPR    R1,     R0      ;   6   Is numerator &amp;gt;= denominator ?&lt;br /&gt;
            BNC     @@b0            ;   7/9 NO:   Quotient bit is 0&lt;br /&gt;
&lt;br /&gt;
@@b1:       RLC     R3,     1       ;   6   YES:  Quotient bit is 1&lt;br /&gt;
            SUBR    R1,     R0      ;   6&lt;br /&gt;
            DECR    R2              ;   6&lt;br /&gt;
            BNEQ    @@div           ;   9/7 Iterate for all quotient bits&lt;br /&gt;
                                    ;------&lt;br /&gt;
                                    ;  46*k - 2&lt;br /&gt;
@@zero:     JR      R5              ;   7   Return!&lt;br /&gt;
                                    ; 451&lt;br /&gt;
                                    ;======&lt;br /&gt;
                                    ; 456 + 46*k worst case.&lt;br /&gt;
&lt;br /&gt;
@@b0:       SLL     R3,     1       ;   6   NO:   Quotient bit is 0&lt;br /&gt;
            DECR    R2              ;   6&lt;br /&gt;
            BNEQ    @@div           ;   9/7 Iterate for all quotient bits&lt;br /&gt;
                                    ;------&lt;br /&gt;
                                    ;  42*k - 2&lt;br /&gt;
@@done:     JR      R5              ;   7   Return!&lt;br /&gt;
                                    ; 451&lt;br /&gt;
                                    ;======&lt;br /&gt;
                                    ; 456 + 42*k &lt;br /&gt;
&lt;br /&gt;
            ENDP    &lt;br /&gt;
&lt;br /&gt;
;; ======================================================================== ;;&lt;br /&gt;
;;  End of File:  fastdivu.asm                                              ;;&lt;br /&gt;
;; ======================================================================== ;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr z</name></author>	</entry>

	</feed>