I need to create an array of 20 values (bytes) and compute the average. I'm new in this. This is my code for the addition phase:
.MODEL SMALL
.STACK 100h
.DATA
arreglo db 3, 8, 5, 3, 9, 2, 1, 4, 5, 11, 2, 1, 12, 10, 7, 17, 18, 6, 14, 13
arrsuma db ?
promedio db ?
.CODE
main proc
mov ax,@DATA
mov ds,ax
mov al,arreglo[0]
add al,arreglo[1]
add al,arreglo[2]
add al,arreglo[3]
add al,arreglo[4]
add al,arreglo[5]
add al,arreglo[6]
add al,arreglo[7]
add al,arreglo[8]
add al,arreglo[9]
add al,arreglo[10]
add al,arreglo[11]
add al,arreglo[12]
add al,arreglo[13]
add al,arreglo[14]
add al,arreglo[15]
add al,arreglo[16]
add al,arreglo[17]
add al,arreglo[18]
add al,arreglo[19]
mov arrsuma,al
mov ax,4c00h
int 21h
main endp
end main
--------end of code------------
the problem is that when I create the executable it only have 1kb and when I use debug to see if it is doing what I want the it doesn't do it. Help me please
.MODEL SMALL
.STACK 100h
.DATA
arreglo db 3, 8, 5, 3, 9, 2, 1, 4, 5, 11, 2, 1, 12, 10, 7, 17, 18, 6, 14, 13
arrsuma db ?
promedio db ?
.CODE
main proc
mov ax,@DATA
mov ds,ax
mov al,arreglo[0]
add al,arreglo[1]
add al,arreglo[2]
add al,arreglo[3]
add al,arreglo[4]
add al,arreglo[5]
add al,arreglo[6]
add al,arreglo[7]
add al,arreglo[8]
add al,arreglo[9]
add al,arreglo[10]
add al,arreglo[11]
add al,arreglo[12]
add al,arreglo[13]
add al,arreglo[14]
add al,arreglo[15]
add al,arreglo[16]
add al,arreglo[17]
add al,arreglo[18]
add al,arreglo[19]
mov arrsuma,al
mov ax,4c00h
int 21h
main endp
end main
--------end of code------------
the problem is that when I create the executable it only have 1kb and when I use debug to see if it is doing what I want the it doesn't do it. Help me please