aboutsummaryrefslogtreecommitdiffhomepage
path: root/print.html
diff options
context:
space:
mode:
authorjohannst <johannst@users.noreply.github.com>2021-02-22 23:39:28 +0000
committerjohannst <johannst@users.noreply.github.com>2021-02-22 23:39:28 +0000
commita2c2408d431a55d5b1db44fbb2495a83f52cfcaf (patch)
tree05fe70fcf1eedebbd4d5fb09651754144ee5aefd /print.html
parenta703aed9ec0380d8a08e42792ff6c87294d3760b (diff)
downloadnotes-a2c2408d431a55d5b1db44fbb2495a83f52cfcaf.tar.gz
notes-a2c2408d431a55d5b1db44fbb2495a83f52cfcaf.zip
deploy: d44d6c1efdf8bf0d43b98e512503d66521b2be00
Diffstat (limited to 'print.html')
-rw-r--r--print.html27
1 files changed, 24 insertions, 3 deletions
diff --git a/print.html b/print.html
index 820fe00..8464508 100644
--- a/print.html
+++ b/print.html
@@ -2606,6 +2606,24 @@ sp_el3 stack pointer EL3
elr_el3 exception link register EL3
spsr_el3 saved process status register EL3
</code></pre>
+<h2><a class="header" href="#instructions-cheatsheet" id="instructions-cheatsheet">Instructions cheatsheet</a></h2>
+<h3><a class="header" href="#accessing-system-registers" id="accessing-system-registers">Accessing system registers</a></h3>
+<p>Reading from system registers:</p>
+<pre><code class="language-armasm">mrs x0, vbar_el1 // move vbar_el1 into x0
+</code></pre>
+<p>Writing to system registers:</p>
+<pre><code class="language-armasm">msr vbar_el1, x0 // move x0 into vbar_el1
+</code></pre>
+<h3><a class="header" href="#control-flow-1" id="control-flow-1">Control Flow</a></h3>
+<pre><code class="language-armasm">b &lt;offset&gt; // relative forward/back branch
+br &lt;Xn&gt; // absolute branch to address in register Xn
+
+// branch &amp; link, store return address in X30 (LR)
+bl &lt;offset&gt; // relative forward/back branch
+blr &lt;Xn&gt; // absolute branch to address in register Xn
+
+ret {Xn} // return to address in X30, or Xn if supplied
+</code></pre>
<h2><a class="header" href="#addressing-1" id="addressing-1">Addressing</a></h2>
<h3><a class="header" href="#offset" id="offset">Offset</a></h3>
<pre><code class="language-armasm">ldr x0, [x1] // x0 = [x1]
@@ -2754,13 +2772,16 @@ greeting_len:
Hi ASM-World!
</code></pre>
<blockquote>
-<p>Cross-compiling on <code>Ubuntu 20.04</code>, paths might differ on other distributions.
-Compiling natively on arm64, specifying the dynamic linker should not be required.</p>
+<p>Cross-compiling on <code>Ubuntu 20.04 (x86_64)</code>, paths might differ on other
+distributions. Explicitly specifying the dynamic linker should not be
+required when compiling natively on arm64.</p>
</blockquote>
<h2><a class="header" href="#references-2" id="references-2">References</a></h2>
<ul>
<li><a href="https://github.com/ARM-software/abi-aa/blob/master/aapcs64/aapcs64.rst">Procedure Call Standard ARM64</a></li>
-<li><a href="https://developer.arm.com/documentation/den0024/a">ARMv8 Programmer's Guide</a></li>
+<li><a href="https://developer.arm.com/documentation/den0024/a">ARMv8-A Programmer's Guide</a></li>
+<li><a href="https://developer.arm.com/documentation/ddi0487/latest">ARMv8-A Architecture Reference Manual</a></li>
+<li><a href="https://developer.arm.com/documentation/dai0527/a">AppNote: ARMv8 Bare-metal boot code</a></li>
<li><a href="https://sourceware.org/binutils/docs/as">GNU Assembler</a></li>
<li><a href="https://sourceware.org/binutils/docs/as/Pseudo-Ops.html#Pseudo-Ops">GNU Assembler Directives</a></li>
</ul>