| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/de/docs/WebAssembly/Reference/Numeric/extend | [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 extend- Zahleninstruktionen werden verwendet, um Zahlen vom Typ i32 in den Typ i64 zu konvertieren (erweitern). Es gibt signierte und unsignierte Versionen dieser Anweisung.
(module
(import "console" "log" (func $log (param i64)))
(func $main
i32.const 10 ;; push an i32 onto the stack
i64.extend_i32_s ;; sign-extend from i32 to i64
call $log ;; log the result
)
(start $main)
)
const url = "{%wasm-url%}";
await WebAssembly.instantiateStreaming(fetch(url), { console });
;; push an i32 onto the stack
i32.const 10
;; sign-extend from i32 to i64
i64.extend_i32_s
;; the top item on the stack will now be the value 10 of type i64
| Anweisung | Binrer Opcode |
|---|---|
i64.extend_i32_s |
0xac |
i64.extend_i32_u |
0xad |
| Spezifikation |
|---|
| WebAssembly Core Specification # numeric-instructions%E2%91%A8 |
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 |