Question: Inline Assembly, MASM Program 3 : Inline Assembly In this assignment we will be using high - level language, C + + , with inline

Inline Assembly, MASM
Program 3: Inline Assembly
In this assignment we will be using high-level language, C++, with inline assembly to complete specific tasks. One purpose of doing this is to help optimize code more efficiently, if possible. This also allows us to use high-level language for input, output, and more. Most of the time compilers can optimize your code efficiently, but there may be cases where it does not.
Requirements: \({}^{i}\)
- Create a constant variable for holding the size of the array using C++
- Type: Integer
- Name and Value: arrSize =10
- Create the following pre-designed array using C++
- Type: Integer
- Name and Value: numArrA[arrSize]\(=\{9,3,4,6,1,7,2,8,5,0\}\)
- Create a void function in C++ to sort the array using Bubble Sort algorithm
- Function Name: bubbleSort
-\# of Parameters: numArrA, arrSize (constant)
- Display the unsorted array using C++
- Display the sorted array using C++
Problem:
Create a C++ program with inline assembly to do Bubble Sort on an unsorted pre-designed array with the values between 0 and 9(unique). Your program must use high-level language to do display and function calling. The Bubble Sort function must use assembly to sort the array. The algorithm in Pseudo-code for Bubble Sort is as follows: it
WHILE (FLAG IS NOT EQUAL TO 0)
SET INDEX TO 0
SET FLAG TO 0
WHILE (INDEX IS LESS THEN ARRAY_SIZE)
IF (ARRAY[INDEX] IS GREATER THEN ARRAY[INDEX +1])
SET TEMP TO ARRAY[INDEX]
SET ARRAY[INDEX] TO ARRAY[INDEX +1]
SET ARRAY[INDEX +1] TO TEMP
SET FLAG TO 1
END_IF
INCREMENT INDEX
END_WHILE
END_WHILE
Inline Assembly, MASM Program 3 : Inline Assembly

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!