e01.org

WebAssembly control flow instructions

WebAssembly control flow instructions.

WebAssembly control flow instructions.

- [`block`](/docs/WebAssembly/Reference/Control_flow/block)
- : Creates a label that can later be branched out of with a [`br`](/docs/WebAssembly/Reference/Control_flow/br).
- [`br`](/docs/WebAssembly/Reference/Control_flow/br)
- : Branches to a `loop`, `block`, or `if`.
- [`br_if`](/docs/WebAssembly/Reference/Control_flow/br_if)
- : Branches to a `loop`, `block`, or `if`, based on a boolean condition.
- [`br_table`](/docs/WebAssembly/Reference/Control_flow/br_table)
- : Branches to different `loop`, `block`, or `if` statements, based on an argument.
- [`call`](/docs/WebAssembly/Reference/Control_flow/call)
- : Calls a function.
- [`drop`](/docs/WebAssembly/Reference/Control_flow/drop)
- : Pops a value from the stack, and discards it.
- [`end`](/docs/WebAssembly/Reference/Control_flow/end)
- : Can be used to end a `block`, `loop`, `if`, or `else`.
- [`if...else`](/docs/WebAssembly/Reference/Control_flow/if...else)
- : Executes a statement if the last item on the stack is true (non-zero).
- [`loop`](/docs/WebAssembly/Reference/Control_flow/loop)
- : Creates a label that can later be branched to with a [`br`](/docs/WebAssembly/Reference/Control_flow/br).
- [`nop`](/docs/WebAssembly/Reference/Control_flow/nop)
- : Does nothing.
- [`return`](/docs/WebAssembly/Reference/Control_flow/return)
- : Returns from a function.
- [`select`](/docs/WebAssembly/Reference/Control_flow/select)
- : Selects one of its first two operands based on a boolean condition.
- [`unreachable`](/docs/WebAssembly/Reference/Control_flow/unreachable)
- : Denotes a point in code that should not be reachable.

source: MDN Web Docs mirror · page

Cite this

"WebAssembly control flow instructions". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/Control_flow

JSON record · API collection · citation policy