<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)!]]></title><description><![CDATA[<p>A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)!</p><p>For example, this is a clever way to initialize once:</p><p>        goto init;<br />init:<br />        ouptr = oubuf;<br />        init = init1;<br />init1:</p><p>which is compiled to:</p><p>jmp     *4120<br />mov     4136,4144<br />mov     4122,4120</p><p>Note the indirect jump and assignment to that address. All gotos used indirect jumps. This apparently would have also worked with functions.</p><p><a href="https://discuss.systems/tags/c" rel="tag">#<span>c</span></a> <a href="https://discuss.systems/tags/unix" rel="tag">#<span>unix</span></a> <a href="https://discuss.systems/tags/retrocomputing" rel="tag">#<span>retrocomputing</span></a> <a href="https://discuss.systems/tags/vintagecomputing" rel="tag">#<span>vintagecomputing</span></a></p>]]></description><link>https://board.circlewithadot.net/topic/a2a2ffa2-0ad5-4c59-b931-ca480ca40ad8/a-cursed-feature-of-c-in-1972-labels-and-functions-were-reassignable-i.e.-lvalues</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 06:41:33 GMT</lastBuildDate><atom:link href="https://board.circlewithadot.net/topic/a2a2ffa2-0ad5-4c59-b931-ca480ca40ad8.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 May 2026 02:26:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 10:24:11 GMT]]></title><description><![CDATA[<p><span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> Very cursed indeed !<br />I'm glad this was removed before it ever got standardized. (Otherwise we'd still be stuck with it nowadays, right <span><a href="/user/thephd%40pony.social">@<span>thephd</span></a></span> ?)</p>]]></description><link>https://board.circlewithadot.net/post/https://social.sciences.re/users/Sobex/statuses/116549789382396037</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://social.sciences.re/users/Sobex/statuses/116549789382396037</guid><dc:creator><![CDATA[sobex@social.sciences.re]]></dc:creator><pubDate>Sun, 10 May 2026 10:24:11 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 10:08:07 GMT]]></title><description><![CDATA[<p><span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> Very interesting program too <img src="https://board.circlewithadot.net/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=28325c671da" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /> did it ever up in anything later or was it more like an experiment?</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.sdf.org/users/aap/statuses/116549726180749671</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.sdf.org/users/aap/statuses/116549726180749671</guid><dc:creator><![CDATA[aap@mastodon.sdf.org]]></dc:creator><pubDate>Sun, 10 May 2026 10:08:07 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 10:00:03 GMT]]></title><description><![CDATA[<p><span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> </p><p>PUSHJ, PUSHJ, POPJ P,<br />JRST . + 1203</p><p>pushjay, pushjay, popjay pee<br />Jrst to point plus twelve oh three</p><p>PUSHJ is the recursive subroutine call, POPJ is the return therefrom, both require the stack register to be stipulated.</p><p>JRST is the unconditional jump instruction, and "." ("point") is the current address.</p><p>The point of 1203 being that it's a pretty random place in memory that's really unlikely to have code starting there that makes any sense.</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.mit.edu/users/djl/statuses/116549694486802246</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.mit.edu/users/djl/statuses/116549694486802246</guid><dc:creator><![CDATA[djl@mastodon.mit.edu]]></dc:creator><pubDate>Sun, 10 May 2026 10:00:03 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 09:53:19 GMT]]></title><description><![CDATA[<p><span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> oh this is cool, basically self-modifying code in C!</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.gamedev.place/users/eniko/statuses/116549668044499259</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.gamedev.place/users/eniko/statuses/116549668044499259</guid><dc:creator><![CDATA[eniko@mastodon.gamedev.place]]></dc:creator><pubDate>Sun, 10 May 2026 09:53:19 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 09:52:33 GMT]]></title><description><![CDATA[<a href="/user/thalia%40discuss.systems">@thalia@discuss.systems</a> I’m sorry. What.]]></description><link>https://board.circlewithadot.net/post/https://comfy.social/notes/am35ryw77x</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://comfy.social/notes/am35ryw77x</guid><dc:creator><![CDATA[sigmasternchen@comfy.social]]></dc:creator><pubDate>Sun, 10 May 2026 09:52:33 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 09:45:31 GMT]]></title><description><![CDATA[<p><span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> Eeeek! Make it go away!</p>]]></description><link>https://board.circlewithadot.net/post/https://hachyderm.io/users/RupertReynolds/statuses/116549637311807377</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://hachyderm.io/users/RupertReynolds/statuses/116549637311807377</guid><dc:creator><![CDATA[rupertreynolds@hachyderm.io]]></dc:creator><pubDate>Sun, 10 May 2026 09:45:31 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 08:18:44 GMT]]></title><description><![CDATA[<p>This snippet deliberately triggers a "Bus error -- Core dumped":</p><p>int o1[];<br />o1 = -3;<br />*o1;</p><p>From Dennis_Tapes/dmr/cgd/cg1.c:expr.</p>]]></description><link>https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116549296109756428</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116549296109756428</guid><dc:creator><![CDATA[thalia@discuss.systems]]></dc:creator><pubDate>Sun, 10 May 2026 08:18:44 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 08:08:19 GMT]]></title><description><![CDATA[<p><span><a href="/user/djl%40mastodon.mit.edu">@<span>djl</span></a></span> <span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> This was largely because of the constant need to translate longword-pointers to byte ones when interworking between modules with BCPL and C linkage. It only specifically affected AmigaDOS and not other subsystems (exec, graphics, intuition etc.)</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.social/ap/users/116175731239673526/statuses/116549255156956842</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.social/ap/users/116175731239673526/statuses/116549255156956842</guid><dc:creator><![CDATA[bms48@mastodon.social]]></dc:creator><pubDate>Sun, 10 May 2026 08:08:19 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 07:52:27 GMT]]></title><description><![CDATA[<p><span><a href="/user/huitema%40social.secret-wg.org">@<span>huitema</span></a></span> <span><a href="/user/vk2bea%40mastodon.radio">@<span>vk2bea</span></a></span> <span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> ALTER-like functionality reflects the fact that programming was still evolving to use subroutines/functions and concepts like Structured Programming were still considered radical by old-school programmers at the time**.</p><p>It probably didn't help that this was a time prior to formal programming courses so a lot of programmers were self-taught and developed their craft in isolation (and often in assembler) so using "go to"s and ALTERs came pretty naturally.</p><p>IOWs, if you wanted a language that appealed to the masses at the time then you pretty well had to include goto and ALTER.</p><p>** <a href="https://en.wikipedia.org/wiki/Structured_programming#Debate" rel="nofollow noopener"><span>https://</span><span>en.wikipedia.org/wiki/Structur</span><span>ed_programming#Debate</span></a></p>]]></description><link>https://board.circlewithadot.net/post/https://hachyderm.io/users/markd/statuses/116549192724323352</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://hachyderm.io/users/markd/statuses/116549192724323352</guid><dc:creator><![CDATA[markd@hachyderm.io]]></dc:creator><pubDate>Sun, 10 May 2026 07:52:27 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 07:02:21 GMT]]></title><description><![CDATA[<p>Another strange pattern from the same program.</p><p>This one reassigns the address of an array, `int nlist[250]`, in char increments. Arrays are no longer lvalues, so this doesn't work anymore. Also, the address is unaligned every other iteration.</p><p>lbp;<br />nlist[250];</p><p>getnam()<br />{<br />        extern nlist, lbp;<br />        char nlist[], lbp[], c;</p><p>loop:<br />        c = *lbp++;<br />        if (c==';' | c=='\n')<br />                goto el;<br />        *nlist++ = c;<br />        goto loop;<br />el:<br />        *nlist++ = '\0';<br />}</p><p>Somewhat simplified from Dennis_Tapes/dmr/cgd/cg1.c:getnam.</p>]]></description><link>https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116548995749982389</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116548995749982389</guid><dc:creator><![CDATA[thalia@discuss.systems]]></dc:creator><pubDate>Sun, 10 May 2026 07:02:21 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 05:59:07 GMT]]></title><description><![CDATA[<p><span><a href="/user/usul%40piaille.fr">@<span>usul</span></a></span> PDP-11 assembly with UNIX syntax. Those are octal addresses. Unless an address has a $, it refers to the value at that address. * is a dereference.</p>]]></description><link>https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116548747105834930</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116548747105834930</guid><dc:creator><![CDATA[thalia@discuss.systems]]></dc:creator><pubDate>Sun, 10 May 2026 05:59:07 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 05:52:30 GMT]]></title><description><![CDATA[<p><span><a href="/user/vk2bea%40mastodon.radio">@<span>vk2bea</span></a></span> <span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> <br />The ASSIGN statement in Fortran IV and the ALTER statement in COBOL supported ways to redirect the target of a GOTO, much in the same way as the "cursed figure" of C that you described. I assume that at the time, it felt important to have parity between C and Fortran (and maybe COBOL).</p>]]></description><link>https://board.circlewithadot.net/post/https://social.secret-wg.org/users/huitema/statuses/116548721100364553</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://social.secret-wg.org/users/huitema/statuses/116548721100364553</guid><dc:creator><![CDATA[huitema@social.secret-wg.org]]></dc:creator><pubDate>Sun, 10 May 2026 05:52:30 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 05:46:46 GMT]]></title><description><![CDATA[<p><span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> what lond of assembly is that ?</p>]]></description><link>https://board.circlewithadot.net/post/https://piaille.fr/users/usul/statuses/116548698565142869</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://piaille.fr/users/usul/statuses/116548698565142869</guid><dc:creator><![CDATA[usul@piaille.fr]]></dc:creator><pubDate>Sun, 10 May 2026 05:46:46 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 05:11:46 GMT]]></title><description><![CDATA[<p><span><a href="/user/djl%40mastodon.mit.edu">@<span>djl</span></a></span> I'm afraid I don't speak PDP-6 / PDP-10 assembly (yet?). Could you elucidate?</p>]]></description><link>https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116548560912896661</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116548560912896661</guid><dc:creator><![CDATA[thalia@discuss.systems]]></dc:creator><pubDate>Sun, 10 May 2026 05:11:46 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 05:08:47 GMT]]></title><description><![CDATA[<p><span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> </p><p>I'm reminded of the MIT PDP-6 assmbler poem:</p><p>PUSHJ, PUSHJ, POPJ P,<br />JRST . + 1203</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.mit.edu/users/djl/statuses/116548549177787026</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.mit.edu/users/djl/statuses/116548549177787026</guid><dc:creator><![CDATA[djl@mastodon.mit.edu]]></dc:creator><pubDate>Sun, 10 May 2026 05:08:47 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 05:04:18 GMT]]></title><description><![CDATA[<p><span><a href="/user/djl%40mastodon.mit.edu">@<span>djl</span></a></span> <span><a href="/user/bms48%40mastodon.social">@<span>bms48</span></a></span> Lovely. I'd love to get a PDP-7, but they're incredibly rare.</p>]]></description><link>https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116548531525064673</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116548531525064673</guid><dc:creator><![CDATA[thalia@discuss.systems]]></dc:creator><pubDate>Sun, 10 May 2026 05:04:18 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 05:02:44 GMT]]></title><description><![CDATA[<p><span><a href="/user/bms48%40mastodon.social">@<span>bms48</span></a></span> <span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> </p><p>" like kicking dead whales down the beach."</p><p>Hmm. I used BCPL on Tenex in 1980, and don't remember having problems.</p><p>And my dad had a PDP-7 at work. This one.</p><p><div class="card col-md-9 col-lg-6 position-relative link-preview p-0">



<a href="https://pbase.com/davidjl/image/149069834" title="FAF_PDP7web.jpg by David in Tokyo">
<img src="https://a4.pbase.com/g2/29/138229/3/149069834.1jW4gZuG.jpg" class="card-img-top not-responsive" style="max-height: 15rem;" alt="Link Preview Image" />
</a>



<div class="card-body">
<h5 class="card-title">
<a href="https://pbase.com/davidjl/image/149069834">
FAF_PDP7web.jpg by David in Tokyo
</a>
</h5>
<p class="card-text line-clamp-3"></p>
</div>
<a href="https://pbase.com/davidjl/image/149069834" class="card-footer text-body-secondary small d-flex gap-2 align-items-center lh-2">



<img src="https://pbase.com/favicon.ico" alt="favicon" class="not-responsive overflow-hiddden" style="max-width: 21px; max-height: 21px;" />



<p class="d-inline-block text-truncate mb-0">PBase <span class="text-secondary">(pbase.com)</span></p>
</a>
</div></p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.mit.edu/users/djl/statuses/116548525371010409</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.mit.edu/users/djl/statuses/116548525371010409</guid><dc:creator><![CDATA[djl@mastodon.mit.edu]]></dc:creator><pubDate>Sun, 10 May 2026 05:02:44 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 03:46:21 GMT]]></title><description><![CDATA[<p><span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> that seems dangerous!</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.radio/users/vk2bea/statuses/116548225031409332</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.radio/users/vk2bea/statuses/116548225031409332</guid><dc:creator><![CDATA[vk2bea@mastodon.radio]]></dc:creator><pubDate>Sun, 10 May 2026 03:46:21 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 02:31:20 GMT]]></title><description><![CDATA[<p><span><a href="/user/thalia%40discuss.systems">@<span>thalia</span></a></span> Dealing with BCPL in AmigaOS systems code, inherited from TripOS, pre-A3000 era was like kicking dead whales down the beach.</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.social/ap/users/116175731239673526/statuses/116547930050404648</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.social/ap/users/116175731239673526/statuses/116547930050404648</guid><dc:creator><![CDATA[bms48@mastodon.social]]></dc:creator><pubDate>Sun, 10 May 2026 02:31:20 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 02:26:57 GMT]]></title><description><![CDATA[<p>This snippet appears in cvft, a compiler for translating Fortran threaded code to machine code from June 1972, which is notably derived from the early C code generator. See putchar (and also getcha) in dmr/cgd/cvft.c.</p><p>The earliest extant C compiler is last1120c from July 1972, the last C version for the PDP-11/20, before they migrated to the PDP-11/45. This version still has the label lvalue behavior of B seen in cvft. Then, it was changed to the modern behavior by the time of prestruct-c from December 1972. That version supports structures, but does not yet use them itself.</p><p>All three can be found in Dennis_Tapes: <a href="https://www.tuhs.org/Archive/Applications/Dennis_Tapes" rel="nofollow noopener"><span>https://www.</span><span>tuhs.org/Archive/Applications/</span><span>Dennis_Tapes</span></a></p>]]></description><link>https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116547912833941350</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116547912833941350</guid><dc:creator><![CDATA[thalia@discuss.systems]]></dc:creator><pubDate>Sun, 10 May 2026 02:26:57 GMT</pubDate></item><item><title><![CDATA[Reply to A cursed feature of C in 1972: Labels and functions were reassignable (i.e., lvalues)! on Sun, 10 May 2026 02:26:44 GMT]]></title><description><![CDATA[<p>At the time, C was rapidly evolving into what we recognize today.</p><p>It started as B, an untyped and interpreted language that only had one kind of value, a word. This was a perfect fit for the PDP-7 that UNIX started on, with 18-bit words, but as they transitioned to the PDP-11, with 16-bit words and 8-bit addressing, this became a limitation.</p><p>Soon, types were added, to distinguish char, int, and pointers, and it became known as NB ("New B"). But, B wasn't particularly fast, as it was interpreted (well, threaded).</p><p>Once it was rewritten to be compiled, the language became known as C (perhaps initially as NC). For a short while, everything in C was an lvalue like B, giving the above snippet, but this was dropped a few months later, presumably for efficiency.</p><p>Some UNIX utilities had been written in B/C from the start, but efforts to rewrite the kernel itself in B/C had failed. Finally, once structs were added to C, it was powerful enough to support the kernel and it was rewritten in C over the summer of 1973, culminating in the release of UNIX V4.</p><p><a href="https://discuss.systems/tags/c" rel="tag">#<span>c</span></a> <a href="https://discuss.systems/tags/unix" rel="tag">#<span>unix</span></a> <a href="https://discuss.systems/tags/retrocomputing" rel="tag">#<span>retrocomputing</span></a> <a href="https://discuss.systems/tags/vintagecomputing" rel="tag">#<span>vintagecomputing</span></a></p>]]></description><link>https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116547911963520466</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://discuss.systems/ap/users/115918347060720003/statuses/116547911963520466</guid><dc:creator><![CDATA[thalia@discuss.systems]]></dc:creator><pubDate>Sun, 10 May 2026 02:26:44 GMT</pubDate></item></channel></rss>