call
Make a call to a function. You need to make sure you have passed all the required parameters onto the stack before calling the function. Any returned results will be placed on the stack by the function, ready to be used after the call is finished.

Syntax

call $label

Parameters

$label
The name of the function to execution.

Example

(func $add (param $first i32) (param $second i32) (result i32)
  ;; Add first and second parameters together and return result
  local.get $first
  local.get $second
  i32.add
)

(func $testAdd
  ;; Push parameters onto the stack
  i32.const 42
  i32.const 101

  ;; Call the $add function
  call $add

  ;; The stack contains the returned result of an i32 value of 143
)