MIPSym Assembly 1 Allocate enough memory 4 bytes for each sq

MIPSym Assembly

1. Allocate enough memory (4 bytes for each square) in a 6x6 square board. Assign the values following values at the specified row,column locations: Board[2,3] = 5 Board[1,5] = 3 Board[4,3] = 7 Board[1,0] = 1 All other board locations have the value zero assigned to them. Using a nested loop, print the value of each board location as an integer using syscall $print_int.

2. Use a loop to print a single row of black and white squares. Start with a white square, then print a black square, then a white square, etc until the program prints six squares.

3. Using 2 nested loops, write a program to print a 6x6 checker board using black and white squares. The upper left and lower right corners of the checker board should be white.

4. Merge the programs from problems above. Also add a set of if/else or a switch/case style statement to the nested loops so that the proper game piece is printed.

5. In the final problem, you must convert the display routine (the 2 nested loops and if/else statements) from problem 4 into a function. Next, you should write a program to test that your display function works. The flow of the program should go as follows: 1. allocate space for board state [problem 1] 2. initialize board state to all zeros [problem 1] 3. Begin loop a. print board state (display the board) [problems 2-5] b. ask for row c. ask for column d. ask for value e. set board (row,column) to value [problem 1] f. go to (3a) The input parameter to this function is the board state. The function prototype would be defined as follows: void displayBoard(int* board) { … } The board is a data object that stores the locations of all the checkers on the board and the information associated with it. This is referred to as the “state” of the board. When you declare your function in MIPS assembly, please pass the variable “board” by reference—i.e. it is a pointer. Do not try to allocate space for the entire board on the stack every time you call displayBoard. Use $a0 to pass the pointer to the board data instead.

Solution

OUTSIDE DIMENSION

6x6 COLUMN = 5 1/2\" X 5 1/2\"

8x8 COLUMN = 7 1/4\" X 7 1/4\"

10x10 COLUMN = 9 1/4\" X 9 1/4\"

INSIDE DIMENSION

6x6 COLUMN = 4 1/2\" X 4 1/2\"

8x8 COLUMN = 6 1/4\" X 6 1/4\"

10x10 COLUMN = 8 1/4\" X 8 1/4\"

*4 Piece Knock Down Kit*

*Assembly Required*

*Columns Require Prime And Paint Finish After Installation*

   *9 ft and 10 ft Columns Are Special Order, Two Week Lead Time From Date Of Order*

MIPSym Assembly 1. Allocate enough memory (4 bytes for each square) in a 6x6 square board. Assign the values following values at the specified row,column locati

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site