aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/language.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/language.md b/docs/language.md
index a4743b3..ecdbf19 100644
--- a/docs/language.md
+++ b/docs/language.md
@@ -171,6 +171,12 @@ while .countdown rcx > 0 // emits `.countdown:` … `jmp .countdown` … `.c
rcx -= 1
```
+A **conditional select** picks one of two register values without a branch: `dst = a if <cond> else b`. It lowers to `csel` on AArch64 (one instruction) and `cmov` on x86 (a default move plus a conditional move, arranged so `dst` may safely alias either source). Both sources must be registers.
+
+```hdass
+r3 = r1 if r1 > r2 else r2 // r3 = max(r1, r2), branchless
+```
+
## Dereference (`^`)
`^reg` is the memory at the address in `reg` — NASM's `[reg]`. On the left of `=` it stores there. The store width comes from the value operand, so a sized sub-register picks the size: