Test whether a register is zero with CMP reg,0 vs OR reg,reg?
问题 Is there any execution speed difference using the following code: cmp al, 0 je done and the following: or al, al jz done I know that the JE and JZ instructions are the same, and also that using OR gives a size improvement of one byte. However, I am also concerned with code speed. It seems that logical operators will be faster than a SUB or a CMP, but I just wanted to make sure. This might be a trade-off between size and speed, or a win-win (of course the code will be more opaque). 回答1: It