WebAssembly

From Lazarus wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Assemblers

There are different assemblers available, from Wabt and emscripten.org. The expected format is a slightly different between those two:

wat2wasm (Wabt)

(module
  (func $add (param $lhs i32) (param $rhs i32) (result i32)
    local.get $lhs
    local.get $rhs
    i32.add
  )
  (export "add" (func $add))
)

wasm-as (emscripten)

(module
  (func $add (param $lhs i32) (param $rhs i32) (result i32)
    (
    local.get $lhs
    local.get $rhs
    i32.add
    )
  )
  (export "add" (func $add))
)

See Also