title: x86 Assembly - Error A2022: instruction operands must be the same size
body: <p>So, from my understanding DB can be used to create a string in x86 Assembly. I am trying to move my index pointer to be at the beginning of the string so I can iterate through it. I am getting this error,</p>
  <p>&quot;instruction operands must be the same size&quot;</p>
  <p>So far I have tried using a doubleword which is the correct 32-bit size, but the issue with this is it says my string is too large for that definition. I'm confused as to how I can solve this.</p>
  <pre><code>.DATA
  excerpt  db  &quot;Follow. But! Follow only if ye be men of valour, for the entrance to this cave is guarded by a creature so foul, so cruel that no man yet has fought with it and lived! Bones of full fifty men lie strewn about its lair.&quot;
           db  &quot;So, brave knights, if you do doubt your courage or your strength, come no further, for death awaits you all with nasty, big, pointy teeth. – Tim&quot;     ; string
  lenExcerpt  equ  $ - excerpt    ; length of string
  compvar db &quot;t&quot;
  compvar2 db &quot;T&quot;
  
  
  .CODE
  
  main PROC
  
  mov ecx, 0
  mov esi, excerpt
  xor ebx, ebx
  </code></pre>