Advertisement
Guest User

Untitled

a guest
Apr 11th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. TITLE Summing an Array
  2. ;
  3. ;
  4. ;
  5. ;
  6. ;
  7.  
  8. INCLUDE Irvine32.inc
  9.  
  10.     .data
  11.     intarray DWORD 10000h,20000h,30000h,40000h ; create integer array
  12.  
  13.     .code
  14.     main PROC
  15.  
  16.     mov edi,OFFSET intarray ; edi equals offset of the int array
  17.  
  18.     mov ecx,LENGTHOF intarray
  19.  
  20.     mov eax,0
  21.  
  22. L1:
  23.  
  24.     add eax,[edi] ; Move pointer into eax
  25.  
  26.     add edi,TYPE intarray
  27.  
  28.     loop L1
  29.     CALL DumpRegs
  30.     exit
  31.  
  32. main ENDP
  33. END main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement