Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. .Data
  2. frequency DW 0, 260, 300, 330, 350, 390, 440, 500, 520, 590, 660, 700
  3.  
  4. mov EAX, frequency
  5. mov ECX, 0 // as a counter
  6.  
  7. mov ecx, 0 ; initialize counter
  8. mov edx, OFFSET frequency ; get address of the first element
  9. DoLoop:
  10. mov eax, DWORD PTR [edx] ; get value of the element
  11. ... ; do something with that value, now in the EAX register
  12. inc ecx ; increment counter by one
  13. add edx, 2 ; increment pointer by size of an element
  14. cmp ecx, 12 ; compare counter against 12 (total number of elements)
  15. jl DoLoop ; keep looping while less than 12
  16.  
  17. cmp X, 700 ; where X is some register or memory location that you want to test
  18. jne BranchLabel ; where 'BranchLabel' is the label to jump to if X != 700
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement