...
1;; multiValueWasmFunctions defines Wasm functions that illustrate multiple
2;; results using the "multiple-results" feature.
3(module $multi-value/wasm
4
5 ;; Define a function that returns two results
6 (func $get_age (result (;age;) i64 (;errno;) i32)
7 i64.const 37 ;; stack = [37]
8 i32.const 0 ;; stack = [37, 0]
9 )
10
11 ;; Now, define a function that returns only the first result.
12 (func (export "call_get_age") (result i64)
13 call $get_age ;; stack = [37, errno] result of get_age
14 drop ;; stack = [37]
15 )
16)
View as plain text