Home / Essays / COMPUTER

COMPUTER

COMPUTER

Procedures and Arrays

The goals for this week’s assignment are the following:
1. Write procedures and
2. Work with arrays
Note:
3. comment your code generously
4. mark the various questions in the code with a comment shown below and use the waitMsg function between each question. Example is shown below:

.code
;Question 1
Enter the code for problem 1 here…
….
Call WaitMsg ;this will allow one to observe the output
;Question 2
Enter the code for problem 2 here…
…..
Call WaitMsg ;this will allow one to observe the output
(and so on)

Problems:
1. Write a procedure to implement the C/C++ string compare procedure: strnicmp()
It should have the interface:
INVOKE Strnicmp, strA, strB, nBytes
Constrain the length N to a maximum of 20 characters. Use the following test cases

1. compare string MASM and MASM
2. compare string MASS and MASM
3. compare string mASM and MASm
To show this procedure working, print out the result of the above 3 comparisons by printing the results to the console screen, e.g. “Test1, the strings are equal” or “Test1, strings are not equal”
2. Write two matrix manipulation procedures and test the matrix identity. Assume the matrices are square 3×3.
a. Write a procedure to transpose a matrix A
b. Write a procedure to multiply 2 matrices. Y=AB
c. Test your two procedures by demonstrating that the following matrix identity holds true: (AB)T = BTAT
Use for matrix A = 1 5 2 and B = 2 0 1
1 0 1 1 3 1
2 2 1 2 1 0
Show that the identity is true by printing out the resultant matrix for left hand side and the right hand side, and showing that they are equal.

FOR YOUR ASSIGNMENTS TO BE DONE AT A CHEAPER PRICE PLACE THIS ORDER OR A SIMILAR ORDER WITH US NOW:)

Leave a Reply

WPMessenger