Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
31
Task/Call-a-function/WebAssembly/call-a-function.wasm
Normal file
31
Task/Call-a-function/WebAssembly/call-a-function.wasm
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
(func $main (export "_start")
|
||||
|
||||
(local $result i32)
|
||||
|
||||
;;Call a function with no arguments
|
||||
call $noargfunc
|
||||
|
||||
;;Multiply two numbers and store the result, flat syntax
|
||||
i32.const 12
|
||||
i32.const 3
|
||||
call $multipy
|
||||
set_local $result
|
||||
|
||||
;;Multiply two numbers and store the result, indented syntax
|
||||
(set_local $result
|
||||
(call $multipy
|
||||
(i32.const 12)
|
||||
(i32.const 3)
|
||||
)
|
||||
)
|
||||
|
||||
;;Add two numbers in linear memory (similar to using pointers)
|
||||
(i32.store (i32.const 0) (i32.const 5))
|
||||
(i32.store (i32.const 4) (i32.const 7))
|
||||
|
||||
(call $addinmemory
|
||||
(i32.const 0)
|
||||
(i32.const 4)
|
||||
(i32.const 8)
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue