29 ms·
> Do note that modern compilers can detect when the return value of the ++ operator is unused, and skip the extra steps when unneeded. Is there an equivalent i
by NAFV_P 12y ago
> Do note that modern compilers can detect when the return value of the ++ operator is unused, and skip the extra steps when unneeded.
Is there an equivalent instruction in assembly for postfix increment/decrement?
- wtracy 12y agoNeither one really has a direct "equivalent" in assembly. Prefix is going to look something like: inc eax # increment the value mov eax,ecx # copy the return value to its destination Postfix is going to look something like: mov eax,ebx # copy original value inc eax # increment value mov ebx,ecx # copy original value to final destination The actual code you'd get would vary a lot between compilers, architectures, and even just different contexts within the same compiler-architecture combination.
- NAFV_P 12y agoThank you, dammit I really should learn assembly.
- deleted 12y ago[deleted]