From cbdb9073480c3e4d8a088b306c23406cf42e25c0 Mon Sep 17 00:00:00 2001 From: hachem Date: Mon, 31 Aug 2026 17:55:16 +0200 Subject: feat: hex/binary integer literals and constant-folding const expressions --- examples/constants.hdass | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/constants.hdass (limited to 'examples') diff --git a/examples/constants.hdass b/examples/constants.hdass new file mode 100644 index 0000000..1bb85eb --- /dev/null +++ b/examples/constants.hdass @@ -0,0 +1,15 @@ +[entry: main] + +// The exit status is folded from constant arithmetic, and SYS_EXIT is a hex +// literal. STATUS = 6 * 7 = 42. +const A = 6 +const B = 7 +const STATUS = A * B +const SYS_EXIT = 0x3C + +proc main +{ + rdi = STATUS + rax = SYS_EXIT + syscall +} -- cgit v1.3