<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>&amp;#39;while&amp;#39; vs &amp;#39;for&amp;#39; loop</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/17793/while-vs-for-loop</link><description> Hi all, 
Can someone know if there&amp;#39;s a differance between loop with &amp;#39;for&amp;#39; and same one with &amp;#39;while&amp;#39;? 
Is there a differance in code space, time execution and etc? 
 
Thanks a lot, 
Robert </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: 'while' vs 'for' loop</title><link>https://community.arm.com/thread/72630?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2004 00:43:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7f642276-627e-4575-a15a-4e3f02f23a89</guid><dc:creator>Ruven H</dc:creator><description>&lt;p&gt;Thank you all for your help, it was very helpfull.&lt;br /&gt;
&lt;br /&gt;
Roberto&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 'while' vs 'for' loop</title><link>https://community.arm.com/thread/42545?ContentTypeID=1</link><pubDate>Mon, 26 Jul 2004 11:37:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:40b81871-1240-428a-93b1-dd36ee663334</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;It is impossible to give a general answer, as this depends greatly on so many other factors; eg,&lt;br /&gt;
* Whether you count up or down;&lt;br /&gt;
* Which Memory Model you use;&lt;br /&gt;
* The size of your index variable;&lt;br /&gt;
* The loop exit condition;&lt;br /&gt;
* etc, etc, etc...&lt;br /&gt;
&lt;br /&gt;
You will just have to look at the generated code and see what is best &lt;i&gt;in your particular application&lt;/i&gt;.&lt;br /&gt;
Only you can do this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 'while' vs 'for' loop</title><link>https://community.arm.com/thread/42547?ContentTypeID=1</link><pubDate>Mon, 26 Jul 2004 09:08:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:66ca0b37-690f-4794-8b0d-30b4b0b7761a</guid><dc:creator>John Donaldson</dc:creator><description>&lt;p&gt;You could try the various constructs and take a look at the .cod file to see the generated assembler. Remember however that the exact code generated may change with different compiler versions or even with changes you make elsewhere in your code due to compiler optimisations.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>