Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Webassembly 32 bit Int Array Example
(module
(memory 1)
(func $load_num (param $index i32) (result i32)
(i32.mul (get_local $index) (i32.const 4))
i32.load
)
(func $store_num (param $index i32) (param $num i32)
(i32.mul (get_local $index) (i32.const 4))
get_local $num ;; value to store
i32.store
)
(export "store_num" (func $store_num))
(export "load_num" (func $load_num))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment