Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction This assignment introduces arrays. An array is really the only data structure found natively in X86. Some authors have tried to introduce the concept

Introduction

This assignment introduces arrays. An array is really the only data structure found natively in X86. Some authors have tried to introduce the concept of object-oriented assembly programming, but such attempts are mostly wishful conjecturing. Here we do a basic program with arrays of doubles (64-bit floats)).

Requirements

Make a program consisting of two files: a controller program in C++ or C and a principal function written in X86. The controller program, sometimes called a driver is not part of the solution. It exists simply as a reminder that C++, X86, and C are all friends living in one neighborhood. Also, C++ has the best linker of the three languages mentioned above.

The driver program displays a welcome message and calls the assembly function. The assembly function does the following:

= Displays an introductory message

= Instructs the user to input a sequence of doubles and terminate with cntl+D.

= Outputs the numbers in the array

= Finds the largest number in the array.

= Finds the smallest number in the array.

= Swaps position between the largest and smallest

= Outputs the numbers in the modified array

= Display a closing message

= Returns control to the driver.

There is no error checking for invalid inputs.

On the next page is a sample run. Make your program produce output as close to the sample as possible. Output all numbers with 18 decimal digits on the right side of the decimal point.

Sample execution

This is CPSC 240 Assignment 2 programmed by Paris Hilton.

This software is running on a MSI GP622 with processor Intel Core i5-5780 running at 2.2GHz with

operating system Ubuntu 17.10.

Welcome to the array program. This program will save your 64-bit data in an array.

Please enter floating point number and press enter after each number. The limit is 10 numbers.

5.9

-11.89

3.12

7.77

2.915

<== Cntl+D is pressed here, but no visible symbol appears.

Thank you for you inputs. Your array is as follows:

5.900000000000000071

-11.89000000000000103

3.120000000000000003

7.770000000000000118

2.915000000000000226

The software is now swapping the largest and smallest numbers in the array. Finished.

Your array is now the following.

5.900000000000000071

7.770000000000000118

3.120000000000000003

-11.89000000000000103

2.915000000000000226

This assembly function will now return to the caller function.

The main function will now return 0 to the operating system. Have a nice program.

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

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions