You are on page 1of 20

puck:~/cse109.

104/p5% SkStack 1p5


count==2
Opening file: '1p5'
Is p good? 1
Loading:
0: enter 3
1: x +
2: enter 4
3: y +
4: getRegister
5: + 5
6: * 6
7: - 9
8: / 2 $expect ((4+5)*6-9)/2 = 22.5
9: getRegister
10: + x
11: getRegister $expect 25.5
12: - y
13: getRegister $expect 21.5
14: * y
15: getRegister $expect 86
16: / x
17: getRegister $expect 86/3 = 28.6666
18: enter 3
19: push
20: push
21: push
22: stack +
23: stack+
24: pop
25: getRegister $expect 9
26: push
27: push
28: push
29: stack*
30: stack*
31: pop
32: getRegister $expect 729
33: push
34: enter 70
35: push
36: stack/
37: pop
38: getRegister $ expect 10.414...
39: enter 10
40: push
41: enter 15
42: push
43: stack-
44: pop
45: getRegister $ expcect -5
46: enter x
47: getRegister $ expect 3
48: end
Program successfully loaded...
------------------------------
Running......
Register----> 4
Register----> 22.5
Register----> 25.5
Register----> 21.5
Register----> 86
Register----> 28.6667
Register----> 9
Register----> 729
Register----> 10.4143
Register----> -5
Register----> 3

puck:~/cse109.104/p5% SkStack 2p5


count==2
Opening file: '2p5'
Is p good? 1
Loading:
0: $ test out the jumps
1: $ test out enter
2: $
3: enter 3
4: x+ $memory starts with 0, so we get x==3
5: enter x
6: getRegister $ displays 3
7: loop: $ loop until we get -1
8: enter x
9: getRegister $prints 3 2 1 0 -1
10: jumpL exit1
11: enter -1
12: x+
13: jump loop
14: exit1:
15: enter 2
16: push
17: enter 4
18: push
19: stack-
20: loopa: $start with -2
21: $ prints -1 0 1
22: enter 1
23: push
24: stack+
25: pop
26: push
27: getRegister
28: jumpG exit2
29: jump loopa
30: exit2:
31: enter 999
32: getRegister $expect 999
33: end
34:
Program successfully loaded...
------------------------------
Running......
Register----> 3
Register----> 3
Register----> 2
Register----> 1
Register----> 0
Register----> -1
Register----> -1
Register----> 0
Register----> 1
Register----> 999

puck:~/cse109.104/p5% SkStack 3p5


count==2
Opening file: '3p5'
Is p good? 1
Loading:
0: enter
1: push
2: enter 9.5
3: push
4: stack+
5: pop
6: + 35
7: getRegister
8: end
9: 9.5 -18.75
10:
Program successfully loaded...
------------------------------
Running......
INPUT<--- 9.5
Register----> 54

puck:~/cse109.104/p5% SkStack 4p5


count==2
Opening file: '4p5'
Is p good? 1
Loading:
0: $ read in positive numbers, display square of each
1: $ finish with display of sum of squares
2: $ use negative number as sentinel
3:
4: enter 0
5: push
6: loop:
7: enter
8: jumpL finish
9: push
10: push
11: stack*
12: pop
13: push
14: getRegister
15: stack+
16: jump loop
17: finish:
18: pop
19: getRegister
20: end
21: 1.1 2 3 4 -1
Program successfully loaded...
------------------------------
Running......
INPUT<--- 1.1
Register----> 1.21
INPUT<--- 2
Register----> 4
INPUT<--- 3
Register----> 9
INPUT<--- 4
Register----> 16
INPUT<--- -1
Register----> 30.21

puck:~/cse109.104/p5% SkStack 5p5


