Skip to content

Instantly share code, notes, and snippets.

@therewillbecode
Created April 14, 2019 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save therewillbecode/15538f193e13e8318c5654a92f3df79d to your computer and use it in GitHub Desktop.
Save therewillbecode/15538f193e13e8318c5654a92f3df79d to your computer and use it in GitHub Desktop.
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