Tag Info

New answers tagged

0

Your question is quite hard to follow, and I'm unsure which issue you want answered. My contribution is to point out that at the assembly language level, there is absolutely no difference between a pointer and a value, and both can be stored in memory or loaded into a register at the level of a C-like language a distinction is made between pointers and ...


4

They produce the same assembly because the compiler removes the unused variable. It does not contribute to the code, so it does not show up in the assembly. You may be able to see a difference if you turn off all optimizations. But let's look at the assembly after removing all cruft (added line numbers for making the explanation simpler): 1: main: 2: ...


0

The fact that two programs compile to the same assembly code means that the two programs produce the same behavior. Differences in programs that don't contribute to the behavior (such as the unused variables in your examples) may or may not show up in the assembly code. The compiler is fully within its rights to throw those parts out completely. Assembly ...


0

If the two programs generate the same assembly, then you can be certain that if assembled using the same assembler, those will produce the same machine code. And that's about it. But if that were the only point, then we'd all be coding in assembly. Programming languages are about abstractions. That's literally the whole point. In C, pointers are part of ...


2

The only absolute conclusion you can draw is that the two programs will behave the same if they have been compiled with the same compiler for the same target platform. If you then analyse the differences in the source code, you may also be able to deduce that there are semantic similarities / equivalences. In fact, it is highly likely that there will be ...



Top 50 recent answers are included