Skip to content

Step2.1: fibonacchi

Latest
Compare
Choose a tag to compare
@vsanna vsanna released this 20 Sep 01:35
· 18 commits to main since this release

input

class Recursive2 {
    static public void main() {
        fibonacchi(10);
    }

    static int fibonacchi(int n) {
        if(n <= 1) return n;
        return fibonacchi(n-1) + fibonacchi(n-2);
    }
}

output

stack#=0, pc = 259, inst = 10, frame=LFrame{locals=[], operandStack=[Word(0,0,0,0: 0)]}
stack#=0, pc = 261, inst = b8, frame=LFrame{locals=[], operandStack=[Word(0,0,0,a: 10), Word(0,0,0,0: 0)]}
stack#=1, pc = 308, inst = 1a, frame=LFrame{locals=[Word(0,0,0,a: 10)], operandStack=[Word(0,0,1,8: 264)]}
stack#=1, pc = 309, inst = 4, frame=LFrame{locals=[Word(0,0,0,a: 10)], operandStack=[Word(0,0,0,a: 10), Word(0,0,1,8: 264)]}
stack#=1, pc = 310, inst = a3, frame=LFrame{locals=[Word(0,0,0,a: 10)], operandStack=[Word(0,0,0,1: 1), Word(0,0,0,a: 10), Word(0,0,1,8: 264)]}
stack#=1, pc = 315, inst = 1a, frame=LFrame{locals=[Word(0,0,0,a: 10)], operandStack=[Word(0,0,1,8: 264)]}
stack#=1, pc = 316, inst = 4, frame=LFrame{locals=[Word(0,0,0,a: 10)], operandStack=[Word(0,0,0,a: 10), Word(0,0,1,8: 264)]}
stack#=1, pc = 317, inst = 64, frame=LFrame{locals=[Word(0,0,0,a: 10)], operandStack=[Word(0,0,0,1: 1), Word(0,0,0,a: 10), Word(0,0,1,8: 264)]}
stack#=1, pc = 318, inst = b8, frame=LFrame{locals=[Word(0,0,0,a: 10)], operandStack=[Word(0,0,0,9: 9), Word(0,0,1,8: 264)]}
stack#=2, pc = 308, inst = 1a, frame=LFrame{locals=[Word(0,0,0,9: 9)], operandStack=[Word(0,0,1,41: 321)]}
stack#=2, pc = 309, inst = 4, frame=LFrame{locals=[Word(0,0,0,9: 9)], operandStack=[Word(0,0,0,9: 9), Word(0,0,1,41: 321)]}
stack#=2, pc = 310, inst = a3, frame=LFrame{locals=[Word(0,0,0,9: 9)], operandStack=[Word(0,0,0,1: 1), Word(0,0,0,9: 9), Word(0,0,1,41: 321)]}
stack#=2, pc = 315, inst = 1a, frame=LFrame{locals=[Word(0,0,0,9: 9)], operandStack=[Word(0,0,1,41: 321)]}
stack#=2, pc = 316, inst = 4, frame=LFrame{locals=[Word(0,0,0,9: 9)], operandStack=[Word(0,0,0,9: 9), Word(0,0,1,41: 321)]}
stack#=2, pc = 317, inst = 64, frame=LFrame{locals=[Word(0,0,0,9: 9)], operandStack=[Word(0,0,0,1: 1), Word(0,0,0,9: 9), Word(0,0,1,41: 321)]}
stack#=2, pc = 318, inst = b8, frame=LFrame{locals=[Word(0,0,0,9: 9)], operandStack=[Word(0,0,0,8: 8), Word(0,0,1,41: 321)]}
stack#=3, pc = 308, inst = 1a, frame=LFrame{locals=[Word(0,0,0,8: 8)], operandStack=[Word(0,0,1,41: 321)]}
stack#=3, pc = 309, inst = 4, frame=LFrame{locals=[Word(0,0,0,8: 8)], operandStack=[Word(0,0,0,8: 8), Word(0,0,1,41: 321)]}
stack#=3, pc = 310, inst = a3, frame=LFrame{locals=[Word(0,0,0,8: 8)], operandStack=[Word(0,0,0,1: 1), Word(0,0,0,8: 8), Word(0,0,1,41: 321)]}
stack#=3, pc = 315, inst = 1a, frame=LFrame{locals=[Word(0,0,0,8: 8)], operandStack=[Word(0,0,1,41: 321)]}
stack#=3, pc = 316, inst = 4, frame=LFrame{locals=[Word(0,0,0,8: 8)], operandStack=[Word(0,0,0,8: 8), Word(0,0,1,41: 321)]}
stack#=3, pc = 317, inst = 64, frame=LFrame{locals=[Word(0,0,0,8: 8)], operandStack=[Word(0,0,0,1: 1), Word(0,0,0,8: 8), Word(0,0,1,41: 321)]}
stack#=3, pc = 318, inst = b8, frame=LFrame{locals=[Word(0,0,0,8: 8)], operandStack=[Word(0,0,0,7: 7), Word(0,0,1,41: 321)]}
...
...
stack#=3, pc = 327, inst = 60, frame=LFrame{locals=[Word(0,0,0,6: 6)], operandStack=[Word(0,0,0,3: 3), Word(0,0,0,5: 5), Word(0,0,1,47: 327)]}
stack#=3, pc = 328, inst = ac, frame=LFrame{locals=[Word(0,0,0,6: 6)], operandStack=[Word(0,0,0,8: 8), Word(0,0,1,47: 327)]}
stack#=2, pc = 327, inst = 60, frame=LFrame{locals=[Word(0,0,0,8: 8)], operandStack=[Word(0,0,0,8: 8), Word(0,0,0,d: 13), Word(0,0,1,47: 327)]}
stack#=2, pc = 328, inst = ac, frame=LFrame{locals=[Word(0,0,0,8: 8)], operandStack=[Word(0,0,0,15: 21), Word(0,0,1,47: 327)]}
stack#=1, pc = 327, inst = 60, frame=LFrame{locals=[Word(0,0,0,a: 10)], operandStack=[Word(0,0,0,15: 21), Word(0,0,0,22: 34), Word(0,0,1,8: 264)]}
stack#=1, pc = 328, inst = ac, frame=LFrame{locals=[Word(0,0,0,a: 10)], operandStack=[Word(0,0,0,37: 55), Word(0,0,1,8: 264)]}
stack#=0, pc = 264, inst = 57, frame=LFrame{locals=[], operandStack=[Word(0,0,0,37: 55), Word(0,0,0,0: 0)]}
stack#=0, pc = 265, inst = b1, frame=LFrame{locals=[], operandStack=[Word(0,0,0,0: 0)]}