Logo 
Search:

Assembly Language Articles

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

Program to find the addition and average of 1 to n no

Posted By: Adalrik Fischer     Category: Assembly Language     Views: 21170

Write a program to find the addition and average of 1 to n no.

Code for Program to find the addition and average of 1 to n no in Assembly Language

DATA SEGMENT
A DB 1,2,3,4,5,6,7,8,9,10
SUM DB ?
DATA ENDS
CODE SEGMENT
        ASSUME DS:DATA,CS:CODE
START:
      MOV AX,DATA
      MOV DS,AX
      LEA BX,A
      MOV CL,10
      MOV AX,0000
   L1:ADD AL,BYTE PTR[BX]
      INC BX
      DEC CL
      CMP CL,00
      JNZ L1
      MOV SUM,AL
      MOV BH,10
      DIV BH
      MOV AH,4CH
      INT 21H
CODE ENDS
END START

;OUTPUT:->
;-G CS: 001E
;
;AX=0505  BX=0A0A  CX=0000  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BA8  ES=0B98  SS=0BA8  CS=0BA9  IP=001E   NV UP EI PL ZR NA PE NC
;0BA9:001E B44C          MOV     AH,4C
  
Share: 


Didn't find what you were looking for? Find more on Program to find the addition and average of 1 to n no Or get search suggestion and latest updates.

Adalrik Fischer
Adalrik Fischer author of Program to find the addition and average of 1 to n no 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!