SlideShare a Scribd company logo
Write a assembly program for IA-32 to count up the number of even numbers in the memory
locations from 00000 to 000FF.
Solution
DATA SEGMENT
A DW 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 (00000 to 000FF)
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA SI,A
MOV DX,0000 (starting from the address 0000)
MOV BL,02
MOV CL,10
Lone:MOV AX,WORD PTR[SI]
DIV BL
CMP AH,00
JNZ Ltwo
INC DH
JMP Lthree
Ltwo:INC DL
Lthree:
ADD SI,2
DEC CL
CMP CL,00
JNZ Lone
MOV AH,4CH
INT 21H
CODE ENDS
END START

More Related Content

More from aniarihant

Bill is outside on a snowy day without a warm coat. His skin is al.pdf
Bill is outside on a snowy day without a warm coat. His skin is al.pdfBill is outside on a snowy day without a warm coat. His skin is al.pdf
Bill is outside on a snowy day without a warm coat. His skin is al.pdf
aniarihant
 
As a network administrator, what are some of the options you have fo.pdf
As a network administrator, what are some of the options you have fo.pdfAs a network administrator, what are some of the options you have fo.pdf
As a network administrator, what are some of the options you have fo.pdf
aniarihant
 
A concert has three pieces of music to be played before intermission.pdf
A concert has three pieces of music to be played before intermission.pdfA concert has three pieces of music to be played before intermission.pdf
A concert has three pieces of music to be played before intermission.pdf
aniarihant
 
5 of 50 students are female. If I randomly selects 10 students witho.pdf
5 of 50 students are female. If I randomly selects 10 students witho.pdf5 of 50 students are female. If I randomly selects 10 students witho.pdf
5 of 50 students are female. If I randomly selects 10 students witho.pdf
aniarihant
 
