git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: 276e1f2ef76f665728f308c95464327233c1ba98

Files: 276e1f2ef76f665728f308c95464327233c1ba98 / tests / interface / call.wast

897 bytesRaw
1;; starts with an address of 5d48c1018904a172886829bbbd9c6f4a2d06c47b
2(module
3 (import "ethereum" "call" (func $call (param i32 i32 i32 i32 i32 i32 i32 i32) (result i32)))
4 (memory 1)
5 (export "a" (memory 0))
6 (export "main" (func $main))
7 (func $main
8 (block
9 ;; Memory layout:
10 ;; 0 - 20 bytes: address (4)
11 ;; 20 - 52 bytes: value (0)
12 ;; 52 - 56 bytes: data (0x42004200)
13 ;; 56 - 60 bytes: result
14 (i32.store (i32.const 0) (i32.const 0x4))
15 (i32.store (i32.const 52) (i32.const 0x42004200))
16 (call $call (i32.const 2000) (i32.const 0) (i32.const 20) (i32.const 52) (i32.const 4) (i32.const 56) (i32.const 4) (i32.const 1))
17 drop
18 )
19 )
20
21 (export "1" (func $callback))
22 (func $callback (param $result i32)
23 (if (i32.eq (i32.const 1) (get_local $result))
24 (return)
25 )
26 (unreachable)
27 )
28)
29

Built with git-ssb-web