{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Program3 - Matrix Manipulation

# Program3 - Matrix Manipulation - author’s library...

This preview shows page 1. Sign up to view the full content.

CSC 322 Program 3 – Matrix Manipulation Due Friday October 7, 2011 Write an assembly language program that defines an arbitrary two-dimensional array of integers in the data segment. You should also define constants ROWS and COLS that specify the actual number of rows and columns in the matrix. Your code should calculate the sum of each row and place the sum in the corresponding slot of the array RowSums. Your code should also calculate the sum of each column and place the sum in the corresponding slot of the array ColSums. A grand total should also be calculated (sum of all integers in the matrix). Use the following two test cases for the data definitions for this assignment. Your code should also work for other matrices properly defined. You may define additional variables to assist you with this assignment. Print out the values in RowSums, ColSums, and Sum, along with labels, before exiting (our
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: author’s library WriteString on page 148 will come in handy). ;;;;;;;;;;;;;;;;;;;;;;;; TEST CASE 1 ;;;;;;;;;;;;;;;;;;;;;;;;; ROWS EQU 2 ; defines a constant ROWS set to 2. COLS EQU 3 ; defines a constant COLS set to 3. .data MyMatrix dd 1, 2, 3 dd 4, 5, 6 RowSums dd ROWS dup (0) ColSums dd COLS dup (0) Sum dd ;;;;;;;;;;;;;;;;;;;;;;;; TEST CASE 2 ;;;;;;;;;;;;;;;;;;;;;;;;; ROWS EQU 5 ; defines a constant ROWS set to 5. COLS EQU 7 ; defines a constant COLS set to 7. .data MyMatrix dd 1, 2, 3, 4, 5, 6, 7 dd 8, 9, 10, 11, 12, 13, 14 dd 15, 16, 17, 18, 19, 20, 21 dd 22, 23, 24, 25, 26, 27, 28 dd 29, 30, 31, 32, 33, 34, 35 RowSums dd ROWS dup (0) ColSums dd COLS dup (0) Sum dd Email your .asm file to [email protected] by the due date. Enjoy!!...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online