title: Returning table in assembler
body: <p>I'm having some troubles with my asm function. Here is the code:</p>
  
  <pre><code>afterModulo PROC stdcall uses edx tab:DWORD, ile:DWORD, e:DWORD, n:DWORD
  LOCAL tabEnd:DWORD
  
  mov EAX, tab
  add EAX, ile
  mov tabEnd, EAX
  
  forLoop:
      mov EDX, [EAX]
      push EAX
      push n
      push e
      push EDX
      call powerModulo
      mov EDX, EAX
      pop EAX
      mov [EAX], EDX
      inc EAX
      cmp EAX, tabEnd
      jge exitLoop
      jmp forLoop
  exitLoop:
      ret
  afterModulo ENDP
  </code></pre>
  
  <p>I want to return modified table stored in EAX. Here is how i call asm function in C#:</p>
  
  <pre><code> [DllImport("bibliotekaASM.dll", CallingConvention = CallingConvention.StdCall)]
      private static extern int[] afterModulo(int[] tab, int ile, int e, int n);
  
   public int[] wywolajFunkcjeAfter(int[] tab, int ile, int e, int n) 
      {
          return afterModulo(tab, ile, e, n);
      }
  </code></pre>
  
  <p>Unfortunatelly, i got this error: <em>An unhandled exception of type 'System.Runtime.InteropServices.MarshalDirectiveException' occurred in GUI.exe</em>
  I'm sure it's return value issue(I've never worked on tables in assembler)</p>