or download this
mov r1,0 // sometimes, xor r1,r1 needs less program space and/
+or time
mov r2,N
...
inc r1 // may or may not set flags, depending on the impleme
+ntation
cmp r1,r2 // often imlemented as sub r1,r2 but without actually
+ writing the result back to the register, just setting flags
jne loop // if implemented as sub r1,r2, jne (jump if not rqua
+l) is equal to jnz (jump if not zero)