loop: cmp port0,port1 jl up jg down jmp there up: mov port0,1 jmp loop down: mov eax,-1 neg eax mov port0,eax jmp loop there mov port0,0 jmp loop