Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me with this question? Using assembly language on visual studio 2. fibonacci.asm - computes the following. a. Compute fib(n) for n =

Can someone help me with this question? Using assembly language on visual studio

image text in transcribed

image text in transcribed

2. fibonacci.asm - computes the following. a. Compute fib(n) for n = 2, 3, ..., 8 using an array, of the appropriate size and type. If you so desire, you may declare a value for fib(0) and fib(1). However, all computation of the remaining elements of the array must be done by your program, no use of immediate values is allowed. In other words, you must use the formula shown below (figure 1) to determine the values of the remainder of the required elements. Do not declare an array pre-filled with ALL the required elements. Do not use a loop b. After your array is filled with required values, store fib(4) through fib(7) in consecutive bytes of the ebx register starting from the lowest byte; that is, fib(4) is stored in the low byte (bl) of ebx, fib(5) is stored in the next byte (bh), fib(6) is stored in the next byte of ebx and fib(7) is stored in the highest byte. i. EBX register will look like this OD080503 Often, especially in modern usage, the sequence is extended by one more initial term 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... By definition, the first two numbers in the Fibonacci sequence are either 1 and 1 or 0 and 1, depending on the chosen starting point of the sequence, and each subsequent number is the sum of the previous two In mathematical terms, the sequence F, of Fibonacci numbers is defined by the recurrence relation F = F-1 + F.-2, with seed values F-1, F1 ort Fo=0, F = 1. Figure 1: Information on the Fibonnaci sequence Notes for Fibonacci.asm 1. Assume fib(0)=0, fib(1)=1. 2. You may use any instruction/directive/operator through chapter 4 pg 128. including any of the arithmetic operators +,,, 3. Your program must use indirect operands in some way as discussed in chapter 4. 2. fibonacci.asm - computes the following. a. Compute fib(n) for n = 2, 3, ..., 8 using an array, of the appropriate size and type. If you so desire, you may declare a value for fib(0) and fib(1). However, all computation of the remaining elements of the array must be done by your program, no use of immediate values is allowed. In other words, you must use the formula shown below (figure 1) to determine the values of the remainder of the required elements. Do not declare an array pre-filled with ALL the required elements. Do not use a loop b. After your array is filled with required values, store fib(4) through fib(7) in consecutive bytes of the ebx register starting from the lowest byte; that is, fib(4) is stored in the low byte (bl) of ebx, fib(5) is stored in the next byte (bh), fib(6) is stored in the next byte of ebx and fib(7) is stored in the highest byte. i. EBX register will look like this OD080503 Often, especially in modern usage, the sequence is extended by one more initial term 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... By definition, the first two numbers in the Fibonacci sequence are either 1 and 1 or 0 and 1, depending on the chosen starting point of the sequence, and each subsequent number is the sum of the previous two In mathematical terms, the sequence F, of Fibonacci numbers is defined by the recurrence relation F = F-1 + F.-2, with seed values F-1, F1 ort Fo=0, F = 1. Figure 1: Information on the Fibonnaci sequence Notes for Fibonacci.asm 1. Assume fib(0)=0, fib(1)=1. 2. You may use any instruction/directive/operator through chapter 4 pg 128. including any of the arithmetic operators +,,, 3. Your program must use indirect operands in some way as discussed in chapter 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions