Chad wrote:
No. If there were an object, you could form a pointer to that
object and pass the pointer around. But you can't: The 6 merely
denotes a value, and says nothing at all about how that value comes
to life in the program.
In C you can't form a pointer to an object with register storage
class. On most matchines ff it actually is in a register, it is not
possible to have a pointer to it (there are a few exceptions). But C
makes the prohibition uniform; even if the compiler chooses to put a
'register' object in memory, you still can't take & of it.
The defining characteristic of objects is storage. For objects that
are mutable, you can observe change in state i.e. contents. But C also
has const objects, which you can't change. In a philosophical sense,
const register objects aren't distinguishable from values.
Some implementations may actually allocate an int-sized piece
of memory containing the value 6, and read from that "invisible
object" when the value is needed -- but that's just the system's
own way of getting things done, not an implication that there's an
actual object floating around. Other implementations may have a
I'd say there is not a *C* object. There is a kinda-sorta-object.
For example, S/360 et seq did this so much that the assembler had
convenient syntax for it:
Load R3, =W(123)
assembles a word of data elsewhere (initially) containing 123, and a
code instruction (inline) that loads from that word of data to R3.
more economical way of generating small integer values, like an
"immediate operand" taking less than an int's worth of memory,
so there's not even an int-sized piece of storage to look at if
you could peer behind the curtain. You write 6, the implementation
works some kind of magic, and the value six shows up. That's all.
And sometimes two (or perhaps more) pieces, e.g.
LoadHI R3, 0x12
LoadLO R3, 0x3456
to give you 0x123456 in the register without any contiguous storage
containing 0x123456 (in whatever endianness applies).
And sometimes no storage at all. Quite a few machines have 'hardcoded
zero' as one of the register choices, and I've heard of some that have
a few others like -1 (equivalently ~0 in 2sC as is now most common).
The PDP-8 had microcoded* operate instructions that could generate a
small and rather eclectic set of values with no data word (which was
precious; you got at most 125 in current page and 128 minus
reservations in zero page) and no data fetch (also precious).
6 happens to be among them, using CLA INC STL RTL .
I no longer remember the encoding for this (and am not going to bother
looking it up) but I'm confident it doesn't resemble 6 *at all*.
(* sort of VLIW style, for extremely small values of large, about
15-20 years before that terminology came into use)
<snip rest>