Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   8085 ALP instruction problem (http://www.go4expert.com/forums/8085-alp-instruction-problem-t759/)

miss ain 25Apr2006 21:05

8085 ALP instruction problem
 
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

shabbir 28Apr2006 06:53

Re: 8085 ALP instruction problem
 
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.

miss ain 28Apr2006 17:44

Re: 8085 ALP instruction problem
 
3 consecutive memory location for example;

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

shabbir 28Apr2006 20:45

Re: 8085 ALP instruction problem
 
That can be done with
STA Y
STA Y + 1
STA Y + 2

prakash20 24Jan2009 22:21

Re: 8085 ALP instruction problem
 
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.


All times are GMT +5.5. The time now is 01:16.