Featured

    Featured Posts

Write a program to calculate the sum of the series of even numbers.


Write a program to calculate the sum of the series of even numbers.

Program statement :- Write a program in the ALP of 8085 to calculate the sum of series of even numbers. Assume that the length of the series is stored at memory location D000 H and the series itself begins at memory D001 H. Store the result at memory location E000 H. Draw flowchart.

   Explanation :-
  1. Initialize the sum to zero. Load the count of numbers in register C. Iniialize pointer to start of series.
  2. To check whether the number is even we will AND the number with 01 H. If the result of ANDing is zero it indicates that the number is even. We will add this even number to the initialised sum.
  3. Decrement counter Increment source pointer to next location. Continue the process till sum of all even numbers is found. Store the sum at memory location E000 H.
Program :
Lable
Instruction
Comment

LDA D000H
MOV C,A
MVI B, 00 H
LXI H, D001 H

Initialize counter
sum = 0
Initialize pointer
Back :
MOV A,M
ANI 01 H
JNZ SKIP
MOV A,B
ADD M
MOV B,A
Get the number
Mask Bit 1 to Bit 7
Don’t add if number is Odd
Get sum
SUM = Sum + data
Store result in B register
SKIP:
INX H
DCR C
JNZ BACK
STA E000H
HLT
Increment pointer
Decrement counter
If counter =/ 0 repeat
Store sum (Result)
Terminate program execution


9 comments

Needed to compose one little word yet thanks for the suggestions that you are contributed here, really very much impressed with this blog please do keep on sharing...
Best Online Software Training Institute | Data Science Training

Reply

I am really happy with your blog because your article is very unique and powerful for new reader.
Click here:
selenium training in chennai
selenium training in bangalore
selenium training in Pune
selenium training in pune
Selenium Online Training

Reply

Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
Java training in Chennai | Java training in USA |

Java training in Bangalore | Java training in Indira nagar | Java training in Bangalore | Java training in Rajaji nagar

Reply

Wonderful article, very useful and well explanation. Your post is extremely incredible. I will refer this to my candidates...
python interview questions and answers
python tutorials
python course institute in electronic city

Reply

Really very nice blog information for this one and more technical skills are improve,i like that kind of post.
Best Devops training in sholinganallur
Devops training in velachery
Devops training in annanagar
Devops training in tambaram

Reply

Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.

angularjs interview questions and answers

angularjs Training in bangalore

angularjs Training in bangalore

angularjs online Training

angularjs Training in marathahalli

Reply

Very good informative article. Thanks for sharing such nice article, keep on up dating such good articles. Data Science Online Training

Reply

When I initially commented, I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several emails with the same comment. Is there any way you can remove people from that service? Thanks.

Advanced AWS Training in Bangalore | Amazon Web Services Training in Bangalore
Amazon Web Services Training in Pune | Best AWS Training in Pune
AWS Online Training | Online AWS Certification Course - Gangboard
Top 110 AWS Interview Question and Answers | Advanced AWS interview Questions and Answers – AWS jobs


Reply

Post a Comment

www.CodeNirvana.in

www.posthatke.com. Powered by Blogger.

Google+ Followers

Copyright © www.posthatke.com | Blogger Templates | Designed By posthatke.com