-
Notifications
You must be signed in to change notification settings - Fork 0
/
ramxy.wat
63 lines (63 loc) · 1007 Bytes
/
ramxy.wat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
(module
(table 0 anyfunc)
(memory $0 1)
(export "memory" (memory $0))
(export "ram2value" (func $ram2value))
(func $ram2value (; 0 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $label$0
(block $label$1
(br_if $label$1
(i32.gt_u
(tee_local $0
(i32.add
(tee_local $3
(i32.add
(i32.shl
(get_local $0)
(i32.const 1)
)
(get_local $3)
)
)
(i32.const -1)
)
)
(i32.const 1024)
)
)
(set_local $3
(i32.add
(i32.shl
(get_local $0)
(i32.const 2)
)
(i32.const 16)
)
)
(br_if $label$0
(i32.eqz
(get_local $1)
)
)
(i32.store
(get_local $3)
(get_local $2)
)
(return
(get_local $2)
)
)
(return
(i32.shl
(i32.eqz
(get_local $3)
)
(i32.const 9)
)
)
)
(i32.load
(get_local $3)
)
)
)