<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Static on P01NT</title><link>https://outofsrvc.github.io/en/tags/static/</link><description>Recent content in Static on P01NT</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 13 Aug 2026 10:00:00 +0300</lastBuildDate><atom:link href="https://outofsrvc.github.io/en/tags/static/index.xml" rel="self" type="application/rss+xml"/><item><title>Functions — Part Two</title><link>https://outofsrvc.github.io/en/cworkshop/functions-part-two/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/functions-part-two/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>Having laid the cornerstone of C, memory division, pointers, and the assembly introduction — we continue toward a complete body of knowledge. This article treats functions at an &lt;strong>advanced&lt;/strong> level, with K&amp;amp;R as a primary reference, tracing registers in the assembly to see how the code moves at the low level.&lt;/p>
&lt;p>&lt;strong>Article index:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>1.1 Variable Scope&lt;/li>
&lt;li>1.2 Header Files&lt;/li>
&lt;li>1.3 Static Variables and Functions&lt;/li>
&lt;li>1.4 Recursion&lt;/li>
&lt;/ul>
&lt;h2 id="function-essentials">Function Essentials&lt;/h2>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Component&lt;/th>
 &lt;th>Description&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>&lt;strong>Signature&lt;/strong>&lt;/td>
 &lt;td>the declaration: &lt;code>returnType funcName(Parameters) {}&lt;/code>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;strong>Body&lt;/strong>&lt;/td>
 &lt;td>what the function does&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;strong>Parameters&lt;/strong>&lt;/td>
 &lt;td>input values&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;strong>Return value&lt;/strong>&lt;/td>
 &lt;td>the main output&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h2 id="a-functions-execution-model">A Function&amp;rsquo;s Execution Model&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-c" data-lang="c">&lt;span class="line">&lt;span class="cl">&lt;span class="kt">int&lt;/span> &lt;span class="nf">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kt">int&lt;/span> &lt;span class="n">a&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="kt">int&lt;/span> &lt;span class="n">b&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kt">int&lt;/span> &lt;span class="n">result&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">a&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="n">b&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">result&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="the-assembly-32-bit">The Assembly (32-bit)&lt;/h3>
&lt;p>We use &lt;code>-m32&lt;/code> to simplify the explanation (the classic EBP pattern seen in millions of legacy programs):&lt;/p></description></item></channel></rss>