2015-08-14 13:38:01 +00:00
|
|
|
VAR global : INT;
|
|
|
|
|
2015-08-19 14:26:28 +00:00
|
|
|
# OBJ timer : "/sys/timer";
|
|
|
|
# OBJ heap : "/sys/malloc";
|
|
|
|
# OBJ interrupts : "/sys/interrupt";
|
|
|
|
|
2015-08-20 15:51:31 +00:00
|
|
|
PUB main() | i : INT, str : TEXT
|
2015-08-14 13:38:01 +00:00
|
|
|
BEGIN
|
2015-08-14 21:53:51 +00:00
|
|
|
0 -> i;
|
2015-08-20 15:51:31 +00:00
|
|
|
"Hello " -> str;
|
|
|
|
printStr(str + "World!");
|
2015-08-19 13:07:25 +00:00
|
|
|
WHILE ((i + 1) -> i) <= fun() DO
|
2015-08-15 22:45:12 +00:00
|
|
|
BEGIN
|
2015-08-20 15:33:30 +00:00
|
|
|
hlp(i, fun() - i);
|
2015-08-16 21:40:34 +00:00
|
|
|
sleep(2);
|
2015-08-15 22:45:12 +00:00
|
|
|
END
|
2015-08-14 13:38:01 +00:00
|
|
|
END
|
|
|
|
|
2015-08-20 15:33:30 +00:00
|
|
|
PRI hlp(i : INT, j : INT)
|
|
|
|
BEGIN
|
|
|
|
print2Int(i, j);
|
|
|
|
END
|
|
|
|
|
2015-08-14 15:12:08 +00:00
|
|
|
PUB fun() -> i : INT
|
2015-08-14 13:38:01 +00:00
|
|
|
BEGIN
|
2015-08-19 14:26:28 +00:00
|
|
|
60 -> i;
|
2015-08-14 13:38:01 +00:00
|
|
|
END
|