8085 ALP instruction problem

Discussion in 'Assembly Language Programming (ALP) Forum' started by miss ain, Apr 25, 2006.

  1. miss ain

    miss ain New Member

    Joined:
    Apr 24, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    not working yet
    Location:
    malaysia
    can u help n explain 2 me to write 8085 instruction for this program?

    Write 8085 ALP to convert the given binary number in a memory location X to the equivalent unpacked BCD numbers in three consecutive memory location
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    I guess I can provide you some hints of code. Its not tested and you need to be doing it yourself.

    Code:
    LDA X // Load from the memory location X
    DAA   // Decimal adjust it to BCD
    STA Y //Store the result into the Location Y.
    
    Can you explain what you meant by 3 consecutive memory locations.
     
  3. miss ain

    miss ain New Member

    Joined:
    Apr 24, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    not working yet
    Location:
    malaysia
    3 consecutive memory location for example;

    data will be point to memory location n stored at 5200,5201,5202 memory location
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    That can be done with
    STA Y
    STA Y + 1
    STA Y + 2
     
  5. prakash20

    prakash20 New Member

    Joined:
    Jan 24, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    student
    Location:
    chennai
    Home Page:
    http://www.prakash20.page.tl
    I don't know exactly
    but to unpack a number

    LDA 8200
    MOV B,A
    ANI 0F
    MOV C,A
    MOV A,B
    ANI F0
    RRC
    RRC
    RRC
    RRC
    MOV B,C


    FROM THE ABOVE PGM
    A CONTAINS FIRST UNPACKED NO.

    AND

    B CONTAINS SECOND UNPACKED NO.
     

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