hello.wat 599 B

12345678910111213141516171819202122
  1. ;; Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. ;; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. (module
  4. ;; import test_write function which is implemented by host
  5. (import "env" "test_write"
  6. (func $test_write (param externref i32 i32) (result i32)))
  7. ;; memory with one page (64KiB).
  8. (memory (export "memory") 1)
  9. (data (i32.const 0x8) "Hello, world!\n")
  10. ;; function that writes string to a given open file handle
  11. (func (export "test") (param externref)
  12. (local.get 0)
  13. (i32.const 0x8)
  14. (i32.const 14)
  15. (call $test_write)
  16. drop
  17. )
  18. )