Question: L 3 . 3 Write 6 8 HC 1 1 microcontroller code of subroutine to swap the first row of a matrix with the last

L3.3 Write 68HC11 microcontroller code of subroutine to swap the first row of a matrix with the last row, the second row with the second-to-last row, etc. The matrix is N by M and is stored in row-major order. The starting address of the matrix and the matrix dimensions (N and M) are passed to this routine in the stack in this order: matrix base address, N, M (that is, the matrix base address is pushed onto the stack first, followed by N and M). The matrix elements are 8-bit. Write a main program to test this routine, including the following features:
1. Call the Buffalo I/O routine OUTSTRG to output the message "The original matrix is as follows:" and call the routine OUTCRLF to move the screen cursor to the next line.
2. Call the Buffalo monitor I/O routines OUTLHLF and OUTRHLF to output the matrix elements, one row per line. Elements should be separated by one space.
3. Call the matrix swap subroutine to swap the rows of the matrix.
4. Call the I/O routine OUTSTRG to output the message "The swapped matrix is as follows:" and call the routine OUTCRLF to move the screen cursor to the next line.
5. Call the Buffalo I/O routines OUTLHLF and OUTRHLF to output the matrix elements, one row per line.

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!