title: Problem with strings in assembler [beginner]
body: <p>I'm working in Visual Studio 2010 and here's a little bit of code I'm having trouble with:</p>
  
  <pre><code>void main()
  {
  int x;
  char c1[100]="cd";
  char c2[100]="abcdef";
  _asm {
      lea edx,c2
      lea ecx,c1
      push edx
      push ecx
      call subsir
      add esp, 8   
      mov x, eax
  }
  }
  
  char subsir (char *c1, char *c2) 
  {
  _asm {
  mov ecx, c1
  mov edx, c2
  mov edi, 0
  mov esi, 0
  start: cmp [edx + edi], 0
  je end
  mov esi, 0
  mov eax, [edx + edi]
  cmp eax, [ecx + esi]
    .....
  </code></pre>
  
  <p>This is the first part of a program that's meant to compare 2 words. </p>
  
  <p>The problem I am having is that when I do</p>
  
  <pre><code> mov eax, [edx + edi]
  </code></pre>
  
  <p>eax receives an adress and not the actual value.
  I tested this by doing </p>
  
  <pre><code> cmp eax, 97
  </code></pre>
  
  <p>which should activate a JE instruction (97 being the ASCII code for 'a') But it doesn't. If I do</p>
  
  <pre><code>      cmp [edx + edi], 97
  </code></pre>
  
  <p>it does activate the JE jump.</p>
  
  <p>I would be very grateful if you could tell me what am I doing wrong and how can I put the actual valuea in EAX instead of an adress.</p>