Assembly seems to have lots of tricks.
- Set a register to zero (
xor reg, reg
) - Extend the stack by only four bytes (
push/pop ecx
) - Setting a regiseter to -1 (
OR reg -1
) - Mulitiplying by powers of two with bit shifting, or n**2+1 with LEA
Is there a list/book/resource anywhere of these kinds of Assembly idiosyncrasies?
xor-ing
register to get a zero? It's just math/logic.