Skip to content

Instantly share code, notes, and snippets.

@JeremyLikness
Created February 11, 2020 22:49
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 JeremyLikness/8a96cc75c90cb453cb7deeeab62f6081 to your computer and use it in GitHub Desktop.
Save JeremyLikness/8a96cc75c90cb453cb7deeeab62f6081 to your computer and use it in GitHub Desktop.
WASI "Hello, World"
(module
(type $t0 (func (param i32 i32 i32 i32) (result i32)))
(type $t1 (func))
(import "wasi_unstable" "fd_write" (func $fd_write (type $t0)))
(func $main (type $t1)
i32.const 0
i32.const 8
i32.store
i32.const 4
i32.const 22
i32.store
i32.const 1
i32.const 0
i32.const 1
i32.const 30
call $fd_write
drop
)
(memory $memory 1)
(export "memory" (memory 0))
(export "_start" (func $main))
(data (i32.const 8) "My first WASI module!\0a")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment