GithubHelp home page GithubHelp logo

Comments (4)

nihaoqingtuan avatar nihaoqingtuan commented on July 28, 2024

fib.asm
{ "program": "main:\n.LBL7_0:\n add r8 r8 4\n mstore [r8,-2] r8\n mov r1 10\n call fib_recursive\n add r8 r8 -4\n end\nfib_recursive:\n.LBL8_0:\n add r8 r8 9\n mstore [r8,-2] r8\n mov r0 r1\n mstore [r8,-3] r0\n mload r0 [r8,-3]\n eq r0 r0 1\n cjmp r0 .LBL8_1\n jmp .LBL8_2\n.LBL8_1:\n mov r0 1\n add r8 r8 -9\n ret\n.LBL8_2:\n mload r0 [r8,-3]\n eq r0 r0 2\n cjmp r0 .LBL8_3\n jmp .LBL8_4\n.LBL8_3:\n mov r0 1\n add r8 r8 -9\n ret\n.LBL8_4:\n mload r0 [r8,-3]\n not r7 1\n add r7 r7 1\n add r1 r0 r7\n range r1\n call fib_recursive\n mstore [r8,-7] r0\n mload r0 [r8,-3]\n not r7 2\n add r7 r7 1\n add r0 r0 r7\n mstore [r8,-4] r0\n mload r0 [r8,-4]\n range r0\n mload r1 [r8,-4]\n call fib_recursive\n mload r1 [r8,-7]\n add r0 r1 r0\n mstore [r8,-5] r0\n mload r0 [r8,-5]\n range r0\n mload r0 [r8,-5]\n add r8 r8 -9\n ret\n", "prophets": [] }

from olavm.

nihaoqingtuan avatar nihaoqingtuan commented on July 28, 2024

fib.ola

contract Fibonacci {

fn main() {
   fib_recursive(10);
}

fn fib_recursive(u32 n) -> (u32) {
    if (n == 1) {
        return 1;
    }
    if (n == 2) {
        return 1;
    }

    return fib_recursive(n -1) + fib_recursive(n -2);
}

}

from olavm.

Softcloud88 avatar Softcloud88 commented on July 28, 2024

I'm really sorry for the confusion. The reason behind this is that the ola-lang project is entirely open-source, while the olavm project has been open-sourced in stages. This has led to compatibility issues between the latest assembly code compiled from the most recent ola-lang code and the older codebase of olavm. We have plans to fully open-source olavm in the near future, which will address this disparity between the compiler and virtual machine versions.

from olavm.

nihaoqingtuan avatar nihaoqingtuan commented on July 28, 2024

ok.

from olavm.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.