第一個 WebAssembly 程式
Wabt 工具
git clone https://github.com/WebAssembly/wabtgit clone https://github.com/WebAssembly/wabtcd wabt && mkdir build && cd build && cmake -DBUILD_TESTS=OFF ..編寫 Wasm 程式
Last updated
git clone https://github.com/WebAssembly/wabtgit clone https://github.com/WebAssembly/wabtcd wabt && mkdir build && cd build && cmake -DBUILD_TESTS=OFF ..Last updated
make./wat2wasm 文字檔名 -o 要輸出的位元格式檔名 -v(module
(func $main
i32.const 3
unreachable
)
(start $main)
)0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0100 0000 ; WASM_BINARY_VERSION
...以下省略./WasmVM 檔案名稱Values in the stack:
Type: i32, Value: 3(func: 0, offset: 3) [unreachable] Trap without syscall provided.(func: 0, offset: 3) [syscall][sys_close] No enough value in the stack.