Files: 9224a38130d9646acdb70e89eadcd3de8b626082 / tests / interface / call.wast
953 bytesRaw
1 | ;; starts with an address of 5d48c1018904a172886829bbbd9c6f4a2d06c47b |
2 | (module |
3 | (import "ethereum" "call" (func $call (param i64 i32 i32 i32 i32 i32 i32 i32) (result i32))) |
4 | (memory 1) |
5 | (export "memory" (memory 0)) |
6 | (export "main" (func $main)) |
7 | |
8 | (table |
9 | (export "callback") |
10 | anyfunc |
11 | (elem |
12 | $callback |
13 | ) |
14 | ) |
15 | |
16 | (func $main |
17 | (block |
18 | ;; Memory layout: |
19 | ;; 0 - 20 bytes: address (4) |
20 | ;; 20 - 52 bytes: value (0) |
21 | ;; 52 - 56 bytes: data (0x42004200) |
22 | ;; 56 - 60 bytes: result |
23 | (i32.store (i32.const 0) (i32.const 0x4)) |
24 | (i32.store (i32.const 52) (i32.const 0x42004200)) |
25 | (call $call (i64.const 2000) (i32.const 0) (i32.const 20) (i32.const 52) (i32.const 4) (i32.const 56) (i32.const 4) (i32.const 0)) |
26 | drop |
27 | ) |
28 | ) |
29 | |
30 | (func $callback (param $result i32) |
31 | (if (i32.eq (i32.const 1) (get_local $result)) |
32 | (return) |
33 | ) |
34 | (unreachable) |
35 | ) |
36 | ) |
37 |
Built with git-ssb-web