Masm procedure to perform letter case conversion, C/C++ Programming

Assignment Help:

Assignment:  write a C program and a MASM procedure.  The C program calls the MASM procedure to perform letter case conversion.

Text sections covered:  12.1 to 12.3.1

Write a C program containing two input arrays and two output arrays.  The first input array consists of lower case alphabetical characters.  The second input array consists of upper case alphabetical characters.  This C program will call a MASM procedure that converts the characters in the input array to either upper or lower case and places them in the output array.  The procedure is called with the following parameters:

            MASMprocedure (input_array, output_array, input_array_length, to_lower);

input_array                  =          the input array as described above

output_array                =          the output array as described above

input_array_length      =          the length (in bytes) of the input array

to_lower                      =          Boolean variable (false = convert to upper case,
                                                true = convert to lower case)

The MASMprocedure declaration in your C program should have a return type of void.

These C variables are to be declared as follows:

char     input_array[] = "lower or upper case letters";

char     output_array[sizeof input_array];

long     input_array_length;

bool     to_lower;

Your C program should call the MASM procedure twice.  The first call should be with the array containing lower case letters that your MASM procedure will convert to upper case.  The second call should be with the array containing upper case letters that your MASM procedure will convert to lower case.

When your C program completes, display both the input arrays and the output arrays.

A few notes you should be aware of:

1)      You do not have to use a header file as described on page 413.  Simply put the extern directive in your main .cpp file.

2)      If you wish to debug your C program (or step through it using breakpoints), you need to set the debug option in the general screen for the C++ compiler.  See the Debug Information

3)      C/C++ long variables are passed as DWORD types to MASM.

4)      C/C++ Boolean variables are passed as BYTE types to MASM.

5)      You should account for the trailing NULL when handling C/C++ strings.

6)      Any use of a JMP instruction in your MASM procedure should use the syntax:

                                     jmp            short         

7)      Create both the .asm and .cpp programs in the same project file within Visual Studio.  Use the same settings for the .asm program as any other .asm program you have written in this class.


Related Discussions:- Masm procedure to perform letter case conversion

Compiler Design - Limit In The Method Instructions, Raj is a newbie to the ...

Raj is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''{'' and end with ''}''

Erp, How does an ERP System facilitates better decision making?

How does an ERP System facilitates better decision making?

Luminous Jewels - The Polishing Game, Byteland county is very famous for lu...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Define difference among new & malloc?, Both malloc & new functions are util...

Both malloc & new functions are utilized for dynamic memory allocations & the basic difference is: malloc need a special "typecasting" while it allocates memory for eg. if the poin

Non-maxima suppression, Use the program called harris-shell.c and add some ...

Use the program called harris-shell.c and add some code to find the corners in the image checkers.jpg. You should say that a pixel in the image is a corner if it passes the given t

#titlbinary searching.., Ask question #Minimum 100 words awhat is the pre c...

Ask question #Minimum 100 words awhat is the pre condition for binary searching ccepted#

Chapter 21, Test scores solution help. Three member variables

Test scores solution help. Three member variables

What happens while a function throws an exception which , Q-What happens wh...

Q-What happens while a function throws an exception which was not specified through an exception specification for this function? A: Unexpected() is called, which, by default, w

Fibonacci function by using simple recursive approach, Implement, in rPeANU...

Implement, in rPeANUt, the a Fibonacci function by using the simple recursive approach. The Fibonacci function can be implemented in c as follow: int fib(int x) {   if (x

Write Your Message!

Captcha
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