Created
April 14, 2019 17:12
-
-
Save therewillbecode/15538f193e13e8318c5654a92f3df79d to your computer and use it in GitHub Desktop.
Webassembly 32 bit Int Array Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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