Question: MASM assembly language For this assignment you will write four MASM assembly language functions that will be called from a C++ function. The four functions

MASM assembly language

For this assignment you will write four MASM assembly language functions that will be called from a C++ function. The four functions should provide equivalents to these prototypes:

  • int getIndex( int address20bit );
  • int getBlockOffset( int address20bit );
  • int getTag( int address20bit );
  • char* toLower( char[] buffer );

First three functions should accept a 20 bit address (in an int), and extract the fields indicated by the name of the function. The size of memory in bytes is indicated by the fact that an address is 20 bits. A single entry in this cache can hold 64 bytes. The Index field is 4 bits. The width of the Tag field is all the bits that remain after accounting for the Block Offset and Tag.

The values returned by these 3 functions should isolated from each other, and right shifted in the integer returned to the calling function. As an example of "isolated", the getIndex function should only return the bits that represent the Index field, right justified in an integer.

The fourth function should accept a null-terminated character array of ASCII characters, and traverse the buffer, converting any upper case letters to lower case. The buffer can possibly contain special characters, and numerics. So make sure you check the value before trying to convert it.

The calling convention is different between Windows and System V (Linux, Mac, BSD). Make sure you implemented; Windows Failure to indicate which calling convention you've implemented in the comments at the top of your assembly language source file(s) will earn a substantial points penalty.

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!