You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
683 B
22 lines
683 B
(module
|
|
(import "wasi_snapshot_preview1" "fd_write"
|
|
(func $__wasi_fd_write (param i32 i32 i32 i32) (result i32)))
|
|
(func (export "_initialize")
|
|
(call $print (i32.const 32) (i32.const 18))
|
|
)
|
|
(func (export "greet")
|
|
(call $print (i32.const 64) (i32.const 12))
|
|
)
|
|
(func $print (param $ptr i32) (param $len i32)
|
|
(i32.store (i32.const 8) (local.get $len))
|
|
(i32.store (i32.const 4) (local.get $ptr))
|
|
(drop (call $__wasi_fd_write
|
|
(i32.const 1)
|
|
(i32.const 4)
|
|
(i32.const 1)
|
|
(i32.const 0)))
|
|
)
|
|
(memory (export "memory") 1)
|
|
(data (i32.const 32) "Hello _initialize\0a")
|
|
(data (i32.const 64) "Hello greet\0a")
|
|
)
|
|
|