summaryrefslogtreecommitdiff
path: root/examples/wasm/call.wat
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2024-01-26 12:03:59 +0100
committerHenry Gressmann <mail@henrygressmann.de>2024-01-26 12:03:59 +0100
commitf3d890a36d6299dbd70377ce57b0bd9d61de5c1b (patch)
tree36b51022af641c0f464fd0c5d4456b722e5f735b /examples/wasm/call.wat
parent461126ce309f99e4ad2a6ddcbc175ea01c5e8fee (diff)
docs: working selfhosted example
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'examples/wasm/call.wat')
-rw-r--r--examples/wasm/call.wat42
1 files changed, 0 insertions, 42 deletions
diff --git a/examples/wasm/call.wat b/examples/wasm/call.wat
deleted file mode 100644
index d515e78..0000000
--- a/examples/wasm/call.wat
+++ /dev/null
@@ -1,42 +0,0 @@
-(module
- (func (export "check") (param i32) (result i32)
- i64.const 0 ;; Set 0 to the stack
- local.get 0
- i32.const 10
- i32.lt_s ;; Check if input is less than 10
- if (param i64) (result i32) ;; If so,
- i32.const 1 ;; Set 1 to the stack
- return ;; And return immediately
- else ;; Otherwise,
- i32.const 0 ;; Set 0 to the stack
- return ;; And return immediately
- end) ;; End of the if/else block
-
- (func (export "simple_block") (result i32)
- (block (result i32)
- (i32.const 0)
- (i32.const 1)
- (i32.add)
- )
- )
-
- (func (export "checkloop") (result i32)
- (block (result i32)
- (i32.const 0)
- (loop (param i32)
- (block (br 2 (i32.const 18)))
- (br 0 (i32.const 20))
- )
- (i32.const 19)
- )
- )
-
-
- (func (export "param") (result i32)
- (i32.const 1)
- (loop (param i32) (result i32)
- (i32.const 2)
- (i32.add)
- )
- )
-) \ No newline at end of file