Question: PLEASE WRITE IN ARM ASSEMBLY CODE Please make sure to include as your output at a minimum the source code and the output screenshots showing

PLEASE WRITE IN ARM ASSEMBLY CODE Please make sure to include as your output at a minimum the source code and the output screenshots showing a 5x5,7x7, and 9x9. I will test your code for additional matrix sizes. You are welcome to add addition sizes if you wish. Functionalize your code and minimize the work done in the main function (e.g., makefile, function to get user input, function to calculate the magic square, function to print the square, etc.).
Implement the following algorithm to construct magic n \times n squares; it works only if n is odd.
Set row = n -1, column = n /2.
For k =1... n * n
Place k at [row][column].
Increment row and column.
If the row or column is n, replace it with 0.
If the element at [row][column] has already been filled
Set row and column to their previous values.
Decrement row.
Here is the 5\times 5 square that you get if you follow this method:
image.png
Write an ARM assembler program from scratch (DO NOT WRITE THE CODE IN C THEN AUTO CONVERT. AUTO CONVERTED CODE WILL RECEIVE A ZERO) that will run on your Raspberry Pi that takes in as input a number n (size of the matrix) and whose output is the magic square of order n if n is odd. Provide a makefile and all functions implemented. You must provide at least four functions: main.s, getinput.s, magicSquare.s, and printSquare.s
For anyone having trouble viewing the image above, it's an example of a 5x5 magic square:
11182529
101219213
46132022
23571416
17241815

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!