Program that generates an array of pseudorandom integers

Assignment Help Programming Languages
Reference no: EM131287403

Programming Project

One of the very practical uses of assembly language programming is its ability to optimize the speed and size of computer programs. While programmers do not typically write large-scale applications in assembly language, it is not uncommon to solve a performance bottle neck by replacing code written in a high level language with an assembly language procedure.

In this programming project you will be given a C++ program that generates an array of pseudorandom integers, sorts the array, and then searches the array for a particular value. The C++ program uses the binary search algorithm to determine if the search value is one of the elements in the array. A binary search procedure is considered efficient.

Your job is to write an assembly language procedure that also performs the binary search. The C++ program will time multiple searches performed by both the C++ code and your assembly language procedure and compare the result. If all goes as expected, your assembly language procedure should be faster than the C++ code.

Chapter 13 of your text book contains a discussion of how to interface an assembly language procedure with a high-level programming language like C++. The author also provides an example of a C++ program linkedwith an assembly language procedure in the C:\Irvine\other examplesfolder. In addition, the author has provided batch files that will conveniently allow you to assemble the object code version of your assembly language procedure.You will need to link the object file to the existing C++ program files. Depending upon the version of Microsoft's Visual Studio IDE, you will find these batch files and instructions for their use in either:

Getting Started with MASM and Visual Studio 2012 OR
Getting Started with MASM and Visual Studio 2013.
Both can be found at the author's web site:
https://www.kipirvine.com/asm/

Search for "Assembling without Linking" to get to this material quickly.

The Visual Studio solution for the C++ program that you are to be given has been packaged and compressed into a file called "ProjectFour.zip".
Download the compressed file, ProjectFour.zip, and unpack it into
C:\Users\<your name>\Documents\Visual Studio 2012\Projects

Look in the \...\Projects\ProjectFour folder for a file named "ProjectFour.sln". The ".sln" file extension stands for solution. Double clicking on this file will start up the Visual Studio solution for ProjectFour and allow you to execute the C++ program.

A "stub" assembly language procedure has been provided so that you can execute the C++ program to get a feel for how it works. Your job is to improve on the efficiency of the C++ compiled code. Look in the \...\Projects\ProjectFour\ProjectFour folder for the assembly language stub file named "AsmBinarySearch.asm". This file is your starting point for creating an assembly language version of the binary search routine.

As always, start small. DO NOT be the Cookie Monster and gobble up the whole project at once. Steps you might consider, but are not limited to are:
- Have your assembly language procedure return the number of elements in the array. This will tell you if what is being passed as an argument is the value you expected.
- Have your assembly language procedure return the value of the first element in the array. This will tell you if you understand how to address and retrieve the value of an element in the array.
- Have your procedure return the second (or fifth) element in the array.
- Calculate the subscript of the "middle" element in the array and return the value of that subscript. This will confirm that you can make one of the calculations needed to implement the binary search and retrieve a particular element in the array.
- Calculate the subscript of the "middle" element in the array and return the value of that element in the array. This will confirm that you can retrieve any element in the array.

This project will provide you with the opportunity to:
- Link an assembly language procedure to an existing C++ program.
- Demonstrate your ability to work with a one-dimensional array.
- Show that you can implement a while loop in assembly language.
- Display your understanding of what an assembly language procedure is and how they can be used.
- Provides a chance for you to show that you understand how to compare values and take conditional action based on the results.
- Observe how assembly language procedures can be used to optimize.

Attachment:- ProjectFour.rar

Reference no: EM131287403

Questions Cloud

How to identify someones individual paradigm or interests : What three factors best describe how to identify someone's individual paradigm or interests? What process should we use to decide which factors to use to determine their individual paradigm or interests?
Calculate the actual annual percentage rate of interest : Calculate the actual annual percentage rate of interest for the loan in Exercise 1 using both formulas APR1 a and APR2 a.
What do they mean by grafting : What are two reasons why the US may not want such a treaty?
What you think would be a fair compensation package for you : Using the information from, make a list of all the elements that should be included in your compensation package. What changes, if any, should be made over time?
Program that generates an array of pseudorandom integers : COSC-2425 Programming Project - program that generates an array of pseudorandom integers, sorts the array, and then searches the array for a particular value.
How accurately did the mass media report the study : Find and read an article in the media or a video clip that reports the results of a scientific study. You must include the link to the website. How accurately did the mass media report the study?
Research a news article dealing with white collar crime : Research a news article dealing with White Collar Crime
How to best address customers needs : Later the manager tells you that he received an all-expenses-paid cruise for his family from Smith Windows. What, if anything, should you do with this information?
Describe database backup and disaster planning : Describe Database Backup and Disaster Planning and compare and contrast Database Backup & Disaster Planning.

Reviews

len1287403

11/23/2016 5:52:11 AM

Assignment Work with following details... Comments/Deadline : Use visual studio and I need the screenshot of all programs and it must be in a JPG format. it is not uncommon to solve a performance bottle neck by replacing code written in a high level language with an assembly language procedure.

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd