| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/de/docs/WebAssembly/Reference/Variables/local.set | [Back] [Original] |
Get to know MDN better
Dieser Inhalt wurde automatisch aus dem Englischen bersetzt, und kann Fehler enthalten. Erfahre mehr ber dieses Experiment.
Die local.set Variablenanweisung setzt den Wert einer lokalen Variablen.
(module
(import "console" "log" (func $log (param i32)))
(func $main
(local $var i32) ;; create a local variable named $var
(local.set $var (i32.const 10)) ;; set $var to 10
local.get $var ;; load $var onto the stack
call $log ;; log the result
)
(start $main)
)
const url = "{%wasm-url%}";
await WebAssembly.instantiateStreaming(fetch(url), { console });
;; load the number 2 onto the stack
i32.const 2
;; store the number 2 in the variable $val
local.set $val
| Anweisung | Binrer Opcode |
|---|---|
local.set |
0x21 |
| Spezifikation |
|---|
| WebAssembly Core Specification # variable-instructions |
Der Bauplan fr ein besseres Internet.
Teile dieses Inhalts sind 19982026 von einzelnen mozilla.org-Mitwirkenden. Inhalte sind verfgbar unter einer Creative-Commons-Lizenz.
| Web Proxy Viewer | New URL | Original Page |