I think I asked the wrong question...
The question is really, what is the path from c++ source code to machine language code with intermediate assembly step?
So when the compiler starts to convert source code to assembly code it does something important:
int x {1};
is converted by compiler to three things:
- the name
x
, - the address of the
x
object - the number of bytes at this address determined by the type of x.
[Editors note: The OP has forgotten "code to initialize x
with value 1"]
so at machine level there is address and count of bytes for the value at this address, and I think this is what is referred to as an lvalue.
But if compiler puts a value in a processor register and did not give it an address in memory ,then this value is represented in source code as rvalue.
I want to know if this understanding is correct and this was not answered by the duplicate suggested.