xorpd-solutions

View on GitHub

0x07

[dec] [home] [inc]

[See this riddle on the book]

inc      rax
neg      rax
inc      rax
neg      rax
See explanation ## nop This snippet, just like the previous, is equivalent to doing nothing. the value of `rax` in incremented and negated (using [two's complement](https://en.wikipedia.org/wiki/Two%27s_complement)), twice. In other words: ``` -(-(rax+1)+1) ``` which is equivalent to ``` -(-rax-1+1) ``` which is equivalent to ``` rax+1-1 ``` which is equivalent to ``` rax ```

[dec] [home] [inc]