SlideShare a Scribd company logo
1 of 1
Download to read offline
//Write the assembly program.
//Can use put_qword_safe to print the intermediate values of specified registers
#include <stdio.h>
long fib(long x) {
if (x <= 2) {
return 1;
}
else {
return fib(x - 1) + fib(x - 2);
}
}
void main() {
printf("%ldn", fib(10));
}

More Related Content

More from agpcorp

Write Short answers specific and avoid extra off topic det.pdf
Write Short answers specific and avoid extra off topic det.pdfWrite Short answers specific and avoid extra off topic det.pdf
Write Short answers specific and avoid extra off topic det.pdfagpcorp
 
write report that will Evaluate your organizations IT infras.pdf
write report that will Evaluate your organizations IT infras.pdfwrite report that will Evaluate your organizations IT infras.pdf
write report that will Evaluate your organizations IT infras.pdfagpcorp
 
Write program in JavaC to sort the given array using merge .pdf
Write program in JavaC to sort the given array using merge .pdfWrite program in JavaC to sort the given array using merge .pdf
Write program in JavaC to sort the given array using merge .pdfagpcorp
 
Write the Asymptotic Complexity for each line of code and th.pdf
Write the Asymptotic Complexity for each line of code and th.pdfWrite the Asymptotic Complexity for each line of code and th.pdf
Write the Asymptotic Complexity for each line of code and th.pdfagpcorp
 
Write the below pseudo code segment using a multipleselecti.pdf
Write the below pseudo code segment using a multipleselecti.pdfWrite the below pseudo code segment using a multipleselecti.pdf
Write the below pseudo code segment using a multipleselecti.pdfagpcorp
 
Write node express application that displays the rectangle f.pdf
Write node express application that displays the rectangle f.pdfWrite node express application that displays the rectangle f.pdf
Write node express application that displays the rectangle f.pdfagpcorp
 
write information about the plant propertieseffects of coca.pdf
write information about the plant propertieseffects of coca.pdfwrite information about the plant propertieseffects of coca.pdf
write information about the plant propertieseffects of coca.pdfagpcorp
 
Write in SML A proper divisor of a natural number is the div.pdf
Write in SML A proper divisor of a natural number is the div.pdfWrite in SML A proper divisor of a natural number is the div.pdf
Write in SML A proper divisor of a natural number is the div.pdfagpcorp
 
Write a main method that will request the user to enter Stri.pdf
Write a main method that will request the user to enter Stri.pdfWrite a main method that will request the user to enter Stri.pdf
Write a main method that will request the user to enter Stri.pdfagpcorp
 
Write combining forms for each of the following terms 1 an.pdf
Write combining forms for each of the following terms 1 an.pdfWrite combining forms for each of the following terms 1 an.pdf
Write combining forms for each of the following terms 1 an.pdfagpcorp
 
Write code for problem 2 please Create a linked list by ent.pdf
Write code for problem 2 please  Create a linked list by ent.pdfWrite code for problem 2 please  Create a linked list by ent.pdf
Write code for problem 2 please Create a linked list by ent.pdfagpcorp
 
Write a Python function named validInput that displays to .pdf
Write a Python function named validInput that displays to .pdfWrite a Python function named validInput that displays to .pdf
Write a Python function named validInput that displays to .pdfagpcorp
 
write code in PYTHON please 82 LAB Set of upper and low.pdf
write code in PYTHON please 82 LAB Set of upper and low.pdfwrite code in PYTHON please 82 LAB Set of upper and low.pdf
write code in PYTHON please 82 LAB Set of upper and low.pdfagpcorp
 
Write a program in Python that implements Newtons method to.pdf
Write a program in Python that implements Newtons method to.pdfWrite a program in Python that implements Newtons method to.pdf
Write a program in Python that implements Newtons method to.pdfagpcorp
 
Write a Python Monster class Monster should have the follow.pdf
Write a Python Monster class Monster should have the follow.pdfWrite a Python Monster class Monster should have the follow.pdf
Write a Python Monster class Monster should have the follow.pdfagpcorp
 
Write a program that prints the message Hello my name is .pdf
Write a program that prints the message Hello my name is .pdfWrite a program that prints the message Hello my name is .pdf
Write a program that prints the message Hello my name is .pdfagpcorp
 
Write a program named FavoriteWordsjava that prompts user t.pdf
Write a program named FavoriteWordsjava that prompts user t.pdfWrite a program named FavoriteWordsjava that prompts user t.pdf
Write a program named FavoriteWordsjava that prompts user t.pdfagpcorp
 
Write a method called recAdd that will add the integer ele.pdf
Write a method called recAdd that will add the integer ele.pdfWrite a method called recAdd that will add the integer ele.pdf
Write a method called recAdd that will add the integer ele.pdfagpcorp
 
Write an HCS12 assembly program that executes the following .pdf
Write an HCS12 assembly program that executes the following .pdfWrite an HCS12 assembly program that executes the following .pdf
Write an HCS12 assembly program that executes the following .pdfagpcorp
 
Write an AES 128 code that encrypts and decrypts the followi.pdf
Write an AES 128 code that encrypts and decrypts the followi.pdfWrite an AES 128 code that encrypts and decrypts the followi.pdf
Write an AES 128 code that encrypts and decrypts the followi.pdfagpcorp
 