count==2
Opening file: '5p5'
Is p good? 1
Loading:
0: $ test out jumps more carefully
1: $ only output should be single digits
2: $ 1, 2, ...
3: enter 1
4: jumpL one
5: getRegister
6: jump two
7: one:
8: enter 101
9: getRegister
10: two:
11: enter 0
12: -3
13: jumpL three
14: enter 102
15: getRegister
16: jump four
17: three:
18: enter 2
19: getRegister
20: four:
21: enter 0
22: jumpG five
23: enter 3
24: getRegister
25: jump six
26: five:
27: enter 103
28: getRegister
29: six:
30: enter 1
31: jumpG seven
32: enter 104
33: getRegister
34: jump eight
35: seven:
36: enter 4
37: getRegister
38: end
39:
Program successfully loaded...
------------------------------
Running......
Register----> 1
Register----> 2
Register----> 3
Register----> 4

puck:~/cse109.104/p5% SkStack 6p5


count==2
Opening file: '6p5'
Is p good? 1
Loading:
0: $ test out the clear operation
1:
2: $ expect 3, 0, 6, 0
3: enter 3
4: x+
5: x+
6: getScreen
7: clear
8: getScreen
9: +x
10: getScreen
11: clear x
12: clear
13: +x
14: getScreen
15: end
16:
17:
Program successfully loaded...
------------------------------
Running......
Line 6: getScreen
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected
puck:~/cse109.104/p5% SkStack 7p5
count==2
Opening file: '7p5'
Is p good? 1
Loading:
0: $ syntactically incorrect
1: x
2: y:
3: end
4:
Program successfully loaded...
------------------------------
Running......
Line 1: x
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected

puck:~/cse109.104/p5% SkStack 7p5


count==2
Opening file: '7p5'
Is p good? 1
Loading:
0: $ syntactically incorrect
1: x
2: y:
3: end
4:
Program successfully loaded...
------------------------------
Running......
Line 1: x
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected

puck:~/cse109.104/p5% SkStack 8p5


count==2
Opening file: '8p5'
Is p good? 1
Loading:
0: $ syntactically incorrect
1: y: x
2: end
3:
Program successfully loaded...
------------------------------
Running......
Line 1: y: x
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected

puck:~/cse109.104/p5% SkStack 9p5


count==2
Opening file: '9p5'
Is p good? 1
Loading:
0: $ syntactically incorrect
1: y: x + 2
2: end
3:
Program successfully loaded...
------------------------------
Running......
Line 1: y: x + 2
^^^^
ERROR: (SkStack::doLine()) junk at end of line

puck:~/cse109.104/p5% SkStack 10p5


count==2
Opening file: '10p5'
Is p good? 1
Loading:
0: $ syntactically incorrect
1: clear x
2: y: x +
3: y: x+
Line 3: y: x+
^^^^
ERROR: (SkStack::checkLabel()) duplicate label

puck:~/cse109.104/p5% SkStack 11p5


count==2
Opening file: '11p5'
Is p good? 1
Loading:
0: $ what about using the same identifier
1: $ as label and variable? There is no
2: $ clear answer about what to do.
3: $Allow it? Forbid it?
4: $ fpcalc allows it....
5: clear x
6: enter 5
7: x+
8: jump x
9: enter 3
10: x: getScreen
11: end
12:
Program successfully loaded...
------------------------------
Running......
Line 10: x: getScreen
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected

puck:~/cse109.104/p5% SkStack 12p5


count==2
Opening file: '12p5'
Is p good? 1
Loading:
0: $deal with missing end?
1: enter 6
2: getScreen
3:
4:
Program successfully loaded...
------------------------------
Running......
Line 2: getScreen
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected

puck:~/cse109.104/p5% SkStack 13p5


count==2
Opening file: '13p5'
Is p good? 1
Loading:
0: $deal with missing end?
1: enter
2: getScreen
3: 6
4:
5:
Program successfully loaded...
------------------------------
Running......
INPUT<--- 6
Line 2: getScreen
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected

puck:~/cse109.104/p5% SkStack 14p5


