3 ms·
What is wrong with that? Besides the fact that the canonical way to zero a register on x86 if flags are of no concern is xor reg,reg (recommended way) or
by wolfgke 9y ago
What is wrong with that? Besides the fact that the canonical way to zero a register on x86 if flags are of no concern is
xor reg,reg
(recommended way) or
sub reg,reg
- Jach 9y agoIt's wrong if you try to read it as "move 0 into esp" because the source and destination are reversed in code from how it's expressed in English. The way to fix that is to use the other syntax, or change how you think of the English. If read like Lisp, then it's "set esp to 0" and 'mov' is just a poor mnemonic.
- deleted 9y ago[deleted]
- hota_mazi 9y agoI read "mov a,b" as "Move a into b".
- wolfgke 9y agoIt is canonical in Intel syntax that the parameter order is always "destination, source" (in AT&T syntax it is "source,destination").