Anonymous user
Call a function: Difference between revisions
→{{header|WebAssembly}}
Line 5,309:
=={{header|WebAssembly}}==
<lang webassembly>(
(
(i32.const 2)▼
(i32.const 3)▼
call
(
(i32.
(i32.
)
▲ ;;Call a function with no arguments
▲ ;;Multiply two numbers and store the result, flat syntax
▲ set_local $result
▲ ;;Multiply two numbers and store the result, indented syntax
▲ (set_local $result
▲ )
▲ ;;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))
)
)</lang>
|