local.get
Push a variable's value onto the stack.

Syntax

local.get $label

Parameters

$label
The label name of the local variable. This can also be the index of the local variable. The value will be pushed onto the stack. The stack will contain the same data type as the variable.

Stack In

NONE

Stack Out

* The value stored in the local variable. The data type must be the same as the variable used.

Example

;; Add function
(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
)