x86 opcode, 8B
fun:
call edx ; 2B
cmpxchg eax, ecx ; 3B, on 8086 use xchg and cmp instead
jnz fun ; 2B
ret ; 1B
input ecx(init), edx(func ecx->eax without modifying non-output var)