8085 simple subtraction and output

Discussion in 'Assembly Language Programming (ALP) Forum' started by Moedig, Jan 8, 2010.

  1. Moedig

    Moedig New Member

    Joined:
    Jan 8, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hey all, I'm new to assembley and this forum, I'm currently doing a module on low level programming in my college course. We were given task to make a simple program and I'm trying to make one that does the following:

    Loads '50' into the C register and the accumalator, subtract '1' from the accumalator and output the result, then decrement 1 from the C register until '0', if it isnt 0 then loop back to 'subtract '1'' and continue untill C=0. Then halt.

    So far I have:

    MVI C,$36
    LDA A,$36
    NXT: MOV A,M
    SUI A,$01
    DCR C
    OUT $FF
    JMP NXT
    HLT

    When I try to assemble this I get rc=5 undefined label on line 3 (NXT: MOV A,M)

    I'm really stuck, any help would be greatly appreciated, thanks :) (I'm sure that alot of this is wrong but its my first attempt and just need pointing in the right direction please, thanks)
     

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