<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<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">
	<channel>
		<title>LeafLabs Garden &#187; Topic: instruction goto</title>
		<link>http://forums.leaflabs.com/topic.php?id=77</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:19:38 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=77" rel="self" type="application/rss+xml" />

		<item>
			<title>leaflabsandy on "instruction goto"</title>
			<link>http://forums.leaflabs.com/topic.php?id=77#post-424</link>
			<pubDate>Wed, 30 Jun 2010 08:45:17 +0000</pubDate>
			<dc:creator>leaflabsandy</dc:creator>
			<guid isPermaLink="false">424@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Its your call ... the goto should be in color just like the&#60;br /&#62;
other keywords and most users, like me, use this command&#60;br /&#62;
to break out from a nested loop so having it in color will&#60;br /&#62;
make this command stand out. The goto &#34;label:&#34; keyword changes to a bold light grey.&#60;br /&#62;
Note: The Arduino leaves it in black. Doesn't mean it is right?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bnewbold on "instruction goto"</title>
			<link>http://forums.leaflabs.com/topic.php?id=77#post-421</link>
			<pubDate>Wed, 30 Jun 2010 02:21:54 +0000</pubDate>
			<dc:creator>bnewbold</dc:creator>
			<guid isPermaLink="false">421@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hey andy, thanks for unit testing for us! I quickly ran through all the &#34;bundled&#34; examples to try and catch errors, but we really need to have a full gigantic arduino language unit test sketch that we'll toss in the Maple example directory (and push back to the Arduino team?). &#60;/p&#62;
&#60;p&#62;By &#34;no color&#34; on goto did you mean that the 'goto' keyword it turn orange in the IDE? I'm adding SerialUSB and a couple other missing keywords... I might leave 'goto' out to indicate that it isn't really pastel-happy-easy-coding-approved (the same way that a lot of low-level register macros like &#60;code&#62;TIMER3_BASE&#60;/code&#62; also get left out). Do you agree?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>perry on "instruction goto"</title>
			<link>http://forums.leaflabs.com/topic.php?id=77#post-415</link>
			<pubDate>Tue, 29 Jun 2010 21:14:10 +0000</pubDate>
			<dc:creator>perry</dc:creator>
			<guid isPermaLink="false">415@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;This is a result of the compiler optimizing away the label.&#60;/p&#62;
&#60;p&#62;The code is straight line code, there's nothing between the goto and the label, and there are no instructions at the label, so there's no reason to do the goto (there's nothing to go to!). The compiler is smart enough to recognize this and will simply remove it. &#60;/p&#62;
&#60;p&#62;For future reference, we compile with gcc optimization level -Os
&#60;/p&#62;</description>
		</item>
		<item>
			<title>leaflabsandy on "instruction goto"</title>
			<link>http://forums.leaflabs.com/topic.php?id=77#post-414</link>
			<pubDate>Tue, 29 Jun 2010 17:18:04 +0000</pubDate>
			<dc:creator>leaflabsandy</dc:creator>
			<guid isPermaLink="false">414@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;It works, in the Arduino, if you &#34;add&#34; another instruction after the label: &#38;lt;------&#60;/p&#62;
&#60;p&#62;Arduino Example&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;for(byte r = 0; r &#38;lt; 255; r++){
   for(byte g = 255; g &#38;gt; -1; g--){
        for(byte b = 0; b &#38;lt; 255; b++){
            if (analogRead(0) &#38;gt; 250){ goto bailout;}
            // more statements ...
        }
    }
}
bailout: // &#38;lt;------------- You need to add another instruction after this for it to
         //                compile !!!!! The example left the next instruction out.&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;BTW ... just killing time checking all the Maple's instruction commands until I get my&#60;br /&#62;
USBprint and have the capability to run on external power on my win xp 32 ... Hint Hint&#60;/p&#62;
&#60;p&#62;&#60;strong&#62;EDITED by bnewbold: put code in code block for readability&#60;/strong&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "instruction goto"</title>
			<link>http://forums.leaflabs.com/topic.php?id=77#post-413</link>
			<pubDate>Tue, 29 Jun 2010 17:06:14 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">413@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;hmm. interesting. Does that work in arduino? I havent had the occasion to use goto, but Im not particularly surprised that you cant reference labels before they are declared. We will add this to the docs, thanks for the tip!&#60;/p&#62;
&#60;p&#62;p.s. this is an issue of how arm-gcc functions, so I think were just going to have to live with it (but documented!)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>leaflabsandy on "instruction goto"</title>
			<link>http://forums.leaflabs.com/topic.php?id=77#post-411</link>
			<pubDate>Tue, 29 Jun 2010 16:09:03 +0000</pubDate>
			<dc:creator>leaflabsandy</dc:creator>
			<guid isPermaLink="false">411@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The &#34;Arduino example&#34; did not compile ... hmmm&#60;br /&#62;
You need to have another instruction after the label1: in the second example&#60;br /&#62;
for it to compile??? Doc's need fixed
&#60;/p&#62;</description>
		</item>
		<item>
			<title>leaflabsandy on "instruction goto"</title>
			<link>http://forums.leaflabs.com/topic.php?id=77#post-409</link>
			<pubDate>Tue, 29 Jun 2010 15:20:31 +0000</pubDate>
			<dc:creator>leaflabsandy</dc:creator>
			<guid isPermaLink="false">409@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;PC System: Windows XP SP3&#60;br /&#62;
Maple Version: 0.5&#60;/p&#62;
&#60;p&#62;Problem: goto instruction does not compile.&#60;br /&#62;
Note: &#34;no color&#34; on goto &#60;/p&#62;
&#60;p&#62;------&#60;br /&#62;
Code &#38;lt;---- This compiles&#60;br /&#62;
------&#60;br /&#62;
void setup() {&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void loop() {&#60;br /&#62;
label1:  &#60;/p&#62;
&#60;p&#62;goto label1; &#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;------&#60;br /&#62;
Code &#38;lt;---- This doesn't compile&#60;br /&#62;
------&#60;br /&#62;
void setup() {&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void loop() {&#60;/p&#62;
&#60;p&#62;goto label1;&#60;/p&#62;
&#60;p&#62;label1: &#60;/p&#62;
&#60;p&#62;}
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
