Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   8085 simple subtraction and output (http://www.go4expert.com/forums/8085-simple-subtraction-output-t20627/)

Moedig 8Jan2010 20:54

8085 simple subtraction and output
 
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)


All times are GMT +5.5. The time now is 08:41.