<div dir="auto">The "computed come-from" construct has to be the greatest contribution to computer science that I have ever seen. How has it never come to my attention before? <div dir="auto"><br></div><div dir="auto">A university degree in computer science, decades of experience and this is my first awareness of it. I'm am exposed as a fraud. I wonder if I'll ever be able to work on the field again?</div><div dir="auto"><br></div><div dir="auto">Seeing that it had a publication date of March, can we assume it was delivered on the 1st day of the next month?</div><div dir="auto"><br></div><div dir="auto">Thank you for sharing this. </div><div dir="auto"><br></div><div dir="auto">I was once a co-author of a patent app that *almost* made it past internal review. It was for an assembly instruction that controlled out of order execution. The intent was that it would schedule the next instruction to be executed 2 clock cycles back. The goal was to increase performance by having the result of that instruction completed before the new instruction. According to our write up, 2 instructions back should have made it possible to run most programs in constant time. We didn't think we could get away with 3 clock cycles back which might let you finish before you started. And if you think it odd we weren't happy with just scheduling one cycle back, just know we labored over that exhaustively.</div><div dir="auto"><br></div><div dir="auto">Sadly, without hardware support, our idea was rejected by the review committee. There was considerable debate until someone noticed the submission date - 4/1/19??. I'll leave you to speculate whether they debated the merits of the idea or the qualifications of the authors.</div><div dir="auto"><br></div><div dir="auto">Rob.</div><div dir="auto"><br style="font-family:sans-serif"></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 1, 2020, 10:45 AM Rick DeNatale via TriEmbed <<a href="mailto:triembed@triembed.org">triembed@triembed.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div id="m_6018948895463664392edo-message"><div></div>How many of you are old enough to remember FORTRANs computed go to, and its evil twin the computed come from. <a href="https://web.archive.org/web/20180716171336/http://www.fortran.com/fortran/come_from.html" style="letter-spacing:0.1px;text-align:inherit" target="_blank" rel="noreferrer">https://web.archive.org/web/20180716171336/http://www.fortran.com/fortran/come_from.html</a></div><div id="m_6018948895463664392edo-meta"></div><div id="m_6018948895463664392edo-original"><div><br><br><blockquote type="cite" style="margin:1ex 0 0 0;height:min-content;border-left:1px #ccc solid;padding-left:0.5ex"><div>On Jul 1, 2020 at 9:13 AM, <<a href="mailto:triembed@triembed.org" target="_blank" rel="noreferrer">Scott Hall via TriEmbed</a>> wrote:<br><br></div><div><div dir="ltr"><div>NO NO, DON'T USE GOTO !</div><div><br></div><div>Seriously though, this has been a behaviour of the Arduino compiler compilation for a while -- its even mentioned in some Arduino books.  The workaround is to have a single function called for each case label and to put the statements desired with the function.  This gets optimized to a jump table anyway, so its just a matter of doing this in practice.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 1, 2020 at 12:34 AM Jon Wolfe via TriEmbed <<a href="mailto:triembed@triembed.org" target="_blank" rel="noreferrer">triembed@triembed.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div><p class="MsoNormal">Yep, GCC has a ton of extensions to C and C++, though they obviously need careful consideration when using, if it’s work the downside of making the code less portable. </p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><a href="https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/C-Extensions.html" target="_blank" rel="noreferrer">https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/C-Extensions.html</a></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">One of my favorites is local functions. </p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0in 0in"><p class="MsoNormal" style="border:medium none;padding:0in"><b>From: </b><a href="mailto:ncgadgetry@gmail.com" target="_blank" rel="noreferrer">Rodney Radford</a><br><b>Sent: </b>Tuesday, June 30, 2020 9:04 PM<br><b>To: </b><a href="mailto:jonjwolfe@anibit.com" target="_blank" rel="noreferrer">Jon Wolfe</a><br><b>Cc: </b><a href="mailto:triembed@undecidedgames.net" target="_blank" rel="noreferrer">Brian</a>; <a href="mailto:triembed@triembed.org" target="_blank" rel="noreferrer">Triangle Embedded Computing Discussion</a><br><b>Subject: </b>Re: [TriEmbed] Hacking a fake vintage radio (with Arduino + Pi 0)</p></div><p class="MsoNormal"><u></u> <u></u></p></div></div><div dir="ltr"><div dir="ltr"><div>I had never heard of the GCC label variable, so I had to google it... wow, I learned something new tonight!</div><div><br></div><div><a href="https://stackoverflow.com/questions/1777990/is-it-possible-to-store-the-address-of-a-label-in-a-variable-and-use-goto-to-jum" target="_blank" rel="noreferrer">https://stackoverflow.com/questions/1777990/is-it-possible-to-store-the-address-of-a-label-in-a-variable-and-use-goto-to-jum</a><br><br></div></div></div><br><div class="gmail_quote"><div class="gmail_attr" dir="ltr">On Tue, Jun 30, 2020 at 8:57 PM Jon Wolfe via TriEmbed <<a href="mailto:triembed@triembed.org" target="_blank" rel="noreferrer">triembed@triembed.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:1px solid rgb(204,204,204)"><div lang="EN-US"><div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">There is a trick you can use with gcc that is a non-standard C construct where you can use ‘goto’ and give it a variable containing the address of a label. You then create an array of label address and you can then dynamically index that array to jump to various locations.  I’ve seen it used as an optimization technique, and you can also have more control over the program flow, though it is using the infamous keyword, Essentially though it end up looking pretty much like a switch-case. </p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">That is really odd about that gcc bug.  It’s not like I’ve never seen them, but 99.9% of the time when I thought I had found a compiler bug in C/C++, it turns out to be something else. (hafl the time one of those things that disappears with a “clean/rebuild all”)  I remember the Arduino /AVR/gcc linker used to have a bug related to 8-bit AVR chips that had more than 64KB of flash memory, such as the ATMega 1284. Those chips address by 16 bit words not bytes, so 128kb of flash is accessible without trick likes far pointers, but the linker would mess up the address calculations sometimes I think for interrupt handlers or functions called by interrupt handlers that crossed the 64kb boundary. </p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(225,225,225) currentcolor currentcolor;padding:3pt 0in 0in"><p class="MsoNormal" style="padding:0in;border:medium none"><b>From: </b><a href="mailto:triembed@triembed.org" target="_blank" rel="noreferrer">Huan Truong via TriEmbed</a><br><b>Sent: </b>Tuesday, June 30, 2020 12:48 PM<br><b>To: </b><a href="mailto:triembed@undecidedgames.net" target="_blank" rel="noreferrer">Brian</a><br><b>Cc: </b><a href="mailto:triembed@triembed.org" target="_blank" rel="noreferrer">Triangle Embedded Computing Discussion</a><br><b>Subject: </b>Re: [TriEmbed] Hacking a fake vintage radio (with Arduino + Pi 0)</p></div><p class="MsoNormal"><u></u> <u></u></p></div></div>Oh yeah, that explains my issue. I definitely ran into that issue<br>where I have checked and had no reason to believe I was doing<br>something wrong, yet, when I evacuated each switch to a function, the<br>switch worked correctly. But neither scoping with an anonymous scope<br>nor renaming the variables work.<br><br>The reason I used the switch was that I read on stackoverflow at one<br>point and someone said that we should use switches instead of elseifs<br>when we have a lot of cases. Then, using switches, the compiler will<br>be able to (at some point) create a lookup table for you so it's<br>faster. I doubt that was what happening at least on the Arduino case.<br>You'll need a giant lookup table which the uCs don't have memory for.<br>I suspect that in a lot of cases, using switches is probably just as<br>slow as using elseifs. Now as I see that it is so buggy, I probably<br>will not use switches, at least on Arduino.<br><br>Cheers,<br>- Huan.<br><br>On Tue, Jun 30, 2020 at 9:23 AM Brian via TriEmbed<br><<a href="mailto:triembed@triembed.org" target="_blank" rel="noreferrer">triembed@triembed.org</a>> wrote:<br>><br>> Side note:<br>><br>> The arduino compiler has bugs in how it handles switch statements.  I've<br>> run into situations lately where the order of the case statements matter<br>> (which it never should); cases are completely ignored, etc.<br>><br>> I believe it may be tied to the use of local scoping within a case, e.g.:<br>><br>> switch(thing) {<br>>     case 1:<br>>        {<br>>           // stuff with case-local scope<br>>        }<br>>        break;<br>> }<br>><br>> Syntactically- and semantically-correct code has proven to generate<br>> incorrect runtime results.<br>><br>> I haven't had time/motivation to submit a bug report, but I should do<br>> that.  At any rate, a potential workaround is to reorder your cases.<br>><br>> -B<br>><br>> On 6/24/20 9:51 PM, Huan Truong via TriEmbed wrote:<br>> > Thanks Pete!<br>> ><br>> > I feel like there was something really mysterious about the switch statement. Even if I pasted the whole blocks of code of each function I would have called to the {} inside a case, the code still wouldn’t work. That baffled me by a mile.<br>> ><br>> > But yeah, I spent way too much time on the project that I’m comfortable with the idea of not understanding some of it now. The watchdog timer code was baffling too.<br>> ><br>> > Please excuse my typos, sent from phone.<br>> ><br>> > On Jun 24, 2020, at 10:14 AM, Pete Soper via TriEmbed <<a href="mailto:triembed@triembed.org" target="_blank" rel="noreferrer">triembed@triembed.org</a>> wrote:<br>> ><br>> > What a beautifully presented adventure. Loved reading it. And when you say a problem "could be bad" you make your point. :-) (meant as a "find Waldo" exercise for alert readers)<br>> ><br>> > Hadn't heard of "kev" or any other Arduino emulator for that matter. That aspect was interesting too.<br>> ><br>> > The other issue with redeclaration of the vars local to the switch statement is that they literally don't exist outside it, so communicating their values outside the block would be difficult. :-)  In general, every {} defines a local scope in C/C++ and you can declare variables inside that scope but they cease to be defined outside the scope. The scope outside any {} (aka "global") or vars declared "static" can avoid this issue but not the redefine issue.<br>> ><br>> > Thanks for sharing this!<br>> ><br>> > Pete<br>> ><br>> ><br>> >> On 6/24/20 12:43 PM, Huan Truong via TriEmbed wrote:<br>> >> This has taken me way more time than I thought, but finishing this<br>> >> retrofit is a big achievement for me. It's really silly and serves<br>> >> exactly no purpose other than RE'ing something no one cares about.  So<br>> >> I just want to share for some shits and giggles.<br>> >><br>> >> <a href="http://www.tnhh.net/posts/adventures-hacking-fake-vivitar-vintage-radio.html" target="_blank" rel="noreferrer">http://www.tnhh.net/posts/adventures-hacking-fake-vivitar-vintage-radio.html</a><br>> >><br>> >><br>> >><br>> >><br>> >><br>> ><br>> > _______________________________________________<br>> > Triangle, NC Embedded Computing mailing list<br>> ><br>> > To post message: <a href="mailto:TriEmbed@triembed.org" target="_blank" rel="noreferrer">TriEmbed@triembed.org</a><br>> > List info: <a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" target="_blank" rel="noreferrer">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>> > TriEmbed web site: <a href="http://TriEmbed.org" target="_blank" rel="noreferrer">http://TriEmbed.org</a><br>> > To unsubscribe, click link and send a blank message: mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net" target="_blank" rel="noreferrer">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>> ><br>> ><br>> > _______________________________________________<br>> > Triangle, NC Embedded Computing mailing list<br>> ><br>> > To post message: <a href="mailto:TriEmbed@triembed.org" target="_blank" rel="noreferrer">TriEmbed@triembed.org</a><br>> > List info: <a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" target="_blank" rel="noreferrer">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>> > TriEmbed web site: <a href="http://TriEmbed.org" target="_blank" rel="noreferrer">http://TriEmbed.org</a><br>> > To unsubscribe, click link and send a blank message: mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net" target="_blank" rel="noreferrer">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>> ><br>><br>><br>> _______________________________________________<br>> Triangle, NC Embedded Computing mailing list<br>><br>> To post message: <a href="mailto:TriEmbed@triembed.org" target="_blank" rel="noreferrer">TriEmbed@triembed.org</a><br>> List info: <a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" target="_blank" rel="noreferrer">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>> TriEmbed web site: <a href="http://TriEmbed.org" target="_blank" rel="noreferrer">http://TriEmbed.org</a><br>> To unsubscribe, click link and send a blank message: mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net" target="_blank" rel="noreferrer">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>><br><br><br>-- <br><br>Huan Truong<br>www <a href="http://tnhh.net" target="_blank" rel="noreferrer">tnhh.net</a> / twitter @huant<br><br>_______________________________________________<br>Triangle, NC Embedded Computing mailing list<br><br>To post message: <a href="mailto:TriEmbed@triembed.org" target="_blank" rel="noreferrer">TriEmbed@triembed.org</a><br>List info: <a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" target="_blank" rel="noreferrer">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>TriEmbed web site: <a href="http://TriEmbed.org" target="_blank" rel="noreferrer">http://TriEmbed.org</a><br>To unsubscribe, click link and send a blank message: mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net" target="_blank" rel="noreferrer">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br><br>
_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<br>
To post message: <a href="mailto:TriEmbed@triembed.org" target="_blank" rel="noreferrer">TriEmbed@triembed.org</a><br>
List info: <a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" rel="noreferrer noreferrer" target="_blank">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org" rel="noreferrer noreferrer" target="_blank">http://TriEmbed.org</a><br>
To unsubscribe, click link and send a blank message: mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net" target="_blank" rel="noreferrer">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
<br>
</blockquote></div>

