Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (32 sloc) 582 Bytes
memory {
temp: zero 4;
scale: hex 02000000;
}
func ifelse(cond i32, a i32, b i32) i32 {
storeI32(temp, 10);
if (cond) {
return a > b;
} else {
return a < b;
}
}
export func main() i32 {
storeI32(temp, 0);
var i i32 = 0;
done: while (i < 10) {
i = i + 1;
if (i >= 7) {
break done;
}
}
return (i + ifelse(0, 1, 2) * 2) * loadI32(temp) + loadI32(scale);
}
//export func check() i32 {
// var i i32 = 0;
// var total i32 = 0;
// while (i < 1024 * 1024) {
// total = total | loadI32(i);
// i = i + 4;
// }
// return total;
//}