Logo 
Search:

Assembly Language Articles

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

DECLARE A BYTE_TABLE AND THEN ADD EACH BYTE TO GET THE FINAL SUM

Posted By: Adalricus Fischer     Category: Assembly Language     Views: 5100

DECLARE A BYTE_TABLE AND THEN ADD EACH BYTE TO GET THE FINAL SUM.

Code for DECLARE A BYTE_TABLE AND THEN ADD EACH BYTE TO GET THE FINAL SUM in Assembly Language

.MODEL SMALL

.DATA

        BYTETABLE  DB   1,9,2,4,5
        NL         DB   0AH,0DH,'ADDTION OF 1 9 2 4 5:->','$'

        .CODE
        MAIN    PROC

                MOV AX,@DATA
                MOV DS,AX

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

                LEA  BX,BYTETABLE
                MOV  AL,[BX]
                MOV  AH,00

                MOV CL,4

               L1:

                        INC BX
                        ADD AL,[BX]
                        LOOP L1

               ;----------------------------------------
               ;CONVERT INTO ASCII
               ;----------------------------------------

                DISP:

                        MOV CL,10
                        MOV AH,00
                        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
;*********************************************

;ADDTION OF 1 9 2 4 5:->21
  
Share: 



Adalricus Fischer
Adalricus Fischer author of DECLARE A BYTE_TABLE AND THEN ADD EACH BYTE TO GET THE FINAL SUM is from Frankfurt, Germany.
 
View All Articles

 

Other Interesting Articles in Assembly Language:


 
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!