0

I'm writing a program as a beginner in assembly my program is about summing up all integers in array and then getting their average . I'm stuck with the average is that i need to divide the sum of numbers by my array size and i don't know according to assembly's syntax how to get to this any help please :) thank you

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by reemhatim
0
mov     esi,ak
        mov     ecx,0
        mov     cx,[qak]
        mov     eax,0;sum
msum:
        add     ax,word [esi]
        add     esi,2
        loop    msum

        mov     edx,0
        mov     ebx,0
        mov     bx,[qak]
        div     ebx
;EAX contains average now
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.