Logo 
Search:

Assembly Language Articles

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

Program to declare a byte_table and then add each byte to get the final sum(Hint: Use Indirect Addressing)

Posted By: Ryan Bouchard     Category: Assembly Language     Views: 3196

A program to declare a byte_table and then add each byte to get the final sum(Hint: Use Indirect Addressing).

Code for Program to declare a byte_table and then add each byte to get the final sum(Hint: Use Indirect Addressing) in Assembly Language

.MODEL  SMALL

.DATA
        VAL1    DB      1,4,9,4,5
        NL1     DB      0AH,0DH,'ADDTION OF 1 4 9 4 5:->','$'

.CODE
MAIN    PROC
        MOV AX,@DATA
        MOV DS,AX

        LEA DX,NL1
        MOV AH,09H
        INT 21H

        LEA  BX,VAL1
        MOV  AL,[BX]
        MOV  AH,00
        MOV  CL,4
LBL1:
        
        INC BX
        ADD AL,[BX]
        LOOP LBL1

        MOV AH,00
        MOV CL,10
        DIV CL
       
        MOV DX,AX
        ADD DX,3030H

        MOV AH,02H
        INT 21H

        MOV DL,DH
        INT 21H

        MOV AH,4CH
        INT 21H
MAIN    ENDP
        END     MAIN


OUTPUT
***********
C:\tasm>EX6
ADDTION OF 1 4 9 4 5:->23
  
Share: 



Ryan Bouchard
Ryan Bouchard author of Program to declare a byte_table and then add each byte to get the final sum(Hint: Use Indirect Addressing) is from Montreal, Canada.
 
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!