fibonacci - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.


narisma20narisma20 Posts: 1Member
[b][red]This message was edited by narisma20 at 2006-1-5 23:35:48[/red][/b][hr]
would you please send to my email add the sample code of the fibonacci program using assembly language. tnx
[email protected]


  • DipaleeDipalee Posts: 11Member
    I m not writting exact assembly code.. but just writting algorithm..
    mov ax, 0 //initial fibonacci number 0
    mov bx, 1 //next 1
    loop :
    mov cx, 0 //initialise cx with 0
    add cx, bx
    add cx, ax //final sum is in cx = ax + bx
    print cx
    mov bx, ax //put ax's value in bx
    mov ax, cx //put cx's value in ax
    jmp loop //now again add ax and bx in cx and print it

    add terminating condition in the loop


Sign In or Register to comment.