Why use or al, al instead of cmp al, 0?
Posted: Sun Sep 23, 2007 3:09 pm
I noticed that people use: or al, al instead of cmp al, 0.
Is it the same?
Is it the same?
The Place to Start for Operating System Developers
http://f.osdev.org/
It achieves the same result, but maybe or al, al is faster or takes up less space in the binary.matias_beretta wrote:I noticed that people use: or al, al instead of cmp al, 0.
Is it the same?
cmp performs a subtraction and or only a bitwise boolean operation, so it is theorethically slightly faster. But or destroys the value of al.matias_beretta wrote:I noticed that people use: or al, al instead of cmp al, 0.
Is it the same?
or al,al doesn't change value of al!Craze Frog wrote:But or destroys the value of al.
You're right. I forgot the source and destination had the same value...kataklinger wrote:or al,al doesn't change value of al!Craze Frog wrote:But or destroys the value of al.