mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-07-12 23:26:33 +02:00
96 lines
4.4 KiB
XML
96 lines
4.4 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800">
|
|
<style>
|
|
.bg{fill:#0a0a0f}.pnl{fill:#12121a;stroke:#1a1a2e}.hdr{fill:#12121a}
|
|
.title{font:bold 42px 'Courier New',monospace;fill:#00ff41}
|
|
.sub{font:bold 28px 'Courier New',monospace;fill:#00d4ff}
|
|
.txt{font:24px 'Courier New',monospace;fill:#c0c0c0}
|
|
.dim{font:20px 'Courier New',monospace;fill:#888}
|
|
.grn{font:bold 24px 'Courier New',monospace;fill:#00ff41}
|
|
.red{font:bold 24px 'Courier New',monospace;fill:#ff0040}
|
|
.cyn{font:bold 24px 'Courier New',monospace;fill:#00d4ff}
|
|
.amb{font:bold 24px 'Courier New',monospace;fill:#ffaa00}
|
|
.badge{stroke:#00ff41;rx:14}
|
|
</style>
|
|
<rect class="bg" width="1200" height="800"/>
|
|
|
|
<!-- Title -->
|
|
<text x="600" y="52" text-anchor="middle" class="title">What is a Variable?</text>
|
|
<text x="600" y="88" text-anchor="middle" class="dim">Labeled Boxes in Memory (SRAM)</text>
|
|
|
|
<!-- Memory boxes visualization -->
|
|
<rect x="40" y="110" width="1120" height="200" rx="8" class="pnl"/>
|
|
<text x="60" y="148" class="sub">Memory — A Row of Numbered Boxes</text>
|
|
|
|
<!-- Box 0 -->
|
|
<rect x="70" y="170" width="170" height="80" rx="6" fill="#0a0a0f" stroke="#00ff41" stroke-width="2"/>
|
|
<text x="155" y="207" text-anchor="middle" class="grn">42</text>
|
|
<text x="155" y="240" text-anchor="middle" class="dim">age</text>
|
|
<text x="155" y="280" text-anchor="middle" class="dim">Box 0</text>
|
|
|
|
<!-- Box 1 -->
|
|
<rect x="260" y="170" width="170" height="80" rx="6" fill="#0a0a0f" stroke="#00d4ff" stroke-width="2"/>
|
|
<text x="345" y="207" text-anchor="middle" class="cyn">17</text>
|
|
<text x="345" y="240" text-anchor="middle" class="dim">score</text>
|
|
<text x="345" y="280" text-anchor="middle" class="dim">Box 1</text>
|
|
|
|
<!-- Box 2 -->
|
|
<rect x="450" y="170" width="170" height="80" rx="6" fill="#0a0a0f" stroke="#ffaa00" stroke-width="2"/>
|
|
<text x="535" y="207" text-anchor="middle" class="amb">0</text>
|
|
<text x="535" y="240" text-anchor="middle" class="dim">count</text>
|
|
<text x="535" y="280" text-anchor="middle" class="dim">Box 2</text>
|
|
|
|
<!-- Box 3 -->
|
|
<rect x="640" y="170" width="170" height="80" rx="6" fill="#0a0a0f" stroke="#ff0040" stroke-width="2"/>
|
|
<text x="725" y="207" text-anchor="middle" class="red">255</text>
|
|
<text x="725" y="240" text-anchor="middle" class="dim">max</text>
|
|
<text x="725" y="280" text-anchor="middle" class="dim">Box 3</text>
|
|
|
|
<!-- Box 4 -->
|
|
<rect x="830" y="170" width="170" height="80" rx="6" fill="#0a0a0f" stroke="#1a1a2e"/>
|
|
<text x="915" y="207" text-anchor="middle" class="txt">99</text>
|
|
<text x="915" y="240" text-anchor="middle" class="dim">temp</text>
|
|
<text x="915" y="280" text-anchor="middle" class="dim">Box 4</text>
|
|
|
|
<!-- Anatomy Panel -->
|
|
<rect x="40" y="330" width="1120" height="200" rx="8" class="pnl"/>
|
|
<text x="60" y="368" class="sub">Anatomy of a Declaration</text>
|
|
|
|
<rect x="60" y="390" width="1080" height="50" rx="4" fill="#0a0a0f" stroke="#00ff41" stroke-width="2"/>
|
|
<text x="80" y="422" class="grn">uint8_t age = 42;</text>
|
|
|
|
<text x="80" y="472" class="cyn">uint8_t</text>
|
|
<text x="280" y="472" class="dim">Data type (1 byte)</text>
|
|
|
|
<text x="80" y="502" class="amb">age</text>
|
|
<text x="280" y="502" class="dim">Variable name (label)</text>
|
|
|
|
<text x="600" y="472" class="red">= 42</text>
|
|
<text x="760" y="472" class="dim">Initial value</text>
|
|
|
|
<text x="600" y="502" class="txt">;</text>
|
|
<text x="760" y="502" class="dim">End of statement</text>
|
|
|
|
<!-- Key concepts -->
|
|
<rect x="40" y="555" width="540" height="215" rx="8" class="pnl"/>
|
|
<text x="60" y="593" class="sub">Key Concepts</text>
|
|
|
|
<rect x="60" y="610" width="500" height="42" rx="4" fill="#0a0a0f" stroke="#1a1a2e"/>
|
|
<text x="75" y="638" class="grn">Declaration</text>
|
|
<text x="290" y="638" class="dim">name + type</text>
|
|
|
|
<rect x="60" y="660" width="500" height="42" rx="4" fill="#0a0a0f" stroke="#1a1a2e"/>
|
|
<text x="75" y="688" class="cyn">Definition</text>
|
|
<text x="290" y="688" class="dim">allocates memory</text>
|
|
|
|
<rect x="60" y="710" width="500" height="42" rx="4" fill="#0a0a0f" stroke="#1a1a2e"/>
|
|
<text x="75" y="738" class="amb">Initialization</text>
|
|
<text x="290" y="738" class="dim">assigns value</text>
|
|
|
|
<!-- Rule -->
|
|
<rect x="620" y="555" width="540" height="215" rx="8" class="pnl"/>
|
|
<text x="640" y="593" class="sub">Important Rule</text>
|
|
<text x="640" y="640" class="txt">You MUST declare a</text>
|
|
<text x="640" y="672" class="txt">variable BEFORE you</text>
|
|
<text x="640" y="704" class="txt">use it!</text>
|
|
<text x="640" y="748" class="dim">Compiler needs to know the type</text>
|
|
</svg> |