SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
Microprocessors: Assembly Language
about Decrement/Increment for counting loop, and shift left/right and rotate functions.
Write the following (C language) statement in assembly language.
unsigned char i, j, k;
j=10;
do
{
k=k+i;
j=j+1;
}
while (j != 18);
Solution
taking value of j in Register B and value of k in Register C
fins the assembly language code as below:
it is in 8085,
MVI B,0AH ## load value 10 in j = load value 0A hex in B
MVI C,00H ## initialize C = initialize k
MOV A,B ## copy values of B to A
loop : ADD A,01H ## increment in value of B = increment in j
ADD C,01H ## increment in value of C = in k
XRA A,12H ## xoring of A with 12H = with 18 decimal = check if j is 18 or not
JNZ loop ## j is not 18 then goes to loop = continue the looping
MOV B,A
HLT

Más contenido relacionado

Más de akashganga11

Most U.S. and some European airlines now impose additional charges f.pdf
Most U.S. and some European airlines now impose additional charges f.pdfMost U.S. and some European airlines now impose additional charges f.pdf
Most U.S. and some European airlines now impose additional charges f.pdfakashganga11
 
Morrison claims that the building of the Middlesex Canal can be .pdf
Morrison claims that the building of the Middlesex Canal can be .pdfMorrison claims that the building of the Middlesex Canal can be .pdf
Morrison claims that the building of the Middlesex Canal can be .pdfakashganga11
 
Michelle used a sample of 50 U.S. cities to estimate the relationshi.pdf
Michelle used a sample of 50 U.S. cities to estimate the relationshi.pdfMichelle used a sample of 50 U.S. cities to estimate the relationshi.pdf
Michelle used a sample of 50 U.S. cities to estimate the relationshi.pdfakashganga11
 
MonthYear Consider the population model P(t) = 34.5 + 1.24t,.pdf
MonthYear Consider the population model P(t) = 34.5 + 1.24t,.pdfMonthYear Consider the population model P(t) = 34.5 + 1.24t,.pdf
MonthYear Consider the population model P(t) = 34.5 + 1.24t,.pdfakashganga11
 
Monique, Nelson, Olivia, Patrick, Queenie, Rosa, Sharim, Theo, and U.pdf
Monique, Nelson, Olivia, Patrick, Queenie, Rosa, Sharim, Theo, and U.pdfMonique, Nelson, Olivia, Patrick, Queenie, Rosa, Sharim, Theo, and U.pdf
Monique, Nelson, Olivia, Patrick, Queenie, Rosa, Sharim, Theo, and U.pdfakashganga11
 
Monte inherited 1,000 shares of Corporation Zero stock from his fath.pdf
Monte inherited 1,000 shares of Corporation Zero stock from his fath.pdfMonte inherited 1,000 shares of Corporation Zero stock from his fath.pdf
Monte inherited 1,000 shares of Corporation Zero stock from his fath.pdfakashganga11
 
Monetary Inflation harms the poor.True or False.SolutionHi.pdf
Monetary Inflation harms the poor.True or False.SolutionHi.pdfMonetary Inflation harms the poor.True or False.SolutionHi.pdf
Monetary Inflation harms the poor.True or False.SolutionHi.pdfakashganga11
 
Module 3 – CaseUTILITY ETHICSBackgroundIn the Module 3 Case, w.pdf
Module 3 – CaseUTILITY ETHICSBackgroundIn the Module 3 Case, w.pdfModule 3 – CaseUTILITY ETHICSBackgroundIn the Module 3 Case, w.pdf
Module 3 – CaseUTILITY ETHICSBackgroundIn the Module 3 Case, w.pdfakashganga11
 
Michael have ten pairs of black socks, eight pairs of white socks an.pdf
Michael have ten pairs of black socks, eight pairs of white socks an.pdfMichael have ten pairs of black socks, eight pairs of white socks an.pdf
Michael have ten pairs of black socks, eight pairs of white socks an.pdfakashganga11
 
Michael is approached by a man carrying two boxes. The stranger tell.pdf
Michael is approached by a man carrying two boxes. The stranger tell.pdfMichael is approached by a man carrying two boxes. The stranger tell.pdf
Michael is approached by a man carrying two boxes. The stranger tell.pdfakashganga11
 

