Add wasm2elf: i32 WebAssembly to static x86-64 ELF compiler in MoonBit
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
b8617c7aaa
22 files changed
+1219
No files matched your search
@@ -0,0 +1,12 @@
|
||||
;; sum 1..10 with a loop -> exit code 55
|
||||
(module
|
||||
(func (export "main") (result i32)
|
||||
(local $i i32) (local $acc i32)
|
||||
(local.set $i (i32.const 1))
|
||||
(block $done
|
||||
(loop $top
|
||||
(br_if $done (i32.gt_s (local.get $i) (i32.const 10)))
|
||||
(local.set $acc (i32.add (local.get $acc) (local.get $i)))
|
||||
(local.set $i (i32.add (local.get $i) (i32.const 1)))
|
||||
(br $top)))
|
||||
local.get $acc))
|
||||
Reference in new issue
Block a user