The only conditionals Nasm knows are the ones the CPU knows - jcc, jncc, loop, etc. If you want to use "if", "else" and all, you'll have to provide a macro. Nasm64developer has written a set, available on the "downloads" page under "contributions"...
We can do conditional assembly:
%if 0
mov eax, 42 ; this won't be assembled
%endif
but not at runtime. You want:
cmp eax, 0
jng skipebx
inc ebx
jmp done ; don't do the "else" clause
skipebx:
test eax, eax ; (shorter than cmp eax, 0)
jnz done
inc ecx
done:
...
... or use macros...
Best,
Frank