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<45)
xor edx, edx
mov edx, i
.if([reservedseats+edx]==0)
mov ebx,i
mov x,ebx
push ecx
.while(j<seats)
mov reservedseats,1
inc i
inc j
.endw
pop ecx
jmp next
.endif
inc i
.endw
next:
exit
main endp
end main
This is an assembly (masm32) code.
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.
It gives me an error. The error(invalid instruction) is on first .endw
after inc j
.