Question: Please help me :) This must be done in Assembly Language. Please make sure to follow all specifications. Create the two programs described below. Upload
Create the two programs described below. Upload them to Canvas prior to the due date - rearranges the values of the following array into the order shown. Use only MOV and XCHG to accomplish the desired result. DO NOT use any Use only direct offset addressing to accomplish the goal. Be as efficient as you can. Note: You will have to look at memory to see if you have achieved your goal. You may not create other data elements to assist with this problem. Original Array: arrayD DWORD 123, 251, 12 Ending Array: arrayD DWORD 12,123, 251 computes the following a. Compute fib(n) for n -2, 3, ..., 10 using an array, of the appropriate size and type. If you so desire, you may declare a value for fib(0) and fib(). 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. b. After your array is filled with required values, store fib(3) through fib(6) in consecutive bytes of the ebx register starting from the lowest byte; that is, fib(3) is stored in the low byte (bl) of ebx, fib(4) is stored in the next byte (bh), fib(5) is stored in the next byte of ebx and fib(6) is stored in the highest byte i. EBX register will look like this 08050302 Often, especialily in modern usage, the sequence is extended by one more intial term 0,1,1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, By definition, the first two numbers in the Fibonacei sequence are etner 1 and 1, or o and 1, depenaing on the chosen starting point of the sequence, and each subsequent number is the sum of the previous two in mathemancal tems, the sequence Fo or Fbonacci numbers is oefined by the recurrence relation wth seed values Figure 1: Information on the Fibonnaci sequence Notes for Fibonacci.asm 1. Assume fib(0)-0, fib(l)-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 Specifications for Entire Assignment 1. Your program must make calls to DumpRegs as necessary 2. If you use immediate values for any portion of this assignment (except where specifically allowed), you will receive a zero for that portion of the assignment. Example: mov ebx, 08050302 I This is NOT 3. Part of the program will be graded based on program style. I reserve the right to judge style as I deem fit for the assignment. This includes commenting, whitespace, use of the required header, etc Create the two programs described below. Upload them to Canvas prior to the due date - rearranges the values of the following array into the order shown. Use only MOV and XCHG to accomplish the desired result. DO NOT use any Use only direct offset addressing to accomplish the goal. Be as efficient as you can. Note: You will have to look at memory to see if you have achieved your goal. You may not create other data elements to assist with this problem. Original Array: arrayD DWORD 123, 251, 12 Ending Array: arrayD DWORD 12,123, 251 computes the following a. Compute fib(n) for n -2, 3, ..., 10 using an array, of the appropriate size and type. If you so desire, you may declare a value for fib(0) and fib(). 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. b. After your array is filled with required values, store fib(3) through fib(6) in consecutive bytes of the ebx register starting from the lowest byte; that is, fib(3) is stored in the low byte (bl) of ebx, fib(4) is stored in the next byte (bh), fib(5) is stored in the next byte of ebx and fib(6) is stored in the highest byte i. EBX register will look like this 08050302 Often, especialily in modern usage, the sequence is extended by one more intial term 0,1,1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, By definition, the first two numbers in the Fibonacei sequence are etner 1 and 1, or o and 1, depenaing on the chosen starting point of the sequence, and each subsequent number is the sum of the previous two in mathemancal tems, the sequence Fo or Fbonacci numbers is oefined by the recurrence relation wth seed values Figure 1: Information on the Fibonnaci sequence Notes for Fibonacci.asm 1. Assume fib(0)-0, fib(l)-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 Specifications for Entire Assignment 1. Your program must make calls to DumpRegs as necessary 2. If you use immediate values for any portion of this assignment (except where specifically allowed), you will receive a zero for that portion of the assignment. Example: mov ebx, 08050302 I This is NOT 3. Part of the program will be graded based on program style. I reserve the right to judge style as I deem fit for the assignment. This includes commenting, whitespace, use of the required header, etc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
