aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arch/arm64.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/arch/arm64.md b/src/arch/arm64.md
index 1bf76b4..68c4bfa 100644
--- a/src/arch/arm64.md
+++ b/src/arch/arm64.md
@@ -40,6 +40,31 @@ elr_el3 exception link register EL3
spsr_el3 saved process status register EL3
```
+## Instructions cheatsheet
+
+### Accessing system registers
+Reading from system registers:
+```armasm
+mrs x0, vbar_el1 // move vbar_el1 into x0
+```
+
+Writing to system registers:
+```armasm
+msr vbar_el1, x0 // move x0 into vbar_el1
+```
+
+### Control Flow
+```armasm
+b <offset> // relative forward/back branch
+br <Xn> // absolute branch to address in register Xn
+
+// branch & link, store return address in X30 (LR)
+bl <offset> // relative forward/back branch
+blr <Xn> // absolute branch to address in register Xn
+
+ret {Xn} // return to address in X30, or Xn if supplied
+```
+
## Addressing
### Offset
```armasm