-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.wasm
More file actions
22 lines (19 loc) · 726 Bytes
/
test.wasm
File metadata and controls
22 lines (19 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(module
;; Import the 'set' function from the 'splinter' host module we registered
;; See splinter_cli_cmd_wasm.c for the actual implementation. Right now, only
;; get and set are mapped.
;; Signature: (key_ptr, key_len, val_ptr, val_len) -> i32
(import "splinter" "set" (func $splinter_set (param i32 i32 i32 i32) (result i32)))
(memory (export "memory") 1)
;; Store our strings in linear memory
(data (i32.const 0) "__debug")
(data (i32.const 16) "Hello from WASM!")
(func (export "_start") (result i32)
;; Call splinter:set("wasm_key", "Hello from WASM!")
i32.const 0 ;; key_ptr
i32.const 8 ;; key_len
i32.const 16 ;; val_ptr
i32.const 16 ;; val_len
call $splinter_set
)
)