Question
Starting with the following C++ program: #include using namespace std; extern C Sort (char [] [20], int, int); void main () { char Strings [10]
Starting with the following C++ program:
#include
using namespace std;
extern "C" Sort (char [] [20], int, int);
void main ()
{
char Strings [10] [20]= {
"One",
"Two",
"Three",
"Four",
"Five",
"Six",
"Seven",
"Eight",
"Nine",
"Ten"
};
int i;
cout << "Unsorted Strings are" << endl;
for (i = 0; i < 10; i++)
cout << '\t' << Strings [i] << endl;
Sort (Strings, 10,20);
cout << "Sorted Strings are" << endl;
for (i = 0; i < 10; i++)
cout << '\t' << Strings [i] << endl;
}
Write in assembly language (x86 please) the function Sort. The first parameter is the two dimensional array of bytes, each row being a null terminated C
type string of characters.The second parameter is the number of rows in the array. The third parameter is the number of bytes in one row of the array. The function will sort the
two dimensional array such that the rows now contain data in alphabetical order. You may call the standard C functions strcmp and strcpy if you wish (do not write any C code
of your own). You get a bonus of 20 points if you write the compare and copy functions in assembler. Thank you to whoever takes the time out to reply and help me.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started