Question: x86 Assembly MASM --- For this programming assignment you will develop two assembly language procedures that will be called from C. The C module is

x86 Assembly MASM

---

For this programming assignment you will develop two assembly language procedures that will be called from C. The C module is given to you. You will provide the assembly module containing the two procedures.

The C prototype for the first procedure is shown below.

void convertUpper(char* c);

convertUpper will receive a pointer to a character (i.e. the address). Here are the things convertUpper should do:

Check to see if the character is a lower case character. If not, return without doing anything.

Convert the character at the address to upper case.

The C prototype for the second procedure is shown next.

void convertLower(char c1, char c2, char c3, char c4, char c5, char c6, char c7);

convertLower will receive seven characters. The characters will be either alpha or numeric characters. If a character is an upper case alpha character, it should be converted to lower case. convertLower should do the following things:

Convert each of the seven characters to lower case if it is an upper case alpha character.

Call the C function, printChars, to print the seven characters after the conversion to lower case. printChars is given to you in the C source code file shown below.

The following source file contains the C code you will use to call the assembly procedures. You may modify the code for testing purposes.

You may not use the Microsoft directives PROTO and INVOKE for this assignment.

Details on how to go about this assignment would be greatly appreciated.

C code below

--------------------------

#include

// C prototypes for the functions written in assembly language void convertUpper(char* c); void convertLower(char c1, char c2, char c3, char c4, char c5, char c6, char c7);

// Main ------------------------------------------------------------------- int main() { char lowerChar = 'a'; char upperChar; char c1 = 'C', c2 = 'S', c3 = 'C', c4 = 'I', c5 = '2', c6 = '1', c7 = '2';

upperChar = lowerChar; // Copy the character to be converted convertUpper(&upperChar); // Convert character to upper case printf("lower = %c, upper = %c ", lowerChar, upperChar); // Print result

// Convert seven characters to lower case convertLower(c1, c2, c3, c4, c5, c6, c7);

return 0; }

//------------------------------------------------------------------ // Description: Prints the seven characters that are passed to it // Receives: Seven characters // Returns: Nothing void printChars(char c1, char c2, char c3, char c4, char c5, char c6, char c7) { printf("%c%c%c%c%c%c%c ", c1, c2, c3, c4, c5, c6, c7); }

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 Databases Questions!