logo

deblob

remove binary executables from a directory git clone https://anongit.hacktivis.me/git/deblob.git/

hello.wat (654B)


  1. ;; SPDX-FileCopyrightText: 2021 Stephan Avenwedde <https://opensource.com/article/21/3/hello-world-webassembly>
  2. ;; SPDX-License-Identifier: CC-BY-SA-4.0
  3. (module
  4. ;; Imports from JavaScript namespace
  5. (import "console" "log" (func $log (param i32 i32))) ;; Import log function
  6. (import "js" "mem" (memory 1)) ;; Import 1 page of memory (54kb)
  7. ;; Data section of our module
  8. (data (i32.const 0) "Hello World from WebAssembly!")
  9. ;; Function declaration: Exported as helloWorld(), no arguments
  10. (func (export "helloWorld")
  11. i32.const 0 ;; pass offset 0 to log
  12. i32.const 29 ;; pass length 29 to log (strlen of sample text)
  13. call $log
  14. )
  15. )