aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-31 17:55:16 +0200
committerhachem <im@hachem.wtf>2026-08-31 17:55:16 +0200
commitcbdb9073480c3e4d8a088b306c23406cf42e25c0 (patch)
tree39f3093654cc8f27ea701ed1338cac84d93f42eb /docs
parent53aed3fadf1f7ad66dea9a8a0b46bf42eda921be (diff)
feat: hex/binary integer literals and constant-folding const expressions
Diffstat (limited to 'docs')
-rw-r--r--docs/language.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/language.md b/docs/language.md
index 2429838..43b6246 100644
--- a/docs/language.md
+++ b/docs/language.md
@@ -50,10 +50,12 @@ Unknown keys, a `bits` value other than 32/64, and unknown extensions are errors
## Constants and data
-`const` names an integer (becomes a NASM `%define`). `data` puts a string in `.data`; the name is its address and `.len` is its length in bytes.
+`const` names a constant integer expression — integer literals, character literals, other constants, and `+` `-` `*` `/`. Integers are decimal, `0x` hex, or `0b` binary (these forms work anywhere an integer does). `data` puts a string in `.data`; the name is its address and `.len` is its length in bytes.
```hdass
const STDOUT = 1
+const MASK = 0xFF
+const AREA = 8 * 6 // 48
data message = "type shi.\n" // message -> address, message.len -> 10
```