More from agpcorp (20)

Write Short answers specific and avoid extra off topic det.pdf
Write Short answers specific and avoid extra off topic det.pdfWrite Short answers specific and avoid extra off topic det.pdf
Write Short answers specific and avoid extra off topic det.pdf
 
write report that will Evaluate your organizations IT infras.pdf
write report that will Evaluate your organizations IT infras.pdfwrite report that will Evaluate your organizations IT infras.pdf
write report that will Evaluate your organizations IT infras.pdf
 
Write program in JavaC to sort the given array using merge .pdf
Write program in JavaC to sort the given array using merge .pdfWrite program in JavaC to sort the given array using merge .pdf
Write program in JavaC to sort the given array using merge .pdf
 
Write the Asymptotic Complexity for each line of code and th.pdf
Write the Asymptotic Complexity for each line of code and th.pdfWrite the Asymptotic Complexity for each line of code and th.pdf
Write the Asymptotic Complexity for each line of code and th.pdf
 
Write the below pseudo code segment using a multipleselecti.pdf
Write the below pseudo code segment using a multipleselecti.pdfWrite the below pseudo code segment using a multipleselecti.pdf
Write the below pseudo code segment using a multipleselecti.pdf
 
Write node express application that displays the rectangle f.pdf
Write node express application that displays the rectangle f.pdfWrite node express application that displays the rectangle f.pdf
Write node express application that displays the rectangle f.pdf
 
write information about the plant propertieseffects of coca.pdf
write information about the plant propertieseffects of coca.pdfwrite information about the plant propertieseffects of coca.pdf
write information about the plant propertieseffects of coca.pdf
 
Write in SML A proper divisor of a natural number is the div.pdf
Write in SML A proper divisor of a natural number is the div.pdfWrite in SML A proper divisor of a natural number is the div.pdf
Write in SML A proper divisor of a natural number is the div.pdf
 
Write a main method that will request the user to enter Stri.pdf
Write a main method that will request the user to enter Stri.pdfWrite a main method that will request the user to enter Stri.pdf
Write a main method that will request the user to enter Stri.pdf
 
Write combining forms for each of the following terms 1 an.pdf
Write combining forms for each of the following terms 1 an.pdfWrite combining forms for each of the following terms 1 an.pdf
Write combining forms for each of the following terms 1 an.pdf
 
Write code for problem 2 please Create a linked list by ent.pdf
Write code for problem 2 please  Create a linked list by ent.pdfWrite code for problem 2 please  Create a linked list by ent.pdf
Write code for problem 2 please Create a linked list by ent.pdf
 
Write a Python function named validInput that displays to .pdf
Write a Python function named validInput that displays to .pdfWrite a Python function named validInput that displays to .pdf
Write a Python function named validInput that displays to .pdf
 
write code in PYTHON please 82 LAB Set of upper and low.pdf
write code in PYTHON please 82 LAB Set of upper and low.pdfwrite code in PYTHON please 82 LAB Set of upper and low.pdf
write code in PYTHON please 82 LAB Set of upper and low.pdf
 
Write a program in Python that implements Newtons method to.pdf
Write a program in Python that implements Newtons method to.pdfWrite a program in Python that implements Newtons method to.pdf
Write a program in Python that implements Newtons method to.pdf
 
Write a Python Monster class Monster should have the follow.pdf
Write a Python Monster class Monster should have the follow.pdfWrite a Python Monster class Monster should have the follow.pdf
Write a Python Monster class Monster should have the follow.pdf
 
Write a program that prints the message Hello my name is .pdf
Write a program that prints the message Hello my name is .pdfWrite a program that prints the message Hello my name is .pdf
Write a program that prints the message Hello my name is .pdf
 
Write a program named FavoriteWordsjava that prompts user t.pdf
Write a program named FavoriteWordsjava that prompts user t.pdfWrite a program named FavoriteWordsjava that prompts user t.pdf
Write a program named FavoriteWordsjava that prompts user t.pdf
 
Write a method called recAdd that will add the integer ele.pdf
Write a method called recAdd that will add the integer ele.pdfWrite a method called recAdd that will add the integer ele.pdf
Write a method called recAdd that will add the integer ele.pdf
 
Write an HCS12 assembly program that executes the following .pdf
Write an HCS12 assembly program that executes the following .pdfWrite an HCS12 assembly program that executes the following .pdf
Write an HCS12 assembly program that executes the following .pdf
 
Write an AES 128 code that encrypts and decrypts the followi.pdf
Write an AES 128 code that encrypts and decrypts the followi.pdfWrite an AES 128 code that encrypts and decrypts the followi.pdf
Write an AES 128 code that encrypts and decrypts the followi.pdf
 

Recently uploaded

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 

Recently uploaded (20)

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

Write the assembly program Can use put_qword_safe to pr.pdf

  • 1. //Write the assembly program. //Can use put_qword_safe to print the intermediate values of specified registers #include <stdio.h> long fib(long x) { if (x <= 2) { return 1; } else { return fib(x - 1) + fib(x - 2); } } void main() { printf("%ldn", fib(10)); }