count==2
Opening file: '14p5'
Is p good? 1
Loading:
0: clear x
1: clear y
2: clear z
3: clear a
4: clear b
5: clear c
6: clear d
7: clear e
8: clear f
9: clear g $ should get memory overflow after this line
10: clear h
11: end
Program successfully loaded...
------------------------------
Running......
Line 10: clear h
^^^^
ERROR: (SkStack::addVar()) Only 10 variables allowed

puck:~/cse109.104/p5% SkStack 15p5


count==2
Opening file: '15p5'
ERROR: Failure to open input file

*******************************************************888
puck:~/cse109.104/p5% SkStack 1p5 -v
count==3
Opening file: '1p5'
Is p good? 1
Loading:
0: enter 3
1: x +
2: enter 4
3: y +
4: getRegister
5: + 5
6: * 6
7: - 9
8: / 2 $expect ((4+5)*6-9)/2 = 22.5
9: getRegister
10: + x
11: getRegister $expect 25.5
12: - y
13: getRegister $expect 21.5
14: * y
15: getRegister $expect 86
16: / x
17: getRegister $expect 86/3 = 28.6666
18: enter 3
19: push
20: push
21: push
22: stack +
23: stack+
24: pop
25: getRegister $expect 9
26: push
27: push
28: push
29: stack*
30: stack*
31: pop
32: getRegister $expect 729
33: push
34: enter 70
35: push
36: stack/
37: pop
38: getRegister $ expect 10.414...
39: enter 10
40: push
41: enter 15
42: push
43: stack-
44: pop
45: getRegister $ expcect -5
46: enter x
47: getRegister $ expect 3
48: end
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: enter 3
[Step= 1, line= 1]: x +
[Step= 2, line= 2]: enter 4
[Step= 3, line= 3]: y +
[Step= 4, line= 4]: getRegister
Register----> 4
[Step= 5, line= 5]: + 5
[Step= 6, line= 6]: * 6
[Step= 7, line= 7]: - 9
[Step= 8, line= 8]: / 2 $expect ((4+5)*6-9)/2 = 22.5
[Step= 9, line= 9]: getRegister
Register----> 22.5
[Step= 10, line= 10]: + x
[Step= 11, line= 11]: getRegister $expect 25.5
Register----> 25.5
[Step= 12, line= 12]: - y
[Step= 13, line= 13]: getRegister $expect 21.5
Register----> 21.5
[Step= 14, line= 14]: * y
[Step= 15, line= 15]: getRegister $expect 86
Register----> 86
[Step= 16, line= 16]: / x
[Step= 17, line= 17]: getRegister $expect 86/3 = 28.6666
Register----> 28.6667
[Step= 18, line= 18]: enter 3
[Step= 19, line= 19]: push
[Step= 20, line= 20]: push
[Step= 21, line= 21]: push
[Step= 22, line= 22]: stack +
[Step= 23, line= 23]: stack+
[Step= 24, line= 24]: pop
[Step= 25, line= 25]: getRegister $expect 9
Register----> 9
[Step= 26, line= 26]: push
[Step= 27, line= 27]: push
[Step= 28, line= 28]: push
[Step= 29, line= 29]: stack*
[Step= 30, line= 30]: stack*
[Step= 31, line= 31]: pop
[Step= 32, line= 32]: getRegister $expect 729
Register----> 729
[Step= 33, line= 33]: push
[Step= 34, line= 34]: enter 70
[Step= 35, line= 35]: push
[Step= 36, line= 36]: stack/
[Step= 37, line= 37]: pop
[Step= 38, line= 38]: getRegister $ expect 10.414...
Register----> 10.4143
[Step= 39, line= 39]: enter 10
[Step= 40, line= 40]: push
[Step= 41, line= 41]: enter 15
[Step= 42, line= 42]: push
[Step= 43, line= 43]: stack-
[Step= 44, line= 44]: pop
[Step= 45, line= 45]: getRegister $ expcect -5
Register----> -5
[Step= 46, line= 46]: enter x
[Step= 47, line= 47]: getRegister $ expect 3
Register----> 3
puck:~/cse109.104/p5% SkStack 2p5 -v
count==3
Opening file: '2p5'
Is p good? 1
Loading:
0: $ test out the jumps
1: $ test out enter
2: $
3: enter 3
4: x+ $memory starts with 0, so we get x==3
5: enter x
6: getRegister $ displays 3
7: loop: $ loop until we get -1
8: enter x
9: getRegister $prints 3 2 1 0 -1
10: jumpL exit1
11: enter -1
12: x+
13: jump loop
14: exit1:
15: enter 2
16: push
17: enter 4
18: push
19: stack-
20: loopa: $start with -2
21: $ prints -1 0 1
22: enter 1
23: push
24: stack+
25: pop
26: push
27: getRegister
28: jumpG exit2
29: jump loopa
30: exit2:
31: enter 999
32: getRegister $expect 999
33: end
34:
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: $ test out the jumps
[Step= 1, line= 1]: $ test out enter
[Step= 2, line= 2]: $
[Step= 3, line= 3]: enter 3
[Step= 4, line= 4]: x+ $memory starts with 0, so we get x==3
[Step= 5, line= 5]: enter x
[Step= 6, line= 6]: getRegister $ displays 3
Register----> 3
[Step= 7, line= 7]: loop: $ loop until we get -1
[Step= 8, line= 8]: enter x
[Step= 9, line= 9]: getRegister $prints 3 2 1 0 -1
Register----> 3
[Step= 10, line= 10]: jumpL exit1
[Step= 11, line= 11]: enter -1
[Step= 12, line= 12]: x+
[Step= 13, line= 13]: jump loop
[Step= 14, line= 7]: loop: $ loop until we get -1
[Step= 15, line= 8]: enter x
[Step= 16, line= 9]: getRegister $prints 3 2 1 0 -1
Register----> 2
[Step= 17, line= 10]: jumpL exit1
[Step= 18, line= 11]: enter -1
[Step= 19, line= 12]: x+
[Step= 20, line= 13]: jump loop
[Step= 21, line= 7]: loop: $ loop until we get -1
[Step= 22, line= 8]: enter x
[Step= 23, line= 9]: getRegister $prints 3 2 1 0 -1
Register----> 1
[Step= 24, line= 10]: jumpL exit1
[Step= 25, line= 11]: enter -1
[Step= 26, line= 12]: x+
[Step= 27, line= 13]: jump loop
[Step= 28, line= 7]: loop: $ loop until we get -1
[Step= 29, line= 8]: enter x
[Step= 30, line= 9]: getRegister $prints 3 2 1 0 -1
Register----> 0
[Step= 31, line= 10]: jumpL exit1
[Step= 32, line= 11]: enter -1
[Step= 33, line= 12]: x+
[Step= 34, line= 13]: jump loop
[Step= 35, line= 7]: loop: $ loop until we get -1
[Step= 36, line= 8]: enter x
[Step= 37, line= 9]: getRegister $prints 3 2 1 0 -1
Register----> -1
[Step= 38, line= 10]: jumpL exit1
[Step= 39, line= 14]: exit1:
[Step= 40, line= 15]: enter 2
[Step= 41, line= 16]: push
[Step= 42, line= 17]: enter 4
[Step= 43, line= 18]: push
[Step= 44, line= 19]: stack-
[Step= 45, line= 20]: loopa: $start with -2
[Step= 46, line= 21]: $ prints -1 0 1
[Step= 47, line= 22]: enter 1
[Step= 48, line= 23]: push
[Step= 49, line= 24]: stack+
[Step= 50, line= 25]: pop
[Step= 51, line= 26]: push
[Step= 52, line= 27]: getRegister
Register----> -1
[Step= 53, line= 28]: jumpG exit2
[Step= 54, line= 29]: jump loopa
[Step= 55, line= 20]: loopa: $start with -2
[Step= 56, line= 21]: $ prints -1 0 1
[Step= 57, line= 22]: enter 1
[Step= 58, line= 23]: push
[Step= 59, line= 24]: stack+
[Step= 60, line= 25]: pop
[Step= 61, line= 26]: push
[Step= 62, line= 27]: getRegister
Register----> 0
[Step= 63, line= 28]: jumpG exit2
[Step= 64, line= 29]: jump loopa
[Step= 65, line= 20]: loopa: $start with -2
[Step= 66, line= 21]: $ prints -1 0 1
[Step= 67, line= 22]: enter 1
[Step= 68, line= 23]: push
[Step= 69, line= 24]: stack+
[Step= 70, line= 25]: pop
[Step= 71, line= 26]: push
[Step= 72, line= 27]: getRegister
Register----> 1
[Step= 73, line= 28]: jumpG exit2
[Step= 74, line= 30]: exit2:
[Step= 75, line= 31]: enter 999
[Step= 76, line= 32]: getRegister $expect 999
Register----> 999
puck:~/cse109.104/p5%
puck:~/cse109.104/p5% SkStack 3p5 -v
count==3
Opening file: '3p5'
Is p good? 1
Loading:
0: enter
1: push
2: enter 9.5
3: push
4: stack+
5: pop
6: + 35
7: getRegister
8: end
9: 9.5 -18.75
10:
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: enter
INPUT<--- 9.5
[Step= 1, line= 1]: push
[Step= 2, line= 2]: enter 9.5
[Step= 3, line= 3]: push
[Step= 4, line= 4]: stack+
[Step= 5, line= 5]: pop
[Step= 6, line= 6]: + 35
[Step= 7, line= 7]: getRegister
Register----> 54
puck:~/cse109.104/p5% SkStack 4p5 -v
count==3
Opening file: '4p5'
Is p good? 1
Loading:
0: $ read in positive numbers, display square of each
1: $ finish with display of sum of squares
2: $ use negative number as sentinel
3:
4: enter 0
5: push
6: loop:
7: enter
8: jumpL finish
9: push
10: push
11: stack*
12: pop
13: push
14: getRegister
15: stack+
16: jump loop
17: finish:
18: pop
19: getRegister
20: end
21: 1.1 2 3 4 -1
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: $ read in positive numbers, display square of each
[Step= 1, line= 1]: $ finish with display of sum of squares
[Step= 2, line= 2]: $ use negative number as sentinel
[Step= 3, line= 3]:
[Step= 4, line= 4]: enter 0
[Step= 5, line= 5]: push
[Step= 6, line= 6]: loop:
[Step= 7, line= 7]: enter
INPUT<--- 1.1
[Step= 8, line= 8]: jumpL finish
[Step= 9, line= 9]: push
[Step= 10, line= 10]: push
[Step= 11, line= 11]: stack*
[Step= 12, line= 12]: pop
[Step= 13, line= 13]: push
[Step= 14, line= 14]: getRegister
Register----> 1.21
[Step= 15, line= 15]: stack+
[Step= 16, line= 16]: jump loop
[Step= 17, line= 6]: loop:
[Step= 18, line= 7]: enter
INPUT<--- 2
[Step= 19, line= 8]: jumpL finish
[Step= 20, line= 9]: push
[Step= 21, line= 10]: push
[Step= 22, line= 11]: stack*
[Step= 23, line= 12]: pop
[Step= 24, line= 13]: push
[Step= 25, line= 14]: getRegister
Register----> 4
[Step= 26, line= 15]: stack+
[Step= 27, line= 16]: jump loop
[Step= 28, line= 6]: loop:
[Step= 29, line= 7]: enter
INPUT<--- 3
[Step= 30, line= 8]: jumpL finish
[Step= 31, line= 9]: push
[Step= 32, line= 10]: push
[Step= 33, line= 11]: stack*
[Step= 34, line= 12]: pop
[Step= 35, line= 13]: push
[Step= 36, line= 14]: getRegister
Register----> 9
[Step= 37, line= 15]: stack+
[Step= 38, line= 16]: jump loop
[Step= 39, line= 6]: loop:
[Step= 40, line= 7]: enter
INPUT<--- 4
[Step= 41, line= 8]: jumpL finish
[Step= 42, line= 9]: push
[Step= 43, line= 10]: push
[Step= 44, line= 11]: stack*
[Step= 45, line= 12]: pop
[Step= 46, line= 13]: push
[Step= 47, line= 14]: getRegister
Register----> 16
[Step= 48, line= 15]: stack+
[Step= 49, line= 16]: jump loop
[Step= 50, line= 6]: loop:
[Step= 51, line= 7]: enter
INPUT<--- -1
[Step= 52, line= 8]: jumpL finish
[Step= 53, line= 17]: finish:
[Step= 54, line= 18]: pop
[Step= 55, line= 19]: getRegister
Register----> 30.21
puck:~/cse109.104/p5% SkStack 5p5 -v
count==3
Opening file: '5p5'
Is p good? 1
Loading:
0: $ test out jumps more carefully
1: $ only output should be single digits
2: $ 1, 2, ...
3: enter 1
4: jumpL one
5: getRegister
6: jump two
7: one:
8: enter 101
9: getRegister
10: two:
11: enter 0
12: -3
13: jumpL three
14: enter 102
15: getRegister
16: jump four
17: three:
18: enter 2
19: getRegister
20: four:
21: enter 0
22: jumpG five
23: enter 3
24: getRegister
25: jump six
26: five:
27: enter 103
28: getRegister
29: six:
30: enter 1
31: jumpG seven
32: enter 104
33: getRegister
34: jump eight
35: seven:
36: enter 4
37: getRegister
38: end
39:
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: $ test out jumps more carefully
[Step= 1, line= 1]: $ only output should be single digits
[Step= 2, line= 2]: $ 1, 2, ...
[Step= 3, line= 3]: enter 1
[Step= 4, line= 4]: jumpL one
[Step= 5, line= 5]: getRegister
Register----> 1
[Step= 6, line= 6]: jump two
[Step= 7, line= 10]: two:
[Step= 8, line= 11]: enter 0
[Step= 9, line= 12]: -3
[Step= 10, line= 13]: jumpL three
[Step= 11, line= 17]: three:
[Step= 12, line= 18]: enter 2
[Step= 13, line= 19]: getRegister
Register----> 2
[Step= 14, line= 20]: four:
[Step= 15, line= 21]: enter 0
[Step= 16, line= 22]: jumpG five
[Step= 17, line= 23]: enter 3
[Step= 18, line= 24]: getRegister
Register----> 3
[Step= 19, line= 25]: jump six
[Step= 20, line= 29]: six:
[Step= 21, line= 30]: enter 1
[Step= 22, line= 31]: jumpG seven
[Step= 23, line= 35]: seven:
[Step= 24, line= 36]: enter 4
[Step= 25, line= 37]: getRegister
Register----> 4
puck:~/cse109.104/p5% SkStack 6p5 -v
count==3
Opening file: '6p5'
Is p good? 1
Loading:
0: $ test out the clear operation
1:
2: $ expect 3, 0, 6, 0
3: enter 3
4: x+
5: x+
6: getScreen
7: clear
8: getScreen
9: +x
10: getScreen
11: clear x
12: clear
13: +x
14: getScreen
15: end
16:
17:
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: $ test out the clear operation
[Step= 1, line= 1]:
[Step= 2, line= 2]: $ expect 3, 0, 6, 0
[Step= 3, line= 3]: enter 3
[Step= 4, line= 4]: x+
[Step= 5, line= 5]: x+
[Step= 6, line= 6]: getScreen
Line 6: getScreen
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected
puck:~/cse109.104/p5% SkStack 7p5 -v
count==3
Opening file: '7p5'
Is p good? 1
Loading:
0: $ syntactically incorrect
1: x
2: y:
3: end
4:
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: $ syntactically incorrect
[Step= 1, line= 1]: x
Line 1: x
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected
puck:~/cse109.104/p5% SkStack 8p5 -v
count==3
Opening file: '8p5'
Is p good? 1
Loading:
0: $ syntactically incorrect
1: y: x
2: end
3:
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: $ syntactically incorrect
[Step= 1, line= 1]: y: x
Line 1: y: x
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected
puck:~/cse109.104/p5% SkStack 9p5 -v
count==3
Opening file: '9p5'
Is p good? 1
Loading:
0: $ syntactically incorrect
1: y: x + 2
2: end
3:
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: $ syntactically incorrect
[Step= 1, line= 1]: y: x + 2
Line 1: y: x + 2
^^^^
ERROR: (SkStack::doLine()) junk at end of line
puck:~/cse109.104/p5% SkStack 10p5 -v
count==3
Opening file: '10p5'
Is p good? 1
Loading:
0: $ syntactically incorrect
1: clear x
2: y: x +
3: y: x+
Line 3: y: x+
^^^^
ERROR: (SkStack::checkLabel()) duplicate label
puck:~/cse109.104/p5% SkStack 11p5 -v
count==3
Opening file: '11p5'
Is p good? 1
Loading:
0: $ what about using the same identifier
1: $ as label and variable? There is no
2: $ clear answer about what to do.
3: $Allow it? Forbid it?
4: $ fpcalc allows it....
5: clear x
6: enter 5
7: x+
8: jump x
9: enter 3
10: x: getScreen
11: end
12:
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: $ what about using the same identifier
[Step= 1, line= 1]: $ as label and variable? There is no
[Step= 2, line= 2]: $ clear answer about what to do.
[Step= 3, line= 3]: $Allow it? Forbid it?
[Step= 4, line= 4]: $ fpcalc allows it....
[Step= 5, line= 5]: clear x
[Step= 6, line= 6]: enter 5
[Step= 7, line= 7]: x+
[Step= 8, line= 8]: jump x
[Step= 9, line= 10]: x: getScreen
Line 10: x: getScreen
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected
puck:~/cse109.104/p5% SkStack 12p5 -v
count==3
Opening file: '12p5'
Is p good? 1
Loading:
0: $deal with missing end?
1: enter 6
2: getScreen
3:
4:
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: $deal with missing end?
[Step= 1, line= 1]: enter 6
[Step= 2, line= 2]: getScreen
Line 2: getScreen
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected
puck:~/cse109.104/p5% SkStack 13p5 -v
count==3
Opening file: '13p5'
Is p good? 1
Loading:
0: $deal with missing end?
1: enter
2: getScreen
3: 6
4:
5:
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: $deal with missing end?
[Step= 1, line= 1]: enter
INPUT<--- 6
[Step= 2, line= 2]: getScreen
Line 2: getScreen
^^^^
ERROR: (SkStack::doMemOp()) '+' or expected
puck:~/cse109.104/p5% SkStack 14p5 -v
count==3
Opening file: '14p5'
Is p good? 1
Loading:
0: clear x
1: clear y
2: clear z
3: clear a
4: clear b
5: clear c
6: clear d
7: clear e
8: clear f
9: clear g $ should get memory overflow after this line
10: clear h
11: end
Program successfully loaded...
------------------------------
Running......
[Step= 0, line= 0]: clear x
[Step= 1, line= 1]: clear y
[Step= 2, line= 2]: clear z
[Step= 3, line= 3]: clear a
[Step= 4, line= 4]: clear b
[Step= 5, line= 5]: clear c
[Step= 6, line= 6]: clear d
[Step= 7, line= 7]: clear e
[Step= 8, line= 8]: clear f
[Step= 9, line= 9]: clear g $ should get memory overflow after this line
[Step= 10, line= 10]: clear h
Line 10: clear h
^^^^
ERROR: (SkStack::addVar()) Only 10 variables allowed
puck:~/cse109.104/p5% SkStack 15p5 -v
count==3
Opening file: '15p5'
ERROR: Failure to open input file
puck:~/cse109.104/p5%

You might also like