Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ASSEMBLY LANGUAGE HELP!!! Please help create these two programs:) Please Read the problem carefully and understand it!! Thank you for your help:) I'm really confused

ASSEMBLY LANGUAGE HELP!!! Please help create these two programs:)

Please Read the problem carefully and understand it!! Thank you for your help:)

I'm really confused on this assignment. It's in assembly language kip irvine x86.

lmk if I can do anything to help!!

image text in transcribed2. fibonacci.asm - computes the following.

a. Compute fib(n) for n = 2, 3, , 9 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.

b. After your array is filled with required values, store fib(5) through fib(9) in consecutive bytes of the ebx register starting from the lowest byte; that is, fib(5) is stored in the low byte (bl) of ebx, fib(6) is stored in the next byte (bh), fib(7) is stored in the next byte of ebx and fib(8) is stored in the highest byte.

i. EBX register will look like this 0D080503

NOTES:

Notes for Fibonacci.asm

1. Assume fib(0)=0, fib(1)=1. These are the only two values you may directly initialize in the .data section.

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.

4. You program MUST calculate all values of the Fibonacci sequence except Fib(0) and Fib (1).

5. You must use a loop.

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 ;// This is NOT ALLOWED

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

1. reorder.asm - 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 immediate values except in the .data section. 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: MyArray WORD 4567h, 2348h, 3338h At the end of this part of the assignment, your code the array will be in increasing order. You will be using a new Irvine Library function. Call Dump Mem. In order to use this you need the following information. ESI = Offset of myArray ECX = # of elements in myArray. Use the $ directive to get this information. EBX = unit size (good place to use TYPE instruction. After you have the information required in ESI, ECX, and EBX, you will simply type call Dump Mem on the next line. To be clear, it will be something like the following (where you will fill in the xxxxxxx) mov esi, xxxxxxx mov ecx, XXXXXXX mov ebx, call dumpmem XXXXXXX 1. reorder.asm - 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 immediate values except in the .data section. 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: MyArray WORD 4567h, 2348h, 3338h At the end of this part of the assignment, your code the array will be in increasing order. You will be using a new Irvine Library function. Call Dump Mem. In order to use this you need the following information. ESI = Offset of myArray ECX = # of elements in myArray. Use the $ directive to get this information. EBX = unit size (good place to use TYPE instruction. After you have the information required in ESI, ECX, and EBX, you will simply type call Dump Mem on the next line. To be clear, it will be something like the following (where you will fill in the xxxxxxx) mov esi, xxxxxxx mov ecx, XXXXXXX mov ebx, call dumpmem XXXXXXX

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago