title: error: invalid instruction operand (on .ENDW)
body: <pre><code>include irvine32.inc
  
  .data
  i dword 0
  j dword 0
  x dword 0
  reservedseats byte 45 dup(0)
  seats dword 45
  
  .code
  main proc
  
  xor eax,eax
  xor ecx,ecx
  xor ebx,ebx
  .while(i&lt;45)
  xor edx, edx
  mov edx, i
  .if([reservedseats+edx]==0)
      mov ebx,i
      mov x,ebx
      push ecx
      .while(j&lt;seats)
      mov reservedseats,1
          inc i
  
      inc j
      .endw
      pop ecx
      jmp next
  .endif
  
  
  inc i
  .endw
  next:
  
   exit 
   main endp
   end main
  </code></pre>
  
  <p>This is an assembly (masm32) code.</p>
  
  <p>I am working on assembly project seat reservation. I am trying to convert c++ code to assembly. this progrm will print seats given by users and if user wants to reserve seat again he will skip seats that are already reserved.</p>
  
  <p>It gives me an error. The error(invalid instruction) is on first <code>.endw</code> after <code>inc j</code>.</p>