SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Write a code segment in assembly of PIC18 that implement the following instructions in C.
Note: Variables are long type (4 bytes) Long i,j; i++; i--; j = i+j
Solution
org 0x0000 ; program starting address after reset
goto start
org 0x08
retfie ; high priority interrupt service routine
org 0x18
retfie ; low priority interrupt service routine
start mov.b #0, w0 ;WREG=0=0x64 Initializing the variable
mov.b WREG.0x0800 ; i=WREG
inc.b 0x0800 ;i=i++ or i=i+1
dec.b 0x801 ;j=j-1 or j—
sdd.b 0x0801, WREG ; WREG=j+WREG (ie j+i)
mov.b WREG, 0x0801 ;j=WREG (iej=i+j)
end
PIC18 assembly code for increment, decrement, and addition of long variables

Weitere Àhnliche Inhalte

Mehr von lez31palka

Create a shell script file called q4-sh.docx
Create a shell script file called q4-sh.docxCreate a shell script file called q4-sh.docx
Create a shell script file called q4-sh.docxlez31palka
 
Create a python zork file based on the following UML- Use command func.docx
Create a python zork file based on the following UML- Use command func.docxCreate a python zork file based on the following UML- Use command func.docx
Create a python zork file based on the following UML- Use command func.docxlez31palka
 
Create a new python program- sniff_spoof_icmp-py- The program shall sn.docx
Create a new python program- sniff_spoof_icmp-py- The program shall sn.docxCreate a new python program- sniff_spoof_icmp-py- The program shall sn.docx
Create a new python program- sniff_spoof_icmp-py- The program shall sn.docxlez31palka
 
Create a new webpage called -activity2-html-- This new page must inclu.docx
Create a new webpage called -activity2-html-- This new page must inclu.docxCreate a new webpage called -activity2-html-- This new page must inclu.docx
Create a new webpage called -activity2-html-- This new page must inclu.docxlez31palka
 
Create a multi-client-single server application to check whether the n.docx
Create a multi-client-single server application to check whether the n.docxCreate a multi-client-single server application to check whether the n.docx
Create a multi-client-single server application to check whether the n.docxlez31palka
 
Create a list containing decimal numbers- Write a program to find the.docx
Create a list containing decimal numbers- Write a program to find the.docxCreate a list containing decimal numbers- Write a program to find the.docx
Create a list containing decimal numbers- Write a program to find the.docxlez31palka
 
Create a JAVA class called Staff that has the following attributes- St.docx
Create a JAVA class called Staff that has the following attributes- St.docxCreate a JAVA class called Staff that has the following attributes- St.docx
Create a JAVA class called Staff that has the following attributes- St.docxlez31palka
 
Create a Java class with the below attributes- Create a class called.docx
Create a Java class with the below attributes-  Create a class called.docxCreate a Java class with the below attributes-  Create a class called.docx
Create a Java class with the below attributes- Create a class called.docxlez31palka
 
Create a JAVA class called Faculty that has the following attributes-.docx
Create a JAVA class called Faculty that has the following attributes-.docxCreate a JAVA class called Faculty that has the following attributes-.docx
Create a JAVA class called Faculty that has the following attributes-.docxlez31palka
 
Create a garden project - Submit a project scope document - Submit R.docx
Create a garden project   - Submit a project scope document - Submit R.docxCreate a garden project   - Submit a project scope document - Submit R.docx
Create a garden project - Submit a project scope document - Submit R.docxlez31palka
 
Create a file named insert-php and add the new records in to your rese.docx
Create a file named insert-php and add the new records in to your rese.docxCreate a file named insert-php and add the new records in to your rese.docx
Create a file named insert-php and add the new records in to your rese.docxlez31palka
 
Corporate Fund started the year with o net asset value of $30-80- By y.docx
Corporate Fund started the year with o net asset value of $30-80- By y.docxCorporate Fund started the year with o net asset value of $30-80- By y.docx
Corporate Fund started the year with o net asset value of $30-80- By y.docxlez31palka
 
Create a database design ERD diagram for a Hotel Business and to conf.docx
Create a database design ERD diagram  for a Hotel Business and to conf.docxCreate a database design ERD diagram  for a Hotel Business and to conf.docx
Create a database design ERD diagram for a Hotel Business and to conf.docxlez31palka
 
