global.set
Pops a value off the stack and sets a variable's value with it.
Parameters
$label
The label name of the global variable. This can also be the index of the global variable.
The variable will be set to the value on the stack.
The value on the stack must be the same data type as the variable.
Stack In
* |
The value to be stored in the global variable. The data type must be the same as the variable used. |
Example
(global $vectorX (mut f64) (f64.const 0))
(func $scaleVectorX (param $scaler f64)
global.get $vectorX
local.get $scaler
f64.mul
global.set $vectorX
)