_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<br>
To post message: <a href="mailto:TriEmbed@triembed.org" target="_blank" rel="noreferrer">TriEmbed@triembed.org</a><br>
List info: <a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" rel="noreferrer noreferrer" target="_blank">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org" rel="noreferrer noreferrer" target="_blank">http://TriEmbed.org</a><br>
To unsubscribe, click link and send a blank message: mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net" target="_blank" rel="noreferrer">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Scott G. Hall<br>Raleigh, NC, USA<br><a href="mailto:scottghall1@gmail.com" target="_blank" rel="noreferrer">scottghall1@gmail.com</a></div><i>Although kindness is rarely a job, no matter what you do it's always an option.</i><br></div></div></div></div></div></div>
_______________________________________________
Triangle, NC Embedded Computing mailing list

To post message: <a href="mailto:TriEmbed@triembed.org" target="_blank" rel="noreferrer">TriEmbed@triembed.org</a>
List info: <a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" target="_blank" rel="noreferrer">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a>
TriEmbed web site: <a href="http://TriEmbed.org" target="_blank" rel="noreferrer">http://TriEmbed.org</a>
To unsubscribe, click link and send a blank message: mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net" target="_blank" rel="noreferrer">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe

</div></blockquote></div></div></div>_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<br>
To post message: <a href="mailto:TriEmbed@triembed.org" target="_blank" rel="noreferrer">TriEmbed@triembed.org</a><br>
List info: <a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" rel="noreferrer noreferrer" target="_blank">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org" rel="noreferrer noreferrer" target="_blank">http://TriEmbed.org</a><br>
To unsubscribe, click link and send a blank message: mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net" target="_blank" rel="noreferrer">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
<br>
</blockquote></div>