I was trying to create a for loop in assembly to print out all integers from 0 to N-1. For some reason it breaks and creates an infinite loop. Any ideas why? I am using visual studio 2013 masm
.data
x DWORD 0
y DWORD 0
.code
main:nop
invoke version
invoke readInteger
add x, eax
cmp eax, y
je done
increase:
invoke writeInteger, y
inc y
cmp y, eax
jg increase
done:
invoke writeInteger, x
invoke ExitProcess,0
end main
writeIntegerclobberseax, which is normal for most calling conventions. - Peter Cordes