v / examples / wasm_codegen / memory.v
12 lines · 11 sloc · 217 bytes · d2f69472b2eabcc38f6218622e1b15050545a095
Raw
1import wasm
2
3fn main() {
4 mut m := wasm.Module{}
5 mut mtest := m.new_function('mload', [.i32_t], [.i32_t])
6 {
7 mtest.local_get(0)
8 mtest.load(.i32_t, 2, 0)
9 }
10 m.commit(mtest, false)
11 print(m.compile().bytestr())
12}
13