summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorLam Wei Lun <weilun.lam@gmail.com>2026-02-01 20:23:54 +0800
committerLam Wei Lun <weilun.lam@gmail.com>2026-02-01 20:23:54 +0800
commitc4b73a1e99bda3cdfabe7ff3b64066b310ee7292 (patch)
treea9ac8db385f82865e1bed5798ceaf63920587b2d /README.md
parentfcc9210aa32d671e16b392cf48546c4e2001ff8f (diff)
parenteafd8c67012ea253436b79f703dc0702046703f8 (diff)
Merge with main
Diffstat (limited to 'README.md')
-rw-r--r--README.md7
1 files changed, 4 insertions, 3 deletions
diff --git a/README.md b/README.md
index 2f0832f..87f95af 100644
--- a/README.md
+++ b/README.md
@@ -997,12 +997,13 @@ Zen C simplifies the complex GCC constraint syntax with named bindings.
// Syntax: : out(variable) : in(variable) : clobber(reg)
// Uses {variable} placeholder syntax for readability
-fn add(a: int, b: int) -> int {
+fn add_five(x: int) -> int {
let result: int;
asm {
- "add {result}, {a}, {b}"
+ "mov {x}, {result}"
+ "add $5, {result}"
: out(result)
- : in(a), in(b)
+ : in(x)
: clobber("cc")
}
return result;