Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

Program to find total of rows and columns of N x M matrix

Posted By: Daisy Brown     Category: Assembly Language     Views: 6620

Write an assembly program to find total of rows and columns of N x M matrix.

Code for Program to find total of rows and columns of N x M matrix in Assembly Language

.model small

.data
        tab db 3,4,5,6,0
            db 1,4,5,7,0
            db 1,8,9,0,0
            db 1,8,9,2,0
            db 1,1,1,1,0
            db 0,0,0,0,0

        TotRows db 0
        TotCols db 0
        Rows db 5
        Cols db 4

.code
        mov ax,@data
        mov ds,ax

        ; Counting Total Rows
        LEA SI,tab
        L1:
                mov cx,4
                L2:
                        mov ah,BYTE PTR[SI]
                        add TotRows , ah
                        Inc SI
                        Loop L2

                        mov ah,TotRows
                        mov [SI],ah
                        mov TotRows,0
                        INC SI
                        sub Rows,1
                        cmp Rows,0
                        jg L1

        ;Counting Total Cols
        LEA SI,tab
        mov BX,00
        L3:
                mov cx,5
                LEA SI,tab
                add SI,BX
                L4:
                        mov ah,BYTE PTR[SI]
                        add TotCols , ah
                        add SI,5
                        Loop L4

                        mov ah,TotCols
                        mov [SI],ah
                        mov TotCols,0
                        sub Cols,1
                        cmp Cols,0
                        add BX,1
                        jg L3
                    
        mov ax,4C00h
        int 21h
end
  
Share: 


Didn't find what you were looking for? Find more on Program to find total of rows and columns of N x M matrix Or get search suggestion and latest updates.

Daisy Brown
Daisy Brown author of Program to find total of rows and columns of N x M matrix is from London, United Kingdom.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!