Create a class called IntegerArrayHelper that has the following attrib.docx
Create a class called IntegerArrayHelper that has the following attrib.docxCreate a class called IntegerArrayHelper that has the following attrib.docx
Create a class called IntegerArrayHelper that has the following attrib.docxlez31palka
 
Create a Birthday Card app that accepts a person's name and date of bi.docx
Create a Birthday Card app that accepts a person's name and date of bi.docxCreate a Birthday Card app that accepts a person's name and date of bi.docx
Create a Birthday Card app that accepts a person's name and date of bi.docxlez31palka
 
Create a chart of veins- list the name of the vein- drains into (major.docx
Create a chart of veins- list the name of the vein- drains into (major.docxCreate a chart of veins- list the name of the vein- drains into (major.docx
Create a chart of veins- list the name of the vein- drains into (major.docxlez31palka
 
Crane Corporation earned $379-000 during a period when it had an avera.docx
Crane Corporation earned $379-000 during a period when it had an avera.docxCrane Corporation earned $379-000 during a period when it had an avera.docx
Crane Corporation earned $379-000 during a period when it had an avera.docxlez31palka
 
Country Complete the statement that creates the table- CREATE TABLE Co.docx
Country Complete the statement that creates the table- CREATE TABLE Co.docxCountry Complete the statement that creates the table- CREATE TABLE Co.docx
Country Complete the statement that creates the table- CREATE TABLE Co.docxlez31palka
 
Convert the below-dictated lines into Preoperative History and Physica.docx
Convert the below-dictated lines into Preoperative History and Physica.docxConvert the below-dictated lines into Preoperative History and Physica.docx
Convert the below-dictated lines into Preoperative History and Physica.docxlez31palka
 
Could you explain why the correct answer is C and not B or D (I unders.docx
Could you explain why the correct answer is C and not B or D (I unders.docxCould you explain why the correct answer is C and not B or D (I unders.docx
Could you explain why the correct answer is C and not B or D (I unders.docxlez31palka
 

Mehr von lez31palka (20)

Create a shell script file called q4-sh.docx
Create a shell script file called q4-sh.docxCreate a shell script file called q4-sh.docx
Create a shell script file called q4-sh.docx
 
Create a python zork file based on the following UML- Use command func.docx
Create a python zork file based on the following UML- Use command func.docxCreate a python zork file based on the following UML- Use command func.docx
Create a python zork file based on the following UML- Use command func.docx
 
Create a new python program- sniff_spoof_icmp-py- The program shall sn.docx
Create a new python program- sniff_spoof_icmp-py- The program shall sn.docxCreate a new python program- sniff_spoof_icmp-py- The program shall sn.docx
Create a new python program- sniff_spoof_icmp-py- The program shall sn.docx
 
Create a new webpage called -activity2-html-- This new page must inclu.docx
Create a new webpage called -activity2-html-- This new page must inclu.docxCreate a new webpage called -activity2-html-- This new page must inclu.docx
Create a new webpage called -activity2-html-- This new page must inclu.docx
 
Create a multi-client-single server application to check whether the n.docx
Create a multi-client-single server application to check whether the n.docxCreate a multi-client-single server application to check whether the n.docx
Create a multi-client-single server application to check whether the n.docx
 
Create a list containing decimal numbers- Write a program to find the.docx
Create a list containing decimal numbers- Write a program to find the.docxCreate a list containing decimal numbers- Write a program to find the.docx
Create a list containing decimal numbers- Write a program to find the.docx
 
Create a JAVA class called Staff that has the following attributes- St.docx
Create a JAVA class called Staff that has the following attributes- St.docxCreate a JAVA class called Staff that has the following attributes- St.docx
Create a JAVA class called Staff that has the following attributes- St.docx
 
Create a Java class with the below attributes- Create a class called.docx
Create a Java class with the below attributes-  Create a class called.docxCreate a Java class with the below attributes-  Create a class called.docx
Create a Java class with the below attributes- Create a class called.docx
 
Create a JAVA class called Faculty that has the following attributes-.docx
Create a JAVA class called Faculty that has the following attributes-.docxCreate a JAVA class called Faculty that has the following attributes-.docx
Create a JAVA class called Faculty that has the following attributes-.docx
 
Create a garden project - Submit a project scope document - Submit R.docx
Create a garden project   - Submit a project scope document - Submit R.docxCreate a garden project   - Submit a project scope document - Submit R.docx
Create a garden project - Submit a project scope document - Submit R.docx
 
Create a file named insert-php and add the new records in to your rese.docx
Create a file named insert-php and add the new records in to your rese.docxCreate a file named insert-php and add the new records in to your rese.docx
Create a file named insert-php and add the new records in to your rese.docx
 
Corporate Fund started the year with o net asset value of $30-80- By y.docx
Corporate Fund started the year with o net asset value of $30-80- By y.docxCorporate Fund started the year with o net asset value of $30-80- By y.docx
Corporate Fund started the year with o net asset value of $30-80- By y.docx
 
Create a database design ERD diagram for a Hotel Business and to conf.docx
Create a database design ERD diagram  for a Hotel Business and to conf.docxCreate a database design ERD diagram  for a Hotel Business and to conf.docx
Create a database design ERD diagram for a Hotel Business and to conf.docx
 
Create a class called IntegerArrayHelper that has the following attrib.docx
Create a class called IntegerArrayHelper that has the following attrib.docxCreate a class called IntegerArrayHelper that has the following attrib.docx
Create a class called IntegerArrayHelper that has the following attrib.docx
 
Create a Birthday Card app that accepts a person's name and date of bi.docx
Create a Birthday Card app that accepts a person's name and date of bi.docxCreate a Birthday Card app that accepts a person's name and date of bi.docx
Create a Birthday Card app that accepts a person's name and date of bi.docx
 
Create a chart of veins- list the name of the vein- drains into (major.docx
Create a chart of veins- list the name of the vein- drains into (major.docxCreate a chart of veins- list the name of the vein- drains into (major.docx
Create a chart of veins- list the name of the vein- drains into (major.docx
 
Crane Corporation earned $379-000 during a period when it had an avera.docx
Crane Corporation earned $379-000 during a period when it had an avera.docxCrane Corporation earned $379-000 during a period when it had an avera.docx
Crane Corporation earned $379-000 during a period when it had an avera.docx
 
Country Complete the statement that creates the table- CREATE TABLE Co.docx
Country Complete the statement that creates the table- CREATE TABLE Co.docxCountry Complete the statement that creates the table- CREATE TABLE Co.docx
Country Complete the statement that creates the table- CREATE TABLE Co.docx
 
Convert the below-dictated lines into Preoperative History and Physica.docx
Convert the below-dictated lines into Preoperative History and Physica.docxConvert the below-dictated lines into Preoperative History and Physica.docx
Convert the below-dictated lines into Preoperative History and Physica.docx
 
Could you explain why the correct answer is C and not B or D (I unders.docx
Could you explain why the correct answer is C and not B or D (I unders.docxCould you explain why the correct answer is C and not B or D (I unders.docx
Could you explain why the correct answer is C and not B or D (I unders.docx
 

KĂŒrzlich hochgeladen

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
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
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
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
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
 
call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...SeĂĄn Kennedy
 
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
 
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
 
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
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 

KĂŒrzlich hochgeladen (20)

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
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
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
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
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
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
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
 
call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
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
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.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
 
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Ă...
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 

PIC18 assembly code for increment, decrement, and addition of long variables

  • 1. Write a code segment in assembly of PIC18 that implement the following instructions in C. Note: Variables are long type (4 bytes) Long i,j; i++; i--; j = i+j Solution org 0x0000 ; program starting address after reset goto start org 0x08 retfie ; high priority interrupt service routine org 0x18 retfie ; low priority interrupt service routine start mov.b #0, w0 ;WREG=0=0x64 Initializing the variable mov.b WREG.0x0800 ; i=WREG inc.b 0x0800 ;i=i++ or i=i+1 dec.b 0x801 ;j=j-1 or j— sdd.b 0x0801, WREG ; WREG=j+WREG (ie j+i) mov.b WREG, 0x0801 ;j=WREG (iej=i+j) end