2 ms·
SHL/SAL/SHR/SAR (the shifts) affect the condition codes so one could check for overflow (or use it as part of multibyte arithmetic) while LEA does not affect th
by spc476 7y ago
SHL/SAL/SHR/SAR (the shifts) affect the condition codes so one could check for overflow (or use it as part of multibyte arithmetic) while LEA does not affect the conditions code (so overflow goes undetected). It's something else to keep in mind.
- remcob 7y agoIndeed! And this is not necessarily a downside, sometimes you want to preserve the flags. Intell added the MULX instruction that is similar to MUL, except that it doesn't touch the flags. It's very useful in bignum math.