Question

Write a VSC (macro) program that computes and displays a Fibonacci sequence. A Fbonacci sequence is...

Write a VSC (macro) program that computes and displays a Fibonacci sequence. A Fbonacci sequence is generated by adding the two most recent sequence numbers together, i.e., 1, 1, 1+1-2, 1+2=3, 2+3=5, 3+5=8, … The user will enter the number of terms in the sequence to be displayed. Assemble this program using the VSC assembler (ASM), and simulate this program using the VSC simulator (SIM). Include a copy of the source listing (SOURCE.DAT), the assembled listing (SLIST.DAT) and the simulation output.

Homework Answers

Answer #1

Step1: open file -- new project

Step 2: install c/c++ extension, c/c++ command adaptor

Step 3: write the code of Fibonacci series

#include<studio.h>

int main()

{

int count, first_no= 0, second_no= 1,

next_no, i;

printf("Enter the number of terms in a series");

scanf("%d", &count);

printf("first_no");

for(i=0; i<count; i++)

{

if(i<=1)

next_no=I;

else

{  next_no=first_no+second_no;

first_no = second_no;

second_no=next_no;

}

printf("%d\n", next_no);

}

return 0;

}

Step 4: run the code on new terminal.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Please Write the whole program in assembly i am able to calculate the fibonacci series but...
Please Write the whole program in assembly i am able to calculate the fibonacci series but not sure how to print it in reverse order. Please give a Complete code !! Programming Exercise 1 (10 points): [call it Ass2-Q1.asm] Write an ASM program that reads an integer number N and then displays the first N values of the Fibonacci number sequence, described by: Fib(0) = 0, Fib(1) = 1, Fib(N) = Fib(N-2) + Fib(N-1) Thus, if the input is N...
In mathematics, the Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci...
In mathematics, the Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and characterized by the fact that every number after the first two is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, … The sequence Fn of Fibonacci numbers is defined by the recurrence relation: Fn = Fn-1 + Fn with seed values F1 = 1 F2 = 1 For more information on...
Written in MASM Assembly Problem Definition: Write a program to calculate Fibonacci numbers. • Display the...
Written in MASM Assembly Problem Definition: Write a program to calculate Fibonacci numbers. • Display the program title and programmer’s name. Then get the user’s name, and greet the user. • Prompt the user to enter the number of Fibonacci terms to be displayed. Advise the user to enter an integer in the range [1 .. 46]. • Get and validate the user input (n). • Calculate and display all of the Fibonacci numbers up to and including the nth...
WRITE C++ PROGRAM FOR 1,2,3,4 PARTS of question, DO ADD COOMENTS AND DISPLAY THE OUTPUT OF...
WRITE C++ PROGRAM FOR 1,2,3,4 PARTS of question, DO ADD COOMENTS AND DISPLAY THE OUTPUT OF A RUNNING COMPILER QUESTION: 1) Fibonacci sequence is a sequence in which every number after the first two is the sum of the two preceding ones. Write a C++ program that takes a number n from user and populate an array with first n Fibonacci numbers. For example: For n=10 Fibonacci Numbers: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 2): Write...
Problem 2 write Pseudocode for a program that calculates and displays a customer's bank balance at...
Problem 2 write Pseudocode for a program that calculates and displays a customer's bank balance at the end of a month. The customer's bank balance at the end of the month is the beginning bank balance + the total amount of monthly deposit made - the total amount of monthly withdrawals made + interest earned. The information the program will need to get from the user is the beginning bank balance, the amount of monthly deposits , the amount of...
Write an ARM assembly language program that counts the number of 1’s for any value in...
Write an ARM assembly language program that counts the number of 1’s for any value in R0. The program must assemble/compile in KEIL and must be able to run in the KEIL simulator. Generally, R0 may contain any value, but for purpose of this exercise, you may move 0x2345ABCD into R0. The number in R0 does not need be preserved. You may use any other registers as you need. The result, total count of 1’s in R0, should be in...
---------------- Overview: ---------------- This lab will consist of several independent exercises that must all use recursion...
---------------- Overview: ---------------- This lab will consist of several independent exercises that must all use recursion to solve various problems. Some problems will have fairly short solutions, but declaring and using classes/objects is still required. Some could benefit from having some kind of data structure being passed between calls. Feel free to use your LinkedList if you think it could help. Some solutions will be a mix of iteration and recursion, but all solution need to be recursive in some...
Write a C++ program to find least common multiple (LCM) of two, three and four integer...
Write a C++ program to find least common multiple (LCM) of two, three and four integer values. The integer values are entered from the keyboard and the outputs are printed to the console. The LCM of two, three and four integer values are computed using Prime factorization method. You have to use arrays to hold input values and use functions/methods to get data from the keyboard, display output to the console, calculate LCM using Prime factorization method. Your program should...
C++ PROGRAMMING Assignment: For this assignment, you will construct a program which is capable of taking...
C++ PROGRAMMING Assignment: For this assignment, you will construct a program which is capable of taking a user-given number, and adding up all of the numbers between 1 and the given number. So if someone inputs 12, it should add 1 + 2 + 3 + 4 + … 9 + 10 + 11 + 12, and return the answer. However, you’ll be using two different methods to do this. The first method should utilize either a for loop or...
Problem Statement: Write a Java program “HW6_lastname.java” that prints a program title and a menu with...
Problem Statement: Write a Java program “HW6_lastname.java” that prints a program title and a menu with four items. The user should then be prompted to make a selection from the menu and based on their selection the program will perform the selected procedure. The title and menu should be as the following: Student name: <your name should be printed> CIS 232 Introduction to Programming Programming Project 6 Due Date: October 23, 2020 Instructor: Dr. Lomako ******************************** 1.     Compute Angles                               *...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT