Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Assembly Expert

This program uses Assembly Language and should be done with Visual Studio 2013A sequence of numbers is an ordered list of numbers that follow a certain rule. For example, the positive integers start at 1 and each one is found by adding a 1 to the previous number.

Mathematically, this can be written in a recurrent form as

yk = yk-1 + 1

which means, the current number is the previous number plus one, and the sequence looks like this: { 1,2,3,4,5,6,7,8,9, etc. }.

Another example is the Fibonacci numbers. Their mathematical form is

yk = yk-2 + yk-1

which means, the current number is the sum of the previous 2 numbers. The first two numbers are 0 and 1, and the sequence looks like this: { 0,1,1,2,3,5,8,13, etc. }.

There are many sequences that can be defined in many ways. For this project we will use the following sequence, that starts at 1:

yk = 2 yk-1 + 1
which means, the current number is the previous number times 2 plus one, and the sequence looks like this: { 1,3,7,15,31,63,127,255, etc. }.

The Project

Write a program that fills two arrays with the number sequence defined by the expression: yk = 2yk-1 + 1. The sequence starts at 1.

Here is what you have to do:

Declare two 10 element DWORD arrays, say array1 and array2.

Create a procedure called FillArray1. Calculate the first 10 numbers of the sequence and place them in array1.

Create a procedure called FillArray2. Calculate the next 10 numbers of the sequence and place them in array2.

Create a procedure called PrintArrays. With this, write a message to the screen "The arrays are: " and print the arrays in two columns, side by side, with a header for each array: Array 1 and Array 2. The first array should be displayed in yellow and the second array in green. After the arrays are displayed, bring back the screen font color to the default color of light gray, so that the message "Press any key to continue ..." will be displayed in that color. To change the text color, call the SetTextColor procedure from the book's library. You can find SetTextColor procedure in your textbook, Chapter 5.

In the main program call these 3 procedures. Therefore, the main program should be very simple:

call FillArray1

call FillArray2

call PrintArrays

Very important: Do not hardcode numbers in your procedures. Do not increment the arrays with hard numbers. As we did in previous labs, use the SIZEOF, TYPE, and LENGTHOF operators to make the program as flexible as possible to support the array size and type being changed in the future.

Assembly, Programming

  • Category:- Assembly
  • Reference No.:- M91418362
  • Price:- $75

Priced at Now at $75, Verified Solution

Have any Question?


Related Questions in Assembly

Really need to find a correct answer to this questionwrite

Really need to find a correct answer to this question: Write a MIPS assembly program that can search for a number that is entered by a user in an array with 20 integer number. Make sure it also prints the index of the ar ...

Question a sequence string of one-byte ascii characters is

Question : A sequence (string) of one-byte ASCII characters is stored at memory location $600 onward. A second sequence of equal length is stored at memory location $700 onward. Each sequence ends with the character $0 ( ...

Task 1using masm sdk write an assembly language program

TASK 1 Using MASM SDK, write an assembly language program which converts an integer inputted via the console to binary. Your program should be well commented and well formatted. TASK 2 Using MASM SDK, write an assembly l ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As