954,479 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

dividing two number by each other in an average problem !!

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

reemhatim
Junior Poster in Training
50 posts since Sep 2010
Reputation Points: 5
Solved Threads: 2
 
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
skaa
Light Poster
36 posts since Jan 2011
Reputation Points: 13
Solved Threads: 5
 

Thank YOU skaa :)

reemhatim
Junior Poster in Training
50 posts since Sep 2010
Reputation Points: 5
Solved Threads: 2
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You