Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. mov edx, eax
  2. mov ecx, (LENGTHOF RAW) ;loop counter
  3. mov esi,OFFSET RAW ;esi = 0 index value
  4. mov edi,0
  5. ;loop for variance
  6. Variance:
  7. movzx ebx, byte ptr[esi] ;get the value from the array
  8. mov eax, edx
  9. sub eax, ebx ;subtract mean value from eax value
  10. imul eax,eax ;find the square value
  11. add edi,eax
  12. add esi,2 ;increment esi by 2 for WORD array
  13. loop Variance ;repeat Variance until cl=0
  14.  
  15. mov edx, OFFSET printVariance ;print the variance string
  16. call WriteString
  17. mov ecx,(LENGTHOF RAW)
  18. cdq
  19. mov eax, edi
  20. idiv ecx ;find the variance
  21. call WriteDec ;print the variance
  22. call Crlf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement