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