Files
ioccc/2001/bellard/index.html
T
Landon Curt Noll a9ca93ec47 fix markdown footnote problem caused by pandoc
Add "<!-- BEFORE: 1st line of markdown file: FILE/PATH -->"
before the markdown content.  This line appears in the
generated HTML.

Add "<!-- AFTER: last line of markdown file: FILE/PATH -->"
after the markdown content.  This line appears in the
generated HTML.

We test a fix relating to problems produced by `pandoc(1)`
when footnotes are added at the end of generated HTML.
This test is made for `2000/bmeyer/index.html`.

Fixed exit 4 in `bin/md2html.sh that should be exit 5.

Changed `bin/md2html.sh` VERSION from to "1.3 2024-04-14"
to "1.4 2024-04-18".

Run `bin/readme2index.sh -v 1 2000/bmeyer` to perform the above.
2024-04-19 01:20:31 -07:00

361 lines
18 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- END: this line ends content from: inc/top.default.html -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<link rel="stylesheet" href="../../ioccc.css">
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap" rel="stylesheet">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2001/bellard - Best abuse of the rules</title>
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
<meta name="description" content="2001 IOCCC entry bellard - Best abuse of the rules">
<meta name="keywords" content="IOCCC, 2001, IOCCC 2001, IOCCC entry, bellard, Best abuse of the rules">
</head>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- END: this line ends content from: inc/head.default.html -->
<!-- -->
<!-- This web page was formed via the tool: bin/readme2index.sh -->
<!-- The content of main section of this web page came from: 2001/bellard/README.md -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2001/bellard/README.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2001/bellard/README.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2001/bellard/README.md !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- Markdown content was converted into HTML via the tool: bin/md2html.sh -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/topbar.default.html -->
<div class="theader">
<nav class="topbar">
<div class="container">
<div class="logo">
IOCCC
</div>
<div class="topbar-items">
<div class="item">
<span class="item-header">
Home
</span>
<div class="sub-item">
<div class="outfit-font"><a href="../../index.html">IOCCC Home</a></div>
<div class="outfit-font"><a href="../../years.html">Winning Entries</a></div>
<div class="outfit-font"><a href="../../authors.html">People who have won</a></div>
<div class="outfit-font"><a href="../../location.html">Location of authors</a></div>
</div>
</div>
<div class="item">
<span class="item-header">
News
</span>
<div class="sub-item">
<div class="outfit-font"><a href="../../news.html">IOCCC News</a></div>
<div class="outfit-font"><a href="../../status.html">Contest status</a></div>
<div class="outfit-font"><a href="../../next/index.html">Rules and Guidelines</a></div>
<div class="outfit-font"><a href="../../faq.html#submit">How to enter the IOCCC</a></div>
<div class="outfit-font"><a href="../../faq.html">FAQ</a></div>
</div>
</div>
<div class="item">
<span class="item-header">
Bugs
</span>
<div class="sub-item">
<div class="outfit-font"><a href="../../bugs.html">Bugs &amp; (mis)features</a></div>
<div class="outfit-font"><a href="../../faq.html#fix_an_entry">Fixing IOCCC entries</a></div>
<div class="outfit-font"><a href="../../faq.html#fix_web_site">Fixing the web site</a></div>
<div class="outfit-font"><a href="../../faq.html#fix_author">Fixing author info</a></div>
<div class="outfit-font"><a href="../../thanks-for-help.html">Thanks for the help</a></div>
</div>
</div>
<div class="item">
<span class="item-header">
Judges
</span>
<div class="sub-item">
<div class="outfit-font"><a href="../../judges.html">The IOCCC Judges</a></div>
<div class="outfit-font"><a href="../../contact.html">Contacting the IOCCC</a></div>
</div>
</div>
</div>
</div>
</nav>
</div>
<!-- END: this line ends content from: inc/topbar.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<div class="header">
<img src="../../png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2001/bellard - Best abuse of the rules</h2>
</div>
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/navbar.mid.html -->
<div class="navbar">
<a class="Left" href="../anonymous/index.html">&larr; anonymous</a>
<a class="Left" href="../index.html">&uarr; 2001 &uarr;</a>
<a class="Left" href="../cheong/index.html">cheong &rarr;</a>
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/bellard/bellard.c">C code</a>
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/bellard/Makefile">Makefile</a>
<a class="Right" href="#inventory">Inventory</a>
<a class="Right" href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2001%2Fbellard%2Findex.html">&#x2713;</a>
</div>
<!-- END: this line ends content from: inc/navbar.mid.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<div class="content" id="content">
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
<h2 id="author">Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Fabrice_Bellard">Fabrice Bellard</a><br>
Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</em> (<em>France</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- BEFORE: 1st line of markdown file: 2001/bellard/README.md -->
<h2 id="to-build">To build:</h2>
<pre><code> make</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code> STATUS: INABIAF - please **DO NOT** fix
STATUS: doesn&#39;t work with some platforms - please help us fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2001_bellard">2001 bellard bugs</a>.</p>
<h2 id="to-use">To use:</h2>
<pre><code> ./bellard file</code></pre>
<h2 id="try">Try:</h2>
<pre><code> ./bellard bellard.otccex.c</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p><code>&lt;JUDGES_COMMENTS&gt;</code> :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p><code>OTCC</code> is an Obfuscated Tiny C Compiler for i386-linux. It generates
FAST! i386 32 bit code (no bytecode) and it is powerful enough to
compile itself. <code>OTCC</code> supports a strict subset of C. This subset is
compilable by a standard ANSI C compiler. <code>OTCC</code> compiles,
assembles, links and runs C code without the need of any other
program.</p>
<p>You can use it by typing:</p>
<pre><code> ./bellard bellard.c [args]...</code></pre>
<p>or by giving the C source to its standard input.</p>
<p><code>args</code> are given to the <code>main()</code> function of <code>bellard.c</code> (<code>argv[0]</code> is
<a href="bellard.c">bellard.c</a>).</p>
<h3 id="examples">Examples:</h3>
<ul>
<li>Sample compilation and execution:</li>
</ul>
<pre><code> ./bellard bellard.otccex.c 10</code></pre>
<ul>
<li>Self compilation:</li>
</ul>
<pre><code> ./bellard bellard.c bellard.otccex.c 10</code></pre>
<ul>
<li>Self compilation iterated…</li>
</ul>
<pre><code> ./bellard bellard.c bellard.c bellard.otccex.c 10</code></pre>
<p>An alternate syntax is to use it as a script interpreter: you can
put <code>#!/usr/local/bin/otcc</code> at the beginning of your C source if
you installed <code>otcc</code> at this place.</p>
<h3 id="supported-c-language-subset-read-joint-example-bellard.otccex.c-to-have-an-introduction-to-otcc-dialect">Supported C language subset (read joint example <a href="bellard.otccex.c">bellard.otccex.c</a> to have an introduction to <code>OTCC</code> dialect)</h3>
<h4 id="expressions">Expressions:</h4>
<ul>
<li><p>binary operators, in decreasing precedence order: <code>*</code> <code>/</code> <code>%</code>,
<code>+</code> <code>-</code>, <code>&gt;&gt;</code> <code>&lt;&lt;</code>, <code>&lt;</code> <code>&lt;=</code> <code>&gt;</code> <code>&gt;=</code>, <code>==</code> <code>!=</code>, <code>&amp;</code>,
<code>^</code>, <code>|</code>, <code>=</code>, <code>&amp;&amp;</code>, <code>||</code>.</p></li>
<li><p><code>&amp;&amp;</code> and <code>||</code> have the same semantics as in C: left to right
evaluation and early exit (short-circuited).</p></li>
<li><p>Parenthesis are supported.</p></li>
<li><p>Unary operators: <code>&amp;</code>, <code>*</code> (pointer indirection), <code>-</code>
(negation), <code>+</code>, <code>!</code>, <code>~</code>, postfix <code>++</code> and <code>--</code>.</p></li>
<li><p>Pointer indirection (<code>*</code>) only works with explicit cast to
<code>char *</code>, <code>int *</code> or <code>int (*)()</code> (function pointer).</p></li>
<li><p><code>++</code>, <code>--</code>, and unary <code>&amp;</code> can only be used with variable
lvalue (left value).</p></li>
<li><p><code>=</code> can only be used with variable or <code>*</code> (pointer
indirection) lvalue.</p></li>
<li><p>Function calls are supported <em>with standard <strong>i386</strong> calling
convention</em>. Function pointers are supported <em>with explicit
cast</em>. Functions can be used before being declared.</p></li>
<li><p>Types: only signed integer (<code>int</code>) variables and functions can
be declared. Variables cannot be initialized in
declarations. <em>Only old K&amp;R function declarations are parsed
(implicit integer return value and no types on arguments)</em>.</p></li>
<li><p>Any function or variable from the libc can be used because <code>OTCC</code>
uses the libc dynamic linker to resolve undefined symbols.</p></li>
<li><p>Instructions: blocks (<code>{</code> <code>}</code>) are supported as in C. <code>if</code> and
<code>else</code> can be used for tests. The <code>while</code> and <code>for</code> C loops are supported.
<code>break</code> can be used to exit loops. <code>return</code> is used for the return value of a
function.</p></li>
<li><p>Identifiers are parsed the same way as C. Local variables are
handled, but there is no local name space (not a problem if
different names are used for local and global variables).</p></li>
<li><p>Numbers can be entered in decimal, hexadecimal (<code>0x</code> or <code>0X</code>
prefix), or octal (<code>0</code> prefix).</p></li>
<li><p><code>#define</code> is supported without function like arguments. <em>No macro
recursion is tolerated</em>; <em>other preprocessor directives are
ignored</em>.</p></li>
<li><p>C Strings and C character constants are supported. Only <code>\n</code>,
<code>\"</code>, <code>\'</code> and <code>\\</code> escapes are recognized.</p></li>
<li><p>C Comments can be used (but no C++ comments).</p></li>
<li><p>No error is displayed if an incorrect program is given.</p></li>
<li><p>Memory: the code, data, and symbol sizes are limited to 100KB
(it can be changed in the source code).</p></li>
</ul>
<h3 id="obfuscation">Obfuscation:</h3>
<p>No special effort was needed because obfuscation is almost
unavoidable for such a program :-) <code>#define</code>s must be used to
compress the code, and integrated i386 code generator leads to non
obvious code.</p>
<h3 id="portability">Portability:</h3>
<p><code>OTCC</code> only works on i386 linux because it generates i386 code. <code>OTCC</code>
also relies on little endianness, unaligned memory accesses and
ASCII representation of characters. It also supposes that no valid
pointers are less than 512. If all those constraints are met, then
<code>OTCC</code> could be theoretically used to “cross compile”, although no
such support is currently integrated.</p>
<p>It was successfully compiled with gcc version 2.95.2. You get some
warnings because old K&amp;R prototypes are used, some casts are implicit
and some functions are used before being defined. <code>OTCC</code> uses the
dynamic linker to resolve symbols with <code>dlsym(3)</code>, so <code>-ldl</code> must
be used when you compile and link it.</p>
<!--
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/
-->
<!-- AFTER: last line of markdown file: 2001/bellard/README.md -->
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<div id="inventory">
<h1 id="inventory-for-2001bellard">Inventory for 2001/bellard</h1>
</div>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/bellard/bellard.c">bellard.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/bellard/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/bellard/bellard.orig.c">bellard.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/bellard/bellard.otccex.c">bellard.otccex.c</a> - example otcc source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/bellard/otccelf.c">otccelf.c</a> - another example otcc source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2001_bellard.tar.bz2">2001_bellard.tar.bz2</a> - download entry tarball</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/bellard/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/bellard/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/bellard/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/bellard/.path">.path</a> - directory path from top directory</li>
<li><a href="index.html">index.html</a> - this web page</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
<!-- END: this line ends content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
</div>
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<!--
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/
-->
<div class="footer">
<div id="copyright"><h2>Copyright and CC BY-SA 4.0 License</h2></div>
<p>All IOCCC content including this file and web page are:</p>
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Copyright &copy; 1984-2024 by Landon Curt Noll. <a href="https://creativecommons.org/faq/#what-does-some-rights-reserved-mean">Some Rights Reserved</a>.</b>
<p>This work is licensed by Landon Curt Noll under:</p>
<p><b><a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1"
target="_blank" rel="license noopener noreferrer" style="display:inline-block;">&nbsp;&nbsp;&nbsp;&nbsp;CC BY-SA 4.0
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
src="../../png/cc.png"
alt="cc inside circle symbol">
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
src="../../png/by.png"
alt="person inside circle symbol">
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
src="../../png/sa.png"
alt="arrow looping back on itself inside circle symbol">
</a></b></p>
<p>The <b>CC BY-SA 4.0 LEGAL CODE</b> for this license is found under:</p>
<p>&nbsp;&nbsp;&nbsp;<b><a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en">
https://creativecommons.org/licenses/by-sa/4.0/legalcode.en</a></b></p>
<p>You should <b>carefully review</b> all of the terms and conditions of the
<a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en">actual license</a>
before using the licensed material.</p>
<p>You may wish to review the <b><a href="../../license.html">highlights of some of the key
features and terms</a></b> of the <a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en">actual license</a>.</p>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2001%2Fbellard%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->