random blinking without delay and blinking with delay in 1

I am pretty shure, that your last example will result in something like:

mov reg, val
cmp reg, 1
je @addr1
portx 1
ret
@addr1:
portx 0
ret

Whereas a exclusive or will produce something like:

mov reg, val
xor reg, 1
portx reg
ret

So, that why the xor is not just lazy trickery :slight_smile:

Port manipulation would of course be even faster. But I will not recommend this unless the code is targeted at one, specific chip :slight_smile:

EDIT: Pseudo-assembly alert! Added "ret" for completion :slight_smile: