summaryrefslogtreecommitdiff
path: root/scripts/bin/ex.wat
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bin/ex.wat')
-rw-r--r--scripts/bin/ex.wat29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/bin/ex.wat b/scripts/bin/ex.wat
new file mode 100644
index 0000000..af461bd
--- /dev/null
+++ b/scripts/bin/ex.wat
@@ -0,0 +1,29 @@
+(module
+ (import "alligator" "abs" (func $abs (param i32) (result i32)))
+ (func $add1
+ (local $i i32)
+ (loop $myloop
+ local.get $i
+ i32.const 1
+ i32.add
+ local.set $i
+
+ local.get $i
+ call $abs
+
+ local.get $i
+ i32.const 40
+ i32.lt_s
+ br_if $myloop
+
+ drop
+ )
+ )
+ (func $add2 nop)
+ (export "begin" (func $add2))
+ (export "update" (func $add1))
+ (memory (;0;) 16)
+ (export "memory" (memory 0))
+ (global $base i32 (i32.const 1))
+ (export "__heap_base" (global $base))
+)