diswasm

WASM analysis workbench
HomeDocsReferenceCompilerRuntimeBenchmarksDisassemblyDecompileEditEasy EditorIntermediateCreateSavedControllerGame StudioAboutLicensesContributorsOpen source

Local-first parsing. No automatic module execution.

self-hosted mode

Easy Editor

Build a tiny WebAssembly function with constrained blocks. Invalid stack combinations are disabled before you can add them.

Blocks

Function run(a: i32, b: i32): i32

stack depth 0
use input aRead the first function input.
use input bRead the second function input.
addPop two i32 values and push their sum.
returnReturn the top value from the function.

Guidance

Values go onto the stack first. Math blocks consume two values and produce one value. Return consumes one value and exits.
Try removing `add`, then notice that `return` and other math blocks stay disabled until enough values are on the stack.
Run the module to see output.

Generated WAT

(module ;; beginner_easy_module
  (func $run (param $a i32) (param $b i32) (result i32)
    local.get $a
    local.get $b
    i32.add
    return
  )
  (export "run" (func $run))
)

Validation

Program validates for the beginner subset.

Generated WASM

42 bytes generated.