Más de akashganga11 (10)

Most U.S. and some European airlines now impose additional charges f.pdf
Most U.S. and some European airlines now impose additional charges f.pdfMost U.S. and some European airlines now impose additional charges f.pdf
Most U.S. and some European airlines now impose additional charges f.pdf
 
Morrison claims that the building of the Middlesex Canal can be .pdf
Morrison claims that the building of the Middlesex Canal can be .pdfMorrison claims that the building of the Middlesex Canal can be .pdf
Morrison claims that the building of the Middlesex Canal can be .pdf
 
Michelle used a sample of 50 U.S. cities to estimate the relationshi.pdf
Michelle used a sample of 50 U.S. cities to estimate the relationshi.pdfMichelle used a sample of 50 U.S. cities to estimate the relationshi.pdf
Michelle used a sample of 50 U.S. cities to estimate the relationshi.pdf
 
MonthYear Consider the population model P(t) = 34.5 + 1.24t,.pdf
MonthYear Consider the population model P(t) = 34.5 + 1.24t,.pdfMonthYear Consider the population model P(t) = 34.5 + 1.24t,.pdf
MonthYear Consider the population model P(t) = 34.5 + 1.24t,.pdf
 
Monique, Nelson, Olivia, Patrick, Queenie, Rosa, Sharim, Theo, and U.pdf
Monique, Nelson, Olivia, Patrick, Queenie, Rosa, Sharim, Theo, and U.pdfMonique, Nelson, Olivia, Patrick, Queenie, Rosa, Sharim, Theo, and U.pdf
Monique, Nelson, Olivia, Patrick, Queenie, Rosa, Sharim, Theo, and U.pdf
 
Monte inherited 1,000 shares of Corporation Zero stock from his fath.pdf
Monte inherited 1,000 shares of Corporation Zero stock from his fath.pdfMonte inherited 1,000 shares of Corporation Zero stock from his fath.pdf
Monte inherited 1,000 shares of Corporation Zero stock from his fath.pdf
 
Monetary Inflation harms the poor.True or False.SolutionHi.pdf
Monetary Inflation harms the poor.True or False.SolutionHi.pdfMonetary Inflation harms the poor.True or False.SolutionHi.pdf
Monetary Inflation harms the poor.True or False.SolutionHi.pdf
 
Module 3 – CaseUTILITY ETHICSBackgroundIn the Module 3 Case, w.pdf
Module 3 – CaseUTILITY ETHICSBackgroundIn the Module 3 Case, w.pdfModule 3 – CaseUTILITY ETHICSBackgroundIn the Module 3 Case, w.pdf
Module 3 – CaseUTILITY ETHICSBackgroundIn the Module 3 Case, w.pdf
 
Michael have ten pairs of black socks, eight pairs of white socks an.pdf
Michael have ten pairs of black socks, eight pairs of white socks an.pdfMichael have ten pairs of black socks, eight pairs of white socks an.pdf
Michael have ten pairs of black socks, eight pairs of white socks an.pdf
 
Michael is approached by a man carrying two boxes. The stranger tell.pdf
Michael is approached by a man carrying two boxes. The stranger tell.pdfMichael is approached by a man carrying two boxes. The stranger tell.pdf
Michael is approached by a man carrying two boxes. The stranger tell.pdf
 

Último

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 

Último (20)

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

Microprocessors Assembly Languageabout DecrementIncrement for co.pdf

  • 1. Microprocessors: Assembly Language about Decrement/Increment for counting loop, and shift left/right and rotate functions. Write the following (C language) statement in assembly language. unsigned char i, j, k; j=10; do { k=k+i; j=j+1; } while (j != 18); Solution taking value of j in Register B and value of k in Register C fins the assembly language code as below: it is in 8085, MVI B,0AH ## load value 10 in j = load value 0A hex in B MVI C,00H ## initialize C = initialize k MOV A,B ## copy values of B to A loop : ADD A,01H ## increment in value of B = increment in j ADD C,01H ## increment in value of C = in k XRA A,12H ## xoring of A with 12H = with 18 decimal = check if j is 18 or not JNZ loop ## j is not 18 then goes to loop = continue the looping MOV B,A HLT