fibonacci

[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
braveheart_master@yahoo.com


Comments

  • I m not writting exact assembly code.. but just writting algorithm..
    [code]
    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
    [/code]

    add terminating condition in the loop

    Dipalee

Sign In or Register to comment.

Howdy, Stranger!

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

Categories

In this Discussion