I guess this is just an extension of this.
Now, the compiler defines the datatypes to be integers, signed and unsigned, and floating points so that the processor can use them appropriately.
But say, a processor has an address. Now, a very basic add instruction in RTN would be like
ADD R1, R2
ie R1 <- R1 + R2
. Now say register R1
has just been loaded in with a memory address that contained a 32 bit floating point and R2
has an integer.
I want to know, how and when does the processor precisely know, and where is it told by the program(in the instruction format?) exactly that R1
is a floating point, and R2
is an integer?
and one more, say I randomly give out a memory address that I'm allowed to access, and ask the processor to fetch me it's contents. Now, how does the processor know that if that location has a floating point or an integer. So, how does it exactly treat the contents?