Created
April 22, 2017 01:13
-
-
Save WA9ACE/4bb1ff26beea4c790dc0c3f095d19cde to your computer and use it in GitHub Desktop.
Imports memory and print functions and calls print passing memory offset and length
This file contains hidden or 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 | |
(import "stdlib" "print" (func $print (param i32 i32))) | |
(import "js" "mem" (memory 20)) | |
(data (i32.const 0) "Hello World") | |
(func (export "main") | |
i32.const 0 ;; pass offset 0 to log | |
i32.const 20 ;; pass length 20 to log | |
call $print)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment