Question: Note: Please use assembly language , MIPS system and I need .asm code, Please help me out.... Problem #2 () a) Write a function that

Note: Please use assembly language , MIPS system and I need .asm code, Please help me out....

Problem #2 () a) Write a function that takes as an argument the address of a 2-dimensional array, then reads a series of 4-tuples entered by the user into the array. The program should return the number of 4-tuples entered. A 4-tuple is a set of 4 integers (a,b,c,d). These numbers correspond to the (r1,c1) and (r2,c2) pairs when making moves on the board. The array and pseudo code would be declared as follows: int tuples[24][4]; int getTuples(int *tupleList) { int r1,c1,r2,c2, total=0; for (r1=0; r1 < 6; r1++) { for (c1=0; c1 < 6; c1++) { for (r2=-1; r2 <=1; r2+=2) { for(c2=-1; c2 <=1; c2+=2) { print (r1,c1,r2,c2); // print four nums v0=read_int; if (v0==1) { tuples[total][0]=r1; tuples[total][1]=c1; tuples[total][2]=r2; tuples[total][3]=c2; total++; if (total==24) break; } } } } } return total; } b) Write a function to print all the values in the tuple array. This function will be used for debugging. It should take the list of tuples as a first argument and the number of tuples as a second argument. Pseudo code is as follows: void printTuples(int *tuples, int num) { int i; for (i=0; i

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!