Back to Content

nop: Wasm text instruction

files/en-us/webassembly/reference/control_flow/nop/index.md

latest501 B
Original Source

nop stands for no-operation. It literally does nothing.

{{InteractiveExample("Wat Demo: nop", "tabbed-shorter")}}

wat
(module
  (func (export "do_nothing")
    nop
  )
)
js
const url = "{%wasm-url%}";
await WebAssembly.instantiateStreaming(fetch(url)).then((result) => {
  result.instance.exports.do_nothing();
});

Syntax

wat
nop
InstructionBinary opcode
nop0x01