Hi guys, I'm wondering is it optimal to use "CDQ" to perform the operation in the title. IS there another more optimal way to put -1 in EDX if the MSB of EAX is set or 0 if it is not? Thanks :-D
Posted on 2005-01-29 23:28:54 by x86asm
mov/sar combination does it.
In old days, this combination was preferred, but it seems that cdq performs well recently. Even Intel's manual recommends (in a sense) cdq.
Posted on 2005-01-30 03:29:58 by Starless