<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Float Modulo in PureBasic</title>
	<atom:link href="http://gushh.net/blog/2009/08/27/float-modulo-in-purebasic/feed/" rel="self" type="application/rss+xml" />
	<link>http://gushh.net/blog/2009/08/27/float-modulo-in-purebasic/</link>
	<description>This blog is about software, electronics and game development.</description>
	<lastBuildDate>Mon, 23 Aug 2010 18:55:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: GuShH</title>
		<link>http://gushh.net/blog/2009/08/27/float-modulo-in-purebasic/comment-page-1/#comment-76</link>
		<dc:creator>GuShH</dc:creator>
		<pubDate>Fri, 28 Aug 2009 22:16:18 +0000</pubDate>
		<guid isPermaLink="false">http://gushh.net/blog/?p=48#comment-76</guid>
		<description>No problem. It&#039;s Assembly though, assembler would be the compiler itself. You can ask Intel for the IA32 manuals, they&#039;re free. Or just download the PDFs from their site.

The code is almost entirely taken from a manual. First we load X and Y onto the stack, We then loop until the control flag is cleared. So if the result of TEST is not zero (JNZ), we jump onto the label that we previously declared. We finally pop and we return.

FSTSW is simply used to get the condition bits into AX.

You may test the routine like so:

&lt;pre lang=&quot;purebasic&quot;&gt;For i=0 To 19
	Debug fmod( i*0.1, 0.5 )
Next&lt;/pre&gt;

Cheers.</description>
		<content:encoded><![CDATA[<p>No problem. It&#8217;s Assembly though, assembler would be the compiler itself. You can ask Intel for the IA32 manuals, they&#8217;re free. Or just download the PDFs from their site.</p>
<p>The code is almost entirely taken from a manual. First we load X and Y onto the stack, We then loop until the control flag is cleared. So if the result of TEST is not zero (JNZ), we jump onto the label that we previously declared. We finally pop and we return.</p>
<p>FSTSW is simply used to get the condition bits into AX.</p>
<p>You may test the routine like so:</p>

<div class="wp_syntax"><div class="code"><pre class="purebasic" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">For</span> i<span style="color: #000066;">=</span><span style="color: #CC0000;">0</span> <span style="color: #000066; font-weight: bold;">To</span> <span style="color: #CC0000;">19</span>
	<span style="color: #000066; font-weight: bold;">Debug</span> fmod<span style="color: #000066;">&#40;</span> i<span style="color: #000066;">*</span><span style="color: #CC0000;">0.1</span>, <span style="color: #CC0000;">0.5</span> <span style="color: #000066;">&#41;</span>
<span style="color: #000066; font-weight: bold;">Next</span></pre></div></div>

<p>Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jimmy101</title>
		<link>http://gushh.net/blog/2009/08/27/float-modulo-in-purebasic/comment-page-1/#comment-75</link>
		<dc:creator>jimmy101</dc:creator>
		<pubDate>Fri, 28 Aug 2009 07:32:49 +0000</pubDate>
		<guid isPermaLink="false">http://gushh.net/blog/?p=48#comment-75</guid>
		<description>Thanks! I thought there was no way of doing this in pure basic. I cant read assembler but I will definitely use this.

Could you explain me what the code does though?</description>
		<content:encoded><![CDATA[<p>Thanks! I thought there was no way of doing this in pure basic. I cant read assembler but I will definitely use this.</p>
<p>Could you explain me what the code does though?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
