Working hello world
parent
397eaa13db
commit
1f502bed06
@ -1,3 +1,2 @@
|
||||
intermediate.wat
|
||||
output.wasmu
|
||||
src
|
||||
./intermediate.wat
|
||||
./output.wasmu
|
||||
|
Binary file not shown.
@ -0,0 +1,27 @@
|
||||
;; Currently using a hard-coded struct at location 0
|
||||
(import "wasi_unstable" "fd_write" (func $fd_write (param $file_descriptor i32) (param $io_vectors i32) (param $io_vecnum i32) (param $num_written_ptr i32) (result i32)))
|
||||
|
||||
(func $print (param $location i32) (param $length i32) (result i32)
|
||||
;; create struct at location 0
|
||||
i32.const 0
|
||||
local.get $location
|
||||
i32.store
|
||||
|
||||
i32.const 4
|
||||
local.get $length
|
||||
i32.store
|
||||
|
||||
;; file descriptor
|
||||
i32.const 1
|
||||
|
||||
;; iovs array pointer
|
||||
i32.const 0
|
||||
|
||||
;; iovs array length
|
||||
i32.const 1
|
||||
|
||||
;; where to write length written
|
||||
i32.const 200
|
||||
|
||||
call $fd_write
|
||||
)
|
Loading…
Reference in New Issue