Which if statement below tests if letter holds R (letter is a char .pdf
Which if statement below tests if letter holds R (letter is a char .pdfWhich if statement below tests if letter holds R (letter is a char .pdf
Which if statement below tests if letter holds R (letter is a char .pdf
aniarihant
 
Which of the following is a weighted average of some elements having .pdf
Which of the following is a weighted average of some elements having .pdfWhich of the following is a weighted average of some elements having .pdf
Which of the following is a weighted average of some elements having .pdf
aniarihant
 
Which of the following statements isare true about the graph of the .pdf
Which of the following statements isare true about the graph of the .pdfWhich of the following statements isare true about the graph of the .pdf
Which of the following statements isare true about the graph of the .pdf
aniarihant
 
35. 2H H2 has E0 of -0.42 and NoihN2 has Eo of +0.74. Which is the .pdf
35. 2H H2 has E0 of -0.42 and NoihN2 has Eo of +0.74. Which is the .pdf35. 2H H2 has E0 of -0.42 and NoihN2 has Eo of +0.74. Which is the .pdf
35. 2H H2 has E0 of -0.42 and NoihN2 has Eo of +0.74. Which is the .pdf
aniarihant
 
6. A more in depth look at how to recognize “true adaptation”. Skim .pdf
6. A more in depth look at how to recognize “true adaptation”. Skim .pdf6. A more in depth look at how to recognize “true adaptation”. Skim .pdf
6. A more in depth look at how to recognize “true adaptation”. Skim .pdf
aniarihant
 
What does antibody titer meanSolution It is a method for t.pdf
What does antibody titer meanSolution  It is a method for t.pdfWhat does antibody titer meanSolution  It is a method for t.pdf
What does antibody titer meanSolution It is a method for t.pdf
aniarihant
 
What role do regular expressions typically play in language compiler.pdf
What role do regular expressions typically play in language compiler.pdfWhat role do regular expressions typically play in language compiler.pdf
What role do regular expressions typically play in language compiler.pdf
aniarihant
 
What is the role of ribosomes in an operon What is the role of.pdf
What is the role of ribosomes in an operon What is the role of.pdfWhat is the role of ribosomes in an operon What is the role of.pdf
What is the role of ribosomes in an operon What is the role of.pdf
aniarihant
 
why is it important that the brain not exclusively control all of an.pdf
why is it important that the brain not exclusively control all of an.pdfwhy is it important that the brain not exclusively control all of an.pdf
why is it important that the brain not exclusively control all of an.pdf
aniarihant
 
What is root locus State one application for root locus.Solutio.pdf
What is root locus State one application for root locus.Solutio.pdfWhat is root locus State one application for root locus.Solutio.pdf
What is root locus State one application for root locus.Solutio.pdf
aniarihant
 
This type of community is held together by extracurricular polymeric.pdf
This type of community is held together by extracurricular polymeric.pdfThis type of community is held together by extracurricular polymeric.pdf
This type of community is held together by extracurricular polymeric.pdf
aniarihant
 
Theory and practices of law enforcementThe Supreme Court ruled, in.pdf
Theory and practices of law enforcementThe Supreme Court ruled, in.pdfTheory and practices of law enforcementThe Supreme Court ruled, in.pdf
Theory and practices of law enforcementThe Supreme Court ruled, in.pdf
aniarihant
 
The liquidity ratios or short-term solvency ratios measure the firm.pdf
The liquidity ratios or short-term solvency ratios measure the firm.pdfThe liquidity ratios or short-term solvency ratios measure the firm.pdf
The liquidity ratios or short-term solvency ratios measure the firm.pdf
aniarihant
 
1.In which clade does the blastopore develop into the mouthProtosto.pdf
1.In which clade does the blastopore develop into the mouthProtosto.pdf1.In which clade does the blastopore develop into the mouthProtosto.pdf
1.In which clade does the blastopore develop into the mouthProtosto.pdf
aniarihant
 
Statistics In a school of 1200 students among which 250 fire seniors.pdf
Statistics In a school of 1200 students among which 250 fire seniors.pdfStatistics In a school of 1200 students among which 250 fire seniors.pdf
Statistics In a school of 1200 students among which 250 fire seniors.pdf
aniarihant
 
Problem 3. Relationship between Fourier transform and Laplace transfo.pdf
Problem 3. Relationship between Fourier transform and Laplace transfo.pdfProblem 3. Relationship between Fourier transform and Laplace transfo.pdf
Problem 3. Relationship between Fourier transform and Laplace transfo.pdf
aniarihant
 

More from aniarihant (20)

Bill is outside on a snowy day without a warm coat. His skin is al.pdf
Bill is outside on a snowy day without a warm coat. His skin is al.pdfBill is outside on a snowy day without a warm coat. His skin is al.pdf
Bill is outside on a snowy day without a warm coat. His skin is al.pdf
 
As a network administrator, what are some of the options you have fo.pdf
As a network administrator, what are some of the options you have fo.pdfAs a network administrator, what are some of the options you have fo.pdf
As a network administrator, what are some of the options you have fo.pdf
 
A concert has three pieces of music to be played before intermission.pdf
A concert has three pieces of music to be played before intermission.pdfA concert has three pieces of music to be played before intermission.pdf
A concert has three pieces of music to be played before intermission.pdf
 
5 of 50 students are female. If I randomly selects 10 students witho.pdf
5 of 50 students are female. If I randomly selects 10 students witho.pdf5 of 50 students are female. If I randomly selects 10 students witho.pdf
5 of 50 students are female. If I randomly selects 10 students witho.pdf
 
Which if statement below tests if letter holds R (letter is a char .pdf
Which if statement below tests if letter holds R (letter is a char .pdfWhich if statement below tests if letter holds R (letter is a char .pdf
Which if statement below tests if letter holds R (letter is a char .pdf
 
Which of the following is a weighted average of some elements having .pdf
Which of the following is a weighted average of some elements having .pdfWhich of the following is a weighted average of some elements having .pdf
Which of the following is a weighted average of some elements having .pdf
 
Which of the following statements isare true about the graph of the .pdf
Which of the following statements isare true about the graph of the .pdfWhich of the following statements isare true about the graph of the .pdf
Which of the following statements isare true about the graph of the .pdf
 
35. 2H H2 has E0 of -0.42 and NoihN2 has Eo of +0.74. Which is the .pdf
35. 2H H2 has E0 of -0.42 and NoihN2 has Eo of +0.74. Which is the .pdf35. 2H H2 has E0 of -0.42 and NoihN2 has Eo of +0.74. Which is the .pdf
35. 2H H2 has E0 of -0.42 and NoihN2 has Eo of +0.74. Which is the .pdf
 
6. A more in depth look at how to recognize “true adaptation”. Skim .pdf
6. A more in depth look at how to recognize “true adaptation”. Skim .pdf6. A more in depth look at how to recognize “true adaptation”. Skim .pdf
6. A more in depth look at how to recognize “true adaptation”. Skim .pdf
 
What does antibody titer meanSolution It is a method for t.pdf
What does antibody titer meanSolution  It is a method for t.pdfWhat does antibody titer meanSolution  It is a method for t.pdf
What does antibody titer meanSolution It is a method for t.pdf
 
What role do regular expressions typically play in language compiler.pdf
What role do regular expressions typically play in language compiler.pdfWhat role do regular expressions typically play in language compiler.pdf
What role do regular expressions typically play in language compiler.pdf
 
What is the role of ribosomes in an operon What is the role of.pdf
What is the role of ribosomes in an operon What is the role of.pdfWhat is the role of ribosomes in an operon What is the role of.pdf
What is the role of ribosomes in an operon What is the role of.pdf
 
why is it important that the brain not exclusively control all of an.pdf
why is it important that the brain not exclusively control all of an.pdfwhy is it important that the brain not exclusively control all of an.pdf
why is it important that the brain not exclusively control all of an.pdf
 
What is root locus State one application for root locus.Solutio.pdf
What is root locus State one application for root locus.Solutio.pdfWhat is root locus State one application for root locus.Solutio.pdf
What is root locus State one application for root locus.Solutio.pdf
 
This type of community is held together by extracurricular polymeric.pdf
This type of community is held together by extracurricular polymeric.pdfThis type of community is held together by extracurricular polymeric.pdf
This type of community is held together by extracurricular polymeric.pdf
 
Theory and practices of law enforcementThe Supreme Court ruled, in.pdf
Theory and practices of law enforcementThe Supreme Court ruled, in.pdfTheory and practices of law enforcementThe Supreme Court ruled, in.pdf
Theory and practices of law enforcementThe Supreme Court ruled, in.pdf
 
The liquidity ratios or short-term solvency ratios measure the firm.pdf
The liquidity ratios or short-term solvency ratios measure the firm.pdfThe liquidity ratios or short-term solvency ratios measure the firm.pdf
The liquidity ratios or short-term solvency ratios measure the firm.pdf
 
1.In which clade does the blastopore develop into the mouthProtosto.pdf
1.In which clade does the blastopore develop into the mouthProtosto.pdf1.In which clade does the blastopore develop into the mouthProtosto.pdf
1.In which clade does the blastopore develop into the mouthProtosto.pdf
 
Statistics In a school of 1200 students among which 250 fire seniors.pdf
Statistics In a school of 1200 students among which 250 fire seniors.pdfStatistics In a school of 1200 students among which 250 fire seniors.pdf
Statistics In a school of 1200 students among which 250 fire seniors.pdf
 
Problem 3. Relationship between Fourier transform and Laplace transfo.pdf
Problem 3. Relationship between Fourier transform and Laplace transfo.pdfProblem 3. Relationship between Fourier transform and Laplace transfo.pdf
Problem 3. Relationship between Fourier transform and Laplace transfo.pdf
 

Recently uploaded

Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 

Recently uploaded (20)

Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 

Write a assembly program for IA-32 to count up the number of even num.pdf

  • 1. Write a assembly program for IA-32 to count up the number of even numbers in the memory locations from 00000 to 000FF. Solution DATA SEGMENT A DW 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 (00000 to 000FF) DATA ENDS CODE SEGMENT ASSUME DS:DATA,CS:CODE START: MOV AX,DATA MOV DS,AX LEA SI,A MOV DX,0000 (starting from the address 0000) MOV BL,02 MOV CL,10 Lone:MOV AX,WORD PTR[SI] DIV BL CMP AH,00 JNZ Ltwo INC DH JMP Lthree Ltwo:INC DL Lthree: ADD SI,2 DEC CL CMP CL,00 JNZ Lone MOV AH,4CH INT 21H CODE ENDS END START