1. panayiotispatra

    panayiotispatra New Member

    Joined:
    Oct 25, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    I have problem with Fibonacci code in assembly (intel 8085)
    I'm stuck at, can someone give help me with this.

    lda 8000 //take the number
    cpi 02 // n>2
    jc small
    mov l,a
    mov d,l
    MVI B, 00 //Initialize variable to store previous number
    MVI c, 01 //Initialize variable to store current number
    MOV A, B
    add c
    back:
    MOV B, C //Current number is now previous number
    MOV C, A //Save result as a new current number
    DCR D //Decrement count
    jnz back
    sta 8001 //Save result to this address
    HLT
    small:
    sta 8001
    hlt

    I take the number from 8000 address and I want the result to go to 8001 address
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    In what way are you stuck? Is the program going wrong when you run it? What is it doing that you don't expect?
     
  3. panayiotispatra

    panayiotispatra New Member

    Joined:
    Oct 25, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    I can’t send to 8001 address the result
     
  4. neo_vi

    neo_vi Member

    Joined:
    Feb 1, 2008
    Messages:
    720
    Likes Received:
    16
    Trophy Points:
    18
    Occupation:
    Software engineer
    Location:
    Earth
    Home Page:
    http://computertipaday.blogspot.com
    use some other address to store. Did u do it.? if not try storing it in another address.
     
  5. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Why not? Is the instruction wrong? Is it the wrong part of memory? Or did you look in 8001 and find the wrong number? If the last, what was in 8000 and what did you find in 8001?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice