title: x86 Assembly Passing Parameters by Reference
body: <p>Below is my code for assembly language. I can pass by a stack parameter value using "push [edi]" but I cannot seem to pass by reference using "push OFFSET [edi]". What's the correct syntax to pass something by reference in this case?</p>
  
  <pre><code>sortList        PROC
  ;Parameter memory addresses:
  ;numbers    @ [ebp+8]
  ;list       @ [ebp+12]
  
  ;Used to access stack parameters
  push        ebp
  mov         ebp, esp
  
  ;Sets up the array
  mov         edi, [ebp+12]               ;Puts in the address of the list array
  mov         ecx, [ebp+8]                ;Sets up the loop counter for the array
  
  ;Testing swapNumber function
  push        [edi]                           ;array 1 pushed will be ebp+12
  add         edi, 4
  push        [edi]                           ;array 2 pushed will be ebp+8
  call        swapNumber
  
  pop         ebp
  ret         8
  sortList        ENDP
  </code></pre>