-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathloop.wat
More file actions
42 lines (37 loc) · 984 Bytes
/
loop.wat
File metadata and controls
42 lines (37 loc) · 984 Bytes
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
(module
(func (param i32 i32) (result i32) (local i32 i32)
block
loop
get_local 0
i32.const 0
i32.le_s
br_if 1
get_local 1
set_local 2
block
loop
get_local 2
i32.const 0
i32.le_s
br_if 1
get_local 3
i32.const 1
i32.add
set_local 3
get_local 2
i32.const -1
i32.add
set_local 2
br 0
end
end
get_local 0
i32.const -1
i32.add
set_local 0
br 0
end
end
get_local 3
)
)